<!--
/*==========================================================================================*/
function addLoadEvent(func) {
	var oldonload=window.onload;
	if (typeof window.onload!="function") {
		window.onload=func;
	} else {
		window.onload=function() {
			oldonload();
			func();
		}//end function
	}//end if (typeof window.onload!="function")
}//end function
/*==========================================================================================*/
function addResizeEvent(func) {
	var oldonresize=window.onresize;
	if (typeof window.onresize!="function") {
		window.onresize=func;
	} else {
		window.onresize=function() {
			oldonresize();
			func();
		}//end function
	}//end if (typeof window.onresize!="function")
}//end function
/*==========================================================================================*/
function SetHighlights() {
	xInputs=document.getElementsByTagName("input");
	for (i=0;i<xInputs.length;i++) {
		if (xInputs[i].type=="text") {
			xInputs[i].onfocus=function() {
					if (this.defaultValue==this.value) {
						this.select();
					}//end if ()
				}//end function
			xInputs[i].onmouseup=function(){return false};//because safari is special
		}//end if (xInputs[i].type=="text")
	}//next i<xInputs.length
	xTextAreas=document.getElementsByTagName("textarea");
	for (i=0;i<xTextAreas.length;i++) {
		xTextAreas[i].onfocus=function() {
				if (this.defaultValue==this.value) {
					this.select();
				}//end if ()
			}//end function
		xTextAreas[i].onmouseup=function(){return false};//because safari is special
	}//next i<xTextAreas.length
}//end function
/*==========================================================================================*/
function ShowInfoOverlay(theForm, theFormResponse) {
	if (theForm) {
		xw=theForm.offsetWidth;
		xh=theForm.offsetHeight;
		if (xw&&xh) {
			DarkDiv=document.createElement("div");
				DarkDiv.id="dark"+theForm.id;
				DarkDiv.style.width=xw+"px";
				DarkDiv.style.height=xh+"px";
				DarkDiv.style.position="absolute";
				DarkDiv.style.backgroundColor="#000000";
				DarkDiv.style.filter="alpha(opacity=0)";
				DarkDiv.style.opacity="0";
				theForm.parentNode.insertBefore(DarkDiv, theForm);
			LightDiv=document.createElement("div");
				LightDiv.id="light"+theForm.id;
				LightDiv.style.width=xw-20+"px";
				LightDiv.style.height=xh-20+"px";
				LightDiv.style.position="absolute";
				LightDiv.style.backgroundColor="#ffffff";
				LightDiv.style.filter="alpha(opacity=80)";
				LightDiv.style.opacity="0.8";
				LightDiv.style.margin="10px";
				DarkDiv.appendChild(LightDiv);
//				theForm.parentNode.insertBefore(LightDiv, theForm);
			ClearDiv=document.createElement("div");
				ClearDiv.id="msg"+theForm.id;
				ClearDiv.style.width=xw-40+"px";
				ClearDiv.style.height=xh-40+"px";
				ClearDiv.style.position="absolute";
				ClearDiv.style.margin="10px";
				ClearDiv.style.textAlign="center";
				ClearDiv.innerHTML=theFormResponse;
				ClearDiv.onclick=function() {
					theForm.parentNode.removeChild(document.getElementById("dark"+theForm.id));
//					theForm.parentNode.removeChild(document.getElementById("light"+theForm.id));
//					theForm.parentNode.removeChild(document.getElementById("msg"+theForm.id));
				}//end function
				LightDiv.appendChild(ClearDiv);
//				theForm.parentNode.insertBefore(ClearDiv, theForm);
		}//end if (xw&&xh)
	}//end if (theForm)
}//end function
/*==========================================================================================*/
function ajaxSubmit(theForm) {
	xQuery="";
	if (theForm) {
		xInputs=theForm.getElementsByTagName("input");
		xTextAreas=theForm.getElementsByTagName("textarea");
		xSelects=theForm.getElementsByTagName("select");
		for (i=0;i<xInputs.length;i++) {
			xQuery+=xInputs[i].name;
			xQuery+="=";
			xQuery+=xInputs[i].value.replace(/ /g,"+");
			xQuery+="&";
		}//next i<xInputs.length
		for (i=0;i<xTextAreas.length;i++) {
			xQuery+=xTextAreas[i].name;
			xQuery+="=";
			xQuery+=xTextAreas[i].value.replace(/ /g,"+");
			xQuery+="&";
		}//next i<xTextAreas.length
		for (i=0;i<xSelects.length;i++) {
			xQuery+=xSelects[i].name.replace(/ /g,"+");
			xQuery+="=";
			xQuery+=xSelects[i].options[xSelects[i].selectedIndex].value;
			xQuery+="&";
		}//next i<xSelects.length
		var xmlhttp;
		if (window.XMLHttpRequest) {
		  xmlhttp=new XMLHttpRequest();
		} else {
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}//end if (window.XMLHttpRequest)
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4&&xmlhttp.status==200) {
				theFormResponse=xmlhttp.responseText;
				ShowInfoOverlay(theForm, theFormResponse);
			}//end if (xmlhttp.readyState==4&&xmlhttp.status==200)
		}//end function
		xmlhttp.open("post",theForm.action,true);
		xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
		//xmlhttp.preserveWhitespace=true;
		xmlhttp.send(xQuery);
	}//end if (theForm)
	return false;
}//end function
/*==========================================================================================*/
function SwapImage(theImage) {
	xImageDiv=document.getElementById("mainimage");
	if (xImageDiv) {
		xImage=xImageDiv.getElementsByTagName("img")(0);
		if (xImage) {
			xImage.src=theImage;
		}//end if (xImage)
	} //end if (xImageDiv)
	
}//end function
/*==========================================================================================*/
addLoadEvent(SetHighlights);
/*==========================================================================================*/
-->
