//**********************************
//**********************************
//** RevAlbertaEaton JavaScript   **
//**	  Author:  Bob Lange      **
//**      Date:  06/25/2005       **
//**     Modified:  11/08/2005    **
//**********************************
//**********************************

var sizes = new Array; //See setSizes()

var oldColor; //Used for MouseOver/MouseOut

//Page dimensions
var pageHeight;
var pageWidth;

//Page elements
var oBody;
var oMainDiv;
var oTopDiv;
var oMenuImg;
var oMenuDiv;
var oInfoDiv;
var oInnerDiv;
var oPicDiv;
var oBigPic;
var oBottomImg;

//Variables holding colors used on the site
//	All color changes will occur here
var bodyBackColor	= "#755179"; 
var mainBackColor	= "#EEEEEE"; 
var topBackColor	= "#EEEEEE"; 
var topTextColor	= "#754576"; 
var menuBackColor	= "#CCADCF"; 
var menuLinkColor	= "#EEEEEE"; 
var menuOverColor	= "";
var infoBackColor	= "#EEEEEE"; 
var infoTextColor	= "#333333"; 
var infoLinkColor	= "";
var infoRuleColor	= "#754576"; 
var infoOverColor	= "";

var i; 

//Set sizes array to keep everything in proportion based on browser height
function setSizes() {
	pageHeight = oBody.clientHeight; 
	pageWidth  = oBody.clientWidth;
}

function setElementAliases() {
	oBody		= document.getElementById("body");
	oMainDiv	= document.getElementById("mainDiv");
	oTopDiv		= document.getElementById("topDiv");
	oMenuImg	= document.getElementById("menuImg");
	oMenuDiv	= document.getElementById("menuDiv");
	oInfoDiv	= document.getElementById("infoDiv");
	oInnerDiv	= document.getElementById("innerDiv");
	oBigPic		= document.getElementById("bigPic");
	oBottomImg	= document.getElementById("bottomImg");
}

function setUpDivs() {
	oBody.style.backgroundColor = bodyBackColor;
	oBody.style.fontFamily		= "Georgia,'Times New Roman',serif";

	oMainDiv.style.width	= "540px";
	oMainDiv.style.height	= "539px";
	oMainDiv.style.left		= (pageWidth - 540)/2 + "px";
	oMainDiv.style.top		= (pageHeight * 0.03) + "px";
	oMainDiv.style.backgroundColor = mainBackColor;
	
	oTopDiv.style.width		= (stripPx(oMainDiv.style.width)-2) + "px";
	oTopDiv.style.height	= "27px"; 
	oTopDiv.style.left		= "1px";
	oTopDiv.style.top		= "1px";
	oTopDiv.style.backgroundColor = topBackColor;
	oTopDiv.style.color		= topTextColor;
	oTopDiv.style.fontFamily		= "'Times New Roman',serif";

	oMenuImg.style.position	= "absolute";
	oMenuImg.style.left		= "-30px";
	oMenuImg.style.top		= stripPx(oTopDiv.style.top) + stripPx(oTopDiv.style.height) + 1 + "px";

	oMenuDiv.style.width	= ( stripPx(oTopDiv.style.width) - 97 ) + "px"; 
	oMenuDiv.style.height	= oTopDiv.style.height;
	oMenuDiv.style.left		= ( stripPx(oTopDiv.style.width) - stripPx(oMenuDiv.style.width) -30 ) + "px";
	oMenuDiv.style.top		= stripPx(oTopDiv.style.top) + stripPx(oTopDiv.style.height) + 1 + "px";
	oMenuDiv.style.backgroundColor = menuBackColor;
	oMenuDiv.style.color	= menuLinkColor;
	try	{
		oMenuDiv.style.textAlign	= "right";
	} catch (Exception) {
		handleException();
	}
	oMenuDiv.style.fontFamily		= "'Times New Roman',serif";

	oInfoDiv.style.width	= ( stripPx(oMainDiv.style.width) - 10 ) + "px";
	oInfoDiv.style.height	= ( stripPx(oMainDiv.style.height) - ( stripPx(oTopDiv.style.height) + stripPx(oMenuDiv.style.height) ) - 10 ) + "px";
	oInfoDiv.style.left		= "5px";
	oInfoDiv.style.top		= ( stripPx(oMenuDiv.style.top) + stripPx(oMenuDiv.style.height) + 5) + "px";
	oInfoDiv.style.backgroundColor = infoBackColor;
	oInfoDiv.style.color	= infoTextColor;

	oInnerDiv.style.width	= ( stripPx(oInfoDiv.style.width) - 20 ) + "px";
	oInnerDiv.style.height	= ( stripPx(oInfoDiv.style.height) - 25 ) + "px";
	oInnerDiv.style.top		= "10px";
	oInnerDiv.style.left	= "10px";
	//oInnerDiv.style.fontSize = "18px";
	try	{
		oInnerDiv.style.textAlign = "justified";
	} catch (Exception)	{
		handleException();
	}
	
	oBottomImg.style.position	= "absolute";
	oBottomImg.style.top		= ( stripPx(oMainDiv.style.top) + stripPx(oMainDiv.style.height) - 11 ) + "px";
	oBottomImg.style.left		= ( stripPx(oMainDiv.style.left) + stripPx(oMainDiv.style.width) - 322 ) + "px";
	oBottomImg.style.zIndex		= 1;
}

function initGlobal() {
	setElementAliases();
	setSizes();
	setUpDivs();
	oBody.style.visibility = "visible";
}

function stripPx(withPx) {
	return Number(withPx.substring(0,withPx.length-2));
}

function menuOver(thisElement) {
	thisElement.style.backgroundColor = menuLinkColor;
	thisElement.style.color = menuBackColor;
}

function menuOut(thisElement) {
	thisElement.style.backgroundColor = menuBackColor;
	thisElement.style.color = menuLinkColor;
}

function showBigPic(imgUrl) {
	oBigPic.src = imgUrl;
	setTimeout("oBigPic.style.visibility = 'visible'",500);
}

function handleException() {
	//alert("textAlign error");
}