// HOME PAGE STUFF
		function validate_sform() {
			if (document.zform.dzip.value == "" || document.zform.dzip.value == null || document.zform.dzip.value == "enter your zip") { 
				alert('Please enter a zip code...');
				document.zform.dzip.focus();
				return false;	
			}
		}

		function cform() {
			if (document.zform.dzip.value == "enter your zip") {
				document.zform.dzip.value = "";
			} 
		}

// ZIP SEARCH VALIDATION
		function ConfirmZip(field){
			if (document.zipform.tzip.value == "") {
				alert("\rError\r\nPlease enter your Zip Code to search upon...");
				document.zipform.tzip.focus()
				document.zipform.tzip.select()
				return false;
			}
		}


// CURRENCY FORMAT
function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
		sign = (num == (num = Math.abs(num)));
		num = Math.floor(num*100+0.50000000001);
		cents = num%100;
		num = Math.floor(num/100).toString();
		if(cents<10)
			cents = "0" + cents;
			for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
				num = num.substring(0,num.length-(4*i+3))+','+
				num.substring(num.length-(4*i+3));
				return (((sign)?'':'-') + '$' + num + '.' + cents);
}



// PRICE QUANTITY PAGE
			function clearText(thefield){
				if (thefield.defaultValue==thefield.value)
					thefield.value = ""
					document.getElementById('tquantity').selectedIndex = 0;
					document.pform.ttotal.value = "";
			}

			function doTotal(theactualcost) {
				if (document.pform.tcoupon.value == "") {
					document.pform.tcoupon.value = "";
				}
				var cop = document.pform.tcoupon.value;
				var copamnt = 0;
				if ((cop != "")) {
					TQ = document.pform.tquantity.value;
					if ((TQ==5)||(TQ==6)||(TQ==7)||(TQ==8)||(TQ==9)) {
						copamnt = 5;
					} else if ((TQ==10)||(TQ==11)||(TQ==12)||(TQ==13)||(TQ==14)||(TQ==15)||(TQ==16)||(TQ==17)||(TQ==18)||(TQ==19)) {
						copamnt = 10;
					} else if (TQ>19) {
						copamnt = 20;
					}
					FT = TQ * theactualcost;
					var Fresult=Math.round(FT*100)/100;
					var copamnt=Math.round(copamnt*100)/100;
					TempAmount = (Fresult - copamnt);
					formatCurrency(TempAmount);
					document.pform.ttotal.value = TempAmount;
				} else {
					TQ = document.pform.tquantity.value;
					FT = TQ * theactualcost;
					var Fresult=Math.round(FT*100)/100;
					TempAmount = Fresult;
					formatCurrency(TempAmount);
					document.pform.ttotal.value = TempAmount;
				}
				// show new dynamic text per rob
				document.pform.cy.value = TQ;
				CY = document.pform.cy.value;
				document.pform.cyt.value = (100 * CY);
			}

			// add weed control cost visual only
			function doFTotal(fcost) {
				FTQ = document.pform.tquantityB.value;
				if (FTQ>0) {
					TempFTQ = (FTQ * fcost);
					TempTtoal = document.pform.ttotal.value;
					document.pform.ttotal.value = (TempTtoal + TempFTQ);
				}
			}

			function ConfirmQP(field){
				var tquantity = document.pform.tquantity.value;
				if (tquantity == "0") {
					alert("\rError\r\nPlease enter a quantity...");
					return false;
				}
				var thetquantityD = document.pform.tquantityD.value;
				if (thetquantityD > 0) {
					if ((document.pform.preenbagsize[0].checked) || (document.pform.preenbagsize[1].checked)){
					} else {
						alert("\rError\r\nPlease Choose a Preen Size...");
						return false;
					}
				}
				var iheardya = document.pform.thowhear.value;
				if (iheardya == "left blank") {
					alert("\rError\r\nPlease tell us how you heard about us...");
					return false;
				}

			}

