function SetLoginFocus() {
  if (document.frmLogin.style.visibility=='visible') { 
	if (document.frmLogin) {
	  if (document.frmLogin.LoginName) {
		document.frmLogin.LoginName.focus();
	  }
	}
  }
}

function handleKeyPress(evnt){
	var retVal = true;
	if (evnt.which == 13)
	{
		var testTarget = new String(evnt.target);
		if ((-1 != testTarget.indexOf("LoginName")) || (-1 != testTarget.indexOf("Password")))
		{
			document.frmLogin.submit();
			retVal = false;
		}
	}
	return retVal;
}
function IEHandleKeyPress()
{
	if (event.keyCode == 13)
		{
		if(!ValidateLoginForm(document.frmLogin))
			{
			document.frmLogin.LoginName.value='';
			event.returnValue = false;
			}
		else
			{
			document.frmLogin.submit();
			event.returnValue = false;
			}

		}
}

function DropDownMenu(entered)
{
	with (entered)
	{
	reference=options[selectedIndex].value; 
	splitcharacter=reference.lastIndexOf("&"); 
	if (splitcharacter!=-1) 
		{
		loc=reference.substring(0,splitcharacter);   
		target=reference.substring(splitcharacter+1,1000).toLowerCase();
		}
	else 
		{
		loc=reference; 
		target="_self";
		};

	lowloc=loc.toLowerCase(); 

	if (lowloc=="false") 
		{
		return;
		} 
	if (target=="_self") 
		{
		document.location=loc;
		} 
	else 
		{
		if (target=="_top") 
			{
			top.location=loc;
			} 
		else 
			{
			if (target=="_blank") 
				{
				window.open(loc);
				} 
			else
				{
				if (target=="_parent") 
					{
					parent.location=loc;
					}
				else 
					{
					parent.frames[target].location=loc;
					}; 
				}
			}
		}
	}
}

function chkLogin()
{
	if(ValidateLoginForm(document.frmLogin))
		{
		document.frmLogin.submit();
		return(true);
		}
	else
		{
		document.frmLogin.LoginName.value='';
		}
}

function ValidateLoginForm(theForm)
{
	  checkStr = theForm.LoginName;

	  if(!isNumeric(checkStr.value))
	  {
		 alert('The Account Number you entered was invalid.\nIt must contain only Numeric Characters\n\nFor Example:\n"12345"');
		 checkStr.focus();
		 return(false);
	  }
	  return (true);
}
function isNumeric(str)
{
   var regEx = new RegExp("^[0-9]+(.{1}[0-9]+)?$");
   if (regEx.test(str))
      return true;
   else
      return false;
}

