<!--
/*==========================================================================================*/
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 BrowserIs(xCheck) {
	xBrowser=navigator.appVersion;
	if (xBrowser.indexOf(xCheck)>0) {
		return true;
	} else {
		return false;
	}//end if (xBrowser.indexOf(xCheck)>0)
}//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 SetupMenu() {
	xMenuDiv=document.getElementById("menu");
	if (BrowserIs("IE 6")||BrowserIs("IE 7")) {
		xMenuTable="";
		if (xMenuDiv) {
			xMenuUL=xMenuDiv.getElementsByTagName("ul")[0];
			if (xMenuUL) {
				xMenuLIs=xMenuUL.getElementsByTagName("li");
				if (xMenuLIs) {
					for (i=0;i<xMenuLIs.length;i++) {
						xMenuLIA=xMenuLIs[i].getElementsByTagName("a")[0];
						if (xMenuLIA) {
							xMenuTable+="<td><a href=\""+xMenuLIA.href+"\">"+xMenuLIA.innerHTML+"</a></td>";
						}//end if (xMenuLIA)
					}//next i<xMenuLIs.length
				}//end if (xMenuLIs)
			}//end if (xMenuUL)
			xMenuTable="<table summary=\"main menu\"><tr>"+xMenuTable+"</tr></table>";
			xMenuDiv.innerHTML=xMenuTable; //fix for IE6&7
		}//end if (xMenuDiv)
	} else {
		xMenuDiv.innerHTML=xMenuDiv.innerHTML; //fix for IE8 first load css bug
	}//end if (BrowserIs("IE 6")||BrowserIs("IE 7"))
}//end function
/*==========================================================================================*/
xEMAILcode=[109,97,105,108,64,119,111,98,98,108,121,98,111,98,115,46,110,101,116];
xEMAILaddr="";
for (c=0;c<xEMAILcode.length;c++) {
	xEMAILaddr+=String.fromCharCode(xEMAILcode[c]);
}//next c<xEMAILcode.length
/*==========================================================================================*/
function SetEmailLinks() {
	xLinks=document.getElementsByTagName("a");
	if (xLinks) {
		for (l=0;l<xLinks.length;l++) {
			xLinkRel=xLinks[l].rel;
			if (xLinkRel) {
				if (xLinkRel=="emaillink") {
					xLinks[l].href="mailto:"+xEMAILaddr;
				}//end if (xLinkRel=="emaillink")
			}//end if (xLinkRel)
		}//next l<xLinks.length
	}//end if (xLinks)
}//end function
/*==========================================================================================*/
function FixChromeBug() {
	if (document.width%2==1) {
		document.getElementsByTagName("html")[0].style.marginLeft="1px";
	} else {
		document.getElementsByTagName("html")[0].style.marginLeft="0px";
	}//end if (document.width%2==1)
}//end function
/*==========================================================================================*/
addLoadEvent(FixChromeBug);
addResizeEvent(FixChromeBug);
addLoadEvent(SetupMenu);
addLoadEvent(SetEmailLinks);
addLoadEvent(SetHighlights);
/*==========================================================================================*/
-->
