function contactUs(){	var temp = false;		var cu = document.cu;        if(cu.nm.value == ''){                alert('Name cannot be blank.');                cu.nm.focus();        }else if(cu.email.value == ''){                alert('E-Mail cannot be blank.');                cu.email.focus();	}else if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(cu.email.value))){		alert("Invalid E-mail Address! Please re-enter.")                cu.email.focus();	}else if(cu.msg.value == ''){		alert('Message cannot be blank.');		cu.msg.focus();	}else		temp = true;	return temp;}function getPDF(pdf){	mypage = "pdfs/"+pdf+".pdf";	myname = "JT";	w = "640";	h = "480";	popUp(mypage, myname, w, h);}function popUp(mypage, myname, w, h){	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;	settings =	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=no,scrollbars=yes,resizable,location=no';	window.open(mypage,myname,settings);}function popUp(URL) {day = new Date();id = day.getTime();eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=350,height=350,left = 250,top = 250');");}function getPage(page){	frames['contentFrame'].location.href = "php/content.php?page="+page;	getImage(page);}function searchSite(){	var key = document.processor;	if(key.search.value == ''){		alert('You must enter keywords to search!');		key.search.focus();		return false;	}else{		key.webpage_id.value = 10;		key.submit();		return true;	}	}var xmlHttp = createXmlHttpRequestObject();function createXmlHttpRequestObject(){        var xmlHttp;        if(window.ActiveXObject){                try{                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");                }catch (e){                        xmlHttp = false;                }        }else{                try{                        xmlHttp = new XMLHttpRequest();                }catch (e){                        xmlHttp = false;                }        }        if(!xmlHttp)                alert("Error creating the XMLHttpRequest object.");        else                return xmlHttp;}function getImage(page){	var url = "php/process.php?action=get_img&page="+page;        if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0){		xmlHttp.open("GET", url, true);		xmlHttp.onreadystatechange = HandleServerResponseImage;		xmlHttp.send(null);	}else{		setTimeout('getImage()', 1000);	}}function HandleServerResponseImage(){	var lftImg = document.getElementById('lftImg');        if(xmlHttp.readyState == 4){                xmlResponse = xmlHttp.responseXML;                xmlDocumentElement = xmlResponse.documentElement;                responseTxt = xmlDocumentElement.firstChild.data;		rows = responseTxt.split("||");		for(x=0; x<rows.length; x++){			tmp = rows[x].split("|");			if(tmp[0] != ''){				if(tmp[0] == "webpage_img")					if(tmp[1].length > 4)						lftImg.src = 'Image/'+tmp[1];			}		}        }}function validateForm(theForm) {	  var AtSym    = theForm.Email.value.indexOf('@')  var Period   = theForm.Email.value.lastIndexOf('.')  var Space    = theForm.Email.value.indexOf(' ')  var Length   = theForm.Email.value.length - 1   // Array is from 0 to length-1		  if (theForm.FirstName.value == "")	  {		alert("Please enter a value in the \"First Name\" field.");		theForm.FirstName.focus();		return (false);	  }    else if (theForm.LastName.value == "")	  {		alert("Please enter a value in the \"Last Name\" field.");		theForm.LastName.focus();		return (false);	  }    else if (theForm.Address1.value == "")	  {		alert("Please enter a value in the \"Address 1\" field.");		theForm.Address1.focus();		return (false);	  }    else if (theForm.City.value == "")	  {		alert("Please enter a value in the \"City\" field.");		theForm.City.focus();		return (false);	  }    else if (theForm.State.value == "")	  {		alert("Please enter a value in the \"State\" field.");		theForm.State.focus();		return (false);	  }    else if (theForm.Zip.value == "")	  {		alert("Please enter a value in the \"Zip\" field.");		theForm.Zip.focus();		return (false);	  }  else if (theForm.Phone.value == "")	  {		alert("Please enter a value in the \"Phone\" field.");		theForm.Phone.focus();		return (false);	  }  else if (theForm.Email.value == "")	  {		alert("Please enter a value for the \"E-mail\" field.");		theForm.Email.focus();		return (false);	  }  else if (theForm.Email.value.length < 7)	  {		alert("Please enter at least 7 characters in the \"E-mail\" field.");		theForm.Email.focus();		return (false);	  }  else if ((AtSym < 1) ||                     // '@' cannot be in first position      (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'      (Period == Length ) ||             // Must be atleast one valid char after '.'      (Space  != -1))                    // No empty spaces permitted	  {		alert("Please enter a valid email address in the \"E-mail\" field.");		theForm.Email.focus();		return (false);	  }	    else if (theForm.HeardByReferral.checked == false && theForm.HeardByInternet.checked == false && theForm.HeardByYellowPages.checked == false && theForm.HeardByAdvertising.checked == false && theForm.HeardByOther.checked == false)  	{		alert("Please indicate how you heard about us.");		theForm.HeardByReferral.focus();		return (false);  	}	  else {	  alert("Thank you for your interest in TidyJohn! We will contact you soon regarding your request.");	  return (true);  	}}