
	//-------------------------------------------------


	function resetPassword(frm)
	{
		with(frm)
		{
			if(EmptyIs(pwd,"Please enter a password") == false) return false;
			if(EmptyIs(confirmpwd,"Please enter a confirm password") == false) return false;
			if(pwd.value != '')
			{
				if(pwd.value.length < 6)
				{
					alert("Password length is minimum 6 character");
					pwd.focus();
					return false;
				}
				if(EmptyIs(confirmpwd,"Please enter a confirm password") == false) return false;
			}
			
			if(pwd.value != '' && confirmpwd.value!= '')
			{
				if(pwd.value != confirmpwd.value)
				{
					alert("Password and confirm password are not same");
					confirmpwd.focus();
					return false;
				}
			}

			return true;
		}
		
	}
		
	function checkForgot(frm)
	{
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;	
		with(frm)
		{
			if(EmptyIs(txtemail,"Please enter a email") == false) return false;
			if(!filter.test(txtemail.value))
			{
				alert("Please enter a valid email address");
				txtemail.focus();
				return false;
			}
			return true;
		}
		
	}

	function checkLogin(frm)
	{

		with(frm)
		{
			if(EmptyIs(txtuser,"Please enter a username") == false) return false;
			if(EmptyIs(txtpassword,"Please enter a password") == false) return false;	
			
			return true;
		}
	}

	function checkUser(frm,act)
	{
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		
		
		
		with(frm)
		{
			if(EmptyIs(txtfname,"Please enter a first name") == false) return false;
			if(EmptyIs(txtlname,"Please enter a last name") == false) return false;
			
			if(act == "Add")
			{
			
				if(EmptyIs(txtemail,"Please enter a email") == false) return false;
				if(!filter.test(frm.txtemail.value))
				{
					alert("Please enter a valid email address");
					txtemail.focus();
					return false;
				}
				if(EmptyIs(txtuname,"Please enter a user name") == false) return false;				
				
				if(EmptyIs(txtpassword,"Please enter a password") == false) return false;
				
				if(EmptyIs(txtconfirmpassword,"Please enter a confirm password") == false) return false;

			}
			if(txtpassword.value != '')
			{
				if(txtpassword.value.length < 6)
				{
					alert("Password length is minimum 6 character");
					txtpassword.focus();
					return false;
				}
				if(EmptyIs(txtconfirmpassword,"Please enter a confirm password") == false) return false;
			}
			
			if(txtpassword.value != '' && txtconfirmpassword.value!= '')
			{
				if(txtpassword.value != txtconfirmpassword.value)
				{
					alert("Password and confirm password are not same");
					txtconfirmpassword.focus();
					return false;
				}
			}
			
			if(EmptyIs(txtfirmname,"Please enter a company") == false) return false;
			if(EmptyIs(txtaddress1,"Please enter a address1") == false) return false;
			if(EmptyIs(txtcity,"Please enter a city") == false) return false;
			if(EmptyIs(txtstate,"Please enter a county") == false) return false;
			if(EmptyIs(txtzip,"Please enter a zipcode") == false) return false;
			if(!isDigit(txtzip.value)){
				txtzip.focus();	
				return false;	
			}

			if(EmptyIs(txtphone,"Please enter a phone") == false) return false;	
/*			else if(!isPhone(txtphone))
				return false;
*/
			
			//if(EmptyIs(requiredVerificationCode,"Please enter a verification code") == false) return false;
			
			/*if(Accept.checked == false)
			{
				alert("Please accept the bidding terms and conditions");
				return false;
			}*/
			
			
			
		}
	}

	
function isDigit(s)
{
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if ( ( (c < "0") || (c > "9") ) ) 
        {
			alert(" Please Enter Digit Only ");
			return false;
        }	
    }
		return true;
}
	
function isPhone(t){
	var i;
	var s=t.value;
	if(s.length > 1 && s.length != 12){
		alert(" Enter Valid Phone Number (e.g.801-222-3333)");
		t.focus();
		return false;
	}
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
		if( (i == 3 || i == 7) && c != "-" ) {
			alert(" Enter Valid Phone Number (e.g.801-222-3333)");
			t.focus();
			return false;
		}
        if ( ( c < "0" || c > "9" ) && i!= 3 && i != 7) 
        {
			alert(" Enter Valid Phone Number (e.g.801-222-3333)");
			t.focus();
			return false;
        }	
    }
    // All characters are numbers.
    return true;
}

