// JavaScript Document

function quoteValidation()
{
	
	
			if(document.myfrm.first_name.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill first name.";
			document.myfrm.first_name.focus();
			return false;
			}
			
			if(document.myfrm.last_name.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill last name.";
			document.myfrm.last_name.focus();
			return false;
			}
			
			if(document.myfrm.email_id.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill email address.";
			document.myfrm.email_id.focus();
			return false;
			}
			
			var email=document.myfrm.email_id.value;
			if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
			{
			document.getElementById("formvalidationid").innerHTML="The e-mail address format is not correct.";
			document.myfrm.email_id.focus();
			return false;
			
			}
			
			
			if(document.myfrm.home_phone.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill home phone.";
			document.myfrm.home_phone.focus();
			return false;
			}
			
			if(document.myfrm.address.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill proper address.";
			document.myfrm.address.focus();
			return false;
			}
			
			if(document.myfrm.city.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill city.";
			document.myfrm.city.focus();
			return false;
			}
			
			if(document.myfrm.state.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill state.";
			document.myfrm.state.focus();
			return false;
			}
			
			if(document.myfrm.zip_code.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill zip code.";
			document.myfrm.zip_code.focus();
			return false;
			}
			
			if(document.myfrm.typeof_home.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill type of home.";
			document.myfrm.typeof_home.focus();
			return false;
			}
			
			if(document.myfrm.address_same.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill proper mailing address.";
			document.myfrm.address_same.focus();
			return false;
			}
			
			if(document.myfrm.city_same.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill city for mailing address.";
			document.myfrm.city_same.focus();
			return false;
			}
			
			if(document.myfrm.state_same.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill state for mailing address.";
			document.myfrm.state_same.focus();
			return false;
			}
			
			if(document.myfrm.zip_code_same.value=='')
			{
			document.getElementById("formvalidationid").innerHTML="Please fill zip code for mailing address.";
			document.myfrm.zip_code_same.focus();
			return false;
			}
		
	}
	
	function ContactValidation()
	{
		
		if(document.contactform.full_name.value=='')
			{
			document.getElementById("contactErrorForId").innerHTML="Please fill full name for contact.";
			document.contactform.full_name.focus();
			return false;
			}
			
			if(document.contactform.email_id.value=='')
			{
			document.getElementById("contactErrorForId").innerHTML="Please fill email id for contact.";
			document.contactform.email_id.focus();
			return false;
			}
			
			var email=document.contactform.email_id.value;
			if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
			{
			document.getElementById("contactErrorForId").innerHTML="The email format is not correct.";
			document.contactform.email_id.focus();
			return false;
			
			}
			
			
			if(document.contactform.phone_no.value=='')
			{
			document.getElementById("contactErrorForId").innerHTML="Please fill phone number for contact.";
			document.contactform.phone_no.focus();
			return false;
			}
		}
		
		
		function forgotPassword()
		{
			
			
				if(document.frm.email_id.value=='')
			{
			document.getElementById("errorForgetPassword").innerHTML="Please fill correct email id.";
			document.frm.email_id.focus();
			return false;
			}
			
				var email=document.frm.email_id.value;
			if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
			{
			document.getElementById("errorForgetPassword").innerHTML="The email format is not correct.";
			document.frm.email_id.focus();
			return false;
			
			}
			
			
			
			}
		
		
		
		
		function ValidationContratcto()
		{
		
			if(document.contactform.full_name.value=='')
			{
			document.getElementById("contactErrorForId").innerHTML="Please fill full name for contact.";
			document.contactform.full_name.focus();
			return false;
			}
			
			if(document.contactform.email_id.value=='')
			{
			document.getElementById("contactErrorForId").innerHTML="Please fill email id for contact.";
			document.contactform.email_id.focus();
			return false;
			}
			
			var email=document.contactform.email_id.value;
			if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
			{
			document.getElementById("contactErrorForId").innerHTML="The email format is not correct.";
			document.contactform.email_id.focus();
			return false;
			
			}
			
			
			if(document.contactform.phone_no.value=='')
			{
			document.getElementById("contactErrorForId").innerHTML="Please fill phone number for contact.";
			document.contactform.phone_no.focus();
			return false;
			}
			
			
			
		
		}
	
	
	function ValidationForJoin()
		{
		
			if(document.joinusform.full_name.value=='')
			{
			document.getElementById("contactErrorForId").innerHTML="Please fill full name.";
			document.joinusform.full_name.focus();
			return false;
			}
			
			if(document.joinusform.email_id.value=='')
			{
			document.getElementById("contactErrorForId").innerHTML="Please fill email id.";
			document.joinusform.email_id.focus();
			return false;
			}
			
			var email=document.joinusform.email_id.value;
			if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
			{
			document.getElementById("contactErrorForId").innerHTML="The email format is not correct.";
			document.joinusform.email_id.focus();
			return false;
			
			}
			
			
			if(document.joinusform.phone_no.value=='')
			{
			document.getElementById("contactErrorForId").innerHTML="Please fill phone number.";
			document.joinusform.phone_no.focus();
			return false;
			}
			
			
			
		
		}
	
	function PaymentValidation()
	{
		if(document.getElementById("Bcard_number").value=='' && document.getElementById("check_account").value=='' )
		{
			document.getElementById("showerrorPayment").innerHTML="Please fill account number or credit card number.";
			document.paymentfrm.check_account.focus();
			return false;
			
		}else
		{
		
			
			
			if(document.getElementById("check_routing").value=='' && document.getElementById("check_account").value!='')
			{
			document.getElementById("showerrorPayment").innerHTML="Please fill check routing for payment method.";
			document.paymentfrm.check_routing.focus();
			return false;
			}
			
			if(document.getElementById("Bcard_number").value!=''&&document.getElementById("Bcard_cvv").value=='')
			{
				
				document.getElementById("showerrorPayment").innerHTML="Please fill  CVV number on back of the card.";
					document.paymentfrm.Bcard_cvv.focus();
					return false;
			}
			
		
			if(document.getElementById("Bcard_number").value!=''&&document.getElementById("Bcard_cvv").value!='')
			{
				var cvvno = document.getElementById("Bcard_cvv").value;
				
				if(cvvno.length>4||cvvno.length<3)
				{
				document.getElementById("showerrorPayment").innerHTML="Please fill 3 or 4 digt CVV number on back of the card.";
					document.paymentfrm.Bcard_cvv.focus();
					return false;
				}
			}
			
			if(document.paymentfrm.Bcard_exp_day.value=='' && document.paymentfrm.Bcard_number.value!='')
			{
			document.getElementById("showerrorPayment").innerHTML="Please fill expiry month for payment method.";
			document.paymentfrm.Bcard_exp_day.focus();
			return false;
			}
			
			if(document.paymentfrm.Bcard_exp_year.value=='' && document.paymentfrm.Bcard_number.value!='')
			{
			document.getElementById("showerrorPayment").innerHTML="Please fill expiry year for payment method.";
			document.paymentfrm.Bcard_exp_year.focus();
			return false;
			}
			
			
		}
			
			
			
		
			if(document.paymentfrm.Bname.value=='')
			{
			document.getElementById("showerrormessage").innerHTML="Please fill name for billing/mailing address.";
			document.paymentfrm.Bname.focus();
			return false;
			}
			
				if(document.paymentfrm.Baddress.value=='')
			{
			document.getElementById("showerrormessage").innerHTML="Please fill address for billing/mailing address.";
			document.paymentfrm.Baddress.focus();
			return false;
			}
			
				if(document.paymentfrm.Bcity.value=='')
			{
			document.getElementById("showerrormessage").innerHTML="Please fill city for billing/mailing address.";
			document.paymentfrm.Bcity.focus();
			return false;
			}
			
			if(document.paymentfrm.Bstate.value=='')
			{
			document.getElementById("showerrormessage").innerHTML="Please fill state for billing/mailing address.";
			document.paymentfrm.Bstate.focus();
			return false;
			}
			
			if(document.paymentfrm.Bzip.value=='')
			{
			document.getElementById("showerrormessage").innerHTML="Please fill zip code for billing/mailing address.";
			document.paymentfrm.Bzip.focus();
			return false;
			}
			
			if(document.paymentfrm.agree.checked!=true)
			{
			document.getElementById("showerrormessage").innerHTML="Please check Terms & Conditions for billing/mailing address.";
			document.paymentfrm.agree.focus();
			return false;
			}
		
		
		}
		
		
		function LoginValidation()
		{
			
			if(document.loginform.user_emailid.value=='')
			{
			document.getElementById("errorLoginId").innerHTML="Please enter proper login name.";
			document.loginform.user_emailid.focus();
			return false;
			}
			
				if(document.loginform.user_password.value=='')
			{
			document.getElementById("errorLoginId").innerHTML="Please enter password.";
			document.loginform.user_password.focus();
			return false;
			}
			
			
			}
			
			
			function complaintValidation()
			{
				
					if(document.complaint_frm.textarea_va.value=='')
			{
			document.getElementById("complainterrorLoginId").innerHTML="Please enter the complaint.";
			document.complaint_frm.textarea_va.focus();
			return false;
			}
				
				}
	
	
	
	function sameValidationValueCopy()
	{
		//alert(document.myfrm.sameasabove.checked);
		if(document.myfrm.sameasabove.checked==true)
		{ 
		 document.myfrm.address_same.value=document.myfrm.address.value;
		 document.myfrm.alternate_addresssame.value=document.myfrm.alternate_address.value;
		 document.myfrm.city_same.value=document.myfrm.city.value;
		 document.myfrm.state_same.value=document.myfrm.state.value;
		 document.myfrm.zip_code_same.value=document.myfrm.zip_code.value;
		 }
		 else
		 {
			 document.myfrm.address_same.value='';
			 document.myfrm.alternate_addresssame.value='';
			 document.myfrm.city_same.value='';
			 document.myfrm.state_same.value='';
			 document.myfrm.zip_code_same.value=''; 
		 }
		}

