
	//-------------------------------------------------

	function checkPayment(frm)
	{
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		
		with(frm)
		{
			if(EmptyIs(fname,"Please enter a first name") == false) return false;
			if(EmptyIs(lname,"Please enter a last name") == false) return false;
			
			if(EmptyIs(phone,"Please enter a phone") == false) return false;	
			else if(!isPhone(phone))
				return false;

			if(EmptyIs(email,"Please enter a email") == false) return false;
				if(!filter.test(frm.email.value))
				{
					alert("Please enter a valid email address");
					email.focus();
					return false;
				}

			if(EmptyIs(amount,"Please enter a amount") == false) return false;
			if(EmptyIs(cc_name,"Please enter a name on card") == false) return false;
			if(EmptyIs(cc_num,"Please enter a credit card") == false) return false;
			if(EmptyIs(cc_exp_month,"Please select expiry month") == false) return false;
			if(EmptyIs(cc_exp_year,"Please select expiry year") == false) return false;			
			
			if(EmptyIs(cc_address,"Please enter a address1") == false) return false;
			if(EmptyIs(cc_city,"Please enter a city") == false) return false;
			if(EmptyIs(cc_state,"Please enter a state") == false) return false;
			if(EmptyIs(cc_zip,"Please enter a zip") == false) return false;
			if(!isDigit(cc_zip.value)){
				cc_zip.focus();	
				return false;	
			}
			if(cc_zip.value.length != 5){
				alert("please enter valid zip (e.g.23345) ");					
				cc_zip.focus();	
				return false;	
			}
			if(EmptyIs(cc_country,"Please enter a country") == false) return false;			
			
		
			if(agree.checked == false)
			{
				alert("Please accept the terms and conditions");
				return false;
			}
			
			
			
		}
	}

	function checkPayment2(frm)
	{
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		
		with(frm)
		{
			if(EmptyIs(fname,"Please enter a first name") == false) return false;
			if(EmptyIs(lname,"Please enter a last name") == false) return false;
			
			if(EmptyIs(phone,"Please enter a phone") == false) return false;	
			else if(!isPhone(phone))
				return false;

			if(EmptyIs(email,"Please enter a email") == false) return false;
				if(!filter.test(frm.email.value))
				{
					alert("Please enter a valid email address");
					email.focus();
					return false;
				}

			if(EmptyIs(amount,"Please enter a amount") == false) return false;
			if(EmptyIs(bank_name,"Please enter a bank name") == false) return false;
			if(EmptyIs(bank_routing,"Please enter a bank routing") == false) return false;
			if(EmptyIs(bank_account,"Please select a bank account") == false) return false;
			
			if(EmptyIs(cc_address,"Please enter a address1") == false) return false;
			if(EmptyIs(cc_city,"Please enter a city") == false) return false;
			if(EmptyIs(cc_state,"Please enter a state") == false) return false;
			if(EmptyIs(cc_zip,"Please enter a zip") == false) return false;
			if(!isDigit(cc_zip.value)){
				cc_zip.focus();	
				return false;	
			}
			if(cc_zip.value.length != 5){
				alert("please enter valid zip  (e.g.23345)");					
				cc_zip.focus();	
				return false;	
			}
			if(EmptyIs(cc_country,"Please enter a country") == false) return false;			
			
		
			if(agree.checked == false)
			{
				alert("Please accept the terms and conditions");
				return false;
			}
			
			
			
		}
	}

	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 state") == false) return false;
			if(EmptyIs(txtzip,"Please enter a zipcode") == false) return false;
			if(!isDigit(txtzip.value)){
				txtzip.focus();	
				return false;	
			}
			if(txtzip.value.length != 5){
				alert("please enter valid zip (e.g.23345) ");					
				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 increaseSize(ref)
	{
		if(document.all)
			ref.className='ctrDropDownClick';
		else
			ref.className='ctrDropDown';
	}
	
	

	function SetBgColor(obj)
	{
		obj.style.backgroundColor='#F0F0F0' ;
	}
	//---------------------------------------
	function SetDefaultBbColor(obj)
	{
		obj.style.backgroundColor='#FFFFFF' ;
	}

	//-------------------------------------------------
	
	
	
   
	   
	
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 Number 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;
}

