// JavaScript Document

function fillWindow(targetID) {
	
	//1280x1024
	
	var target = document.getElementById(targetID);
	var originalHeight = 989;
	var originalWidth = 1521;
	
	var w = 0;
	var h = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	
	var newWidth = w;
	var newHeight = Math.round(originalHeight*(w/originalWidth));
	if (newHeight < h) {
		newHeight = h;
		newWidth = Math.round(originalWidth*(h/originalHeight));
	}
	
	target.height = newHeight;
	target.style.left = Math.round((w/2) - (newWidth/2))+"px";
	target.style.top = Math.round((h/2) - (newHeight/2))+"px";
	
}
