// JavaScript Document

//Validate form in RequestContact.html
function validateForm()
	{
	if (document.contactForm.myname.value.length == 0)
		{
		alert("Please provide us with your name.");
		document.contactForm.myname.focus();
		return false;
		}
	if (document.contactForm.myaddress.value.length == 0 &&
		document.contactForm.myphone.value.length == 0 &&
		document.contactForm.myemail.value.length == 0)
		{
		alert("Please provide an address,\nphone number or email address.");
		document.contactForm.myaddress.focus();
		return false;
		}
	if (document.contactForm.apptdate.value.length == 0 &&
		document.contactForm.freehomevisit.checked == false &&
		document.contactForm.contactme.checked == false &&
		document.contactForm.sendliterature.checked == false &&
		document.contactForm.mynotes.value.length == 0)
		{
		alert("Please tell us how we may help you \nby choosing from the options.");
		document.contactForm.mynotes.focus();
		return false;
		}
	if (document.contactForm.apptdate.value.length != 0 && 
		document.contactForm.myaddress.value.length == 0)
		{
		alert("Please provide us with the address for the appointment.");
		document.contactForm.myaddress.focus();
		return false;
		}
	if (document.contactForm.apptdate.value.length != 0 &&
		document.contactForm.myphone.value.length == 0)
		{
		alert("Please provide us with a phone number \nso we can confirm the time of the \nappointment with you.");
		document.contactForm.myaddress.focus();
		return false;
		}
	if (document.contactForm.freehomevisit.checked == true &&
		(document.contactForm.myphone.value.length == 0 && document.contactForm.myemail.value.length == 0))
		{
		alert("Please provide us with a phone number \n or email address so we can contact you \nabout a free home visit.");
		document.contactForm.myphone.focus();
		return false;
		}
	if (document.contactForm.contactme.checked == true &&
		(document.contactForm.myphone.value.length == 0 && document.contactForm.myemail.value.length == 0))
		{
		alert("Please provide us with a phone number \n or email address so we can contact you.");
		document.contactForm.myphone.focus();
		return false;
		}	
	if (document.contactForm.sendliterature.checked == true &&
		document.contactForm.myaddress.value.length == 0)
		{
		alert("Please provide us with an address \nso we can mail you literature.");
		document.contactForm.myaddress.focus();
		return false;
		}
	if (document.contactForm.mynotes.value.length != 0 &&
		(document.contactForm.myphone.value.length == 0 && document.contactForm.myemail.value.length == 0))
		{
		alert("Please provide us with a phone number or \nemail address so we can answer your question.");
		document.contactForm.myphone.focus();
		return false;
		}
	return true;
	}
//Validate form in RequestCallBack.html
function validateCallBackForm()
	{
	if (document.CallBackForm.myname.value.length == 0)
		{
		alert("Please provide us with your name.");
		document.CallBackForm.myname.focus();
		return false;
		}
	if (document.CallBackForm.myphone.value.length == 0)
		{
		alert("Please provide a phone number to call.");
		document.CallBackForm.myphone.focus();
		return false;
		}
	return true;
	}
//Validate form in buynow3.html
function validateOnlineOrderForm()
	{
	if (document.BuyNowForm.myname.value.length == 0)
		{
		alert("Please provide us with your name.");
		document.BuyNowForm.myname.focus();
		return false;
		}
	if (document.BuyNowForm.myaddress.value.length == 0)
		{
		alert("Please provide an installation address.");
		document.BuyNowForm.myaddress.focus();
		return false;
		}
	if (document.BuyNowForm.myphone.value.length == 0)
		{
		alert("Please provide a phone number so we can arrange an installation date.");
		document.BuyNowForm.myphone.focus();
		return false;
		}
	return true;
	}