onload = function(){
	marginLeft();
	equalHeight();
	timer();
}

onresize = function(){
	marginLeft();
}

function marginLeft(){
	
// This auto centers the wrap div AND aligns it correctly with the background

	var mL = document.body.clientWidth;
	mL = mL-849;
	mL = mL/2;
	mL = Math.floor(mL);
	mL = mL/3;
	mL = Math.floor(mL);
	mL = mL*3;
	document.getElementById("wrap").style.marginLeft = mL + "px";
}

function equalHeight(){
	var bH = document.getElementById("content");
	var iH = document.getElementById("blue_bar");
	var rH = document.getElementById("rcol");
	
// This is to lengthen the body so that the footer is lined up with the background appropriately

	var xH = bH.offsetHeight;
	xH = xH/3;
	xH = Math.ceil(xH); //the next integer that is >= the answer
	xH = xH*3;
	xH = xH+21; //a margin space so all text is easily read at the bottom of the page (the number has to be divisible by 3)
	bH.style.height = xH + "px";
	
// This makes the "blue_bar" image and right column stretch to 100% of the body without any defined heights

	iH.offsetHeight >= bH.offsetHeight ? bH.style.height = iH.offsetHeight + "px" : iH.style.height = bH.offsetHeight + "px";
	rH.style.height = xH + "px";
}

function fillTitle(t){
	document.getElementById("title").value = t;
	document.title = document.title + " - " + t;
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=370,height=360');");
}

function timer(){
	var load_time=setTimeout("maskHide()",250); //This is the delay timer that allows the page to build itself before being seen.
}

function maskHide(){
	document.getElementById("mask").style.visibility="hidden";
}