function getAttribute(oSource,oAttributeName) {
	if (oSource == null || oAttributeName == null) {
		return null;
	}
	if (oSource.getAttribute == null)
		return null ;
	oAttributeName = oSource.getAttribute(oAttributeName);
	if (oAttributeName == "")
		oAttributeName = null;
	return oAttributeName;
}

function getTag(oDocument, sTagName) {
	if (document.getElementsByTagName == null) {
		return (new Array());
	}
	if (sTagName == null) {
		return (new Array());
	}
	return oDocument.getElementsByTagName(sTagName);
}

function getObject(ID) {
	if (document.getElementById == null) {
		document.getElementById = document.all;
	}
	if (ID == null) return null;
	return document.getElementById(ID);
}

function resizeFix() {
	if (!window.IE|| window.Mac ) {return;}
	if (!window.GDA) {return;}
	if (window.baseFont1 == null) {
		window.baseFont1 = document.createElement("div");
		window.baseFont1.innerHTML = "&nbsp;";
		window.baseFont1.style.cssText = "position:absolute;top:-5000px;";
		document.body.insertAdjacentElement("AfterBegin", window.baseFont1);
	}
	if (window.baseFont2 == null) {
		window.baseFont2 = document.createElement("div");
		window.baseFont2.innerHTML = "&nbsp;";
		window.baseFont2.style.cssText = "position:absolute;top:-5000px;";
		document.body.insertAdjacentElement("AfterBegin", window.baseFont2);
		window.baseFont2.onresize = function() {resizeFix();}
	}
	var ratio = window.baseFont2.offsetHeight / window.baseFont1.offsetHeight;
	getObject("main").style.width = Math.max( getObject("basewidth").offsetWidth, Math.ceil( ratio * getObject("basewidth").offsetWidth)) +"px";
	window.pageWidth = getObject("main").style.width;
}

function PageLoad() {
	var sbtext = getObject("sbtext");
	SRBoxFox();
}

function SRBoxFox(ev) {
	try {
		getObject("sbtext").focus();
		document.body.scrollTop = 0;
		document.documentElement.scrollTop = 0;
	}
	catch(e) { }
}

