	<!--

		/* --------------------------- 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 SwapStyles(where, what) {
			if (ns4) {
				document.layers[where].className=what;
			} else if (ie4) {
				document.all[where].className=what;
			} else if (ie5 || ns6) {
				document.getElementById(where).className=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 ClearThis(frm, fld) {
			document[frm][fld].value = "";
		}

		function GetMonths() {
			var moList = {
				"1" : "January",
				"2" : "February",
				"3" : "March",
				"4" : "April",
				"5" : "May",
				"6" : "June",
				"7" : "July",
				"8" : "August",
				"9" : "September",
				"10" : "October",
				"11" : "November",
				"12" : "December"
			}
			return moList;
		}

		function ClearIt(frm, tmp) {
			document[frm][tmp].value = "";
		}

		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 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 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;
			}
		}

		function CheckLink(dname,fname,item) {
			var linkUrl = document[dname][fname].value;
			linkUrl = linkUrl.toLowerCase();
			if ((linkUrl.indexOf("http://") !== 0) && (linkUrl.indexOf("https://") !== 0)) {
				alert("The " + item + " must begin with \"http://\" or \"https://\".");
				document[dname][fname].focus();
				return false;
			}
		}

		function NotHere() {
			alert("This item is coming soon. Check back often.  ");
		}

		function ShowTips(tmp) {
			showMenu(tmp);
		}

		function KillTips(tmp) {
			hideMenu(tmp);
		}

		function FixTable(cols, max) {
			var theFix = "";
			if (cols > 0) {
				while (cols < max) {
					theFix += "<td>&nbsp;</td>";
					cols++;
				}
				if (cols == max) {
					theFix += "</tr>";
				}
			}
			return theFix;
		}

		function CheckNumber(dname, fname) {
			var theNum = document[dname][fname].value;
			theNum = theNum.replace(/ /g, "");
			if ((theNum == "") || (theNum < 0) || (isNaN(theNum))) {
				document[dname][fname].value = "0";
			}
		}

		function FixField(dname, fname) {
			var theTitle = document[dname][fname].value;
			theTitle = theTitle.replace(/"/g, "'");
			document[dname][fname].value = theTitle;
		}

		/* ------------------------------- DEEP TISSUE ----------------------------- */

		function CheckForms(dname,fname) {
			var theStuff = document[dname][fname].value;
			theStuff = theStuff.toLowerCase();
			if ((theStuff.indexOf("<form") > -1) || (theStuff.indexOf("</form") > -1) || (theStuff.indexOf("<input") > -1) || (theStuff.indexOf("<textarea") > -1)) {
				alert("Form tags are not allowed.");
				document[dname][fname].focus();
				return true;
			}
			if ((theStuff.indexOf("<script") > -1) || (theStuff.indexOf("</script") > -1)) {
				alert("Script tags are not allowed.");
				document[dname][fname].focus();
				return true;
			}
			if ((theStuff.indexOf("<?") > -1) || (theStuff.indexOf("?>") > -1)) {
				alert("The item contains illegal characters.");
				document[dname][fname].focus();
				return true;
			}
		}

		function CheckTags(dname,fname) {
			var theStuff = document[dname][fname].value;
			if ((theStuff.indexOf("<") > -1) || (theStuff.indexOf(">") > -1)) {
				alert("Tags are not allowed.");
				document[dname][fname].focus();
				return true;
			}
		}

		function CheckCode(dname,fname) {
			var theStuff = document[dname][fname].value;
			theStuff = theStuff.toLowerCase();
			if ((theStuff.indexOf(".exe") > -1) || (theStuff.indexOf(".vbs") > -1) || (theStuff.indexOf(".scr") > -1)) {
				alert("This material appears to contain potentially \nmalicious elements, and cannot be applied.");
				return true;
			}
			if ((theStuff.indexOf("<?") > -1) || (theStuff.indexOf("?>") > -1)) {
				alert("The item contains illegal characters.");
				document[dname][fname].focus();
				return true;
			}
		}

		/* ------------------------------- RIGHT MOUSE ----------------------------- */

		function clickIE4() {
			if (event.button == 2) {
				alert(message);
				return false;
			}
		}

		function clickNS4(e) {
			if (document.layers || document.getElementById && !document.all) {
				if (e.which == 2 || e.which == 3) {
					alert(message);
					return false;
				}
			}
		}

		if (document.layers) {
			document.captureEvents(Event.MOUSEDOWN);
			document.onmousedown = clickNS4;
		} else if (document.all && !document.getElementById) {
			document.onmousedown=clickIE4;
		}

	//	document.oncontextmenu = new Function("return false");


		/* ------------------------------ 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;
		}


		/* ------------------------------- IMAGE SIZER ----------------------------- */

		function SizePic(pic, picW, picH, boxW, boxH) {
			if (picH > picW) {
				var ratio = (picW / picH);
				var ratioUp = (picH / picW);
				if (picH > boxH) {
					var showH = boxH;
				} else {
					var showH = picH;
				}
				showW = Math.round(showH * ratio);
				if (showW > boxW) {
					showW = boxW;
					showH = Math.round(showW * ratioUp);
	
				}
			} else {
				var ratio = (picH / picW);
				var ratioUp = (picW / picH);
				if (picW <= boxW) {
					var showW = picW;
					var showH = picH;
				} else {
					var showW = boxW;
					var showH = Math.round(showW * ratio);
				}
				if (showH > boxH) {
					showH = boxH;
					showW = Math.round(showH * ratioUp);
				}
			}
			return showW + "x" + showH;
		}


		/* -------------------------------- EDITOR TOY ----------------------------- */

		function GetSortForm(place, extraid) {
			var theScript = "../modules/moEditorSort.php?itemplace=" + place + "&extraid=" + extraid + "&r=" + Math.random();
			GetItem(theScript, "itemlist", "");
			SwapText("newform", "");
		}

		function GetNewForm(type, place, extraid) {
			if (type == 'image') {
				var theWhere = "../vasdf/admEditorPic.php?itemplace=" + place + "&extraid=" + extraid;
				document.location.href = theWhere;
			} else {
				var newText = "../modules/moEditorNewT.php";
				var newBullets = "../modules/moEditorNewB.php";
				switch (type) {
					case "text":
						theScript = newText;
						break;
					case "bullets":
						theScript = newBullets;
						break;
					default:
						alert("Error!");
						return false;
				}
				theScript += "?itemplace=" + place + "&extraid=" + extraid;
				GetItem(theScript, "newform", "");
				EditorRefresh(place, extraid);
			}
		}

		function GetEmbedForm(id, place, extraid) {
			var theWhere = "../vasdf/admEditorEmbed.php?itemplace=" + place + "&extraid=" + extraid + "&id=" + id + "&r=" + Math.random();
			document.location.href = theWhere;
		}

		function KillEmbed(id) {
			if (confirm("This is permanent and can\'t be reversed!")) {
				GetItem("../modules/moEditorKillEmbed.php?id=" + id + "&r=" + Math.random(), "item" + id, "");
			}
		}

		function EditorUpdate(id, typeid) {
			if (typeid == 0) {
				if (CheckNull('frmText','itemtext','Please enter the Item Text first.')) {
					return false;
				}
				if (CheckForms('frmText','itemtext')) {
				//	return false;
				}
				FixField('frmText','itemtitle');
				if (CheckForms('frmText','itemtitle')) {
				//	return false;
				}
				if (!document.frmText.nopic) {
					var theMax = (document.frmText.halfpage.value * 1);
					var picW = document.frmText.picwidth.value;
					var msg = "The image width must be a numeric value from 40 to " + document.frmText.halfpage.value;
					picW = picW.replace(/ /g, "");
					if (isNaN(picW)) {
						alert(msg);
						document.frmText.picwidth.focus();
						return false;
					}
					picW = (picW * 1);
					if ((picW < 40) || (picW > theMax)) {
						alert(msg);
						document.frmText.picwidth.focus();
						return false;
					}
				}
				var theScript = "../modules/moEditorWriteT.php";
			} else if (typeid == 3) {
				var theMax = (document.frmText.pagewidth.value * 1);
				var picW = document.frmText.picwidth.value;
				var msg = "The image width must be a numeric value from 40 to " + document.frmText.pagewidth.value;
				picW = picW.replace(/ /g, "");
				if (isNaN(picW)) {
					alert(msg);
					document.frmText.picwidth.focus();
					return false;
				}
				picW = (picW * 1);
				if ((picW < 40) || (picW > theMax)) {
					alert(msg);
					document.frmText.picwidth.focus();
					return false;
				}
				var theScript = "../modules/moEditorWriteT.php";
			} else if (typeid == 1) {
				var isOK = 0;
				var theField = "";
				var theLimit = document.frmText.bulletcount.value;
				for (i = 1; i < theLimit; i++) {
					theField = document.frmText["bullet" + i].value;
					theField = theField.replace(/ /g, "");
					if (theField !== "") {
						isOK = 1;
						FixField('frmText','bullet' + i);
						if (CheckForms('frmText','bullet' + i)) {
						//	return false;
						}
					}
				}
				if (isOK == 0) {
					alert("Please enter at least one bullet-point item.");
					document.frmText.bullet1.focus();
					return false;
				}
				FixField('frmText','itemtitle');
				if (CheckForms('frmText','itemtitle')) {
				//	return false;
				}
				var theScript = "../modules/moEditorWriteB.php";
			}
			PostItem(theScript, "frmText", "item" + id);
		}


		function CheckEditorT() {
			if (CheckNull('frmText','itemtext','Please enter the Item Text first.')) {
				return false;
			}
			if (CheckForms('frmText','itemtext')) {
			//	return false;
			}
			FixField('frmText','itemtitle');
			if (CheckForms('frmText','itemtitle')) {
			//	return false;
			}
			var thePlace = document.frmText.itemplace.value;
			var theExtra = document.frmText.extraid.value;
			var theList = "../modules/moEditorList.php?itemplace=" + thePlace + "&extraid=" + theExtra;
			PostItem("../modules/moEditorWriteT.php", "frmText", "trashcan");
			SwapText("newform", "");
			hideMenu("newform");
			SwapText("itemlist", "");
			GetItem(theList, "itemlist", "");
			GetItem(theList, "itemlist", "");
		}

		function CheckEditorB() {
			var bulletMax = 9;
			var isOK = 0;
			var theField = "";
			for (i = 1; i < bulletMax; i++) {
				theField = document.frmText["bullet" + i].value;
				theField = theField.replace(/ /g, "");
				if (theField !== "") {
					isOK = 1;
					FixField('frmText','bullet' + i);
				}
				if (CheckForms('frmText','bullet' + i)) {
				//	return false;
				}
			}
			if (isOK == 0) {
				alert("Please enter at least one bullet-point item.");
				document.frmText.bullet1.focus();
				return false;
			}
			FixField('frmText','itemtitle');
			var thePlace = document.frmText.itemplace.value;
			var theExtra = document.frmText.extraid.value;
			var theList = "../modules/moEditorList.php?itemplace=" + thePlace + "&extraid=" + theExtra;
			PostItem("../modules/moEditorWriteB.php", "frmText", "trashcan");
			SwapText("newform", "");
			hideMenu("newform");
			SwapText("itemlist", "");
			GetItem(theList, "itemlist", "");
			GetItem(theList, "itemlist", "");
		}

		function EditorRefresh(itemplace, extraid) {
			var theList = "../modules/moEditorList.php?itemplace=" + itemplace + "&extraid=" + extraid;
			GetItem(theList, "itemlist", "");
			SwapText("newform", "");
		}

		function EditorDelete(tmp) {
			if (confirm("This will permanently remove the item!")) {
				GetItem("../modules/moEditorDelete.php?id=" + tmp, "trashcan", "");
				SwapText("item" + tmp, "");
				hideMenu("item" + tmp);
			}
		}

		function EditorDoSort() {
			var numString = document.frmSort.numstring.value;
			var theNum = "";
			if (numString.indexOf(",") > 0) {
				numArray = numString.split(",");
				for (i = 0; i < numArray.length; i++) {
					theNum = document.frmSort["sort" + numArray[i]].value;
					theNum = theNum.replace(/ /g, "");
					if ((isNaN(theNum)) || (theNum == "") || (theNum < 0) || (theNum.indexOf(".") > -1)) {
						document.frmSort["sort" + numArray[i]].value = "0";
					}
				}
			} else {
				theNum = document.frmSort["sort" + numString].value;
				theNum = theNum.replace(/ /g, "");
				if ((isNaN(theNum)) || (theNum == "") || (theNum < 0) || (theNum.indexOf(".") > -1)) {
					document.frmSort["sort" + numString].value = "0";
				}
			}
			var thePlace = document.frmSort.itemplace.value;
			var theExtra = document.frmSort.extraid.value;
			var theList = "../modules/moEditorList.php?itemplace=" + thePlace + "&extraid=" + theExtra;
			PostItem("../modules/moEditorSortWrite.php", "frmSort", "trashcan");
			SwapText("itemlist", "");
			GetItem(theList, "itemlist", "");
			GetItem(theList, "itemlist", "");
		}

		function EditorGetForm(tmp) {
			GetItem("../modules/moEditorItemForm.php?id=" + tmp + "&r=" + Math.random(), "item" + tmp, "");
		}


		/* ------------------------------- LINK MAKER ------------------------------ */

		function MakeLink(frm, fld, div) {
			var theURL = document.frmLink.linkurl.value;
			var theTest = theURL.replace(/ /g, "");
			if (theTest == "") {
				alert("Please enter the Link URL first.");
				document.frmLink.linkurl.focus();
				return false;
			}
			theTest = theTest.toLowerCase();
			if ((theTest.indexOf("http://") < 0) && (theTest.indexOf("https://") < 0)) {
				alert("The Link URL must begin with \"http://\" or \"https://\"");
				document.frmLink.linkurl.focus();
				return false;
			}
			var theTarget = document.frmLink.linkwindow.value;
			var theWhole = document[frm][fld].value;
			var theHighlight;
			var theNew;
			if (theHighlight = GetHighlight(frm, fld)) {
				if ((fld == "itemtext") && (theHighlight == document[frm][fld].value)) {
					alert("You either failed to highlight any text, or you highlighted the entire field.");
					return false;
				}
				theURL = theURL.replace(/http:\/\/www.customandsimple.com\//g, "../");
				var theLink = "<a href='" + theURL + "'" + theTarget + ">" + theHighlight + "</a>";
				var theCode = "theWhole.replace(/" + theHighlight + "/,\"" + theLink + "\");";
				var theNew = eval(theCode);
				document[frm][fld].value = theNew;
				KillLinkBox(div);
			}
		}

		function GetHighlight(frm, fld) {
			var theH = "";
			if(document.selection && document.selection.createRange().text != "") {
				theH = document.selection.createRange().text;
			} else {
				var startPos = document[frm][fld].selectionStart;
				var endPos = document[frm][fld].selectionEnd;
				theH = document[frm][fld].value.substring(startPos, endPos);
			}
			if (theH == "") {
				alert("Please highlight some text first.");
				return false;
			} else {
				return theH;
			}
		}

		function GetLinkBox(frm, fld, div) {
			var theText = document[frm][fld].value;
			theText = theText.replace(/ /g, "");
			if (theText == "") {
				alert("You have no text yet to transform into a link.");
				document[frm][fld].focus();
				return false;
			}
			GetItem("../modules/moEditorLink.php?frm=" + frm + "&fld=" + fld + "&div=" + div + "&r=" + Math.random(), div, "");
			showMenu(div);
		}

		function KillLinkBox(div) {
			SwapText(div, "");
			hideMenu(div);
		}



		/* ------------------------------- GALLERY TOY ----------------------------- */

		function GalleryStart() {
			SwapText("gallerythumbs", "");
			SwapText("gallerycontent", "");
			var theForm = document.frmTitles.id.value;
			theArray = theForm.split("-");
			var theID = theArray[0];
			var theType = theArray[1];
			if (theID > 0) {
				switch (theType) {
					case "0":
						GetItem("../modules/moGalleryFirstPic.php?id=" + theID + "&r=" + Math.random(), "gallerycontent", "");
						GetItem("../modules/moGalleryThumbs.php?id=" + theID + "&r=" + Math.random(), "gallerythumbs", "");
						break;
					case "1":
						GetItem("../modules/moGalleryVids.php?id=" + theID + "&r=" + Math.random(), "gallerycontent", "");
				}
			}
		}

		function GalleryGetPic(pic, picW, picH, boxW, boxH) {
			var picW = (picW - 0);
			var picH = (picH - 0);
			var boxW = (boxW - 0);
			var boxH = (boxH - 0);
			var showW = 0;
			var showH = 0;
			if (picH > picW) {
				var ratio = (picW / picH);
				var ratioUp = (picH / picW);
				if (picH > boxH) {
					showH = boxH;
				} else {
					showH = picH;
				}
				showW = Math.round(showH * ratio);
				if (showW > boxW) {
					showW = boxW;
					showH = Math.round(showW * ratioUp);
				}
			} else {
				var ratio = (picH / picW);
				var ratioUp = (picW / picH);
				if (picW <= boxW) {
					showW = picW;
					showH = picH;
				} else {
					showW = boxW;
					showH = Math.round(showW * ratio);
				}
				if (showH > boxH) {
					showH = boxH;
					showW = Math.round(showH * ratioUp);
				}
			}
			var capW = showW;

			var theStuff = "<table width=\"" + showW + "\" cellpadding=\"0\" cellspacing=\"0\" style=\"position: relative; top: +2px; left: +2px\"><tr><td>";
			theStuff += "<img src=\"../uploads/" + pic + "\" width=\"" + showW + "\" height=\"" + showH + "\" class=\"picBorder\" ";
			theStuff += "onClick=\"DoBox('../uploads/" + pic + "', '" + picW + "', '" + picH + "', '30', '30');\" style=\" cursor: pointer\">";
			theStuff += "</td></tr></table>";

			theStuff += "<table width=\"" + showW + "\" cellpadding=\"0\" cellspacing=\"0\" style=\"position: relative; top: +2px; left: +2px\"><tr><td><div id=\"caption\"></div></td></tr></table><br>";

			SwapText("gallerycontent", theStuff);
			GetItem("../modules/moGalleryCaption.php?pic=" + pic + "&r=" + Math.random(), "caption", "");

		}


		/* ------------------------------- MAILING LIST ---------------------------- */

		function GetSubscribeForm() {
			GetItem("../modules/moSubscribeForm.php?r=" + Math.random(), "content", "");
		}

		function Subscribe() {
			if (CheckNull('frmList','fname','Please enter your First Name.')) {
				return false;
			}
			if (CheckNull('frmList','lname','Please enter your Last Name.')) {
				return false;
			}
			if (CheckNull('frmList','email','Please enter your Email first.')) {
				return false;
			}
			if (CheckEmail('frmList','email','That Email address doesn\'t look valid.')) {
				return false;
			}
			PostItem("../modules/moSubscribe.php", "frmList", "content");
			setTimeout("GetSubscribeForm()", 6000);
		}

		function MailerTest() {
			if (CheckNull('frmMail','mailsubject','Please enter the message\'s Subject.')) {
				return false;
			}
			if (CheckNull('frmMail','mailmessage','Please enter your Message first.')) {
				return false;
			}
			PostItem("../modules/moMailerTest.php", "frmMail", "testIn");
			showMenu("testIn");
			setTimeout("hideMenu('testIn')", 4000);
			document.frmMail.tested.value = "1";
		}

		function MailerSend() {
			if (document.frmMail.tested.value == "0") {
				alert("You must test this email prior to sending it.");
				return false;
			}
			if (CheckNull('frmMail','mailsubject','Please enter the message\'s Subject.')) {
				return false;
			}
			if (CheckNull('frmMail','mailmessage','Please enter your Message first.')) {
				return false;
			}
		}

		function DoOptout() {
			PostItem("../modules/moSubscribeOut.php", "frmOut", "optout");
			ClearOptout();
			alert("You\'ve been removed from the mailing list.");
		}

		function ClearOptout() {
			SwapText("optout", "");
			hideMenu("optout");
		}


		/* ------------------------------ CONTACT FORMS ---------------------------- */

		function GetContact() {
			GetItem("../modules/moContactForm.php?r=" + Math.random(), "content", "");
		}

		function WriteContact() {
			if (CheckNull('frmContact','gname','Please enter your Name.')) {
				return false;
			}
			var phone = document.frmContact.phone.value;
			var email = document.frmContact.email.value;
			phone = phone.replace(/ /g, "");
			email = email.replace(/ /g, "");
			if ((phone == "") && (email == "")) {
				alert("Please provide either a Phone or an Email address so we can contact you.");
				document.frmContact.email.focus();
				return false;
			}
			if (email !== "") {
				if (CheckEmail('frmContact','email','That Email address doesn\'t look valid.')) {
					return false;
				}
			}
			if (CheckNull('frmContact','msg','Please enter your Message.')) {
				return false;
			}
			PostItem("../modules/moContactWrite.php", "frmContact", "content");
			setTimeout("GetContact()", 6000);
		}

		function GetMessage(tmp) {
			var theWhere = "msg" + tmp;
			GetItem("../modules/moContactView.php?id=" + tmp + "&r=" + Math.random(), theWhere, "");
		}

		function KillMessage(tmp) {
			var theWhere = "msg" + tmp;
			SwapText(theWhere, "");
			hideMenu(theWhere);
		}

		function GetMessage2(tmp) {
			var theWhere = "msg" + tmp;
			GetItem("../modules/moConversionView.php?id=" + tmp + "&r=" + Math.random(), theWhere, "");
		}

		/* ----------------------------  NAVIGATION ADMIN -------------------------- */

		function GetCategNav() {
			GetItem("../modules/moNavNav.php?r=" + Math.random(), "categnav", "");
		}

		function GetCategViewer(tmp) {
			GetItem("../modules/moNavViewer.php?id=" + tmp + "&r=" + Math.random(), "categbox", "");
		}

		function GetCategNew() {
			GetItem("../modules/moNavNew.php?r=" + Math.random(), "categbox", "");
		}

		function WriteNewCateg() {
			if (CheckNull('frmCateg','cat1name','Enter the Nav Label first.')) {
				return false;
			}
			if (CheckNull('frmCateg','cat1title','Enter the Page Title first.')) {
				return false;
			}
			PostItem("../modules/moNavNav.php", "frmCateg", "categnav");
			var theStuff = "<span class=\"pageCopy\">The new page has been added.</span>";
			SwapText("categbox", theStuff);
		}

		function CancelNewCateg1() {
			var theStuff = "<span class=\"pageCopy\">Use the controls at right to manage your site architecture.</span>";
			SwapText("categbox", theStuff);
		}

		function GetCategEditor(type, id, sid) {
			var inDiv = "in" + type + "-" + sid;
			var outDiv = "out" + type + "-" + sid;
			GetItem("../modules/moNavEditor.php?type=" + type + "&id=" + id + "&sid=" + sid + "&r=" + Math.random(), inDiv, "");
			showMenu(outDiv);
		}

		function GetSubcatForm(type, id, parentid) {
			var inDiv = "insub" + type + "-" + parentid;
			var outDiv = "outsub" + type + "-" + parentid;
			GetItem("../modules/moNavSubcat.php?type=" + type + "&id=" + id + "&pid=" + parentid + "&r=" + Math.random(), inDiv, "");
			showMenu(outDiv);
		}

		function SaveCateg(type) {
			var theField = "cat" + type + "name";
			var theField2 = "cat" + type + "title";
			if (CheckNull('frmCateg',theField,'Please enter the Nav Label.')) {
				return false;
			}
			if (CheckNull('frmCateg',theField2,'Please enter the Page Title.')) {
				return false;
			}
			if (!Math.round(document.frmCateg.sortno.value)) {
				document.frmCateg.sortno.value = "0";
			} else {
				document.frmCateg.sortno.value = Math.round(document.frmCateg.sortno.value);
			}
			PostItem("../modules/moNavViewer.php", "frmCateg", "categbox");
		}

		function CancelSub(type, parentid) {
			var inDiv = "insub" + type + "-" + parentid;
			var outDiv = "outsub" + type + "-" + parentid;
			SwapText(inDiv, "");
			hideMenu(inDiv);
			hideMenu(outDiv);
		}

		function WriteNewSub(type) {
			var theField = "cat" + type + "name";
			var theField2 = "cat" + type + "title";
			if (CheckNull('frmCateg',theField,'Please enter the Nav Label.')) {
				return false;
			}
			if (CheckNull('frmCateg',theField2,'Please enter the Nav Title.')) {
				return false;
			}
			if (!Math.round(document.frmCateg.sortno.value)) {
				document.frmCateg.sortno.value = "0";
			} else {
				document.frmCateg.sortno.value = Math.round(document.frmCateg.sortno.value);
			}
			PostItem("../modules/moNavViewer.php", "frmCateg", "categbox");
		}

		function CancelSave(type, id) {
			var inDiv = "in" + type + "-" + id;
			var outDiv = "out" + type + "-" + id;
			SwapText(inDiv, "");
			hideMenu(inDiv);
			hideMenu(outDiv);
		}


		function CategsDone() {
			document.location.href="../vasdf/admMenu.php";
		}

		/* -------------------------------- UBER ADMIN ----------------------------- */

		function GetForm(script, id) {
			var theWhere = "../modules/moCSS" + script + ".php?id=" + id + "&r=" + Math.random();
			GetItem(theWhere, "designbox", "");
		}

		function WriteForm(which, form) {
			var theWhere = "../modules/moCSS" + which + ".php";
			var theWhat = form;
			PostItem(theWhere, theWhat, "designbox");
		}

		function GetMiscellaneous(id) {
			GetItem("../modules/moConfigMisc.php?id=" + id + "&r=" + Math.random(), "designbox", "");
		}

		function WriteMiscellaneous() {
			PostItem("../modules/moConfigMisc.php", "frmMisc", "designbox");
		}


		function GetFeatures(id) {
			GetItem("../modules/moConfigFeatures.php?id=" + id + "&r=" + Math.random(), "designbox", "");
		}

		function WriteFeatures() {
			PostItem("../modules/moConfigWriteFeatures.php", "frmFeatures", "designbox");
		}

		function PWFind(id) {
			GetItem("../modules/moConfigPW.php?id=" + id + "&r=" + Math.random(), "pw" + id, "");
		}

		function AgyPWFind(id) {
			GetItem("../modules/moConfigAgyPW.php?id=" + id + "&r=" + Math.random(), "pw" + id, "");
		}

		function StorePWFind(id) {
			GetItem("../modules/moConfigStorePW.php?id=" + id + "&r=" + Math.random(), "pw" + id, "");
		}

		function PWKill(id) {
			SwapText("pw" + id, "");
			hideMenu("pw" + id);
		}

		function CCForm(type, id) {
			GetItem("../modules/moConfigCC.php?type=" + type + "&id=" + id + "&r=" + Math.random(), "pw" + id, "");
		}

		function CCWrite(id) {
			if (CheckNull('frmCC','ccnum','Please enter the Credit Card Number.')) {
				return false;
			}
			if (document.frmCC.ccmonth.value == "0") {
				alert("Please select the card's Expiration Month.");
				return false;
			}
			if (document.frmCC.ccyear.value == "0") {
				alert("Please select the card's Expiration Year.");
				return false;
			}
			PostItem("../modules/moConfigCC.php", "frmCC", "pw" + id, "");
			PWKill(id);
		}

		function CSRForm(type, id) {
			GetItem("../modules/moConfigCSR.php?type=" + type + "&id=" + id + "&r=" + Math.random(), "pw" + id, "");
		}

		function CSRChange(type, id) {
			GetItem("../modules/moConfigCSR2.php?type=" + type + "&id=" + id + "&r=" + Math.random(), "pw" + id, "");
		}

		function CSRWriteChange(type, id) {
			if (CheckNull('frmCSR','repid','Please select the CSR.')) {
				return false;
			}
			PostItem("../modules/moConfigCSR.php", "frmCSR", "pw" + id, "");
			PWKill(id);
			var theStuff = "<span class=\"pageCopy\">&nbsp;<a href=\"#3\" onClick=\"CSRChange('" + type + "', '" + id + "');\" onMouseOver=\"status=''; return true;\"><font color=\"#883300\">Change CSR</font></a></span>";
			SwapText("csr" + id, theStuff);
		}

		function CSRWrite(id) {
			if (CheckNull('frmCSR','repid','Please select the CSR.')) {
				return false;
			}
			if (confirm("\n\nThis will create a commission transaction record in \naddition to associating the CSR with the client.\n\n")) {
				PostItem("../modules/moConfigCSR.php", "frmCSR", "pw" + id, "");
				PWKill(id);
				var theStuff = "<span class=\"pageCopy\">&nbsp;<a href=\"#3\" onClick=\"CSRChange('site', '" + id + "');\" onMouseOver=\"status=''; return true;\"><font color=\"#883300\">Change CSR</font></a></span>";
				SwapText("csr" + id, theStuff);
			}
		}

		function GetInfo(type, id) {
			GetItem("../modules/moConfigInfo.php?type=" + type + "&id=" + id + "&r=" + Math.random(), "pw" + id, "");
		}

		function GetPrefInfo(type, id) {
			if (type == 1) {
				var theWhere = "cin-";
			} else {
				var theWhere = "sin-";
			}
			GetItem("../modules/moConfigPrefInfo.php?type=" + type + "&id=" + id + "&r=" + Math.random(), theWhere + id, "");
		}

		function KillPref(type, id) {
			if (type == 1) {
				var theWhere = "cin-";
			} else {
				var theWhere = "sin-";
			}
			SwapText(theWhere + id, "");
			hideMenu(theWhere + id);
		}

		function GetConcepts(type, id) {
			if (type == 1) {
				var theWhere = "cin-";
			} else {
				var theWhere = "sin-";
			}
			GetItem("../modules/moConfigConcepts.php?type=" + type + "&id=" + id + "&r=" + Math.random(), theWhere + id, "");
		}

		function PWSend(type, id) {
			if (confirm("This will send the login information to the email shown.")) {
				GetItem("../modules/moConfigPWSend.php?type=" + type + "&id=" + id + "&r=" + Math.random(), "pw" + id, "");
			}
		}

		function ShowroomSend(type, id) {
			if (confirm("This will send the Design Showroom to the client.")) {
				GetItem("../modules/moShowroomSend.php?type=" + type + "&id=" + id + "&r=" + Math.random(), "showroom-" + id, "");
			}
		}

		function PreferencerNav(id) {
			GetItem("../modules/moPreferencerNav.php?id=" + id + "&r=" + Math.random(), "preferencernav", "");
		}

		function PreferencerSend(type, id) {
			if (confirm("This will send the Design Preferencer to the client.")) {
				GetItem("../modules/moPreferencerSend.php?type=" + type + "&id=" + id + "&r=" + Math.random(), "design-" + id, "");
			}
		}

		function GetPNote(id) {
			GetItem("../modules/moPreferencerNote.php?id=" + id + "&r=" + Math.random(), "additional", "");
		}

		function WritePNote() {
			PostItem("../modules/moPreferencerNote.php", "frmNote", "additional");
		}

		/* ------------------------------ CALENDAR STUFF --------------------------- */

		function GetCalendar(mo, yr) {
			var theTable = "gnCalendar";
			var theCell = document.frmHide.cellwide.value;
			GetItem("../modules/moCalendar.php?mo=" + mo + "&yr=" + yr + "&table=" + theTable + "&cell=" + theCell + "&r=" + Math.random(), "calendarbox", "");
		}

		function GetCalendarItem(tmp) {
			GetItem("../modules/moCalendarItem.php?id=" + tmp + "&r=" + Math.random(), "inner" + tmp, "");
			showMenu("outer" + tmp);
			showMenu("inner" + tmp);
		}

		function KillCalendarItem(tmp) {
			SwapText("inner" + tmp, "");
			hideMenu("outer" + tmp);
			hideMenu("inner" + tmp);
		}

		function CalendarForm() {
			var id = document.frmEvent.id.value;
			var typeid = document.frmEvent.typeid.value;
			GetItem("../modules/moCalendarForm.php?id=" + id + "&typeid=" + typeid + "&r=" + Math.random(), "calform", "");
		}


		/* ------------------------------- SOUND STUFF ----------------------------- */

		function StartIt(id, track) {
			var theStuff = "<embed src=\"../uploads/" + track + "\" autostart=true loop=false volume=200 hidden=true><noembed><bgsound src=\"../uploads/" + track + "\"></noembed>";
			SwapText("sound", theStuff);
			FixBars();
			SwapStyles("status-" + id, "soundOn");
		}

		function StopIt() {
			SwapText("sound", "");
			FixBars();
		}

		function FixBars() {
			var numString = document.frmHide.numstring.value;
			if (numString.indexOf(",") > -1) {
				numArray = numString.split(",");
				for (i = 0; i < numArray.length; i++) {
					SwapStyles("status-" + numArray[i], "soundOff");
				}
			} else {
				SwapStyles("status-" + numString, "soundOff");
			}
		}


		/* ------------------------------ LANDING PAGES ---------------------------- */

		function GetAlias(where, id) {
			switch (where) {
				case "aliastop":
					var theScript = "Header";
					break;
				case "aliasleft":
					var theScript = "Vid";
					break;
				case "aliasright":
					var theScript = "Action";
			}
			GetItem("../modules/moAlias" + theScript + ".php?id=" + id + "&r=" + Math.random(), where, "");
		}

		function WriteAlias(where, id) {
			switch (where) {
				case "aliastop":
					var theFields = "title,subtitle";
					var theScript = "Header";
					break;
				case "aliasleft":
					var theFields = "vidtitle,vidcode,vidbutton";
					var theScript = "Vid";
					break;
				case "aliasright":
					var theFields = "copytitle,pagecopy,copybutton,disclaimer";
					var theScript = "Action";
			}
			fieldArray = theFields.split(",");
			for (i = 0; i < fieldArray.length; i++) {
				if (CheckNull('frmAlias', fieldArray[i], 'All fields must be completed.')) {
					return false;
				}
			}
			PostItem("../modules/moAlias" + theScript + ".php", "frmAlias", where);
		}

		function GetBottom(id, itemid) {
			GetItem("../modules/moAliasBottom.php?id=" + id + "&itemid=" + itemid + "&r=" + Math.random(), "aliasbottom", "");
		}

		function WriteBottom() {
			var theFields = "sortno,title,note";
			fieldArray = theFields.split(",");
			for (i = 0; i < fieldArray.length; i++) {
				if (CheckNull('frmAlias', fieldArray[i], 'All fields except \"Link Text\" must be completed.')) {
					return false;
				}
			}
			var sortNo = document.frmAlias.sortno.value;
			sortNo = sortNo.replace(/ /g, "");
			if ((isNaN(sortNo)) || (sortNo.indexOf(".") > -1) || (sortNo < 0)) {
				document.frmAlias.sortno.value = "0";
			}
			PostItem("../modules/moAliasBottom.php", "frmAlias", "aliasbottom");
		}

		function KillBottom(id, itemid) {
			if (confirm("This is permanent!")) {
				GetItem("../modules/moAliasBottom.php?func=kill&id=" + id + "&itemid=" + itemid + "&r=" + Math.random(), "aliasbottom", "");
			}
		}

		function GetAllItems(id) {
			GetItem("../modules/moAliasBottomAll.php?id=" + id + "&r=" + Math.random(), "aliasbottom", "");

		}

		/* ----------------------------- BUSINESS SEARCH --------------------------- */

		function FixSub() {
			var typeID = document.frmBusiness.typeid.value;
			if (typeID > 0) {
				GetItem("../modules/moBusinessSubs.php?typeid=" + typeID + "&r=" + Math.random(), "cat2box", "");
			}
		}

		function GetFullListing(id, src) {
			GetItem("../modules/moBusinessFull.php?src=" + src + "&id=" + id + "&r=" + Math.random(), "listing-" + id, "");
		}

		function GetLinkListing(id, src) {
			GetItem("../modules/moBusinessLink.php?id=" + id + "&src=" + src + "&r=" + Math.random(), "listing-" + id, "");
		}


		/* --------------------------- FRONT AD SLIDE SHOW ------------------------- */

		function GetAdPic(id) {
			var pic = "../uploads/" + document.frmData["picfile-" + id].value;
			var picW = document.frmData["w-" + id].value;
			var picH = document.frmData["h-" + id].value;
			var boxW = 598;
			var boxH = 348;
			var newSize = SizePic(pic, picW, picH, boxW, boxH);
			sizeArray = newSize.split("x");
			var showW = sizeArray[0];
			var showH = sizeArray[1];
			var jump = document.frmData["jump-" + id].value;
			if (jump == "1") {
				var theStuff = "<img src=\"" + pic + "\" onClick=\"window.open('../content/cnRedirect.php?id=" + id + "')\"; width=\"" + showW + "\" height=\"" + showH + "\" style=\"cursor: pointer\">";
			} else {
				var theStuff = "<img src=\"" + pic + "\" onClick=\"document.location.href='../content/cnRedirect.php?id=" + id + "';\" width=\"" + showW + "\" height=\"" + showH + "\" style=\"cursor: pointer\">";
			}
			SwapText("adPic", theStuff);
			var theTitle = document.frmData["title-" + id].value;
			theTitle = theTitle.replace(/ 0/g, " \"");
			theTitle = theTitle.replace(/0 /g, "\" ");
			theStuff = theTitle + "&nbsp;&nbsp;&bull;&nbsp;&nbsp;" + "Click Image for More Information";
			SwapText("adNote", theStuff);
		}

		function GetAdThumbs(id) {
			var cols = 0;
			var theTitle = "";
			var theBlurb = "";
			var theTest = "";
			var color = document.frmData.color.value;
			var theStuff = "<table cellpadding=\"0\" cellspacing=\"0\">";
			var dataString = document.frmData.datastring.value;
			if (dataString.indexOf(",") > -1) {
				picArray = dataString.split(",");
				for (i = 0; i < picArray.length; i++) {
					cols++;
					if (cols == 1) {
						theStuff += "<tr>";
					}
					if (picArray[i] == id) {
						theStuff += "<td id=\"tab" + picArray[i] + "\" class=\"tabOn\">";
					} else {
						theStuff += "<td id=\"tab" + picArray[i] + "\" class=\"tabOff\" onClick=\"GetAdBoth('" + picArray[i] + "');\" onMouseOver=\"SwapStyles('tab" + picArray[i] + "','tabOver');\" onMouseOut=\"SwapStyles('tab" + picArray[i] + "','tabOff');\">";
					}
					theStuff += "<hr width=\"100%\" color=\"" + color + "\" size=\"1\">";
					theTitle = document.frmData["title-" + picArray[i]].value;
					theTitle = theTitle.replace(/ 0/g, " \"");
					theTitle = theTitle.replace(/0 /g, "\" ");
					theStuff += "<span class=\"editorTitle\">" + theTitle + "</span>";
					theStuff += "<hr width=\"100%\" color=\"" + color + "\" size=\"1\">";
					theBlurb = document.frmData["blurb-" + picArray[i]].value;
					theTest = theBlurb.replace(/ /g, "");
					if (theTest !== "") {
						theBlurb = theBlurb.replace(/ 0/g, " \"");
						theBlurb = theBlurb.replace(/0 /g, "\" ");
						theStuff += "<!br><span class=\"pageCopy\">" + theBlurb + "</span>";
					}
					theStuff += "</td>";
					if (cols == 3) {
						theStuff += "</tr>";
						cols = 0;
					}
				}
			} else {
				theStuff += "<td id=\"tab" + picArray[i] + "\" class=\"tabOn\">";
				theTitle = document.frmData["title-" + id].value;
				theTitle = theTitle.replace(/ 0/g, " \"");
				theTitle = theTitle.replace(/0 /g, "\" ");
				theStuff += "<span class=\"editorTitle\">" + theTitle + "</span>";
				theBlurb = document.frmData["blurb-" + id].value;
				theTest = theBlurb.replace(/ /g, "");
				if (theTest !== "") {
					theBlurb = theBlurb.replace(/ 0/g, " \"");
					theBlurb = theBlurb.replace(/0 /g, "\" ");
					theStuff += "<br><span class=\"pageCopy\">" + theBlurb + "</span>";
				}
				theStuff += "</td>";
				cols = 1;
			}
			theStuff += FixTable(cols, 3);
			theStuff += "</table>";
			SwapText("adThumbs", theStuff);
		}

		function GetAdBoth(id) {
			GetAdPic(id);
			GetAdThumbs(id);
		}


		/* -------------------------------- ARB STUFF ------------------------------ */

		function ARBStart(ttype, id) {
			switch (ttype) {
				case "site":
					var ltr = "c";
					break;
				case "proxy":
					var ltr = "c";
					break;
				case "store":
					var ltr = "s";
					break;
				case "agency":
					var ltr = "a";
					break;
			}
			var theWhere = "cmd-" + ltr + "-" + id;
			GetItem("../modules/moARBCreate.php?ttype=" + ttype + "&id=" + id + "&r=" + Math.random(), theWhere, "");
		}

		function ARBCancel(ttype, id) {
			if (confirm("This is final and can\'t be reversed!")) {
				switch (ttype) {
					case "site":
						var ltr = "c";
						break;
					case "proxy":
						var ltr = "c";
						break;
					case "store":
						var ltr = "s";
						break;
					case "agency":
						var ltr = "a";
						break;
				}
				var theWhere = "cmd-" + ltr + "-" + id;
				GetItem("../modules/moARBCancel.php?ttype=" + ttype + "&id=" + id + "&r=" + Math.random(), theWhere, "");
			}
		}

		/* ------------------------------- FOOD MENUS ------------------------------ */

		function GetMenu() {
			var theNum = document.frmMenu.id.value;
			var theName = document.frmData["title" + theNum].value;
			var theStuff = "<span class=\"pageTitle\">" + theName + "</span>";
			SwapText("theTitle", theStuff);
			GetItem("../modules/moMenu.php?id=" + theNum + "&r=" + Math.random(), "content", "");
		}


		/* ---------------------------------- SMS ---------------------------------- */

		function GetSMSSignup(func) {
			GetItem("../modules/moSMS.php?func=" + func + "&r=" + Math.random(), "content", "");
		}

		function WriteSMS() {
			var area = document.frmSMS.area.value;
			var prefix = document.frmSMS.prefix.value;
			var number = document.frmSMS.number.value;
			var phone = area + prefix + number;
			phone = phone.replace(/ /g, "");
			if ((phone.length !== 10) || (isNaN(phone))) {
				alert("Please enter your phone as a 10-digit number.");
				return false;
			}
			document.frmSMS.phone.value = phone;
			if (document.frmSMS.func.value == "add") {
				if (CheckNull('frmSMS','provider','Please select your cell phone carrier.')) {
					return false;
				}
				if (CheckNull('frmSMS','logpw','Please create a password.')) {
					return false;
				}
			} else if (document.frmSMS.func.value == "remove") {
				if (CheckNull('frmSMS','logpw','Please enter your password.')) {
					return false;
				}
			}
			PostItem("../modules/moSMS.php", "frmSMS", "content");
			var theNext = "GetSMSSignup('add')";
			setTimeout(theNext, 6000);
		}

		function SMSJump(where) {
			if (where == "prefix") {
				var theStuff = document.frmSMS.area.value;
			} else {
				var theStuff = document.frmSMS.prefix.value;
			}
			theStuff = theStuff.replace(/ /g, "");
			if (theStuff.length == 3) {
				document.frmSMS[where].focus();
			}
		}

		function CountBox() {
			var theText = document.frmSMS.message.value;
			var theStuff = "<span class=\"formBox\">" + theText.length + "</span>";
			SwapText("statusbar", theStuff);
		}

		/* ----------------------------- SCRIPT SPECIFIC --------------------------- */

		function DoLog(va, vb) {
			var theStuff = document.frmHide.lc.value + va + document.frmHide.rc.value;
			document.frmHide.remote.value = theStuff;
			document.frmHide.tempid.value = vb;
			document.frmHide.submit();
		}

		function DoAnswer(id) {
			GetItem("../modules/moFAQ.php?id=" + id + "&r=" + Math.random(), "a" + id, "");
		}

		function KillAnswer(id) {
			SwapText("a" + id, "");
		}

		function ShowLinks() {
			showMenu("links");
		}

		function KillLinks() {
			hideMenu("links");
		}

		function GetNews(type) {
			if (type == "0") {
				GetItem("../modules/moEvents.php?r=" + Math.random(), "content", "");
			} else {
				GetItem("../modules/moEventsR.php?r=" + Math.random(), "content", "");
			}
		}

		function DoBar() {
			var theStuff = "<img src=\"../graphics/bert.gif\">";
			SwapText("statusbar", theStuff);
		}


	-->

