/**
 * McKinley Header Init Script
 * init loader
 */

function GetWindowSize (w) {
	w = window;
	var width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
	var height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);
	return [width, height]
}

function resizeFlashBackground () {
	try {
		var size = GetWindowSize();
		$("backgroundFlash").setAttribute("width",size[0]);
		$("backgroundFlash").setAttribute("height",size[1]);
	}
	catch (e) {}
}
function resizePortalFlash() {
	try {
		if ($('portalteaser')) {
			
			var size = GetWindowSize();
			var sidehight = size [1];
			var newsize = false;

			if (sidehight < 700 ) {
				newsize = sidehight - 530;
			}
			else {
				newsize = 170;
			}
			if (newsize > 5 ) {
				$('portalteaser').setStyle({top: newsize + 'px'});
			}
			else {
				$('portalteaser').setStyle({top: '5px'});
			}
		}
	}
	catch (e) { }
}
function resizeCampaign () {
	try {
		if ($('campaign')) {

			var size = GetWindowSize();
			var sidehight = size [1];
			var newsize = false;

			if (sidehight < 740 ) {
				newsize = sidehight - 570;
			}
			else {
				newsize = 170;
			}
			if (newsize > 55 ) {
				$('campaign').setStyle({top: newsize + 'px'});
			}
			else {
				$('campaign').setStyle({top: '55px'});
			}
		}
	}
	catch (e) { }
}