function runAOPG(oSource, nDirection, nScroolTimes, bRunDone) {
	var oAOPG = getObject(oSource);
	oAOPG.nDirection = nDirection;
	oAOPG.nScroolTimes = nScroolTimes;
	oAOPG.bRunDone = bRunDone;
	if (oAOPG && (window.IE || window.MOZ) && (!window.MAC)) {
		oAOPG.Hover = false;
		oAOPG.onmouseover = function() {
			if (oAOPG.bRunDone)
				this.Hover = true;
			else
				this.Hover = false;
		}
		oAOPG.onmouseout = function() {
			this.Hover = false;
		}
		oAOPG.style.display = "block";
		oAOPG.oDivBlock = new Array();
		var oDivBlock = getTag(oAOPG, "div");
		var oTable = getTag(oAOPG, "table");
		var oTd = getTag(oAOPG, "td");
		for (nCount = 0; nCount < oTable.length; nCount++) {
			if (getAttribute(oTable[nCount], "width")) {
				oTable[nCount].removeAttribute("width");
			}
		}
		for (nCount = 0; nCount < oTd.length; nCount++) {
			if (getAttribute(oTd[nCount], "width")) {
				oTd[nCount].removeAttribute("width");
			}
		}
		oAOPG.nScrolldelay = getAttribute(oAOPG, "delay");
		if (isNaN(oAOPG.nScrolldelay)) {
			oAOPG.style.display = "none";
			return;
		}
		if (oAOPG.nScrolldelay <= 0)
			oAOPG.nScrolldelay = 1;
		oAOPG.nScrolldelay = Math.max(parseFloat(oAOPG.nScrolldelay) * 1000, 1000);
		for (nCount = 0; nCount < oDivBlock.length; nCount++) {
			oAOPG.oDivBlock[nCount] = oDivBlock[nCount];
			oDivBlock[nCount].style.backgroundColor = "white";
			oDivBlock[nCount].runEvent = setTimeout("void(0)",0);
			oDivBlock[nCount].nCount = nCount;
			oDivBlock[nCount].nScroolCount = oAOPG.nScroolTimes;
			switch(oAOPG.nDirection) {
				case 0 :
					oDivBlock[nCount].style.top = oAOPG.offsetHeight * 2 + "px";
					oDivBlock[nCount].style.left = "1px";
					break;
				case 1 :
					oDivBlock[nCount].style.top = -oAOPG.offsetHeight + "px";
					oDivBlock[nCount].style.left = "1px";
					break;
				case 2 :
					oDivBlock[nCount].style.top = "1px";
					oDivBlock[nCount].style.left = oAOPG.offsetWidth * 2 + "px";
					break;
				case 3 :
					oDivBlock[nCount].style.top = "1px";
					oDivBlock[nCount].style.left = -oAOPG.offsetWidth + "px";
					break;
			}
			if (oDivBlock[nCount].id == null || oDivBlock[nCount].id == "") 
				oDivBlock[nCount].id = "_marquee" + oSource + "_" + nCount;
			oDivBlock[nCount].flyin = function() {
				clearTimeout(this.runEvent);
				this.style.visibility = "visible";
				var oDivCount = this.nCount - 1;
				if (oDivCount < 0)
					oDivCount = oAOPG.oDivBlock.length - 1;
				if (this.nScroolCount > 0) {
					oAOPG.bRunDone = false;
					if (this.parentNode.Hover == false) {
						switch(oAOPG.nDirection) {
							case 0 :
								this.nScroolCount -= 1;
								this.style.top = ((this.parentNode.offsetHeight * this.nScroolCount / oAOPG.nScroolTimes))+ "px";
								break;
							case 1 :
								this.nScroolCount -= 1;
								this.style.top = (-(this.parentNode.offsetHeight * this.nScroolCount / oAOPG.nScroolTimes))+ "px";
								break;
							case 2 :
								this.nScroolCount -= 1;
								this.style.left = ((this.parentNode.offsetWidth * this.nScroolCount / oAOPG.nScroolTimes))+ "px";
								break;
							case 3 :
								this.nScroolCount -= 1;
								this.style.left = (-(this.parentNode.offsetWidth * this.nScroolCount / oAOPG.nScroolTimes))+ "px";
								break;
						}
					}
					this.runEvent = setTimeout("getObject('"+this.id+"').flyin()", 30);
				}
				else {
					oAOPG.bRunDone = true;
					this.nScroolCount = 0;
					var oDiv = this.nCount + 1;
					if (oDiv > (oAOPG.oDivBlock.length - 1))
						oDiv = 0;
					oDiv = getObject("_marquee" + oSource + "_" + oDiv);
					if (oDiv.id != this.id) {
						this.runEvent = setTimeout("getObject('"+this.id+"').flyout()",(oAOPG.nScrolldelay));
						switch(oAOPG.nDirection) {
							case 0 :
								oDiv.runEvent = setTimeout("getObject('"+oDiv.id+"').style.top = '900px';getObject('"+oDiv.id+"').flyin()",(oAOPG.nScrolldelay-0));
								break;
							case 1 :
								oDiv.runEvent = setTimeout("getObject('"+oDiv.id+"').style.top = '-900px';getObject('"+oDiv.id+"').flyin()",(oAOPG.nScrolldelay-0));
								break;
							case 2 :
								oDiv.runEvent = setTimeout("getObject('"+oDiv.id+"').style.left = '1200px';getObject('"+oDiv.id+"').flyin()",(oAOPG.nScrolldelay-0));
								break;
							case 3 :
								oDiv.runEvent = setTimeout("getObject('"+oDiv.id+"').style.left = '-1200px';getObject('"+oDiv.id+"').flyin()",(oAOPG.nScrolldelay-0));
								break;
						}
					}
				}
			}
			oDivBlock[nCount].flyout = function() {
				clearTimeout(this.runEvent);
				if (this.nScroolCount < oAOPG.nScroolTimes) {
					if (this.parentNode.Hover == false) {
						switch(oAOPG.nDirection) {
							case 0 :
								this.nScroolCount += 1;
								this.style.top = (-(this.nScroolCount / oAOPG.nScroolTimes * this.offsetHeight) - 1) + "px";
								break;
							case 1 :
								this.nScroolCount += 1;
								this.style.top = ((this.nScroolCount / oAOPG.nScroolTimes * this.offsetHeight) + 1) + "px";
								break;
							case 2 :
								this.nScroolCount += 1;
								this.style.left = (-(this.nScroolCount / oAOPG.nScroolTimes * this.offsetWidth) - 1) + "px";
								break;
							case 3 :
								this.nScroolCount += 1;
								this.style.left = ((this.nScroolCount / oAOPG.nScroolTimes * this.offsetWidth) + 1) + "px";
								break;
						}
					}
					this.runEvent = setTimeout("getObject('"+this.id+"').flyout()",30);
				}
				else {
					this.nScroolCount = oAOPG.nScroolTimes;
					switch(oAOPG.nDirection) {
						case 0 :
							this.style.top = this.parentNode.offsetHeight * 2 + "px";
							this.style.left = "1px";
							break;
						case 1 :
							this.style.top = -this.parentNode.offsetHeight + "px";
							this.style.left = "1px";
							break;
						case 2 :
							this.style.top = "1px";
							this.style.left = this.parentNode.offsetWidth * 2 + "px";
							break;
						case 3 :
							this.style.top = "1px";
							this.style.left = -this.parentNode.offsetWidth + "px";
							break;
					}
				}
			}
		}
		if (oDivBlock.length > 0) {
			oDivBlock[0].style.top = "1px";
			oDivBlock[0].style.left = "1px";
			oDivBlock[0].flyin();
		}
	}
	else if (oAOPG) {
		oAOPG.style.display = "block";
		oAOPG.style.overflow = "visible";
		oAOPG.style.height = "auto";
		var oDivBlock = getTag(oAOPG, "div");
		if (oDivBlock.length >= 1) {
			oDivBlock[0].style.position = "static";
			oDivBlock[0].style.visibility = "visible";
		}
	}
}

