window.onload = function() {
    setMainImageSize();
}

window.onresize = function() {
    setMainImageSize();
}

var type = "";
if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP";
if (document.all) type="IE";
if (document.layers) type="NN";
if (!document.all && document.getElementById) type="MO";

function setMainImageSize() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
		 myWidth = window.innerWidth;
		 myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
	}
	
	var new_image_width = (myWidth - 0);
	var new_image_height = new_image_width * (1092/1500);
    
    var background = document.getElementById('background');
    
    
	if(new_image_height < myHeight) { 
			new_image_height = (myHeight-0);
			new_image_width = new_image_height * (1500/1092);
			var left = - (new_image_width - myWidth) / 2;
            background.style.left = left + "px";
            background.style.top = "0px";
	} else {
	   var top = - (new_image_height - myHeight) / 2;
        background.style.top = top + "px";
        background.style.left = "0px";
	}
	
	
	
	background.style.height = new_image_height + "px";
    background.style.width = new_image_width + "px";
	
	var container = document.getElementById('larger');
	
	container.style.height = (myHeight-00) + "px";
    container.style.width = (myWidth-00) + "px";

	//videoplayer.style.top = (((myHeight) / 2) - (new_image_height / 2 )) + "px";
	//videoplayer.style.left = left + "px";
	/*
	var countdown = document.getElementById('countdown');
	countdown.style.left = (left+20) + "px";
	
	var continuelink = document.getElementById('continue');
	continuelink.style.right = (right) + "px";
	
	var days = document.getElementById('days');
	days.style.right = (right) + "px";*/
}

function fieldFocus(element, text)
{
	if(text == element.value) {
		element.value = "";
	}
}
function fieldBlur(element, text)
{
	if("" == element.value) {
		element.value = text;
	}
}
