// JavaScript Document
function setfocus(){
	document.frmQuote.name.focus();
}

function submitIt(frmQuote) {

			// must enter a valid contact name

			if (frmQuote.name.value == "") {

				alert("Please enter a contact name")

				frmQuote.name.focus()

				frmQuote.name.select()

				return false;

			}

			// must enter a valid telephone  #

			if (frmQuote.phone.value == "") {

				alert("Please enter a telephone number")

				frmQuote.phone.focus()

				frmQuote.phone.select()

				return false;

			}

			// must enter a valid email

//			if (frmQuote.email.value.indexOf("@") == -1 || frmQuote.email.value == ""){
//
//				alert("Please enter a vaild email address")
//
//				frmQuote.email.focus()
//
//				frmQuote.email.select()

//				return false;

//			}
			
						
			// must enter a valid address

			if (frmQuote.address.value == "") {

				alert("Please enter the address of the painting project")

				frmQuote.address.focus()

				frmQuote.address.select()

				return false;

			}

			// must enter a  city

			if (frmQuote.city.value == "")  {

				alert("Please enter your city")

				frmQuote.city.focus()

				frmQuote.city.select()

				return false;

			}

			// must enter a postal code

			if (frmQuote.postal.value == "") {

				alert("Please enter a postal code")

				frmQuote.postal.focus()

				frmQuote.postal.select()

				return false;

			}
			
			// Location of work
			
			myOption = -1;
			for (i=0; i<frmQuote.location.length; i++) {
				if (frmQuote.location[i].checked) {
					myOption = i;
					}
				}	
				if (myOption == -1) {
				alert("You must select Interior, Exterior, or Both");
				return false;
			}

			
			//  Type of work
			
			myOption = -1;
			for (i=0; i<frmQuote.type.length; i++) {
				if (frmQuote.type[i].checked) {
					myOption = i;
					}
				}	
				if (myOption == -1) {
				alert("You must select  Residential or Commercial");
				return false;
			}
			
			// Enter project start date
			
			//if (frmQuote.startdate.value == "") {

				//alert("Please enter a start date for your painting project")

				//frmQuote.startdate.focus()

				//frmQuote.startdate.select()

				//return false;

			//}
		
			// all of the frmQuote has been validated.

			return true;

		}
