// JavaScript Document

function getDocumentHeight() {
	var h;
	h = document.documentElement.clientHeight || window.height;
	return h;
}
function getDocumentWidth() {
	var w;
	w = document.documentElement.clientWidth || window.width;
	return w;
}

function setElemToBottom(elementID,botMargin,itemHeight,w,d) {
	var w = w || window;
	var d = d || document;
	var b = d.body;
	var x = d.getElementById(elementID);
	var itemHeight = itemHeight || x.offsetHeight;
	var windowHeight = getDocumentHeight();
	
	var newY = windowHeight - itemHeight;
	var yOffset = w.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
	newY += yOffset;
	var botMargin = botMargin || 0;
	newY -= botMargin;
	x.style.margin = newY + "px 0px 0px 0px";
	//x.style.top = newY + "px";
}
function preloadImage(imgId,overImage) {
	var x = document.getElementById(imgId);
	var img = new Image();
	img.src = overImage;
	x.overImage = img;
	var img = new Image();
	img.src = x.src;
	x.upImage = img;
	x.onmouseover = rollOverImage;
	x.onmouseout = rollOutImage;
}
function rollOverImage() {
	var x = this;
	x.src = x.overImage.src;
}
function rollOutImage() {
	var x = this;
	x.src = x.upImage.src;
}

