			function checkForm() {
				var errStr = "";
				var errFree = true;
				var emailID=document.theForm.email;
				var phoneID=document.theForm.phone;
				
				// name checks
				if (document.theForm.company.value == "") {
					errFree = false;
					errStr += needcompany + "\n";
				}
				if (document.theForm.locations.value == "") {
					errFree = false;
					errStr += needlocations + "\n";
				}
				
				// email checks
				if (
						(emailID.value==null || emailID.value=="") &&
						(phoneID.value==null || phoneID.value=="")
					){
					errStr += needPhoneOrEmail + "\n";
					errFree = false;
				} else if ((emailID.value!=null) && (emailID.value!="") && echeck(emailID.value)==false){
					errStr += badEmail + "\n";
					errFree = false;
				}
			
				if (!errFree) {
					alert(errPretext + "\n\n" + errStr);
					return false;
				} else {

					return true;
				}
			}
			
			/**
			 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
			 */
			
			function echeck(str) {
		
				var at="@"
				var dot="."
				var lat=str.indexOf(at)
				var lstr=str.length
				var ldot=str.indexOf(dot)
				if (
						(str.indexOf(at)==-1) ||
						(str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) ||
						(str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) ||
						(str.indexOf(at,(lat+1))!=-1) ||
						(str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) ||
						(str.indexOf(dot,(lat+2))==-1) ||
						(str.indexOf(" ")!=-1)
					) {
				   return false;
				}
				return true;
			}
			
			function confirmCancel(theURL) {
				if (confirm(cancelConfirmLbl)) {
					location.href=theURL;
					return false;
				}
				return false;
			}
