// All scripting hereafter copyright Eric Noyes Design & Consulting, All Rights Reserved. 
// All materials contained herein are the sole copyrighted property
// of Eric Noyes Design & Consulting, all rights reserved.

// This scripting and all associated materials are heretofor referred to as 'software'
// as defined within US codes 17 and 18.

// The 'software' contained herein is used under licence soley by the owner
// of this domain, therefore reverse engineering, modification, or re-use
// of any part in any form, of any 'software' contained within the aforementioned
// site, including, but not limited to, imaging, databases, scripting, content,
// or source code without the express written consent of
// Eric Noyes Design & Consulting, or its assigned officer,
// eric_noyes@hotmail.com, is EXPRESSLY PROHIBITED.

// Any such use will constitute infringement of copyright, as well as piracy
// of software as defined under US Codes 17 & 18, and will be prosecuted to the
// fullest extent of all applicable local/state/federal laws.

function checkForm(){   
	if ((isName()) && (isEmail()) && (isAddress1()) && (isCity()) && (isState()) && (isZip()) && (isHomePhone()) && (isWorkPhone()) && (isBestTime()) && (isPreferredMethod()) && (isAirConditionerRunsWithoutPower())){    
		alert("\nAll required fields appear to be filled out properly.\n\nYour request will now be made.");      
	}  else {return false;} 
}
function isName(){   
	var str = document.MainForm.Name.value;  
	if (str == ""){      
		alert("\nPlease enter your name.")      
		document.MainForm.Name.focus();      
		return false;      
	}   
	return true;   
}
function isEmail(){  
	if (document.MainForm.Email.value == ""){      
		alert("\nThe e-mail field is blank.\n\nPlease enter your e-mail address.")      
		document.MainForm.Email.focus();      
		return false;       
	}    
	if (document.MainForm.Email.value.indexOf ('@',0) == -1 || document.MainForm.Email.value.indexOf ('.',0) == -1){      
		alert("\nThe e-mail field requires a \"@\" and a \".\"be used.\n\nPlease re-enter your e-mail address.")      
		document.MainForm.Email.select();      
		document.MainForm.Email.focus();      
		return false;      
	}   
	else {      
		return true;      
	}   
}
function isAddress1(){   
	var str = document.MainForm.Address1.value;   
	if (str == ""){      
		alert("\nPlease enter your Address.")      
		document.MainForm.Address1.focus();      
		return false;      
	}   
	return true;   
}
function isCity(){   
	var str = document.MainForm.City.value;  
	if (str == ""){      
		alert("\nPlease enter your city.")      
		document.MainForm.City.focus();      
		return false;      
	}   
	return true;   
}
function isState(){   
	var str = document.MainForm.State.value;   
	if (str == "select"){      
		alert("\nPlease enter your state.")      
		document.MainForm.State.focus();      
		return false;      
	}   
	return true;   
}
function isZip(){   
	var str = document.MainForm.Zip.value;  
	if (str == ""){      
		alert("\nPlease enter your zip.")      
		document.MainForm.Zip.focus();      
		return false;      
	}   
	return true;
}
function isHomePhone(){   
	var str = document.MainForm.HomePhone.value;  
	if (str == ""){      
		alert("\nPlease enter your home phone number.")      
		document.MainForm.HomePhone.focus();      
		return false;      
	}   
	return true;   
}
function isWorkPhone(){   
	var str = document.MainForm.WorkPhone.value;  
	if (str == ""){      
		alert("\nPlease enter your work phone number.")      
		document.MainForm.WorkPhone.focus();      
		return false;      
	}   
	return true;   
}
function isBestTime(){   
	var str = document.MainForm.BestTime.value;  
	if (str == "select"){      
		alert("\nPlease select the best time to contact you.")      
		document.MainForm.BestTime.focus();      
		return false;      
	}   
	return true;
}
function isPreferredMethod(){   
	var str = document.MainForm.PreferredMethod.value;  
	if (str == "select"){      
		alert("\nPlease select your preferred method of contact.")      
		document.MainForm.PreferredMethod.focus();      
		return false;      
	}   
	return true;
}
function isAirConditionerRunsWithoutPower(){   
	var str = document.MainForm.AirConditionerRunsWithoutPower.value;  
	if (str == "select"){      
		alert("\nPlease select whether you would like your air conditioner runs during power outages.")      
		document.MainForm.AirConditionerRunsWithoutPower.focus();      
		return false;      
	}   
	return true;
}