﻿function ClickButton(event, focusControl)
{
    event = event || window.event;	
    
    var keyCode = null;

    if( event.which ) 
    {
        keyCode = event.which;
    } 
    else if( event.keyCode )
    {
        keyCode = event.keyCode;
    }
                
    if( 13 == keyCode ) 
    {                
        document.getElementById(focusControl).focus();                    
        return false;
    }
                
    return true;
}

function IsIE()
{
    var agt=navigator.userAgent.toLowerCase();
    
    if (agt.indexOf("msie") != -1)
        return true;
       
    return false;
}

function JumpLocation(ddl)
{
    loc = getQueryString()["u"];

    if(loc == null)
        loc = encodeURIComponent(location.href);

    window.top.location.href = ddl.options[ddl.selectedIndex].value;
}

function SearchTextBox_OnBlur(obj)
{
    if(obj.value == "")
    {
        obj.value = "Search this site"
    }
}

function SearchTextBox_OnClick(obj)
{
    if(obj.value == "Search this site")
    {
        obj.value = ""
    }    
}

function popUp(URL, id, ieWidth,ieHeight,ffWidth, ffHeight) 
{
	// default width and height to ff
	
	var width   = ffWidth;
	var height  = ffHeight;
	
	if (navigator.appName == "Microsoft Internet Explorer")
	{                   
		width = ieWidth;
		height = ieHeight;
	}                        
	
	var left    = (screen.width - width) / 2;
	var top     = (screen.height - height) / 2;               
	
	window.open(URL, id, 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=' + width + ',height=' + height + ',left = ' + left +',top = ' + top + '');
}
