//This is the contact us form validation file. Do not delete.
function checkContactForm(){
	var form = document.optinform;
	
	//check contact fields
	if(form.txtFirstName.value == ""){
		alert("Please enter a 'First Name'");
		form.txtFirstName.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.txtLastName.value == ""){
		alert("Please enter a 'Last Name'");
		form.txtLastName.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.txtEmail1.value == ""){
		alert("Please enter an 'Email Address'");
		form.txtEmail1.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.txtEmail2.value == ""){
		alert("Please confirm your 'Email Address'");
		form.txtEmail2.focus()
		return false;
	}//ends if
	
}//ends function


function checkEmail(){
var form = document.form;
	if(form.confirm_email.value != form.email_address.value){
		alert("The email address you entered is not a match. Please enter the email address again.")
		form.confirm_email.value = ""
		form.confirm_email.focus()
	}//ends function

}//ends function

//This is the Wholesale Create Account form validation file. Do not delete.
function checkCreateAccount(){
	var form = document.form;
	
	//check contact fields
	if(form.firstname.value == ""){
		alert("Please enter a 'First Name'");
		form.firstname.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.lastname.value == ""){
		alert("Please enter a 'Last Name'");
		form.lastname.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.email_address.value == ""){
		alert("Please enter an 'Email Address'");
		form.email_address.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.confirm_email.value == ""){
		alert("Please confirm your 'Email Address'");
		form.confirm_email.focus()
		return false;
	}//ends if

	//check contact fields
	if(form.telephone.value == ""){
		alert("Please enter a 'Phone Number'");
		form.telephone.focus()
		return false;
	}//ends if


	//check contact fields
	if(form.company.value == ""){
		alert("Please enter a 'Company Name'");
		form.company.focus()
		return false;
	}//ends if

	if(form.company_tax_id.value == ""){
		alert("Please enter a 'Company  Tax ID'");
		form.company_tax_id.focus()
		return false;
	}//ends if

	
	//check contact fields
	if(form.street_address.value == ""){
		alert("Please enter an 'Address'");
		form.street_address.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.city.value == ""){
		alert("Please enter a 'City'");
		form.city.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.state.value == ""){
		alert("Please select a 'State'");
		form.state.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.postcode.value == ""){
		alert("Please enter a 'Zip Code'");
		form.postcode.focus()
		return false;
	}//ends if
	
	

//check contact fields
	if(form.shipping_firstname.value == ""){
		alert("Please enter a 'Shippiing Address First Name'");
		form.shipping_firstname.focus()
		return false;
	}//ends if

	if(form.shipping_lastname.value == ""){
		alert("Please enter a 'Shippiing Address Last Name'");
		form.shipping_lastname.focus()
		return false;
	}//ends if

	if(form.shipping_street_address.value == ""){
		alert("Please enter an 'Shipping Street Address'");
		form.shipping_street_address.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.shipping_city.value == ""){
		alert("Please enter a 'Shipping Adddress City'");
		form.shipping_city.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.shipping_state.value == ""){
		alert("Please select a 'Shipping Address State'");
		form.shipping_state.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.shipping_postcode.value == ""){
		alert("Please enter a 'Shipping Address Zip Code'");
		form.shipping_postcode.focus()
		return false;
	}//ends if


//Check the radio buttons for existing customer
	var customer = -1;
	for(var i = 0; i<form.existing_customer.length; i++){
		if(form.existing_customer[i].checked){
			customer = i;
		}
	}
	if (customer == -1) {
		alert("Please let us know if your an 'Existing Customer'");
		return false;
	}
	//Check the check boxes for store front
	var storefront = false;
	for(var i = 0; i<form.store_front.length; i++){
		if(form.store_front[i].checked == true){
			storefront = true;
		}
	}
	if (storefront == false) {
		alert("Please let us know if you have a 'Storefront'");
		return false;
	}
	
	//check contact fields
	if(form.type_products.value == ""){
		alert("Please tell us the 'Type of Products you sell'");
		form.type_products.focus()
		return false;
	}//ends if

//check contact fields
	if(form.years_in_business.options[form.years_in_business.selectedIndex].value == 0){
		alert("Please tell us 'How many years you have been in business'");
		form.years_in_business.focus()
		return false;
	}//ends if

//check contact fields
	if(form.how_did_you_hear.value == ""){
		alert("Please tell us 'How you heard about us'");
		form.how_did_you_hear.focus()
		return false;
	}//ends if


//check contact fields
	if(form.password.value == ""){
		alert("Please enter a 'Password'");
		form.password.focus()
		return false;
	}//ends if
	
	//check contact fields
	if(form.confirmation.value == ""){
		alert("Please confirm your 'Password'");
		form.confirmation.focus()
		return false;
	}//ends if



	
}//ends function

function checkPassword(){
	var form = document.form;
	
	if(form.confirmation.value != form.password.value){
		alert("The password you entered is not a match. Please enter password again.")
		form.confirmation.value = ""
		form.confirmation.focus()
	}//ends function
}// ends function
