var onLoadArray = new Array();
var scrollInterval;
window.onload=function(){
	var Index;
	for(Index in onLoadArray){ onLoadArray[Index](); };
}

function $(id){
	if(document.getElementById(id)){ return document.getElementById(id); }else{ return false;}
}

function setMouseDown(){
	if($("contMenu")){
		var tags = $("contMenu").getElementsByTagName("a");
		for(ii=0;ii<tags.length;ii++){	tags[ii].onmousedown = function(){ return false; } }
	}
}
function on(obj){ obj.style.display = "block"; }
function off(obj){ obj.style.display = "none"; }

function setFooterText(text,thisObj){
	$("imgFootVarText").src= "/resources/img/footMenu/"+text+".gif";
	on($("imgFootVarText"));
	
	thisObj.onmouseout=function(){
		off($("imgFootVarText"));
	}
}
function upFuncText(){
	$("textScroll").scrollTop = $("textScroll").scrollTop-1;
}
function downFuncText(){
	$("textScroll").scrollTop = $("textScroll").scrollTop+1;
}

function clearScrollInterval(){
	clearInterval(scrollInterval);
}

function upText(speed){
	scrollInterval=setInterval("upFuncText();",speed);
}
function downText(speed){
	scrollInterval=setInterval(downFuncText,speed);
}




function loadContent(ID,URL,func) {
	var req = false;
	if(window.XMLHttpRequest && !(window.ActiveXObject)) {	req = new XMLHttpRequest(); 	}
	if(window.ActiveXObject && window.XMLHttpRequest) {		req = new ActiveXObject("Msxml2.XMLHTTP");	}
	if(window.ActiveXObject && !(window.XMLHttpRequest)){	req = new ActiveXObject("Microsoft.XMLHTTP");  }

	if(req) {
		req.open("GET", URL, true);
		req.onreadystatechange = function(){
			if(req.readyState==4){
					if(func){
						func(req);
					}else{
						if($(ID))
						$(ID).innerHTML=req.responseText;
					}
			}
		}
		req.send(null);
	}else{
		alert("AJAX not Supported");
	}
}

function chargeHeader(){
	Math.randomize;
	loadContent("contHeader","/resources/pieces/header.htm?"+Math.floor(Math.random()*100000))
}
function chargeFootMenu(){
	loadContent("contOptions","/resources/pieces/footMenu.htm?"+Math.floor(Math.random()*100000))
}

onLoadArray.push(setMouseDown);
onLoadArray.push(chargeHeader);
onLoadArray.push(chargeFootMenu);