﻿function validateFirstQuoteForm(){
	var theForm = document.Free_Moving_Quote_Form;
	var from_zip = theForm.from_zip;
	var to_state = theForm.to_state;
	var move_size = theForm.move_size;
	if(from_zip.value==''){
		alert('Please fill in From Zip');
		from_zip.focus();
		return false;
	}
	if(to_state.selectedIndex==0){
		alert('Please Select state');
		to_state.focus();
		return false;
	}
	if(move_size.selectedIndex==0 || move_size.selectedIndex==1){
		alert('Please Select Moving size');
		move_size.focus();
		return false;
	}
	return true;
}
function validateMainQuoteForm(){
	var theForm = document.Free_Express_Moving;
	var first_name = theForm.first_name;
	var last_name = theForm.last_name;
	var home_phone = theForm.home_phone;
	var email = theForm.email;
	var from_city = theForm.from_city;
	var from_state = theForm.from_state;
	var from_zip = theForm.from_zip;
	var to_city = theForm.to_city;
	var to_state = theForm.to_state;
	var to_zip = theForm.to_zip;
	var move_date = theForm.move_date;
	var move_size = theForm.move_size;
	
	if(first_name.value==''){
		alert('Please fill in First name');
		first_name.focus();
		return false;
	}
	if(last_name.value==''){
		alert('Please fill in Last name');
		last_name.focus();
		return false;
	}
	if(home_phone.value==''){
		alert('Please fill in Home phone');
		home_phone.focus();
		return false;
	}
	if(email.value==''){
		alert('Please fill in Email');
		email.focus();
		return false;
	}
	if(from_city.value==''){
		alert('Please fill in From city');
		from_city.focus();
		return false;
	}
	if(from_state.selectedIndex==0){
		alert('Please select From state');
		from_state.focus();
		return false;
	}
	if(from_zip.value==''){
		alert('Please fill in From zip');
		from_zip.focus();
		return false;
	}
	if(to_city.value==''){
		alert('Please fill in To city');
		to_city.focus();
		return false;
	}
	if(to_state.selectedIndex==0){
		alert('Please select To state');
		to_state.focus();
		return false;
	}
	if(to_zip.value==''){
		alert('Please fill in To zip');
		to_zip.focus();
		return false;
	}
	if(move_date.value==''){
		alert('Please fill in Move date');
		move_date.focus();
		return false;
	}
	if(move_size.selectedIndex==0 || move_size.selectedIndex==1){
		alert('Please Select Moving size');
		move_size.focus();
		return false;
	}
	return true;
}

function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
