/* THESE FUNCTION ARE FOR CHECKING THE VALUES OF FORM FIELDS */

function gettingCheck(){
with (document.editform) {
	if (NAME.value == ""){
		alert("You must provide your name.");
		NAME.focus();
	}
	else if (ZIP.value == ""){
		alert("You must enter your zip code.");
		ZIP.focus();
	}		
	else if (EMAIL.value == ""){
		alert("You must enter your email address.");
		EMAIL.focus();
	}
	else return true;
}
return false;
}

function formValidator(){
with (document.confirminfoform) {
	if (NAME.value == ""){
		alert("You must provide your name.");
		NAME.focus();
	}
	else if (ZIP.value == ""){
		alert("You must enter your zip code.");
		ZIP.focus();
	}		
	else if (EMAIL.value == ""){
		alert("You must enter your email address.");
		EMAIL.focus();
	}
	else if (MARKET.value == "0"){
		alert("You must enter your market.");
		MARKET.focus();
	}
	else if (AREACODE.value == "0"){
		alert("You must enter your area code.");
		AREACODE.focus();
	}
	else if (HEAR.value == "0"){
		alert("Please let us know how you heard about us.");
		HEAR.focus();
	}
	else return true;
}
return false;
}


/* THESE FUNCTIONS ARE CHANGING PAGES AND CHECKING VALUES OF A STRING */
function updateLocation(path){
	parent.window.location=path;
}
function confirmMove(path){
	confirm("Are you sure you want to delete this item? If you continue, there is no way to recover the information.");
	parent.window.location=path;
}
function downLoadFile(file){
	path = "pushd.php?md5604=" + file;
	$var = window.open(path,'askquestion','width=20,height=20');
}
function isEmail(str) {
	var supported = 0;
	if (window.RegExp) {
		var tempStr = "a";
		var tempReg = new RegExp(tempStr);
		if (tempReg.test(tempStr)) supported = 1;
		}
	if (!supported)
		return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
		var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
		var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	return (!r1.test(str) && r2.test(str));
}


