window.onload = function () {
	var body_ad = document.getElementsByTagName("body")[0];
	//var body_ad = $("body");
	//var ad_url = $(".fullpage_takeover").attr("rel");
	var ad_url = document.getElementById("fullpage_takeover").getAttribute("rel");
	if( body_ad && ad_url) {
		body_ad.onclick = function(e){
			//alert(e.target.id);
			
			var targ;
			if (!e) var e = window.event;
			if (e.target) targ = e.target;
			else if (e.srcElement) targ = e.srcElement;
			
			if (targ.nodeType == 3) // defeat Safari bug
			{
				targ = targ.parentNode;
			}
			if( targ.id == "mainPage" || targ.id == "wrapper" || targ.id == "home" || targ.id == "header_full" )
			{
				//document.location = ad_url;
				var newWindow = window.open(ad_url, '_blank');
				newWindow.focus();
				return false;
			}
			else if( targ == document.body ) 
			{
				var newWindow = window.open(ad_url, '_blank');
				newWindow.focus();
				return false;
			}
			else {
				return true;
			}


		
		};
	}
};
