
///////////////////////////////////////////////////////////
//
//  common.js
//  JavaScript Functions
//  Original author: Sridhar Ganji
//  
///////////////////////////////////////////////////////////
//  Modification history:
//  
//
///////////////////////////////////////////////////////////

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

if (browserName == "Netscape" && browserVer >= 3 || browserName == "Microsoft Internet Explorer" && browserVer >= 4)  
	version = "n3";
else 
	version = "n2";

if (version == "n3") 
{
	//These are the active images on the side next to the border
	cartOn = new Image(32,  197);
	//cartOn.src = "/images/icon_cart_red.gif";
	cartOn.src = "images/icon_cart3.gif";

	//These are the inactive images on the top menu bar
	cartOff = new Image(42,  197);
	cartOff.src = "images/icon_cart3.gif";
}
	
function img_act(imgName) 
{
	if (version == "n3") 
	{
		imgOn = eval(imgName + "On.src");
		document[imgName].src = imgOn;
	}
}

function img_inact(imgName) 
{
	if (version == "n3") 
	{
		imgOff = eval(imgName + "Off.src");
		document[imgName].src = imgOff;
	}
}

//set the focus on the form element -- login request
function SetFocus()
{
	if (document.frmLoginRequest.txtEmail)
		document.frmLoginRequest.txtEmail.focus();
	else if (document.frmLoginRequest.txtEmail1)
		document.frmLoginRequest.txtEmail1.focus();
}

//set the login page focus
function SetLoginFocus()	
{
	//alert(document.frmLogin.txtUserName.value);
	if (document.frmLogin.txtUserName.value != "")
		document.frmLogin.txtPassword.focus();
	else
		document.frmLogin.txtUserName.focus();
}

//to disallow submit action upon text box entry
function PreventEnter()
{
	return !(window.event && window.event.keyCode == 13);
}