//on page load
addLoadListener(initWholesale);

//form display & validation
function initWholesale() {	
	document.getElementById("wholesale-form").onsubmit = contactValidateAll;
}

function contactValidateAll() {	
	var name = getFormValue("name");
	var business_name = getFormValue("business_name");
	var email = getFormValue("email");	
	var years = getFormValue("years");	
	var spam = getFormValue("spam");	
	var about = getFormValue("about");	
	if ( (validateLength(name, 1, 100)) && (validateLength(business_name, 1, 100)) && (validateLength(years, 1, 10)) && (validateEmail(email)) && (validateNumerical(spam)) && (validateLength(about, 1, 1000000)) ) {
		return true;
	} else {
		var ErrorDiv = document.getElementById("error");
		ErrorDiv.innerHTML = 'Please complete the entire form';	
		new Effect.Highlight('error');
		return false;
	}	
}
