function getSize() {
	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;
	}
	return [ myWidth, myHeight ];
}

// TOGGLE ON/OFF
var ad;
ad = false;

// INSERT FLYOVERS OR BANNERS
var cookie;
var	cookieTxt;
var movieWidth;
var movieHeight;
var movieX;
var movieY;
var whatAd = new Array('vodafone_1600x792');
var whatLink = new Array('http://clk.atdmt.com/M1G/go/slkmgfor0770000074m1g/direct/01/');
var whatCounter = new Array('');
 
function flyover(which,number) {
	if (which == 'videoStop') {
		document.getElementById('flyoverBox').innerHTML='';
	}
	else if (which != '') {
		if(document.getElementById('flyoverBox')) {
			document.getElementById('flyoverBox').innerHTML=whatCounter[number]+'<div id="'+which+'" style="background-image: url(/cms/fileadmin/user_upload/vodafone-ad.gif); background-position: center center; background-repeat: no-repeat; position:absolute;left:0px;top:0px;width:'+getWindowWidth()+'px;height:'+getWindowHeight()+'px;z-index:101;"><div style="position:absolute;right:10px;top:10px;text-align:right;display:block;margin-bottom:1px;"><span style="padding:1px 2px 1px 2px;cursor:pointer;background-color:#000;color:#FFFFFF;" onmouseover="this.style.backgroundColor=\'#fff\';this.style.color=\'#000000\';" onmouseout="this.style.backgroundColor=\'#000\';this.style.color=\'#FFFFFF\';" onclick="flyover(\'videoStop\');">CLOSE AD</span></div><a href="http://www.vodafone-htc-magic.de" target="_blank" style="width: 100%; height: 100%; display: block;">&nbsp;</div>';
		}
	}
}

function linkOut(whichone) {
	document.getElementById(whichone).innerHTML='';
	document.getElementById(whichone).style.display='none';
}

function readCookie() {
	cookieTxt = document.cookie.slice(document.cookie.indexOf('"')+1,document.cookie.length-1);
	cookie = cookieTxt.split(',');
}

function checkCookie() {
	if(ad==true) {
		readCookie();
		movieWidth = whatAd[0].slice(whatAd[0].lastIndexOf('_')+1,whatAd[0].lastIndexOf('x'));
		movieHeight = whatAd[0].slice(whatAd[0].lastIndexOf('x')+1,whatAd[0].length);
		if (!document.cookie || document.cookie.indexOf(whatAd[0])==-1) {
			document.cookie = 'flyover="'+whatAd[0]+'"';
			movieX = (getWindowWidth()-movieWidth)/2;
			movieY = (getWindowHeight()-movieHeight)/2;
			flyover(whatAd[0],0);
		}
	}
}
window.onload=checkCookie;