﻿// JScript File

function searchIndex()
{

 var keyword;
    keyword=document.getElementById("ucSearch_txtSearch").value;
      if(keyword.length>0)
    {
   
        window.location="products.aspx@k=.html"+ keyword ;
        return true;
    }
    else
    {
    alert("Please Enter Search Criteria");
        return false;
    }
    return;
}
function SetSearchRuleStatusIndex()
{
    document.getElementById("hdnRules").value="S";
}

function SetSearchButtonClickIndex(e)
{
 
    var unicode=e.keyCode? e.keyCode : e.charCode ? e.charCode : e.which
    if(unicode=='13')
    {
	    if(document.getElementById("hdnRules").value=='S')
	    {					
		    document.getElementById("ucSearch_imbSearch").click();
		    e.returnValue=false;
		    return false;
	    }
    }
}
function OnSearchTextboxFocusIndex()
{
    document.getElementById("hdnRules").value="S";
}
 
function search()
{
 
 var keyword;
    keyword=document.getElementById("ctl00_header_uc1_txtSearch").value;
      if(keyword.length>0)
    {
    
        window.location="products.aspx@k=.html"+ keyword;
        return true;
    }
    else
    {
    alert("Please Enter Search Criteria");
    document.getElementById("ctl00_header_uc1_txtSearch").focus();
        return false;
    }
    return;
}
function SetSearchRuleStatus()
{
    document.getElementById("hdnRules").value="S";
}

function SetSearchButtonClick(e)
{
    var unicode=e.keyCode? e.keyCode : e.charCode ? e.charCode : e.which
    if(unicode=='13')
    {
	    if(document.getElementById("hdnRules").value=='S')
	    {					
		    document.getElementById("ctl00_header_uc1_imbSearch").click();
		    e.returnValue=false;
		    return false;
	    }
    }
}
function OnSearchTextboxFocus()
{
    document.getElementById("hdnRules").value="S";
}
function keypress(e)
{
    if ([e.keyCode||e.which]==8) //this is to allow backspace
    return true;
    if ([e.keyCode||e.which]==9) //this is to allow tab
    return true;
   // if ([e.keyCode||e.which]==46) //this is to allow period
   // return true;
    if ([e.keyCode||e.which] < 48 || [e.keyCode||e.which] > 57)
    e.preventDefault? e.preventDefault() : e.returnValue = false;
}




 
