﻿    function scrollfunc(){
        window.scrollBy(0,-350);
        window.scrollBy(0,350);
    }
    
//Updated for the CellPhone TextBox Focuses - Karthick

function changeFocus(textbox1,textbox2)
{
    var browserName=navigator.appName;
    if (browserName=="Netscape")
    { 
        if(textbox1.value.length >= 2)
        {
            textbox2.focus();
        }   
    }
    else if(browserName=="Microsoft Internet Explorer")
    { 
        if(textbox1.value.length == 3)
        {
            textbox2.focus();
        }       
    }
    else
    {
        if(textbox1.value.length == 3)
        {
            textbox2.focus();
        }    
    }
    return true;
}

//End of CellPhoneTextBoxFocus

//Advanced Search JS utility functions
function setCurrentSQuery(qStr)
{
    $.cookie("squery", qStr, {expires:7,path:'/'});
}

function getCurrentSQuery()
{
    return $.cookie("squery");
}

function parseQuery(sQuery,key) 
{    
    //alert("0"+key);        
    hu = sQuery.substring("?");
    //alert("1"+hu);
    gy = hu.split("&");            
    //alert("2"+hu);
    for (i=0;i<gy.length;i++) 
    {
        ft = gy[i].split("=");
        if (ft[0] == key) 
        {
            //alert(ft[0]+"****"+ft[1]);
            return ft[1];
        }
    }
    return "";
}



//Adding window object event:
function addLoadEvent(func)
{
   var oldonload = window.onload;
   if (typeof window.onload != 'function') 
   {
       window.onload = func;
   }
   else 
   {
       window.onload = function() 
       {
           oldonload();
           func();
       }
   }
}

function addUnloadEvent(func)
{
   var oldonunload = window.onunload;
   if (typeof window.onunload != 'function') 
   {
       window.onunload = func;
   }
   else 
   {
       window.onunload = function() 
       {
           oldonunload();
           func();
       }
   }
}
//End of Adding window object event:

