function resizeImage() {
	bgImage = document.getElementById('Image').getElementsByTagName('img')[0];
	winHeight = document.body.clientHeight;
	winWidth = document.body.clientWidth;

	vImage = bgImage.width / bgImage.height;
	vWindow = winWidth / winHeight;

	if(vImage < vWindow) {
		bgImage.style.width = winWidth + 'px';
		bgImage.style.height = "";
	} else {
		bgImage.style.height = winHeight + 'px';
		bgImage.style.width = "";
	}
}

if (window.attachEvent){
	window.attachEvent("onload", resizeImage);
	window.attachEvent("onresize", resizeImage);
}

var ScrollTimer;

function initScroll() {
	clearTimeout(ScrollTimer);
	ScrollTimer = setTimeout(contentPosition, '10');

}

function contentPosition() {
	if($('ContentPosition')) {
		if(Browser.Engine.trident) {
			winHeight = document.body.clientHeight;
		} else {
			winHeight = window.innerHeight;
		}
		if((winHeight + 75) < $('ContentPosition').getHeight()) {
			$('ContentPosition').setStyles({
			    bottom: 'auto'
			});


		} else {
		   $('ContentPosition').setStyles({
			    bottom: 0
			});
		}
	}
}

if(Browser.Engine.trident) {
    window.attachEvent("onload", initScroll);
	window.attachEvent("onresize", initScroll);
} else {
	window.addEventListener("load", initScroll, false);
	window.addEventListener("resize", initScroll, false);
}
