	<!--

		/* --------------------------- 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 GetValue(where) {
			if (ns4) {
				var what = document.layers[where].value;
			} else if (ie4) {
				var what = document.all[where].value;
			} else if (ie5 || ns6) {
				var what = document.getElementById(where).value;
			}
			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 DoBar() {
			var theStuff = "<img src=\"../graphics/waiting.gif\">";
			SwapText("statusbar", theStuff);
		}

		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";
			}
		}


		/* ------------------------------ 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 (!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;
						break;
					}
				}
				if (isOK == 0) {
					alert("Please enter at least one bullet-point item.");
					document.frmText.bullet1.focus();
					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;
			}
			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;
					break;
				}
			}
			if (isOK == 0) {
				alert("Please enter at least one bullet-point item.");
				document.frmText.bullet1.focus();
				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/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, "");
		}

		/* ------------------------------ 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);
		}


		/* --------------------------- TERTIARY NAVIGATION ------------------------- */

		function MakeNav(dir) {

			var key;
			var theStuff;
			var theList;

			switch (dir) {

				case "surgery":

					// ---------------------------- INDEX

					theList = {
						"srFirst" : "Your First Visit",
						"srAppointments" : "Appointments/Drop Offs",
						"srPreOp" : "Pre-Op Information",
						"srPostOp" : "Post-Op Information",
						"srCalls" : "Calls & Updates",
						"srVisitation" : "Visitation",
						"srDischarge" : "Discharge"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("index", theStuff);


					// ------------------- SURGERY TOPICS

					theList = {
						"srTPLO" : "TPLO",
						"srHip" : "Hip Dysplasia",
						"srLuxation" : "Patellar Luxation",
						"srIVDD" : "IVDD",
						"srFracture" : "Fracture Repair",
						"srMinimal" : "Minimally Invasive Surgery",
						"srTissue" : "Soft Tissue",
						"srAbdomen" : "Hemoabdomen"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("srTopics", theStuff);

					break;

				case "medicine":

					// ---------------------------- INDEX

					theList = {
						"mdFirst" : "Your First Visit",
						"mdAppointments" : "Appointments/Drop Offs",
						"mdCalls" : "Calls & Updates",
						"mdVisitation" : "Visitation",
						"mdDischarge" : "Discharge",
						"mdIodine2" : "I-131"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("index", theStuff);


					// ------------------ MEDICINE TOPICS

					theList = {
						"mdIodine" : "I-131",
						"mdAbdominal" : "Abdominal Ultrasound",
						"mdBPressure" : "Blood Pressure Monitoring",
						"mdMarrow" : "Bone Marrow Aspiration",
						"mdBroncho" : "Bronchoscopy",
						"mdColon" : "Colonoscopy",
						"mdCSF" : "CSF Analysis",
						"mdCT" : "CT Scan",
						"mdCysto" : "Cystoscopy",
						"mdEcho" : "Echocardiography",
						"mdElectro" : "Electrocardiogram",
						"mdTubes" : "Feeding Tubes",
						"mdForeign" : "Foreign Body Retrieval",
						"mdJoint" : "Joint Aspiration",
						"mdRhino" : "Rhinoscopy",
						"mdGI" : "Upper GI Endoscopy"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("mdTopics", theStuff);

					break;

				case "oncology":

					// ---------------------------- INDEX

					theList = {
						"onFirst" : "Your First Visit",
						"onAppointments" : "Appointments/Drop Offs",
						"onCalls" : "Calls & Updates",
						"onVisitation" : "Visitation",
						"onDischarge" : "Discharge"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("index", theStuff);


					// ------------------ ONCOLOGY TOPICS

					theList = {
						"onChemo" : "Chemotherapy",
						"onStaging" : "Staging",
						"onSurgery" : "Surgery",
						"onRadiation" : "Radiation Therapy"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("onTopics", theStuff);

					break;

				case "dermatology":

					// ---------------------------- INDEX

					theList = {
						"dmFirst" : "Your First Visit",
						"dmAppointments" : "Appointments/Drop Offs",
					//	"dmCalls" : "Calls & Updates",
					//	"dmVisitation" : "Visitation",
						"dmDischarge" : "Discharge"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("index", theStuff);


					// --------------- DERMATOLOGY TOPICS

					theList = {
						"dmAllergy" : "Allergies & Testing",
						"dmParasites" : "Parasites",
						"dmInfectious" : "Infectious Disease",
						"dmEar" : "Ear Infections",
						"dmFoot" : "Disease of the Foot",
					//	"dmAutoimmune" : "Auto-Immune",
						"dmHormonal" : "Hormonal/Int Disease",
						"dmCancer" : "Skin Cancer"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("dmTopics", theStuff);

					break;

				case "dentistry":

					// ---------------------------- INDEX

					theList = {
						"dnFirst" : "Your First Visit",
						"dnAppointments" : "Appointments/Drop Offs",
						"dnCalls" : "Calls & Updates",
						"dnVisitation" : "Visitation",
						"dnDischarge" : "Discharge"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("index", theStuff);


					// --------------- DENTISTRY TOPICS

					theList = {
						"dnPeriodontics" : "Periodontics",
						"dnRadiography" : "Diagnostic Radiography",
						"dnSurgery" : "Oral Surgery",
						"dnEndodontics" : "Endodontics",
						"dnProsthodontics" : "Prosthodontics",
						"dnOrthodontics" : "Orthodontics",
						"dnRestorative" : "Restorative Dentistry",
						"dnOncology" : "Surgical Oncology"
					};

					theStuff = MakeNavTable(dir, theList);

					SwapText("dnTopics", theStuff);

					break;

			}
		}

		function MakeNavTable(dir, theList) {
			var theStuff = "<table class=\"dropSubBox\">";
			for (key in theList) {
				theStuff += "<tr><td nowrap class=\"dropSubOff\" onClick=\"document.location.href='../" + dir + "/" + key + ".php';\" onMouseOver=\"this.className='dropSubOver';\" onMouseOut=\"this.className='dropSubOff';\">" + theList[key] + "</td></tr>";
			}
			theStuff += "</table>";
			return theStuff;
		}

		/* ------------------------------ PICTURE SHOWS ---------------------------- */

		function GalleryShowPic(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 = document.frmData.boxw.value;
			var boxH = document.frmData.boxh.value;
			if (document.frmData.browser.value == "ie") {
				boxW = (boxW - 2);
				boxH = (boxH - 2);
			}
			var newSize = SizePic(pic, picW, picH, boxW, boxH);
			sizeArray = newSize.split("x");
			var showW = sizeArray[0];
			var showH = sizeArray[1];
			var theStuff = "<img src=\"" + pic + "\" width=\"" + showW + "\" height=\"" + showH + "\" onClick=\"DoBox2('" + pic + "','" + picW + "','" + picH + "','20','20');\" style=\"cursor: pointer\">";
			SwapText("galleryBox", theStuff);
			var theCap = document.frmData["cap-" + id].value;
			theCap = theCap.replace(/ 0/g, " \"");
			theCap = theCap.replace(/0 /g, "\" ");
			SwapText("galleryCaption", theCap);
		}

		/* -------------------------- EVENT VIEWER AND RSVPS ----------------------- */

		function ShowEvents() {
			GetItem("../modules/moEvents.php?r=" + Math.random(), "content", "");
		}

		function StartRSVP(id) {
			GetItem("../modules/moEventRSVP.php?id=" + id + "&r=" + Math.random(), "content", "");
			document.location.href="#top";
		}

		function WriteRSVP() {
			PostItem("../modules/moEventRSVP.php", "frmRSVP", "content");

		}


		/* -------------------------------- SITE FORMS ----------------------------- */

		function GetForm(form, cat) {
			var theForm = form.replace(/fm/g, "");
			var theScript = "../modules/moForm" + theForm + ".php?form=" + theForm + "&cat=" + cat + "&r=" + Math.random();
			GetItem(theScript, "content", "");
		}

		function WriteForm(form, cat) {

			var comeBack = "GetForm('fm" + form + "', '" + cat + "')";

			switch (form) {
				case "Info":

					if (CheckNull('frmForm','owner1','Please enter the owner name.')) {
						return false;
					}
					if (CheckNull('frmForm','addr','Please enter your street address.')) {
						return false;
					}
					if (CheckNull('frmForm','city','Please enter your city.')) {
						return false;
					}
					if (CheckNull('frmForm','state','Please enter your state.')) {
						return false;
					}
					if (CheckNull('frmForm','zip','Please enter your zip code.')) {
						return false;
					}
					if (CheckNull('frmForm','phone','Please enter your home phone number.')) {
						return false;
					}
					if (CheckNull('frmForm','email','Please enter your email address.')) {
						return false;
					}
					if (CheckEmail('frmForm','email','That email address doesn\'t look valid.')) {
						return false;
					}
					if (CheckNull('frmForm','empname','Please enter your employer.')) {
						return false;
					}

					if (CheckNull('frmForm','license','Please enter your driver\'s license number.')) {
						return false;
					}
					if (CheckDate('frmForm','birthdate','Please enter your date of birth in \"m/d/yyyy\" format.')) {
						return false;
					}
					if (CheckNull('frmForm','petname','Please enter your pet\'s name.')) {
						return false;
					}
					if (CheckNull('frmForm','animalid','Please select your pet\'s species.')) {
						return false;
					}
					if (document.frmForm.animalid.value == "99") {
						var tmp = document.frmForm.animalother.value;
						tmp = tmp.replace(/ /g, "");
						if ((tmp == "") || (tmp == "PleaseSpecify")) {
							alert("Please identify your pet\'s \"Other\" species.");
							document.frmForm.animalother.value = "";
							document.frmForm.animalother.focus();
							return false;
						}
					}
					if (CheckNull('frmForm','petage','Please enter your pet\'s birthdate or age.')) {
						return false;
					}
					if (CheckNull('frmForm','gender','Please select your pet\'s gender.')) {
						return false;
					}
					if (CheckNull('frmForm','breed','Please enter your pet\'s breed.')) {
						return false;
					}
					if (CheckNull('frmForm','color','Please enter your pet\'s color.')) {
						return false;
					}

					if (CheckNull('frmForm','problem','Please tell us the reason for your visit.')) {
						return false;
					}

					if (CheckNull('frmForm','vetname','Please tell us who referred you.')) {
						return false;
					}

					if (document.frmForm.heardid[0].checked == true) {
						var tmp = document.frmForm.heardhow.value;
						tmp = tmp.replace(/ /g, "");
						if ((tmp == "") || (tmp == "PleaseSpecify")) {
							alert("Please tell us how you heard of us.");
							document.frmForm.heardhow.value = "";
							document.frmForm.heardhow.focus();
							return false;
						}
					}



					if (document.frmForm.confirm.checked == false) {
						alert("Please affirm your agreement to the financial terms above.");
						return false;
					}

					break;

				case "Refill":

					if (CheckNull('frmForm','fname','Please enter your first name.')) {
						return false;
					}
					if (CheckNull('frmForm','lname','Please enter your last name.')) {
						return false;
					}
					if (CheckNull('frmForm','petname','Please enter your pet\'s name.')) {
						return false;
					}
					if (CheckNull('frmForm','phone','Please enter your phone number(s).')) {
						return false;
					}

					if (document.frmForm.locationid[1].checked == true) {
						if (CheckNull('frmForm','pharmname','Please enter the pharmacy name.')) {
							return false;
						}
						if (CheckNull('frmForm','pharmphone','Please enter the pharmacy phone number.')) {
							return false;
						}
					}
					for (i = 1; i < 5; i++) {
						var isOk = 0; var theField; var theValue;
						theField = "med" + i;
						theValue = document.frmForm[theField].value;
						theValue = theValue.replace(/ /g, "");
						if (theValue !== "") {
							isOk++;
							break;
						}
					}
					if (isOk == 0) {
						alert("Please enter at least one medication to refill.");
						document.frmForm.med1.focus();
						return false;
					}

					break;

				case "Survey":

					break;
			}

			PostItem("../modules/moFormWrite.php", "frmForm", "content");

		//	setTimeout(comeBack, 5000);

			document.location.href="#top";

		}

		function CheckLocation() {
			if (document.frmForm.locationid[0].checked == true) {
				document.frmForm.pharmname.value = "N/A";
				document.frmForm.pharmphone.value = "N/A";
				document.frmForm.pharmfax.value = "N/A";
				document.frmForm.pharmname.disabled = true;
				document.frmForm.pharmphone.disabled = true;
				document.frmForm.pharmfax.disabled = true;
			} else {
				document.frmForm.pharmname.value = "";
				document.frmForm.pharmphone.value = "";
				document.frmForm.pharmfax.value = "";
				document.frmForm.pharmname.disabled = false;
				document.frmForm.pharmphone.disabled = false;
				document.frmForm.pharmfax.disabled = false;
				document.frmForm.pharmname.focus();
			}
		}

		function CheckSpecies() {
			if (document.frmForm.animalid.value == "99") {
				document.frmForm.animalother.value = "Please Specify";
				document.frmForm.animalother.disabled = false;
			} else {
				document.frmForm.animalother.value = "N/A";
				document.frmForm.animalother.disabled = true;
			}
		}

		function CheckReferral() {
			if (document.frmForm.heardid[0].checked == true) {
				document.frmForm.heardhow.value = "Please Specify";
				document.frmForm.heardhow.disabled = false;
			} else {
				document.frmForm.heardhow.value = "N/A";
				document.frmForm.heardhow.disabled = true;
			}
		}

		/* ----------------------------- SCRIPT SPECIFIC --------------------------- */

		function DoLog() {
			var theStuff = GetValue("xlogid");
			theStuff = theStuff.replace(/ /g, "");
			if (theStuff == "") {
				alert("Please enter your Username (email address).");
				window.xlogid.focus();
				return false;
			}
			document.frmLogin.logid.value = theStuff;
			theStuff = GetValue("xlogpw");
			theStuff = theStuff.replace(/ /g, "");
			if (theStuff == "") {
				alert("Please enter your Password.");
				window.xlogpw.focus();
				return false;
			}
			document.frmLogin.logpw.value = theStuff;
			document.frmLogin.goto.value = GetValue("xgoto");
			document.frmLogin.submit();
		}

		function GetRequestForm() {
			GetItem("../modules/moRequestForm.php?r=" + Math.random(), "content", "");
		}

		function WriteRequestForm() {
			if (CheckNull('frmDoctor','fname','Please enter your First Name.')) {
				return false;
			}
			if (CheckNull('frmDoctor','lname','Please enter your Last Name.')) {
				return false;
			}
			if (CheckNull('frmDoctor','busname','Please enter your Business Name.')) {
				return false;
			}
			if (CheckNull('frmDoctor','addr','Please enter your Address.')) {
				return false;
			}
			if (CheckNull('frmDoctor','city','Please enter your City.')) {
				return false;
			}
			if (CheckNull('frmDoctor','state','Please select your State.')) {
				return false;
			}
			if (CheckNull('frmDoctor','zip','Please enter your Zip code.')) {
				return false;
			}
			if (CheckNull('frmDoctor','phone','Please enter your Phone number.')) {
				return false;
			}
			if (CheckNull('frmDoctor','email','Please enter your Email address.')) {
				return false;
			}
			if (CheckEmail('frmDoctor','email','That Email doesn\'t look valid.')) {
				return false;
			}
			PostItem("../modules/moRequestForm.php", "frmDoctor", "content");
			setTimeout("GetRequestForm()", 6000);
		}
	-->

