﻿

function getvalues()
{
   
 


    var strtxtvalue=document.getElementById('textfield').value;  
    var strselectvalu=document.getElementById('ddlsub').value;
  
   
     
    if(strtxtvalue=="")
    {
    alert('Please Enter Search Value');
    return false;
    }
//      alert('ok');
//return false;
//    if(strselectvalu=="0")
//    {
//    alert('Please Enter Search Within');
//    return false;
//    }
         if(strselectvalu == "5")
            {     
                if(strtxtvalue.length >5 )
                {
                alert('Please Enter Correct Book Code');
                return false;
                }
                           
                if(isNaN(strtxtvalue))
                {
                alert('Please Enter Numeric Book Code');
                return false;
                }
                else
                {
                window.location.href = "Products.aspx?gf="+strselectvalu+"&ss="+strtxtvalue;
                }
            }
          else
                {          
                  window.location.href = "Products.aspx?gf="+strselectvalu+"&ss="+strtxtvalue;              
                }

}

function doClick(e)
{

    var key;

     if(window.event)
          key = window.event.keyCode;     //IE

     else
          key = e.which;     //firefox

    if (key == 13)
    {
        //Get the button the user wants to have clicked
        if(document.getElementById("hdnRules").value=="IS")
        {
            document.getElementById('imbSearch').click();
            e.returnValue = false;
            return false;
        }   
    }
}

function OnMSTextBoxFocus()
{

        document.getElementById("hdnRules").value='IS';    
}