function runAOPGon98(oSource, nDirection, nScroolTimes, bRunDone) {
	var oAOPG = getObject(oSource);
	oAOPG.nDirection = nDirection;
	oAOPG.nScroolTimes = nScroolTimes;
	oAOPG.style.display = "block";
	var oDivBlock = getTag(oAOPG, "div");
	var oTable = getTag(oAOPG, "table");
	var oTd = getTag(oAOPG, "td");
	for (nCount = 0; nCount < oTable.length; nCount++) {
		if (getAttribute(oTable[nCount], "width")) {
			oTable[nCount].removeAttribute("width");
		}
	}
	for (nCount = 0; nCount < oTd.length; nCount++) {
		if (getAttribute(oTd[nCount], "width")) {
			oTd[nCount].removeAttribute("width");
		}
	}
	oDivBlock = new Array();
	oDivBlock = getTag(oAOPG, "div");
	var marquee = "";
	for (nCount = 0; nCount < oDivBlock.length; nCount++) {
		marquee += "<div style = 'margin:0 0 0.2em 0;white-space:nowrap;display:block;visibility:visible;position:static;'>" + oDivBlock[nCount].innerHTML+ "</div>";
	}
	switch(oAOPG.nDirection) {
		case 0 :
			oAOPG.innerHTML = "<marquee direction=up scrolldelay=50 scrollamount=1 onmouseover='this.stop()' onmouseout='this.start()'>" + marquee +"</marquee>" ;
			break;
		case 1 :
			oAOPG.innerHTML = "<marquee direction=down scrolldelay=50 scrollamount=1 onmouseover='this.stop()' onmouseout='this.start()'>" + marquee +"</marquee>" ;
			break;
		case 2 :
			oAOPG.innerHTML = "<marquee direction=left scrolldelay=50 scrollamount=1 onmouseover='this.stop()' onmouseout='this.start()'>" + marquee +"</marquee>" ;
			break;
		case 3 :
			oAOPG.innerHTML = "<marquee direction=right scrolldelay=50 scrollamount=1 onmouseover='this.stop()' onmouseout='this.start()'>" + marquee +"</marquee>" ;
			break;
	}
}

window.appVersion = window.navigator.appVersion;
if (window.appVersion != null) {
	window.appVersion = window.appVersion.toUpperCase(); 
	window.MacIE5 = ((window.appVersion.toUpperCase().indexOf("MSIE") >= 0) && (window.appVersion.toUpperCase().indexOf("MACINTOSH") >= 0) && (window.appVersion.indexOf("5.0") >= 0));
}
window.OPR = (window.opera != null) || false;
window.IE = (document.all && (!window.OPR)) || false;
window.IE55 = (window.IE && window.createPopup != null && document.createComment == null) || false;
window.MOZ = (window.outerWidth && !window.OPR && (window.navigator.product != null)) || false;
window.IE50 = (window.IE && (document.createTextNode != null) && (window.createPopup == null)) || false;
window.IE60 = (window.IE && document.createComment != null ) || false;
window.IE40 = (document.all && !window.IE50 && !window.IE55 && !window.IE60 && (window.opera == null)) || false;
window.MS = ( window.navigator.userAgent.toLowerCase().indexOf("windows") >= 0 ) || false ;
window.MAC = ( window.navigator.appVersion.toLowerCase().indexOf("mac") >= 0 ) || false ;
window.CSS1 = (document.compatMode != null)||false;
window.GDA = (( window.IE55 || window.IE50 || window.MOZ || window.IE60 ) && !window.MAC);
if (window.IE) {
	window.WIN98 = (window.navigator.userAgent.toLowerCase().indexOf("windows 98")>= 0);
}
if (window.attachEvent)
	window.attachEvent("onload",PageLoad);
else if (window.addEventListener)
	window.addEventListener ("load",PageLoad,false);
else
	window.onload = PageLoad;