﻿ 
//Function to search the user's query string or data
function searchData()
{        
    var searchText = document.getElementById("txtSearch").value;       
    //location.href="http://localhost:3962/VizExperts_In_aspx/searchtext.aspx?st=" + escape(document.getElementById("txtSearch").value);
    location.href="http://vizexperts.com/searchtext.aspx?st=" + escape(document.getElementById("txtSearch").value);  
    return false;   
}


//Function will activate when user will press enter key after providing search string
//Then it will check the keycode if it is 13, then it will do the same what searchData() function is doing
function chkEnterSearch(e)
{         
    var keynum = CheckKeynumValue(e);   //Passing the kycode value which is receiving from CheckKeynumValue function    
    //alert(keynum);
    if((keynum == 13) && (document.getElementById("txtSearch").value != ''))
    {            
        //alert(document.getElementById("txtSearch").value);
        //location.href="http://localhost:3962/VizExperts_In_aspx/searchtext.aspx?st=" + escape(document.getElementById("txtSearch").value);  
        location.href="http://vizexperts.com/searchtext.aspx?st=" + escape(document.getElementById("txtSearch").value);   
        return false;            
    }
}

//Function to check the value of key - pressed by user and send response to chkEnterSearch() function
function CheckKeynumValue(e)
{
    if(window.event) // for IE
    {
        return(e.keyCode);
    }
    else if(e.which) // for - Netscape/Firefox/Opera
    {
        return(e.which);
    } 
}

