// pause(numberMillis)// Pauses code execution for specified time. Uses busy code, not good.function pause(numberMillis) {	var now = new Date();	var exitTime = now.getTime() + numberMillis;	while (true) {		now = new Date();		if (now.getTime() > exitTime)			return;	}}// getPageScroll()// Returns array with x,y page scroll values.function getPageScroll(){	var yScroll;	if (self.pageYOffset) {		yScroll = self.pageYOffset;	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict		yScroll = document.documentElement.scrollTop;	} else if (document.body) {// all other Explorers		yScroll = document.body.scrollTop;	}	arrayPageScroll = new Array('',yScroll) 	return arrayPageScroll;}// getPageSize()// Returns array with page width, height and window width, heightfunction getPageSize(){		var xScroll, yScroll;		if (window.innerHeight && window.scrollMaxY) {			xScroll = document.body.scrollWidth;		yScroll = window.innerHeight + window.scrollMaxY;	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac		xScroll = document.body.scrollWidth;		yScroll = document.body.scrollHeight;	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari		xScroll = document.body.offsetWidth;		yScroll = document.body.offsetHeight;	}		var windowWidth, windowHeight;	if (self.innerHeight) {	// all except Explorer		windowWidth = self.innerWidth;		windowHeight = self.innerHeight;	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode		windowWidth = document.documentElement.clientWidth;		windowHeight = document.documentElement.clientHeight;	} else if (document.body) { // other Explorers		windowWidth = document.body.clientWidth;		windowHeight = document.body.clientHeight;	}			// for small pages with total height less then height of the viewport	if(yScroll < windowHeight){		pageHeight = windowHeight;	} else { 		pageHeight = yScroll;	}	// for small pages with total width less then width of the viewport	if(xScroll < windowWidth){			pageWidth = windowWidth;	} else {		pageWidth = xScroll;	}	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 	return arrayPageSize;}	// WindowGetKey// Check to see witch key was pressed and process an actionfunction WindowGetKey(e){	if (e == null) { // ie		keycode = event.keyCode;	} else { 		// mozilla		keycode = e.which;	}	key = String.fromCharCode(keycode).toLowerCase();	if((keycode == 120) | (keycode==27) | (keycode==0))	// 120=x 27=ESC (IE), 0=ESC (FireFox)		{ 		WindowHideShow(); 		}}// WindowToggle// Toggle toe Windows bodyfunction WindowToggle()	{	var iWindowB = document.getElementById('Window-body');	if (iWindowB.currentStyle.display=='none')		{		iWindowB.style.display='block';		document.getElementById('Window-close').className = "close";		} else {		iWindowB.style.display='none';		document.getElementById('Window-close').className = "open";		}	}// Window2ClipBoard// Add the content of the window body to the clipboardfunction Window2ClipBoard()	{	window.clipboardData.setData("Text",document.getElementById('Window-body').innerText);	window.status = "Window data copied to clipbard";	}// WindowHideShow// Show or hide the window bShow = null -> toggle	function WindowHideShow(bShow)	{	var iWindow = document.getElementById('Window');	if (bShow==null) bShow = iWindow.hide;	if (bShow==false) 		{		iWindow.hide=true;		iWindow.style.display='none';		document.onkeypress = null;		var iOverlay = document.getElementById('Window-overlay');		iOverlay.style.display='none';		} else {		iWindow.hide=false;		document.onkeypress = WindowGetKey;				// center window 		var arrayPageSize = getPageSize();		var arrayPageScroll = getPageScroll();				iWindow.style.display='block';		var nTop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - iWindow.offsetHeight) / 2);		if (nTop<0) iWindow.style.top = '10px'; else iWindow.style.top = (nTop + 'px');					iWindow.style.left = (((arrayPageSize[0] - 20 - iWindow.offsetWidth) / 2) + 'px');			// set height of Overlay to take up whole page and show		var iOverlay = document.getElementById('Window-overlay');		if (navigator.appVersion.indexOf("MSIE")!=-1) 			{			iOverlay.style.backgroundImage= 'url(blank.gif)'; 			iOverlay.style.left = '0px';			if (window.event!=null)				window.event.cancelBubble=true;		//--For usage within other elements			}		iOverlay.style.height = (arrayPageSize[1] + 'px');		iOverlay.style.display = 'block';					}	}// WindowBody// Add content to the window body, sInfo = text or HTMLfunction WindowBody( sInfo)	{	var iWindowB = document.getElementById('Window-body');	iWindowB.innerHTML = sInfo;		}// WindowAddDebug// Add debug information to the body, sInfo = text or HTMLfunction WindowAddDebug( sInfo)	{	var iWindowB = document.getElementById('Window-body');	var dNow = new Date();   	var sNow = dNow.getHours() + ':' + dNow.getMinutes() + ':' +  dNow.getSeconds() + ' ';			iWindowB.innerHTML +=  sNow  + sInfo + '<br/>';	}// WindowAddHTML// Add a HTML file to the body of the window// sPath = path to flash file// nW = Widht, nH 	=Height// sColor = boackground color// bShow = Show after loadingfunction WindowAddHTML( sPath, nW, nH, sColor, bShow )	{	if (typeof sPath=='object') sPath= sPath.getAttribute("href");		var iWindowB = document.getElementById('Window-body');	iWindowB.style.overflow='visible';	if (sColor!=null) iWindowB.style.backgroundColor=sColor;	iWindowB.innerHTML = '<iframe frameBorder="0" id="WindowB-iframe" src='+sPath+'></iframe>';			var iWindowsBF = document.getElementById('WindowB-iframe');		WindowResize(nW, nH, iWindowsBF, 1);		if (bShow!=null) WindowHideShow(bShow);		}// WindowAddFlash// Add a Flash file to the body// sPath = path to flash file// nW = Widht, nH 	=Height// sColor = boackground color// bShow = Show after loadingfunction WindowAddFlash( sPath, nW, nH, sColor, bShow )	{	if (typeof sPath=='object') 		{		var iObject = sPath;		sPath= iObject.getAttribute("href");		if (nW==null)	nW= new Number(iObject.getAttribute("popupw"));		if (nH==null)	nH= new Number(iObject.getAttribute("popuph"));		//debugger		}		var iWindowB = document.getElementById('Window-body');	iWindowB.style.overflow='visible';		if (sColor!=null) iWindowB.style.backgroundColor=sColor;	iWindowB.innerHTML = '<div frameborder="0" id="flashcontent1"></div>';	var so = new SWFObject(sPath, "Window-flashmovie", nW, nH, 7, sColor);	so.write("flashcontent1");				WindowResize(nW, nH);		if (bShow!=null) WindowHideShow(bShow);	}// WindowAddImg// Add a Flash file to the body// sPath = path to image file// nW = Widht, nH = Height// sColor = boackground color// bShow = Show after loading	function WindowAddImg( sPath, nW, nH, sColor, bShow )	{;	if (typeof sPath=='object') sPath= sPath.getAttribute("href");	var iWindowB = document.getElementById('Window-body');	iWindowB.style.overflow='visible';	if (sColor!=null) iWindowB.style.backgroundColor=sColor;	iWindowB.innerHTML = '<img id="WindowB-img" />';	var iWindowBImg = document.getElementById('WindowB-img');	iWindowBImg.bShow = bShow;	if (nW!=null) iWindowB.style.width=(nW+'px');	if (nH!=null) iWindowB.style.height=(nH+'px');		// preload image	iImgPreload = new Image();	iImgPreload.onload=WindowImgLoaded;	iImgPreload.src=sPath;	}//--Helper function called after loading imgfunction WindowImgLoaded()	{	if (navigator.appVersion.indexOf("MSIE")!=-1)	pause(50);	this.onload=null;	var iWindowBImg = document.getElementById('WindowB-img');	iWindowBImg.src = this.src;	iWindowBImg.onclick = function() {WindowHideShow();};	WindowResize( this.width, this.height);		if (iWindowBImg.bShow!=null) WindowHideShow(iWindowBImg.bShow);	}// WindowTitle	// Set the windows titlefunction WindowTitle( sInfo)	{	var iWindowT = document.getElementById('Window-title');	iWindowT.innerHTML = sInfo;	}// WindowStatus	// Set the windows status	function WindowStatus( sInfo)	{	var iWindowT = document.getElementById('Window-status');	iWindowT.innerHTML = sInfo;	iWindowT.style.display='block';	}		// WindowStatus	// Set the windows size// nW = width, nH = Height// iInner = extra inner object// nInnerMargin = inner marginfunction WindowResize( nW, nH, iInner, nInnerMargin)	{	var iWindowB = document.getElementById('Window-body');			var iWindowT = document.getElementById('Window-header');	var iWindowS = document.getElementById('Window-status');	var iWindow = document.getElementById('Window');		if (nW==null) nW = iWindow.offsetWidth;	if (nH==null) nH = iWindow.offsetHeight;	if (nW==0) nW=100;	if (nH==0) nH=50;		if (navigator.appVersion.indexOf("MSIE")!=-1)		// =IE		{		iWindowB.style.width = (nW) + 'px';		iWindowB.style.height = (nH) + 'px';		iWindowT.style.width = (nW+6) + 'px';		iWindowS.style.width = (nW+6) + 'px';			iWindow.style.width = (nW+6)+'px';		iWindow.style.height = (nH+20)+'px';		if (iInner!=null)			{			if (nInnerMargin==null) nInnerMargin=0;			iInner.style.width = (nW-nInnerMargin)+'px';			iInner.style.height = (nH-nInnerMargin)+'px';				}		} else {														// = FireFox		iWindowB.style.width = (nW) + 'px';		iWindowB.style.height = (nH) + 'px';		iWindowT.style.width = (nW) + 'px';		iWindowS.style.width = (nW+2) + 'px';			iWindow.style.width = (nW+6)+'px';		iWindow.style.height = (nH+38)+'px';		if (iInner!=null)			{			if (nInnerMargin==null) nInnerMargin=0;			iInner.style.width = (nW-nInnerMargin)+'px';			iInner.style.height = (nH-nInnerMargin)+'px';				}		}					}// WindowInit// convert an <a href="xx""></> into an popupfunction WindowInit()	{	if (!document.getElementsByTagName){ return; }	var iAnchors = document.getElementsByTagName("a");	// loop through all anchor tags	for (var i=0; i<iAnchors.length; i++)		{		var iAnchor = iAnchors[i];		if (iAnchor.getAttribute("href") && (iAnchor.getAttribute("popup") == "true"))			{			var sHref = iAnchor.href.toLowerCase();			if ( (sHref.indexOf('.jpg')>0) | (sHref.indexOf('.gif')>0) | (sHref.indexOf('.png')>0) )				iAnchor.onclick = function() { WindowAddImg(this, null, null, null, true); return false};			if (sHref.indexOf('.swf')>0)				iAnchor.onclick = function() { WindowAddFlash(this, null, null, null, true); return false};			if ( (sHref.indexOf('.htm')>0) | (sHref.indexOf('.html')>0) )				iAnchor.onclick = function() { WindowAddHTML(this, 500, 500, 'white', true); return false};							}		}		}