// CUST INFO VALIDATION
			function ConfirmCustInfo(field){
				if (document.custform.fname.value == "") {
					alert("\rError\r\nPlease enter your First Name...");
					document.custform.fname.focus()
					document.custform.fname.select()
					return false;
				}
				if (document.custform.lname.value == "") {
					alert("\rError\r\nPlease enter your Last Name...");
					document.custform.lname.focus()
					document.custform.lname.select()
					return false;
				}
				if (document.custform.street.value == "") {
					alert("\rError\r\nPlease enter your Street Address...");
					document.custform.street.focus()
					document.custform.street.select()
					return false;
				}
				if (document.custform.city.value == "") {
					alert("\rError\r\nPlease enter your City...");
					document.custform.city.focus()
					document.custform.city.select()
					return false;
				}
				if (document.custform.zip.value == "") {
					alert("\rError\r\nPlease enter your Zip Code...");
					document.custform.zip.focus()
					document.custform.zip.select()
					return false;
				}
				if (document.custform.cstreet.value == "") {
					alert("\rError\r\nPlease enter your Cross Street...");
					document.custform.cstreet.focus()
					document.custform.cstreet.select()
					return false;
				}
				//if (document.custform.ptele.value == "") {
				//	alert("\rError\r\nPlease enter your Primary Telephone Number...");
				//	document.custform.ptele.focus()
				//	document.custform.ptele.select()
				//	return false;
				//}
				//if (document.custform.atele.value == "") {
				//	alert("\rError\r\nPlease enter your Alternate Cell Phone Number...");
				//	document.custform.atele.focus()
				//	document.custform.atele.select()
				//	return false;
				//}

				if(document.custform.ptele.value.search(/\d{3}\-\d{3}\-\d{4}/)==-1) {
					alert("\rError\r\nThe Primary Phone Number you entered is not valid.\r\nPlease enter a phone number with the format xxx-xxx-xxxx.");
					document.custform.ptele.focus()
					document.custform.ptele.select()
					return false;
				}

				if(document.custform.atele.value.search(/\d{3}\-\d{3}\-\d{4}/)==-1) {
					alert("\rError\r\nThe Alternate Cell Phone Number you entered is not valid.\r\nPlease enter a phone number with the format xxx-xxx-xxxx.");
					document.custform.atele.focus()
					document.custform.atele.select()
					return false;
				}


				if (document.custform.cemail.value == "") {
					alert("\rError\r\nPlease enter your Email Address...");
					document.custform.cemail.focus()
					document.custform.cemail.select()
					return false;
				}

				// alt delivery address
				if ((document.custform.adstreet.value != "") || (document.custform.adcity.value != "") || (document.custform.adcstreet.value != "")){
					if (document.custform.adstreet.value == "") {
						alert("\rError\r\nIt appears that you are trying to add an alternate deliver addrress:\r\nPlease enter your Alternate Street Address or Erase this field...");
						document.custform.adstreet.focus()
						document.custform.adstreet.select()
						return false;
					}
					if (document.custform.adcity.value == "") {
						alert("\rError\r\nIt appears that you are trying to add an alternate deliver addrress:\r\nPlease enter your Alternate City or Erase this field...");
						document.custform.adcity.focus()
						document.custform.adcity.select()
						return false;
					}
					if (document.custform.adcstreet.value == "") {
						alert("\rError\r\nIt appears that you are trying to add an alternate deliver addrress:\r\nPlease enter your Alternate Cross Street or Erase this field...");
						document.custform.adcstreet.focus()
						document.custform.adcstreet.select()
						return false;
					}
				}
			}


// CONFIRM REVIEW PAGE

			function ConfirmReview() {
				var multiCheckbox = false;
				if ((document.formrev.chk1[0].checked)&&(document.formrev.chk1[1].checked)&&(document.formrev.chk1[2].checked)){
					multiCheckbox = true; 
				}
				if (!multiCheckbox) {
					alert("\rError\r\nPlease read each checkbox and check that you agree");
					return false;
				}
			}

// HOME PAGE ARROW SETTING
function doHPARROW() {
	var screenW;
	var screenH;
	if (parseInt(navigator.appVersion)>3) {
		screenW = screen.width;
		screenH = screen.height;
	} else {
	 	screenW = 800;
		screenH = 600;
	}
	if (screenW == 1280) {
		document.write("<div style='position:absolute; top:402px; left:395px;'>");
	}
	if (screenW == 1024) {
		document.write("<div style='position:absolute; top:422px; left:395px;'>");
	}
	if (screenW == 800) {
		document.write("<div style='position:absolute; top:442px; left:395px;'>");
	}
	if (screenW < 800) {
		document.write("<div style='position:absolute; display:none;'>");
	}
	document.write("	<img src='images/arrow.gif' width='80' height='51' alt='' />");
	document.write("</div>");


}