﻿// JScript File

function redirect(url)
{
    setTimeout("location.replace('"+url+"')", 3000)
}

function share_facebook() 
{
    var	u=location.href;
    var t=document.title;
    //var t1=	document.getElementById('ctl00_CPH1_ProductDetails1_lblProductName').innerHTML;//$('lblProductName').innerHTML;
    
    window.open("http://www.facebook.com/share.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t));

}

function share_twitter()
{
    var	uvnn=location.href;
    var tvnn=document.title;
    window.open("http://twitter.com/home?status=" + encodeURIComponent(uvnn));
}

/* == FOR SEARCH == */

function InputFocus(textdefault, control) {
    text = control.value;
    if (text == textdefault) control.value = "";
}
function InputBlur(textdefault, control) {
    text = control.value;
    if (text == "") control.value = textdefault;
}
var temp;
function checkEnterSearch(e, el) {
            temp = el;

            var keynum;
            if (window.event)   // IE
            {
                keynum = e.keyCode;
            }
            else if (e.which)  //Nescape/FireFox/Opera
            {
                keynum = e.which;
            }

            if (keynum == 13) {   //enter character
                //document.getElementById('imgSearch_vtc').onclick();

                if (temp.value.length != 0) {
                    window.location.href = '/search.aspx?keyword=' + el.value;
                    e.returnValue = false;
                    e.cancel = true;
                } else {
                    alert(input_keyword);
                }
                return false;
            }

            return true;

        }

function SearchURL() 
{
    if (typeof temp != 'undefined' && temp.value.length != 0)
    window.location.href = '/search.aspx?keyword=' + temp.value;
    else
    alert(input_keyword);
    return false;
} 
function changeLang()
{
    alert(temp.value);
    if (typeof temp != 'undefined' && temp.value.length != 0)
    window.location.href = '/changelanguage.aspx?lang=' + temp.value;
}
/* == END SEARCH == */
