
// validate customer registration request form
function validateForm () {
	var quotedoc = document.forms[0];

	strTitle = 'The following information is required to complete your request: \n';
	strM = '';
	a = '';
	if (trim(quotedoc.FirstName.value) == '') {
		strM = strM + 'first name \n';
	}
	if (trim(quotedoc.LastName.value) == '') {
		strM = strM + 'last name\n';
	}
	if (trim(quotedoc.CoName.value) == '') {
		strM = strM + 'company name \n';
	}
	if (trim(quotedoc.CoAddr.value) == '') {
		strM = strM + 'company address \n';
	}
	if (trim(quotedoc.CoCity.value) == '') {
		strM = strM + 'company city \n';
	}
	if (trim(quotedoc.CoZip.value) == '') {
		strM = strM + 'company postal or zip code \n';
	}
	a=trim(quotedoc.AreaCode.value);				
	if (a.length < 3) {
	    strM = strM + 'complete phone number \n ';
	} else {
		a=trim(quotedoc.Phone.value);				
		if (a.length < 7) {
		    strM = strM + 'complete phone number \n ';
		}
	}
	if (trim(quotedoc.EMail.value) == '') {
		strM = strM + 'e-mail address \n';
	}
	a=trim(quotedoc.HostCode.value);
	if (a.length == 7 || a.length == 4) {
	} else {
		strM = strM + 'a valid customer or tariff filing code \n';
	}
	a=trim(quotedoc.UserLogin.value);
	if (a.length < 6 || a.length > 12) {
		strM = strM + 'a login between 6 and 12 characters in length \n';
	}
	a=trim(quotedoc.UserPassword.value);
	if (a.length < 6 || a.length > 10) {
		strM = strM + 'a password between 6 and 10 characters in length \n';
	} else {
		if (a == trim(quotedoc.UserPasswordV.value)) {
		} else {
			strM = strM + 'password and password verification must match \n';
		}
	}
	if (strM == '') {
		quotedoc.ToSubmit.value = 'XX';
		return true;
	} else {
		quotedoc.ToSubmit.value = '';
		alert(strTitle + strM);
		return false;
	}
}

// reset form (just base fields are cleared)
function resetForm () {
	var quotedoc = document.forms[0];

	quotedoc.FirstName.value = '';
	quotedoc.LastName.value = '';
	quotedoc.AreaCode.value = '';
	quotedoc.Phone.value = '';
	quotedoc.EMail.value = '';
	quotedoc.CoName.value = '';
	quotedoc.CoAddr.value = '';
	quotedoc.CoCity.value = '';
	quotedoc.CoZip.value = '';
	quotedoc.HostCode.value = '';
	quotedoc.UserPassword.value = '';
	quotedoc.UserPasswordV.value = '';
}