function rollon() {
  if (window.event.srcElement.className == "menu") {
    window.event.srcElement.className = "highlight"; // change class
  }
}
function rolloff() {
  if (window.event.srcElement.className == "highlight") {
    window.event.srcElement.className = "menu"; // change class
  }
}
document.onmouseover = rollon;
document.onmouseout = rolloff;

function checkFields() 
{
missinginfo = ""
if(document.form.email.value.length < 5){
	missinginfo += "\n     -  You did not enter a valid email address";
}
if(document.form.phone.value == '' && document.form.household != null && document.form.household.value == 1) {
	missinginfo += "\n     -  You did not enter a valid phone number";
}

if (document.form.o_zip.value == "") {
	if (document.form.o_city.value == "" || document.form.o_state.value == 'NO' || document.form.o_state.value == '') {
		missinginfo += "\nYou must provide an origin zip OR city and state.";
	}
}
if (document.form.d_zip.value == "") {
	if (document.form.d_city.value == "" || document.form.d_state.value == 'NO' || document.form.d_state.value == '') {
		missinginfo += "\nYou must provide an destination zip OR city and state.";
	}
}
if (document.form.no_vehicle == null) {
	if(document.form.v_year.value == "") {
		missinginfo += "\n     -  Vehicle Year";
	}
	if (document.form.va_make) {
		if(document.form.v_make.value == "" && (document.form.va_make.value == "" || document.form.va_make.value == "Other")) {
			missinginfo += "\n     -  Vehicle Make";
		}
		if(document.form.v_model.value == "" && document.form.va_model.value == "") {
			missinginfo += "\n     -  Vehicle Model";
		}
		if(document.form.v_description.value == '' && document.form.va_model.value == "") {
			missinginfo += "\n     -  Vehicle Description";
		}
	} else {
		if(document.form.v_make.value == "") {
			missinginfo += "\n     -  Vehicle Make";
		}
		if(document.form.v_model.value == "") {
			missinginfo += "\n     -  Vehicle Model";
		}
		if(document.form.v_description.value == '') {
			missinginfo += "\n     -  Vehicle Description";
		}
	}
}
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You must complete the following required fields:\n" +
missinginfo + "\n_____________________________" +
"\nPlease correct and submit again.";
alert(missinginfo);
return false;
}}

function checkFieldsOne() 
{
missinginfo = ""
if(document.form.o_city.value == "") {
missinginfo += "\n     -  Origin City";
}
/* 
if(document.form.o_zip.value == "") {
missinginfo += "\n     -  Origin Zip";
} 
if(document.form.d_zip.value == "") {
missinginfo += "\n     -  Destination Zip";
}
*/
if(document.form.o_state.value == 'NO' || document.form.o_state.value == '') {
missinginfo += "\n     -  Origin State";
}
if(document.form.d_city.value == "") {
missinginfo += "\n     -  Destination City";
}
if(document.form.d_state.value == 'NO' || document.form.d_state.value == '') {
missinginfo += "\n     -  Destination State";
}

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You must complete the following required fields:\n" +
missinginfo + "\n_____________________________" +
"\nPlease correct and submit again.";
alert(missinginfo);
return false;
}}

function checkFieldsOneV2() {
	missinginfo = ""
	if (document.form.o_zip.value == "") {
		if (document.form.o_city.value == "" || document.form.o_state.value == 'NO' || document.form.o_state.value == '') {
			missinginfo += "\nYou must provide an origin zip OR city and state.";
		}
	}
	if (document.form.d_zip.value == "") {
		if (document.form.d_city.value == "" || document.form.d_state.value == 'NO' || document.form.d_state.value == '') {
			missinginfo += "\nYou must provide a destination zip OR city and state.";
		}
	}
	
	if (missinginfo != "") {
		missinginfo ="_________________________________________________________\n" +
			missinginfo + "\n_________________________________________________________" +
			"\n\nPlease correct and submit again.";
		alert(missinginfo);
		return false;
	}
}

function switchInternational() {
	if (document.form.o_state.value == "international") {
		document.getElementById('o_zip_title').style.display = 'none';
		document.getElementById('o_internat_title').style.display = 'block';
		document.getElementById('o_zip').style.display = 'none';
		document.getElementById('o_country').style.display = 'block';
		document.getElementById('o_csorz').style.display = 'none';
                document.getElementById('of_statel').style.display = 'block';
                document.getElementById('of_statei').style.display = 'block';
	} else {
		document.getElementById('o_zip_title').style.display = 'block';
		document.getElementById('o_internat_title').style.display = 'none';
		document.getElementById('o_zip').style.display = 'block';
		document.getElementById('o_country').style.display = 'none';
		document.getElementById('o_csorz').style.display = 'block';
                document.getElementById('of_statel').style.display = 'none';
                document.getElementById('of_statei').style.display = 'none';
	}
	if (document.form.d_state.value == "international") {
		document.getElementById('d_zip_title').style.display = 'none';
		document.getElementById('d_internat_title').style.display = 'block';
		document.getElementById('d_zip').style.display = 'none';
		document.getElementById('d_country').style.display = 'block';
		document.getElementById('d_csorz').style.display = 'none';
                document.getElementById('df_statel').style.display = 'block';
                document.getElementById('df_statei').style.display = 'block';
	} else {
		document.getElementById('d_zip_title').style.display = 'block';
		document.getElementById('d_internat_title').style.display = 'none';
		document.getElementById('d_zip').style.display = 'block';
		document.getElementById('d_country').style.display = 'none';
		document.getElementById('d_csorz').style.display = 'block';
                document.getElementById('df_statel').style.display = 'none';
                document.getElementById('df_statei').style.display = 'none';
	}
}

function switchMainInternational() {
	if (document.form.o_country.value == "US" || document.form.o_country.value == "") {
		document.getElementById('o_zip_title').style.display = 'block';
		document.getElementById('o_csorz').style.display = 'block';
		document.getElementById('o_zip').style.display = 'block';
		document.getElementById('o_state').style.display = 'block';
		document.getElementById('of_statei').style.display = 'none';
		document.getElementById('o_statel').innerHTML = 'State:';
	} else {
		document.getElementById('o_zip_title').style.display = 'none';
		document.getElementById('o_csorz').style.display = 'none';
		document.getElementById('o_zip').style.display = 'none';
		document.getElementById('o_state').style.display = 'none';
		document.getElementById('of_statei').style.display = 'block';
		document.getElementById('o_statel').innerHTML = 'State/Province:';
	}
	if (document.form.d_country.value == "US" || document.form.d_country.value == "") {
		document.getElementById('d_zip_title').style.display = 'block';
		document.getElementById('d_csorz').style.display = 'block';
		document.getElementById('d_zip').style.display = 'block';
		document.getElementById('d_state').style.display = 'block';
		document.getElementById('df_statei').style.display = 'none';
		document.getElementById('d_statel').innerHTML = 'State:';
	} else {
		document.getElementById('d_zip_title').style.display = 'none';
		document.getElementById('d_csorz').style.display = 'none';
		document.getElementById('d_zip').style.display = 'none';
		document.getElementById('d_state').style.display = 'none';
		document.getElementById('df_statei').style.display = 'block';
		document.getElementById('d_statel').innerHTML = 'State/Province:';
	}
}
