function _submit()

	{
      document.form1.submit();
	}
	
function check_button(e)
	{
		
		var unicode=e.keyCode? e.keyCode : e.charCode;	
	
	if(unicode==13)
	{	    
		document.form1.submit();
	}
	
	else
		return false;
	}
	
	function _onload()
	{
		if(document.getElementById("username").value=="")
		document.getElementById("username").focus();
		else 
		document.getElementById("password").focus();
	 }
     
function _onloadchangePassword()
	{
	   document.getElementById("password").focus();
	}
	
    
function _submitChangePassword()
{

	if(document.getElementById("salesAgentId").value > 0)
	{
		// For Sales Agent change password
		document.getElementById("changePasswordFormId").action = "changePasswordSA.action";
	}
	else 
	{
		document.getElementById("changePasswordFormId").action = "changePassword.action";
	}
	document.changePasswordForm.submit();
}
	

function _cancelChangePassword() 
{	
	var answer = confirm("You are about to cancel the Change Password procedure.")
	if (answer){
		if(document.getElementById("fromId").value == "sa")
		{
			// For Sales Agent change password
			document.getElementById("changePasswordFormId").action = "viewSalesAgentAccount.action?salesAgentId="+document.getElementById("salesAgentId").value;
		}
		else 
		{
			document.getElementById("changePasswordFormId").action = "viewAccount.action";
		}
		document.changePasswordForm.submit();
	}
}

function check_button1(e)
	{	
	var unicode=e.keyCode? e.keyCode : e.charCode;	
	
	if(unicode==13)
	{	    
		
		if(answer){
		if(document.getElementById("salesAgentId").value > 0)
			{
		// For Sales Agent change password
			document.getElementById("changePasswordFormId").action = "changePasswordSA.action";
			}
			else 
			{
			document.getElementById("changePasswordFormId").action = "changePassword.action";
			}
		}
	document.changePasswordForm.submit();
		
	}
	
	else
		return false;
	}
	
	