

	//var BACKGROUND_COLOR = "#3ED1E5";

	// see if yuiloadval is set

	var yuiLoadtest = 1;
	try {
		var foo = yuiloadval;
	} catch (err) {
		yuiLoadtest = 0;
	}

	if (yuiLoadtest == 0) {		// load the whole thing

		document.write("<script language='javascript' src='http://yui.yahooapis.com/2.4.1/build/yahoo/yahoo-min.js'></script>\n");
		document.write("<script language='javascript' src='http://yui.yahooapis.com/2.4.1/build/event/event-min.js'></script>\n");
		document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/yahoo-dom-event/yahoo-dom-event.js\"></script>");
		// next 3 for charts
		//document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/element/element-beta-min.js\"></script>");
	        //document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/datasource/datasource-beta-min.js\"></script>");
		//document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/json/json-beta-min.js\"></script>");

		document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/connection/connection-min.js\"></script>");
		//next 1 for  charts
		//document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/charts/charts-experimental-min.js\"></script>");
		document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/animation/animation-min.js\"></script>");
		document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/utilities/utilities.js\"></script>");
		document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/container/container-min.js\"></script>");
		//document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/button/button.js\"></script>");

		document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/dragdrop/dragdrop-min.js\" ></script>");
		document.write("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.4.1/build/slider/slider-min.js\" ></script>");

	} else if (yuiloadval == 0) {	// load only ajax portion

		document.write("<script src=\"http://yui.yahooapis.com/2.5.1/build/yahoo/yahoo-min.js\"></script>");
		document.write("<script src=\"http://yui.yahooapis.com/2.5.1/build/event/event-min.js\"></script>");
		document.write("<script src=\"http://yui.yahooapis.com/2.5.1/build/connection/connection-min.js\"></script>");
	} 

	if (1 == 2) {
		document.write("<script type=\"text/javascript\" src=\"yuiBlock.js\" ></script>");
	}

	kajax3Mapper = new Array();
	kajax3Buttons = new Array();
	//kajax3ButtonCount = 0;
	var globalProcessingButton = "";
	var globalProcessingElementName = "";
	var topMapSlot = -1;
	
	// new stuff for yui //	////////////////////////////////////////////////////////////////

	function failedYuiCallback(o) {
                //alert("yahoo failure! ResponseText: " + o.responseText + " HTTP Status: " + o.status + " Status code msg: " + o.statusText);
		document.location.href='main.php';
                return false;
        }

	function yuiRequest(uri, theMethod, buffer) {

        	var processYuiCallbackObject = {
        	        success: processYuiCallback,
        	        failure: failedYuiCallback,
        	        argument: "blank"
        	}



		//alert("uri: " + uri + " theMethod: " + theMethod + " buffer: " + buffer);

		// note regarding the below: if this is not done, then on edits of about section
		// the LW servers mod_security will flag something the fck Editor puts in.
		// the fancyEditorAbout is the raw contents of the fck editor, the contentsOfAbout is the xhtml retrieved version
		// hence -strip out the raw stuff on the post

		if (buffer.indexOf("fancyEditorAbout") > -1) {
                        var pos = buffer.indexOf("contentsOfAbout=");
                        buffer = buffer.substr(pos);
                }

		if (1 == 2) {
		if (theMethod == "post" || theMethod == "POST") {

			if (buffer.length <= 1024) {
				var useMethod = "get";
				uri = uri + "?" + encodeURI(buffer);
			} else {
				var useMethod = "post";
			}
		} else {

			var useMethod = "get";
		}
		} else {
			useMethod = theMethod;
		}
	
		//alert("posting useMethod " + useMethod + " uri " + uri);

		try {
			var transaction = YAHOO.util.Connect.asyncRequest(useMethod, uri, processYuiCallbackObject, buffer);

		} catch (err) {

			alert("Page is not yet loaded. Please wait for the page to completely load... Check-out the upper left hand part of the screen near the Star's rank.");
			reloadPage();	
			return false;
		}
	 }

	function processYuiCallback(o) {

		if (globalProcessingElementName != "") {
			document.getElementById(globalProcessingElementName).src = '';
			document.getElementById(globalProcessingElementName).style.visibility = 'hidden';
			globalProcessingElementName = "";
		}

		kajax3SetAutoCursor();

		var didAlert = 0;

                var theTx = o.responseText;

		//alert("theTx is " + theTx);	//////////////////////////////

		var targetSystemCmd = kajax3GetPortion(theTx, "<!-- kajaxSystemAlert: ", " -->");

		if (targetSystemCmd.length > 0) {
			alert(targetSystemCmd);	
			didAlert = 1;						// needed so innerHTML is not loaded
		}

		// system alert //////////////////////////////////////////////
		// kajax alert //////////////////////////////////////////////

		var targetAlertTxt = kajax3GetPortion(theTx, "<!-- kajaxAlert: ", " -->");
		if (targetAlertTxt.length > 0) {
			//alert("alert text is " + targetAlertTxt);
			kajax3OutputKajaxAlert(targetAlertTxt);	
			didAlert = 1;						// needed so innerHTML is not loaded
		}

		// system alert //////////////////////////////////////////////

		// system alert - next cmd //////////////////////////////////////////////

		var targetNextCmd = kajax3GetPortion(theTx, "<!-- kajaxNextCmd: ", " -->");

		if (targetNextCmd.length > 0) {
			eval(targetNextCmd);
			return false;
		} else {
			//alert("Next cmd does NOT have length");
		}

		// system alert - next cmd //////////////////////////////////////////////

		// target div view //////////////////////////////////////////////

		if (!didAlert) {
			var targetDiv = kajax3GetPortion(theTx, "<!-- kajaxTargetView: ", " -->");

			if (targetDiv.length > 0) {

				if (theTx.indexOf("<!-- kajaxSegmentStart -->") > 0) {

					theTx = kajax3GetPortion(theTx, "<!-- kajaxSegmentStart -->", "<!-- kajaxSegmentEnd -->");

				}

				try {

					document.getElementById(targetDiv).innerHTML = theTx;
				} catch (err) {
					alert("targetDiv: [" + targetDiv + "] error: " + err + " theTx: " + theTx);
				}

				// check for pager stuff

				//alert("thetx is " + theTx);
				var pagerTotalRows = kajax3GetPortion(theTx, "<!-- pagerTotalRows: ", " -->");

				//alert("pagerTotalRows is " + pagerTotalRows + " length is " + pagerTotalRows.length);

				if (pagerTotalRows.length > 0) {

					var pagerNext = kajax3GetPortion(theTx, "<!-- pagerNext: ", " -->");
					var pagerPrev = kajax3GetPortion(theTx, "<!-- pagerPrev: ", " -->");
					var pagerStart = kajax3GetPortion(theTx, "<!-- pagerStart: ", " -->");
					var pagerNpp = kajax3GetPortion(theTx, "<!-- pagerNpp: ", " -->");

					var startRange = parseInt(pagerStart) + 1;
					var endRange = parseInt(pagerStart) + parseInt(pagerNpp);

					if (endRange > parseInt(pagerTotalRows)) endRange = pagerTotalRows;

					try {
						document.getElementById(targetDiv + "Count").innerHTML = '(viewing ' + startRange + '-' + endRange + ' of ' + pagerTotalRows + ')';
						document.getElementById(targetDiv + "Next").innerHTML = pagerNext;
					} catch (err) {
						alert("kajax error on targetDiv: " + targetDiv +  " err: " + err);
					}	

					//alert("setting div " + targetDiv + "Prev innerHTML to " + pagerPrev);

					document.getElementById(targetDiv + "Prev").innerHTML = pagerPrev;
				}

				
			}
		} else {
			//alert("here - did alert");
		}

		// target div view //////////////////////////////////////////////

		return false;
	}

	////////////////////////////////////////////////////////////////////////////////////////

	function kajax3ParentAlert(msg, next) {

		var outmsg = "alert.php?msg=" + escape(msg) + "&next=" + escape(next);
		//alert("outmsg is " + outmsg);
		kajax3Get(outmsg);
		return false;

	}

	function kajax3SetWaitCursor() {

		// error occurs if body not defined

		try {
			var a = document.getElementsByTagName("body");
			a[0].style.cursor = "wait";

		} catch (ignore) {}

		return false;
	}

	function kajax3SetAutoCursor() {

		try {
			var a = document.getElementsByTagName("body");
			a[0].style.cursor = "auto";
		} catch (err) {
		}

		if (globalProcessingButton != "") {
			globalProcessingButton.style.backgroundImage =  '';
			globalProcessingButton = "";
		}	

		return false;
	}

	function _kajax3SetAutoCursor(slot) {

		// error occurs if body not defined

		//alert("setting auto cursor for slot " + slot);

		for (j = 0; j <= slot; j++) {
		try {
		
			var a = document.getElementsByTagName("body");
			a[0].style.cursor = "auto";

			for (var k = 0; k < kajax3ButtonCount; k++) {
				kajax3Buttons[j][k].style.backgroundImage =  '';
			}

			kajax3Buttons[j] = null;
			kajax3ButtonCount = 0;

		} catch (ignore) {}
		}

		return false;
	}

	function kajax3Get(ref) {

		//alert("debug: kajax3Get called with ref: " + ref);

		kajax3SetWaitCursor();

                if (ref.toString().indexOf("?") > 0) {
                        var url = ref + "&rand=" + Math.random();
                } else {
                        var url = ref + "?rand=" + Math.random();
                }

		yuiRequest(url, "GET", "");
                return false;
	}

	function _kajax3Get(ref) {

		//alert("debug: kajax3Get called with ref: " + ref);

		kajax3SetWaitCursor();

                var req = new XMLHttpRequest();

		var slot = kajax3NewMapSlot();

		//alert("debug: slot is: " + slot);

                kajax3MapResult(req, slot);

                req.onreadystatechange = kajax3ProcRequest;
                if (ref.toString().indexOf("?") > 0) {
                        var url = ref + "&rand=" + Math.random();
                } else {
                        var url = ref + "?rand=" + Math.random();
                }

		//alert("debug: url is: " + url);

                req.open("get", url);
                req.send(null);
                return false;
	}


	function kajax3GetWindowSize() {

                results = new Array(2);
                var myWidth = 0, myHeight = 0;
                if( typeof( window.innerWidth ) == 'number' ) {
                        //Non-IE
                        myWidth = window.innerWidth;
                         myHeight = window.innerHeight;
                } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                        //IE 6+ in 'standards compliant mode'
                        myWidth = document.documentElement.clientWidth;
                        myHeight = document.documentElement.clientHeight;
                } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                        //IE 4 compatible
                        myWidth = document.body.clientWidth;
                        myHeight = document.body.clientHeight;
                }

                results[0] = myWidth;
                results[1] = myHeight;
                return(results);
        }

	function kajax3RemoveKajaxAlert() {

                document.getElementById("kajaxAlertDiv").style.visibility = 'hidden';
                document.getElementById("kajaxAlertGrayDiv").style.visibility = 'hidden';
                document.getElementById("kajaxAlertDiv").style.display = 'none';
                document.getElementById("kajaxAlertGrayDiv").style.display = 'none';
                return false;
        }

	function kajax3OutputKajaxAlert(msg) {


		var boxWidth = 300;
		var boxHeight = 200;

		if (!document.getElementById("kajaxAlertDiv")) {

			var gray = document.createElement("div");
	                var body = document.getElementsByTagName("body");
	                body[0].appendChild(gray);
			gray.innerHTML = "<div id=kajaxAlertGrayDiv name=kajaxAlertGrayDiv></div>";
			var gray2 = document.getElementById("kajaxAlertGrayDiv");
			gray2.style.visibility = 'visible';
			gray2.style.position = 'absolute';
			gray2.style.top = '0px';
			gray2.style.left = '0px';
			gray2.style.height = "5000px";
			gray2.style.width = "5000px";
			gray2.style.zIndex = "99998";
			gray2.style.backgroundImage = "url(graydivbg.gif)";
			
	                var box = document.createElement("div") ;
	                body[0].appendChild(box);
			box.innerHTML = "<div id=kajaxAlertDiv name=kajaxAlertDiv></div>";
			box2 = document.getElementById("kajaxAlertDiv");
			box2.style.visibility = 'visible';
			box2.style.border = '4px solid lightblue';
			box2.style.backgroundColor = 'darkblue';
			box2.style.color = 'white';
			box2.style.fontFamily = 'verdana';
			box2.style.width = boxWidth + "px";
			box2.style.height = boxHeight + "px";
			box2.style.position = 'absolute';
			box2.style.zIndex = "99999";

		} else {

			box2 = document.getElementById("kajaxAlertDiv");
			gray2 = document.getElementById("kajaxAlertGrayDiv");
		}

		sizeArray = kajax3GetWindowSize();

		//alert("width " + sizeArray[0]);
		//alert("height" + sizeArray[1]);

		//box2.style.left = (((document.body.clientWidth - boxWidth) /2) + document.body.scrollLeft) + 'px';
		//box2.style.top  = (((document.body.clientHeight - boxHeight) /2) + document.body.scrollTop) + 'px';


		box2.style.left = (((sizeArray[0] - boxWidth) /2) + document.body.scrollLeft) + 'px';
		box2.style.top  = (((sizeArray[1] - boxHeight) /2) + document.body.scrollTop) + 'px';

		box2.innerHTML = "<center><table><tr><td align=center valign=middle style='color: white;'>" + msg + "<br /><br /><br /></td></tr></table><center><a href='' onclick='return kajax3RemoveKajaxAlert();'><span style='color: yellow;'>Close</span></a><br />";
		box2.style.visibility = 'visible';
		gray2.style.visibility = 'visible';
		box2.style.display = 'block';
		gray2.style.display = 'block';

		return false;	

	}

	function kajax3GetFormElements(theForm) {

		nElements = theForm.length;

		var amalgamation = "";
		var attvalue = "";

		for (var j = 0; j < nElements; j++) {

			attvalue = "";

			theElement = theForm.elements[j];

			//alert("element name is " + theElement.name + " and type is " + theElement.type);

			if (theElement.type == "text" || theElement.type == "password" || theElement.type == "hidden" ) {

				attvalue = theElement.name + "=" + escape(theElement.value);

			} else if (theElement.type == "checkbox") {

				//alert("element is " + theElement.name + " type is checkbox " + "value is " + theElement.checked);

				if (theElement.checked == true) {

					attvalue = theElement.name + "=" + escape(theElement.value);

				} else {

					continue;
				}

			} else if (theElement.type == "select-multiple") {

				for (var i = 0; i < theElement.options.length; i++) {
					if (theElement.options[i].selected)  {
						if (attvalue.length > 0) {
							attvalue = attvalue + "&" + theElement.name + "=" + escape(theElement.options[i].value);
						} else {
							attvalue = attvalue + theElement.name + "=" + escape(theElement.options[i].value);
						}
					}
				}

			} else if (theElement.type == "select-one") {

				if (theElement.selectedIndex == -1) continue;		// none selected

				var sel = theElement.selectedIndex;
				attvalue = theElement.name + "=" + escape(theElement.options[sel].value); 	// .text is the visible name of the option

			} else if (theElement.type == "submit" ) {

				attvalue = theElement.name + "=" + escape(theElement.value);
				//theElement.style.cursor = 'wait';
				theElement.style.backgroundImage =  'url(buttonSubmitBackground.gif)';

				globalProcessingButton = theElement;

				//try {
			        //	kajax3Buttons[slot][kajax3ButtonCount] = theElement;
				//} catch (err) {
				//	kajax3Buttons[slot] = new Array();
				//	kajax3Buttons[slot][kajax3ButtonCount] = theElement;
				//}	
					
				//kajax3ButtonCount++;

			} else if (theElement.type == "textarea") {

				attvalue = theElement.name + "=" + escape(theElement.value);

			} else if (theElement.type == "radio") {

				if (theElement.checked) {
	
					attvalue = theElement.name + "=" + escape(theElement.value);
				} else {
					continue;
				}

			} else if (theElement.type == "button") {

				attvalue = theElement.name + "=" + escape(theElement.value);

			} else {

				alert("unknown element type! " + theElement.type);
				return false;
			}


			//alert("att value is now " + attvalue);

			if (amalgamation.length == 0) {

				if (theForm.method.toLowerCase()  == "post") {

					amalgamation = attvalue;

				} else if (theForm.method.toLowerCase() == "get") {

					amalgamation = "?" + attvalue;
				} else {

					alert("Unknown form post type!");
					return false;
				}

			} else {

				amalgamation = amalgamation + "&" + attvalue;
			}

			//var element_type = theElement.type;
			//var element_name = theElement.name;
			//var element_value = theElement.value;

		}

		return(amalgamation);
	}

	function _kajax3GetFormElements(theForm, slot) {

		nElements = theForm.length;

		var amalgamation = "";
		var attvalue = "";

		for (var j = 0; j < nElements; j++) {

			attvalue = "";

			theElement = theForm.elements[j];

			//alert("element name is " + theElement.name + " and type is " + theElement.type);

			if (theElement.type == "text" || theElement.type == "password" || theElement.type == "hidden" ) {

				attvalue = theElement.name + "=" + escape(theElement.value);

			} else if (theElement.type == "checkbox") {

				//alert("element is " + theElement.name + " type is checkbox " + "value is " + theElement.checked);

				if (theElement.checked == true) {

					attvalue = theElement.name + "=" + escape(theElement.value);

				} else {

					continue;
				}

			} else if (theElement.type == "select-multiple") {

				for (var i = 0; i < theElement.options.length; i++) {
					if (theElement.options[i].selected)  {
						if (attvalue.length > 0) {
							attvalue = attvalue + "&" + theElement.name + "=" + escape(theElement.options[i].value);
						} else {
							attvalue = attvalue + theElement.name + "=" + escape(theElement.options[i].value);
						}
					}
				}

			} else if (theElement.type == "select-one") {

				if (theElement.selectedIndex == -1) continue;		// none selected

				var sel = theElement.selectedIndex;
				attvalue = theElement.name + "=" + escape(theElement.options[sel].value); 	// .text is the visible name of the option

			} else if (theElement.type == "submit" ) {

				attvalue = theElement.name + "=" + escape(theElement.value);
				//theElement.style.cursor = 'wait';
				theElement.style.backgroundImage =  'url(buttonSubmitBackground.gif)';
				//alert("set slot " + slot + " to an element");

				globalProcessingButton = theElement;

				//try {
			        //	kajax3Buttons[slot][kajax3ButtonCount] = theElement;
				//} catch (err) {
				//	kajax3Buttons[slot] = new Array();
				//	kajax3Buttons[slot][kajax3ButtonCount] = theElement;
				//}	
					
				//kajax3ButtonCount++;

			} else if (theElement.type == "textarea") {

				attvalue = theElement.name + "=" + escape(theElement.value);

			} else if (theElement.type == "radio") {

				if (theElement.checked) {
	
					attvalue = theElement.name + "=" + escape(theElement.value);
				} else {
					continue;
				}

			} else if (theElement.type == "button") {

				attvalue = theElement.name + "=" + escape(theElement.value);

			} else {

				alert("unknown element type! " + theElement.type);
				return false;
			}


			//alert("att value is now " + attvalue);

			if (amalgamation.length == 0) {

				if (theForm.method.toLowerCase()  == "post") {

					amalgamation = attvalue;

				} else if (theForm.method.toLowerCase() == "get") {

					amalgamation = "?" + attvalue;
				} else {

					alert("Unknown form post type!");
					return false;
				}

			} else {

				amalgamation = amalgamation + "&" + attvalue;
			}

			//var element_type = theElement.type;
			//var element_name = theElement.name;
			//var element_value = theElement.value;

		}

		return(amalgamation);
	}

	function _kajax3NewMapSlot() {
		topMapSlot++;
		//alert("returning mapslot " + topMapSlot);
		return(topMapSlot);
	}
	
	function _kajax3MapResult(ob, option) {
		kajax3Mapper[option] = ob;
		return false;
	}

	function kajax3GetPortion(string, left, right) {

                // get the part of a string between left and right - not inclusive

                var newloc = string.indexOf(left);
                if (newloc == -1) {
                        return("");
                }
                var newloc2 = string.substr(newloc + left.length);
                newloc = newloc2.indexOf(right);
                var newloc3 = newloc2.slice(0, newloc);
                return(newloc3);
	}

		
	function kajax3ProcRequest() {

		var j;

		for (j= 0; j < kajax3Mapper.length; j++) {

			try {
				//alert("inner try");

				if (kajax3Mapper[j].readyState == 4) {

					try {
						var temp = kajax3Mapper[j].status;
					} catch (err) {
						alert("error on status: " + err);
					}

					if (kajax3Mapper[j].status == 200) {

						kajax3SetAutoCursor(j);

						var didAlert = 0;

		                                var theTx = kajax3Mapper[j].responseText;

						//alert("theTx is " + theTx);

						// process the various embedded commands

						// system alert //////////////////////////////////////////////

						var targetSystemCmd = kajax3GetPortion(theTx, "<!-- kajaxSystemAlert: ", " -->");

						if (targetSystemCmd.length > 0) {
							alert(targetSystemCmd);	
							didAlert = 1;						// needed so innerHTML is not loaded
						}

						// system alert //////////////////////////////////////////////

						// kajax alert //////////////////////////////////////////////

						var targetAlertTxt = kajax3GetPortion(theTx, "<!-- kajaxAlert: ", " -->");
						if (targetAlertTxt.length > 0) {
							//alert("alert text is " + targetAlertTxt);
							kajax3OutputKajaxAlert(targetAlertTxt);	
							didAlert = 1;						// needed so innerHTML is not loaded
						}
						// system alert //////////////////////////////////////////////

						// system alert - next cmd //////////////////////////////////////////////
						var targetNextCmd = kajax3GetPortion(theTx, "<!-- kajaxNextCmd: ", " -->");

						//alert("next cmd " + targetNextCmd);

						if (targetNextCmd.length > 0) {
							//alert("Next cmd has length and is: " + targetNextCmd);
							//alert("setting slot " + j + " to null");
							kajax3Mapper[j] = null;
							eval(targetNextCmd);
							return false;
						} else {
							//alert("Next cmd does NOT have length");
						}

						// system alert - next cmd //////////////////////////////////////////////

						// target div view //////////////////////////////////////////////

						if (!didAlert) {
							var targetDiv = kajax3GetPortion(theTx, "<!-- kajaxTargetView: ", " -->");

							if (targetDiv.length > 0) {
								document.getElementById(targetDiv).innerHTML = theTx;
							}
						} else {
							//alert("here - did alert");
						}

						// target div view //////////////////////////////////////////////

						//alert("setting slot " + j + " to null");
						kajax3Mapper[j] = null;

					} else {
						//alert("status is " + kajax3Mapper[j].status);
					}

				} else {

					//alert("ready state is " + kajax3Mapper[j].readyState);

				}

			} catch (ignoreErr) {

				//alert("err is " + ignoreErr);
			}
        	}

		return false;
	}

	function kajax3DoPost(action, method, data) {

		//alert("posting to: " + action);
		yuiRequest(action, method, data);
                return false;
        }

	function _kajax3DoPost(action, method, data, newSlot) {
                var req = new XMLHttpRequest();
		//var newSlot = kajax3NewMapSlot();
		//alert("new slot is " + newSlot);	
		kajax3MapResult(req, newSlot);
                req.onreadystatechange = kajax3ProcRequest;
                req.open(method, action);
		//alert("kajax3DoPost: action " + action + " method " + method + " data " + data);
                req.send(data);
                return false;
        }

	function kajax3FormPoster(theForm) {

		//alert("kajax3FormPoster Called!");

		try {
			theForm.processing.style.display = "block";
		} catch (ignore) {}
		kajax3SetWaitCursor();
		var x = kajax3GetFormElements(theForm);
		x = x + "&rand=" + Math.random();
		//alert("posting to: " + theForm.action);
		kajax3DoPost(theForm.action, "post", x);
		return false;
	}

	function _kajax3FormPoster(theForm) {
		kajax3SetWaitCursor();
		var newSlot = kajax3NewMapSlot();		// get the mapslot first so the button can be tied to it
		var x = kajax3GetFormElements(theForm, newSlot);
		x = x + "&rand=" + Math.random();
		//alert("Posting data (action = " + theForm.action + ") : " + x);
		kajax3DoPost(theForm.action, "post", x, newSlot);
		return false;
	}



	function kajax3Getcoords(e) {

		var posx = 0;
                var posy = 0;
		var offsets = new Array(2);

                if (!e) var e = window.event;

                if (e.pageX || e.pageY)         {
                        posx = e.pageX;
                        posy = e.pageY;
			offsets[0] = e.clientX;
			offsets[1] = e.clientY;
                }
                else if (e.clientX || e.clientY)        {
                        posx = e.clientX + document.body.scrollLeft
                                + document.documentElement.scrollLeft;
                        posy = e.clientY + document.body.scrollTop
                                + document.documentElement.scrollTop;
			offsets[0] = e.clientX;
			offsets[1] = e.clientY;
                }

		mousex = posx;
		mousey = posy;

		return(offsets);
	}


	function kajax3CloseInputBox() {

		try {
			kajaxBox.style.visibility = 'hidden';
		} catch (err) {
		}

		try {
			reExposeHiddenDiv();
		} catch (err) {}

		// below is for BigPhotoImage in star public page - won't go over flash video - need to hide and reexpose flash video
		try {
			document.getElementById("popVideoDiv").style.visibility = 'visible';
		} catch (err) {}

                return false;
        }

	function kajax3CancelInputBox() {

                document.getElementById('kajaxInputBoxDivInner').style.visibility = 'hidden';
                return false;
	}

	function kajax3DisplayBox(uri, e, wid, hei) {

		if (uri.indexOf("seeMiniBlog") > -1) {
			var title = "MiniBlog Entry";
		} else {
			var title = "";
		}

		kajax3InputBox('=' + uri, e, wid, hei, "", null, null, title);
		return false;
	}

	function _kajax3DisplayBox(uri, e, wid, hei) {

		if (!document.getElementById("kajaxInputBoxDivInner")) {
			var box = document.createElement("div");
			var x = document.getElementsByTagName("body");
			x[0].appendChild(box);
			box.innerHTML = "<div id=kajaxInputBoxDivInner name=kajaxInputBoxDivInner></div>";
		}

		var box2 = document.getElementById("kajaxInputBoxDivInner");
		box2.innerHTML = 'Loading... please wait.';

		var closeText = "<a href='' onclick='return kajax3CancelInputBox();'> <img border=0 src=closeAlert.jpg></a>";

		kajax3CallFunc("kajaxInputBoxDivInner", uri);

		offsets = kajax3Getcoords(e);

		//sizeArray = kajax3GetWindowSize();

       	        box2.style.position = 'absolute';
		box2.style.fontFamily = 'verdana';
       	        box2.style.visibility = 'visible';
       	        box2.style.top = (mousey-50) + 'px';
       	        box2.style.left = mousex + 'px';
       	        box2.style.fontSize = '10px';
       	        box2.style.color = 'white';
       	        box2.style.width = wid + "px";
       	        box2.style.minWidth = wid + "px";
       	        box2.style.height = hei + "px";
       	        box2.style.minHeight = hei + "px";
       	        box2.style.border = "2px ridge gray";
       	        box2.style.backgroundColor = "black";
       	        box2.style.overflow = 'scroll';
       	        box2.style.zIndex = '99999';
		box2.focus();

		return false;
	}

	var kajaxBox = null;

	function pageWidth() {
		return window.innerWidth != null? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;
	}

	function pageHeight() {
		return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;
	}

	function boxAdjust(which, height, val) {

		if (which == "y") {

			//alert("debug: val is " + val + " docelement scrolltop is " + document.documentElement.scrollTop);
			//alert("debug: val is " + val + " document.body scrolltop is " + document.body.scrollTop);
			if (val < document.documentElement.scrollTop) {
				//alert("debug: returning documentElemeent.scrolltop + 10");
				return(document.documentElement.scrollTop + 10);
			} else {

				var sHeight = pageHeight();
				//alert("debug: pageHeight is " + sHeight);
				var bottom  = document.documentElement.scrollTop + sHeight;
				//alert("debug: bottom is " + bottom);
				if ((val + height) > bottom) {
					//alert("debug: settin val to bottom - (height + 60) which is " + (bottom - (height+60)));
					val = bottom - (height + 60);
				} else {
					//alert("debug: returning val: " + val);
				}
			
				return(val);
			}

		} else {

		}

	}

	function boxAdjustSafari(which, height, val) {

		if (which == "y") {

			//alert("debug: val is " + val + " docelement scrolltop is " + document.documentElement.scrollTop);
			//alert("debug: val is " + val + " document.body scrolltop is " + document.body.scrollTop);
			//if (val < document.documentElement.scrollTop) {
			if (val < document.body.scrollTop) {
				//alert("debug: returning documentElemeent.scrolltop + 10");
				//return(document.documentElement.scrollTop + 10);
				return(document.body.scrollTop + 10);
			} else {

				var sHeight = pageHeight();
				//alert("debug: pageHeight is " + sHeight);
				//var bottom  = document.documentElement.scrollTop + sHeight;
				var bottom  = document.body.scrollTop + sHeight;
				//alert("debug: bottom is " + bottom);
				if ((val + height) > bottom) {
					//alert("debug: settin val to bottom - (height + 60) which is " + (bottom - (height+60)));
					val = bottom - (height + 60);
				} else {
					//alert("debug: returning val: " + val);
				}
			
				return(val);
			}

		} else {

		}

	}

	var kajax3InputBoxTimeout = null;
	
	function closeKajax3InputBox() {

		kajaxBox.style.visibility = "hidden";
		return false;
	}


	function safari() {

		if (navigator.appVersion.indexOf("Safari") > -1) return true;
		return false;

		// note - full text is like: 5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.17

	}

	function kajax3InputBox(formContent, e, wid, hei, data, xOffset, yOffset, title, scroll, expires) {

		var easeArray = new Array(
		YAHOO.util.Easing.backBoth,
		YAHOO.util.Easing.backIn,
		YAHOO.util.Easing.backOut,
		YAHOO.util.Easing.bounceBoth,
		YAHOO.util.Easing.bounceIn,
		YAHOO.util.Easing.bounceOut,
		YAHOO.util.Easing.easeBoth,
		YAHOO.util.Easing.easeBothStrong,
		YAHOO.util.Easing.easeIn,
		YAHOO.util.Easing.easeInStrong,
		YAHOO.util.Easing.easeNone,
		YAHOO.util.Easing.easeOut,
		YAHOO.util.Easing.easeOutStrong,
		YAHOO.util.Easing.elasticBoth,
		YAHOO.util.Easing.elasticIn,
		YAHOO.util.Easing.elasticOut);

		var absolutePos = true;
		try {
			var test = xOffset.indexOf("=");
			if (test > -1) {
				absolutePos = true;
			} else {
				absolutePos = false;
			}
		} catch (err) {
			absolutePos = false;
		}

		try {
			if (kajax3PageLoaded != null && kajax3PageLoaded != undefined) {
				if (kajax3PageLoaded != true) return false;
			}
		} catch(errIgnore) {}

		if (kajax3InputBoxTimeout) {
			try {
				clearTimeout(kajax3InputBoxTimeout);
			} catch(err) {}
		}

		if (kajaxBox != null) {
			var pNode = kajaxBox.parentNode;
			pNode.removeChild(kajaxBox);
		}

		kajaxBox = document.createElement("div");
		kajaxBox.style.zIndex = "99999";
		var x = document.getElementsByTagName("body");
		x[0].appendChild(kajaxBox);


		formContent = formContent.replace(/_DATA_/, data);
	
		if (title == undefined || title == null) {
			var useTitle = "";
		} else {
			var useTitle = decodeURIComponent(title);
		}


		var noClose = 0;

		if (scroll != null && scroll != undefined) {
			if (scroll == "noClose") {
				noClose = 1;
				var margin = "0px";
			} else {
				var margin = "12px";
			}
		} else {
			var margin = "0px";
		}

		if (noClose) {		// just info popup

			//kajaxBox.innerHTML = "<span style='background-color: blue; color: white;'>" + formContent + "</span>";
			//kajaxBox.innerHTML = "<div class='popup' id='popup_sendmessage_kk'><h3 id='kajaxBoxHandle'><span class='popup_text'></span><a href='' onclick='return kajax3CloseInputBox();' class='popup_close'></a></h3><div id='popupInside' class='popup_inner'>" + formContent + "</div></div>";
			kajaxBox.innerHTML = "<div class='popup' id='popup_sendmessage_kk' style='z-index: 99999;'><div id='popupInside' class='popup_inner' style='z-index: 99999;'>" + formContent + "</div></div>";

		} else {		// regular popup

			kajaxBox.innerHTML = "<div class='popup' style='width: 100%; z-index:99999;' id='popup_sendmessage_kk'><h3 id='kajaxBoxHandle' style='z-index:99999;'><span class='popup_text' style='z-index:99999;'>_USETITLE_:</span><a href='' onclick='return kajax3CloseInputBox();' class='popup_close' style='z-index:99999;'>X</a></h3><div id='popupInside' class='popup_inner' style='z-index: 99999;'>_THE_FORM_CONTENT_</div></div>";
			//kajaxBox.innerHTML = "<div class='popup' style='width: 100%;' id='popup_sendmessage_kk'>asdlkfajs dflkas fjalsk fjaslfk asjflkas jdflk</div>";

		}

		if (formContent.charAt(0) == "=") {		// load from file via kajax
			document.getElementById("popupInside").innerHTML = "Loading...";
			var txt = kajaxBox.innerHTML;
			txt = txt.replace(/_USETITLE_/, useTitle);
			kajaxBox.innerHTML = txt;
			var dynForm = formContent.substr(1);
			kajax3CallFunc("popupInside", dynForm);
		} else {
			var txt = kajaxBox.innerHTML;
			txt = txt.replace(/_THE_FORM_CONTENT_/, formContent);
			txt = txt.replace(/_USETITLE_/, useTitle);
			kajaxBox.innerHTML = txt;
		}

		if (e == null) {
			e = new Object();
			e.clientX = 225;
			e.clientY = 225;
		}
		
		if (e != null) {

			kajaxBox.style.position = "absolute";
			kajaxBox.style.visibility = "visible";
			kajaxBox.style.display = "block";
			kajaxBox.style.zIndex = "99999";


			if (e == "center" ){
				mousey = 0;
				mousex = 0;
			} else {	
				offsets = kajax3Getcoords(e);
			}	


			if (yOffset == undefined || yOffset == null) {
		       	       kajaxBox.style.top = (mousey-50) + 'px';
			} else {
		       	       //kajaxBox.style.top = (mousey + yOffset) + 'px';

				if (absolutePos) {
					var id = yOffset.substr(4);
					var ypos = YAHOO.util.Dom.getY(id);
					kajaxBox.style.top = ypos + "px";
				} else {
					//alert("debug: mousey is " + mousey + " yOffset is " + yOffset + " boxAdjust for top is " + boxAdjust("y", hei, (mousey + yOffset)));
					if (safari()) {
						kajaxBox.style.top = boxAdjustSafari("y", hei, (mousey + yOffset)) + 'px';
					} else {
						kajaxBox.style.top = boxAdjust("y", hei, (mousey + yOffset)) + 'px';
					}
				}
			}
	
			if (xOffset == undefined || xOffset == null) {
		       	        kajaxBox.style.left = mousex + 'px';
			} else {
				if (absolutePos) {
					var id = xOffset.substr(4);
					var xpos = YAHOO.util.Dom.getX(id);
					kajaxBox.style.left = xpos + "px";
				} else {					
			       	        kajaxBox.style.left = (mousex + xOffset) + 'px';
				}
			}

			if (scroll == null || scroll == undefined) {
				if (scroll != "scroll") {			// no scroll
			       	        kajaxBox.style.width = wid + "px";
		               		kajaxBox.style.maxWidth = wid + "px";
		       	        	kajaxBox.style.height = hei + "px";
		       	        	kajaxBox.style.maxHeight = hei + "px";
		       	        	kajaxBox.style.zIndex = '99999';
				}
			}

			if (1 == 2) {
				var kbi = document.getElementById("popupInside");
		       	        kbi.style.width = wid + "px";
	               		//kajaxBox.style.minWidth = wid + "px";
	               		kbi.style.maxWidth = wid + "px";
	       	        	kbi.style.height = hei + "px";
	       	        	//kajaxBox.style.minHeight = hei + "px";
	       	        	kbi.style.maxHeight = hei + "px";
	       	        	kbi.style.zIndex = '99999';
			}

			if (scroll != undefined && scroll != null) {

				if (scroll != "noClose") {		// do scroll
					
					kajaxBox.style.width = (wid + 20) + "px";
					kajaxBox.style.maxWidth = (wid + 20) + "px";

					kajaxBox.style.height = "";
					kajaxBox.style.height = (hei + 20) + "px";

					kajaxBox.style.maxHeight = (hei + 20) + "px";

					document.getElementById("popupInside").style.overflowY = 'auto';
					document.getElementById("popupInside").style.overflowX = 'hidden';

					document.getElementById("popupInside").style.height = "auto";
					//document.getElementById("popupInside").style.height = hei + "px";

					document.getElementById("popupInside").style.maxHeight = hei + "px";
					//document.getElementById("popupInside").style.maxHeight = "";
					document.getElementById("popupInside").style.maxWidth = wid + "px";
					document.getElementById("popupInside").style.width = wid + "px";

					//kajaxBox.style.overflowY = 'scroll';
					//kajaxBox.style.overflowX = 'hidden';

					//document.getElementById("popupInside").style.overflowY = 'scroll';
					//document.getElementById("popupInside").style.overflowX = 'hidden';

				} else {	// noclose

					kajaxBox.style.width = (wid + 20) + "px";
					kajaxBox.style.maxWidth = (wid + 20) + "px";
					kajaxBox.style.height = (hei + 20) + "px";
					kajaxBox.style.maxHeight = (hei + 20) + "px";

				}
			} else {
				//if the following 3 are uncommented out - IE truncates!
				//kajaxBox.style.overflowY = 'hidden';
				//kajaxBox.style.overflowX = 'hidden';
				//kajaxBox.style.overflow  = 'hidden';
				document.getElementById("popupInside").style.overflowX = 'hidden';
				document.getElementById("popupInside").style.overflowY = 'hidden';
				document.getElementById("popupInside").style.overflow = 'hidden';
			}

			kajaxBox.focus();
		}

		if (document.getElementById("kajaxBoxHandle")) {
			var dd = new YAHOO.util.DD(kajaxBox);
			dd.setHandleElId("kajaxBoxHandle");
			document.getElementById("kajaxBoxHandle").style.zIndex = "99999";
		}

		if (document.getElementById("aboveBelowId")) {

			if (kajax3InputBox.priorEase == undefined || kajax3InputBox == null) {
				kajax3InputBox.priorEase = -1;
			}

			kajax3InputBox.priorEase++;

			if (kajax3InputBox.priorEase == easeArray.length) {
				kajax3InputBox.priorEase = 0;
			}

			var curwid = document.getElementById("aboveBelowId").width;
			var curhei = document.getElementById("aboveBelowId").height;

			//curwid = wid;
			//curhei = hei;

			var myAnim = new YAHOO.util.Anim("aboveBelowId", { opacity: { from: 0, to: 1.0 }, width: { from: 0, to: curwid }, height: { from: 0, to: curhei } }, .75, easeArray[kajax3InputBox.priorEase]);
			myAnim.animate();

		} else {

			var ch = kajaxBox.style.height.replace("px","");

			//var myAnim = new YAHOO.util.Anim(kajaxBox, { opacity: { from: 0, to: 1.0 }, width: { from: 50, to: cw }, height: { from: 50, to: ch } }, 1.0, YAHOO.util.Easing.easeInStrong);
			var myAnim = new YAHOO.util.Anim("popupInside", { height: { from: 0, to: ch-20 } }, 1.0, YAHOO.util.Easing.elasticOut);
			myAnim.animate();
		}
			

		if (expires != null && expires != undefined) {

			kajax3InputBoxTimeout = setTimeout(closeKajax3InputBox, expires);
		}

		return false;
	}

	function kajaxExpand(x, y) {

		var div = kajaxBox;

		var nowx = div.style.width.replace("px", "");
		var nowy = div.style.height.replace("px", "");

		nowx = nowx + 2;	
		nowy = nowy + 2;	

		if (nowx > x) return false;
		if (nowy > y) return false;

		div.style.width = nowx + "px";
		div.style.height = nowy + "px";

		setTimeout("kajaxExpand(kajaxBox, 300, 300)", 500);
		return false;
	}
	


	function kajax3CallFunc(targetDiv, args) {

		//alert("debug: kajax3CallFunc called with div " + targetDiv + " and args: " + args);
		if (args.toString().indexOf("?") > -1) {
			var delim = "&";
		} else {
			var delim = "?";
		}

		//alert("calling kajax3Get");
		kajax3Get(args + delim + "kajaxTargetView=" + targetDiv);
		return false;

        }

	function _kajax3CallFunc(targetDiv, args) {

		//alert("debug: kajax3CallFunc called with div " + targetDiv + " and args: " + args);
		if (args.toString().indexOf("?") > -1) {
			var delim = "&";
		} else {
			var delim = "?";
		}

		//alert("calling kajax3Get");
		kajax3Get(args + delim + "kajaxTargetView=" + targetDiv);
		return false;

        }


	var kajax3UploadRef;
	var kajax3UploadIter = 0;
	var kajax3WhichSeeDiv = "";
	var kajax3WhichCancelDiv = "";

	function showUploadProgressCallBack(percent) {


		//if (percent.indexOf("uploadDone") > -1) {
		//	eval(percent);
		//	return false;
		//}

		var wid = percent + "%;";	
		var x = "<div style='height: 100%; background-color: green; color: white; font-family: verdana; font-size: 11px; width: " + wid + "'>" + percent + "%</div>";
		document.getElementById(kajax3WhichSeeDiv).innerHTML = x;
		
		if (percent == 100) {
			clearTimeout(kajax3UploadRef);
			//alert("Upload completed!");
			document.getElementById(kajax3WhichSeeDiv).innerHTML = '';
			document.getElementById(kajax3WhichSeeDiv).style.visibility = 'hidden';
			document.getElementById(kajax3WhichCancelDiv).style.visibility = 'hidden';
			return false;
		}

		return;
	}

	function showUploadProgress(id) {

		kajax3UploadIter++;

		//document.getElementById("uploadProgressDiv").innerHTML = "here2";

		if (kajax3UploadIter > 100) {

			alert("Upload has timed out.");
			clearTimeout(kajax3UploadRef);
			return false;
		}

		//document.getElementById("uploadProgressDiv").innerHTML = "here3";
		kajax3CallFunc(kajax3WhichSeeDiv, "uploadProgress.php?id=" + id);
		var exp = "showUploadProgress(" + id + ")";
		kajax3UploadRef = setTimeout(exp, 1000);
		return;
	}

	function kajax3UploadMeter(id, seeDiv, cancelDiv) {

		kajax3WhichSeeDiv = seeDiv;
		kajax3WhichCancelDiv = cancelDiv;

		document.getElementById(seeDiv).style.visibility = "visible";
		document.getElementById(cancelDiv).style.visibility = "visible";
		kajax3UploadIter = 0;
		var exp = "showUploadProgress(" + id + ")";
		kajax3UploadRef = setTimeout(exp, 1000);
		return true;
	}

	function kajax3CancelUpload(id) {

		clearTimeout(kajax3UploadRef);
		alert("Upload cancelled!");
		return false;

	}

