


// simple preload function
function preload(sPath) {
	var o = new Image();
	o.src = sPath;
	return o;
}


// handle rollovers
function mOver(Image) {
	if(Image) {
		if(Image.src.indexOf("_o") == -1) {
   			Image.src = Image.src.replace(".jpg", "_o.jpg");
	    }
	 }
	 
	 if(lastImage) {
		lastImage.src = lastImage.src.replace("_o.jpg", ".jpg");
		}	
	lastImage = Image;
}

function mOverGif(Image) {
	if(Image) {
		if(Image.src.indexOf("_o") == -1) {
   			Image.src = Image.src.replace(".gif", "_o.gif");
	    }
	 }
	 
	 if(lastImage) {
		lastImage.src = lastImage.src.replace("_o.gif", ".gif");
		}	
	lastImage = Image;
}

var lastImage;

function getWindowHeight() 
{
	var windowHeight=0;
	if (typeof(window.innerHeight)=='number') 
	{
		windowHeight=window.innerHeight;
	}
	else 
	{
		if (document.documentElement&& document.documentElement.clientHeight) 
		{
			windowHeight = document.documentElement.clientHeight;
		}
		else 
		{
			if (document.body&&document.body.clientHeight) 
			{
				windowHeight = document.body.clientHeight;
			}
		}
	}
	
	return windowHeight;
}

// determine height for <div> element 
function getDivSize(DivID) {
	var d;
	d = document.getElementById(DivID);
	var divHeight = 0;
	
	if(d.offsetHeight)
		{ 
		 divHeight=d.offsetHeight; 
		} 
		else if(d.style.pixelHeight)
		{ 
		 divHeight=d.style.pixelHeight; 
		} 

		
	return divHeight;
	
}



function RecalculateHeight()
{
    var maxHeight = 164;

	var maxHeight = Math.max(maxHeight, getDivSize("ContentDiv") + getDivSize("FooterDiv"));
	var maxHeight = Math.max(maxHeight, getWindowHeight());
	
	document.getElementById("ContainerDiv").style.height = (maxHeight - getDivSize("FooterDiv")) + "px";
	
	document.getElementById("FooterDiv").style.bottom = "";
	document.getElementById("FooterDiv").style.top = (maxHeight - getDivSize("FooterDiv")) + "px";
	document.getElementById("FooterDiv").style.visibility = "visible";

    //var oContentDiv = document.getElementById("ContentDiv");
    //oContentDiv.style.visibility = "visible";


}

function externalLinks() {
	if (!document.getElementsByTagName) {
		return;
	}
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
	}
}
