	<!--

		/* --------------------------- STANDARD ROUTINES --------------------------- */

		var ns4 = (document.layers);
		var ie4 = (document.all && !document.getElementById);
		var ie5 = (document.all && document.getElementById);
		var ns6 = (!document.all && document.getElementById);

		function showMenu(where) {
			if (ns4) {
				document.layers[where].style.visibility="visible";
			} else if (ie4) {
				document.all[where].style.visibility="visible";
			} else if (ie5 || ns6) {
				document.getElementById(where).style.visibility="visible";
			}
		}

		function hideMenu(where) {
			if (ns4) {
				document.layers[where].style.visibility="hidden";
			} else if (ie4) {
				document.all[where].style.visibility="hidden";
			} else if (ie5 || ns6) {
				document.getElementById(where).style.visibility="hidden";
			}
		}

		function SwapText(where, what) {
			if (ns4) {
				document.layers[where].innerHTML=what;
			} else if (ie4) {
				document.all[where].innerHTML=what;
			} else if (ie5 || ns6) {
				document.getElementById(where).innerHTML=what;
			}
		}

		function GetText(where) {
			if (ns4) {
				var what = document.layers[where].innerHTML;
			} else if (ie4) {
				var what = document.all[where].innerHTML;
			} else if (ie5 || ns6) {
				var what = document.getElementById(where).innerHTML;
			}
			return what;
		}

		function DoBox(url,w,h,top,left) {
			window.open(url,'popup','height=' + h + ',width=' + w + ',top=' + top + ',left=' + left + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no');
		}

		function DoBox2(url,w,h,top,left) {
			window.open(url,'popup','height=' + h + ',width=' + w + ',top=' + top + ',left=' + left + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes');
		}

		function CheckTime(dname,fname) {
			msg = "Please enter a valid time in\n\'0:00 AM\' or \'0:00 PM\' format.";
			tmp = document[dname][fname].value;
			tmp = tmp.toUpperCase();
			if (!tmp.indexOf(":")) {
				alert(msg);
				document[dname][fname].focus();
				return true;
			}
			if (tmp.indexOf(" ")) {
				timeArray = tmp.split(" ");
				if (timeArray.length !== 2) {
					alert(msg);
					document[dname][fname].focus();
					return true;
				} else {
					dayPart = timeArray[1];
					if ((dayPart !== "AM") && (dayPart !== "PM")) {
						alert(msg);
						document[dname][fname].focus();
						return true;
					}
				}
			}
			numArray = timeArray[0].split(":");
			if (numArray.length !== 2) {
				alert(msg);
				document[dname][fname].focus();
				return true;
			} else {
				var hr = numArray[0];
				var mn = numArray[1];
				if ((hr.length !== 1) && (hr.length !== 2)) {
					alert(msg);
					document[dname][fname].focus();
					return true;
				}
				if ((mn.length !== 1) && (mn.length !== 2)) {
					alert(msg);
					document[dname][fname].focus();
					return true;
				}
				if (hr.substr(0, 1) == "0") {
					hr = hr.substr(1, 1);
				}
				if (mn.substr(0, 1) == "0") {
					mn = mn.substr(1, 1);
				}
				if ((isNaN(hr)) || (isNaN(mn))) {
					alert(msg);
					document[dname][fname].focus();
					return true;
				}
				if ((hr < 1) || (hr > 12) || (mn < 0) || (mn > 59)) {
					alert(msg);
					document[dname][fname].focus();
					return true;
				}
			}
		}

		function CheckRadio(dname,fname,msg,num) {
			var isOk = false;
			for (i = 0; i < num; i++) {
				if (document[dname][fname][i].checked==true) {
					isOk = true;
					break;
				}
			}
			if (isOk == false) {
				alert(msg);
				return true;
			}
		}

		function CheckDate(dname,fname,msg) {
			var frmName = dname;
			var fldName = fname;
			var alertText = msg;
			var string1 = document[frmName][fldName].value;
			if (string1.indexOf("/")==-1) {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
		        var dateArray = string1.split('/');
			if (dateArray.length !== 3) {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
			if ((isNaN(dateArray[0])) || (isNaN(dateArray[1])) || (isNaN(dateArray[2]))) {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
			var vMonth = dateArray[0];
			var vDay = dateArray[1];
			var vYear = dateArray[2];
			if ((vMonth > 12) || (vMonth < 1)) {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
			if ((vDay < 1) || (vDay > 31)) {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
			if (vMonth == 2) {
				var febMax = 28;
				var startYear = 1004;
				for (count = 0; count < 1000; count++) {
					startYear = startYear + 4;
					if (vYear == startYear) {
						febMax = 29;
						break;
					}
				}
				if (vDay > febMax) {
					alert(alertText);
					document[frmName][fldName].focus();
					return true;
				}
			}
			if ((vMonth == 4) || (vMonth == 6) || (vMonth == 9) || (vMonth == 11)) {
				if (vDay > 30) {
					alert(alertText);
					document[frmName][fldName].focus();
					return true;
				}
			}
			if ((vMonth == 1) || (vMonth == 3) || (vMonth == 5) || (vMonth == 7) || (vMonth == 8) || (vMonth == 10) || (vMonth == 12)) {
				if (vDay > 31) {
					alert(alertText);
					document[frmName][fldName].focus();
					return true;
				}
			}
			if ((vYear < 1000) || (vYear > 9999)) {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
		}

		function CheckDateRange(dName,dateFrom,dateTo,msg) {
			var frmName = dName;
			var fromDate = document[frmName][dateFrom].value;
			var toDate = document[frmName][dateTo].value;
			var fromArray = fromDate.split('/');
			var toArray = toDate.split('/');
			var mo = fromArray[0];
			var da = fromArray[1];
			if (mo.length < 2) {
				mo = "0" + mo;
			}
			if (da.length < 2) {
				da = "0" + da;
			}
			var fromNum = fromArray[2] + mo + da
			var mo = toArray[0];
			var da = toArray[1];
			if (mo.length < 2) {
				mo = "0" + mo;
			}
			if (da.length < 2) {
				da = "0" + da;
			}
			var toNum = toArray[2] + mo + da
			fromNum = fromNum * 1;
			toNum = toNum * 1;
			if (fromNum > toNum) {
				alert(msg);
				document[frmName][dateFrom].focus();
				return true;
			}
		}

		function CheckTimeRange(dName,timeFrom,timeTo,msg) {

			var fromTime = document[dName][timeFrom].value;
			var toTime = document[dName][timeTo].value;

			fromTime = fromTime.toLowerCase();
			toTime = toTime.toLowerCase();

			if (fromTime.indexOf("a") > -1) {
				var fromPart = "a";
				fromTime = fromTime.replace(/ am/, "");
			} else {
				var fromPart = "p";
				fromTime = fromTime.replace(/ pm/, "");
			}

			if (toTime.indexOf("a") > -1) {
				var toPart = "a";
				toTime = toTime.replace(/ am/, "");
			} else {
				var toPart = "p";
				toTime = toTime.replace(/ pm/, "");
			}

			fromTime = fromTime.replace(/:/, "");
			toTime = toTime.replace(/:/, "");

			fromTime = (fromTime - 0);
			toTime = (toTime - 0);

			if (fromPart == "p") {
				fromTime = (fromTime + 1200) - 0;
			}

			if (toPart == "p") {
				toTime = (toTime + 1200) - 0;
			}

			if (fromTime >= toTime) {
				alert(msg);
				return true;
			}
		}

		function CheckEmail(dname,fname,msg) {
			var frmName = dname;
			var fldName = fname;
			var alertText = msg;
			var string1 = document[frmName][fldName].value;
			if ((string1.indexOf("@")==-1) || (string1.indexOf(".")==-1)) {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
		}

		function CheckNull(dname,fname,msg) {
			var frmName = dname;
			var fldName = fname;
			var alertText = msg;
			var string1 = document[frmName][fldName].value;
			var string2 = string1.replace(/ /g, "");
			if (string2=="") {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
		}

		function CheckNumber(dname,fname,msg) {
			var frmName = dname;
			var fldName = fname;
			var alertText = msg;
			if (isNaN(document[frmName][fldName].value)) {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
		}

		function MakeZero(dname,fname) {
			var frmName = dname;
			var fldName = fname;
			if (document[frmName][fldName].value=="") {
				document[frmName][fldName].value="0";
			}
		}

		function DoFocus(dname,fname) {
			var frmName = dname;
			var fldName = fname;
			document[frmName][fldName].focus();
		}

		function CheckLength(dname,fname,msg,max) {
			var frmName = dname;
			var fldName = fname;
			var alertText = msg;
			var maxLen = max - 0;
			var string1 = document[frmName][fldName].value;
			if (string1.length > maxLen) {
				alert(alertText);
				document[frmName][fldName].focus();
				return true;
			}
		}


		/* ------------------------------ STANDARD AJAX ---------------------------- */


		function PostItem(theScript, frmName, div) {
			frmName = document.forms[frmName];
			var fld;
			var theData = "";
			for (i = 0; i < frmName.elements.length; i++) {
				fld = frmName.elements[i];
				if ((fld.type !== "button") && (fld.type !== "submit")) {
					if ((fld.type == "radio") || (fld.type == "checkbox")) {
						if (fld.checked) {
							if (i > 0) {
								theData += "&" + fld.name + "=" + escape(fld.value);
							} else {
								theData += fld.name + "=" + escape(fld.value);
							}
						}
					} else {
						if (i > 0) {
							theData += "&" + fld.name + "=" + escape(fld.value);
						} else {
							theData += fld.name + "=" + escape(fld.value);
						}
					}
				}
			}
			var xmlHttp;
			if (xmlHttp = startAjax()) {
				xmlHttp.open("POST", theScript, true);
				xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				xmlHttp.onreadystatechange = function() {
					if (xmlHttp.readyState == 4) {
						var theText = xmlHttp.responseText;
						showMenu(div);
						SwapText(div, theText);
					}
				}
				xmlHttp.send(theData);
			}
		}

		function GetItem(scrp, div, tmp) {
			var theScript = scrp + tmp;
			var xmlHttp;
			if (xmlHttp = startAjax()) {
				xmlHttp.onreadystatechange = function() {
					if(xmlHttp.readyState == 4) {
						var theText = xmlHttp.responseText;
						showMenu(div);
						SwapText(div, theText);
					}
				}
				xmlHttp.open("GET", theScript, true);
				xmlHttp.send(null);
			}
			if (tmp.indexOf("#") == 0) {
				document.location.href = tmp;
			}
		}

		function startAjax() {
			var xmlHttp;
			try {
				xmlHttp = new XMLHttpRequest();
			//	xmlHttp.overrideMimeType("text/xml");
			}
			catch (e) {
				try {
					xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch (e) {
					try {
						xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch (e) {
						alert("Your browser does not support AJAX.");
						return false;
					}
				}
			}
			return xmlHttp;
		}


		/* ----------------------------- SCRIPT SPECIFIC --------------------------- */

		// - TEST/SUBMIT SERVICE REQUEST

		function ServiceCheck() {
			if (CheckNull('frmService','fname','Please enter your First Name.')) {
				return false;
			}
			if (CheckNull('frmService','lname','Please enter your Last Name.')) {
				return false;
			}
			if (CheckNull('frmService','email','Please enter your Email Address.')) {
				return false;
			}
			if (CheckEmail('frmService','email','The email doesn\'t look valid.')) {
				return false;
			}
			if (CheckNull('frmService','phone','Please enter your Phone Number.')) {
				return false;
			}
			if (CheckNull('frmService','communityid','Please identify your Community.')) {
				return false;
			}
			if (CheckNull('frmService','request','Please tell us what we can do for you.')) {
				return false;
			}
			PostItem("../modules/moServiceWrite.php", "frmService", "serviceform");
		}


		// ------ TEST/SUBMIT TESTIMONAL

		function TestimonialCheck() {
			if (CheckNull('frmTestimonial','wholename','Please enter your Name(s).')) {
				return false;
			}
			if (CheckNull('frmTestimonial','email','Please enter your Email Address.')) {
				return false;
			}
			if (CheckEmail('frmTestimonial','email','The email doesn\'t look valid.')) {
				return false;
			}
			if (CheckNull('frmTestimonial','communityid','Please identify your Community.')) {
				return false;
			}
			PostItem("../modules/moTestimonialWrite.php", "frmTestimonial", "testimonialform");
		}

		// -------- TEST/SUBMIT FOLLOW-UP

		function DoFollowup() {
			if (CheckNull('frmFollow','msg','Please enter your Message.')) {
				return false;
			}
			PostItem("../modules/moFollowWrite.php", "frmFollow", "content");
			setTimeout("document.location.href='../front/'", 4000);
		}


		// -- TEST/SUBMIT REALTOR SIGNUP

		function RealtorCheck() {
			if (CheckNull('frmRealtor','fname','Please enter your First Name.')) {
				return false;
			}
			if (CheckNull('frmRealtor','lname','Please enter your Last Name.')) {
				return false;
			}
			if (CheckNull('frmRealtor','company','Please enter your Company\'s Name.')) {
				return false;
			}
			if (CheckNull('frmRealtor','email','Please enter your Email Address.')) {
				return false;
			}
			if (CheckEmail('frmRealtor','email','The email doesn\'t look valid.')) {
				return false;
			}
			if (CheckNull('frmRealtor','phone','Please enter your Phone Number.')) {
				return false;
			}
			PostItem("../modules/moRealtorWrite.php", "frmRealtor", "realtorform");
		}

		// - TEST/SUBMIT REALTOR CONTACT

		function RContactCheck() {
			if (CheckNull('frmRealtor','fname','Please enter your First Name.')) {
				return false;
			}
			if (CheckNull('frmRealtor','lname','Please enter your Last Name.')) {
				return false;
			}
			if (CheckNull('frmRealtor','company','Please enter your Company\'s Name.')) {
				return false;
			}
			if (CheckNull('frmRealtor','email','Please enter your Email Address.')) {
				return false;
			}
			if (CheckEmail('frmRealtor','email','The email doesn\'t look valid.')) {
				return false;
			}
			if (CheckNull('frmRealtor','phone','Please enter your Phone Number.')) {
				return false;
			}
			if (CheckNull('frmRealtor','comments','Please enter your Comments.')) {
				return false;
			}
			PostItem("../modules/moRContactWrite.php", "frmRealtor", "realtorform");
		}


		// ---- TEST/SUBMIT CONTACT FORM

		function ContactCheck() {
			if (CheckNull('frmContact','fname','Please enter your First Name.')) {
				return false;
			}
			if (CheckNull('frmContact','lname','Please enter your Last Name.')) {
				return false;
			}
			if (CheckNull('frmContact','email','Please enter your Email Address.')) {
				return false;
			}
			if (CheckEmail('frmContact','email','The email doesn\'t look valid.')) {
				return false;
			}
			if ((document.frmContact.useemail.checked == false) && (document.frmContact.usephone.checked == false)) {
				alert("Please tell us whether to contact you by phone, email, or both");
				return false;
			}
			if (document.frmContact.usephone.checked == true) {
				if (CheckNull('frmContact','phone','Please enter your Phone number if that\'s how you wish to be contacted.')) {
					return false;
				}
			}
			PostItem("../modules/moContactWrite.php", "frmContact", "contactform");
		}


		// ----- GET COMMUNITIES MAP KEY

		function CommList(tmp) {
			GetItem("../communities/cmList.php?ord=" + tmp + "&r=" + Math.random(), "list", "");
		}


		// ----- TEST/SUBMIT SEARCH FORM

		function CheckSearch() {

		}


		// ----------- POP-UP SLIDE SHOW

		function ShowPic(pic, picW, picH) {
			var maxW = document.frmHide.maxwidth.value;
			var maxH = document.frmHide.maxheight.value;
			maxW = (maxW - 0);
			maxH = (maxH - 0);
			var orient = "width";
			if (picH > picW) {
				orient = "height";
			}
			switch (orient) {
				case "width":
					if (picW > maxW) {
						picW = maxW;
					}
					var theDim = picW;
					break;
				case "height":
					if (picH > maxH) {
						picH = maxH;
					}
					var theDim = picH;
			}
			var theStuff = "<img src='" + pic + "' " + orient + "='" + theDim + "'>";
			SwapText("picbox", theStuff);
			var thisPic = Math.round(document.frmHide.thispic.value);
			var picCount = Math.round(document.frmHide.piccount.value);
			thisPic++;
			picCount++;
			var theStuff = "<span class='tableLink'>" + thisPic + " of " + picCount + "</span>";
			SwapText("nums", theStuff);
		}

		function ShowNext(tmp) {
			var thisPic = Math.round(document.frmHide.thispic.value);
			var picCount = Math.round(document.frmHide.piccount.value);
			var listString = document.frmHide.datastring.value;
			listArray = listString.split("|");
			if (tmp == "next") {
				var theNum = ((thisPic + 1) - 0);
			} else {
				var theNum = ((thisPic - 1) - 0);
			}
			if (theNum < 0) {
				theNum = picCount;
			}
			if (theNum > picCount) {
				theNum = 0;
			}
			document.frmHide.thispic.value = theNum;
			var picString = listArray[theNum];
			picArray = picString.split(",");
			ShowPic(picArray[0], picArray[1], picArray[2]);
		}


		// --------- MORTGAGE CALCULATOR

		function floor(number) {
			return Math.floor(number*Math.pow(10,2))/Math.pow(10,2);
		}

		function dosum() {
			var tester;
			var fldString = "YR,IR,LA,AT,AI";
			fldArray = fldString.split(",");
			for (i = 0; i < fldArray.length; i++) {
				tester = document.temps[fldArray[i]].value;
				tester = tester.replace(/ /g, "");
				if ((isNaN(tester)) || (tester == "")) {
					alert("All entries must be numeric values");
					document.temps[fldArray[i]].focus();
					return false;
				}
			}
			var mi = document.temps.IR.value / 1200;
			var base = 1;
			var mbase = 1 + mi;
			for (i=0; i<document.temps.YR.value * 12; i++) {
				base = base * mbase
			}
			document.temps.PI.value = floor(document.temps.LA.value * mi / ( 1 - (1/base)))
			document.temps.MT.value = floor(document.temps.AT.value / 12)
			document.temps.MI.value = floor(document.temps.AI.value / 12)
			var dasum = document.temps.LA.value * mi / ( 1 - (1/base)) + document.temps.AT.value / 12 + document.temps.AI.value / 12;
			document.temps.MP.value = floor(dasum);
		}

		// ------------------ GET IPX VID

		function GetVid(tmp) {
			GetItem("../plans/plVirtualHelper.php?vid=" + tmp, "vid", "");
		}

	-->
