if (true) { //2011-11-30: all wallpapers are suppressed for now 
    //var adURL = 'http://www.billedbladet.dk/julekalender.aspx';
    //var backgroundImage = '/images/wallpaper_julekalender.jpg';
	
	var adURL = 'http://ad1.emediate.dk/eas/cu=11427::camp=249969::no=225994::kw=link1-225994::cat2=BBL_forside::EASLink=http://www.krydsbox.dk/?partnerId=BilledBladet';
    var backgroundImage = '/images/wallpaper_krydsbox_final.jpg';
	
	
    document.body.style.backgroundColor = '#c1c1c1';
    document.body.style.backgroundImage = 'url(' + backgroundImage + ')';
    document.body.style.backgroundPosition = 'top center';
    document.body.style.backgroundRepeat = 'no-repeat';
	
	WallpaperSetup("master", adURL);
}
else if ((document.URL.toLowerCase().indexOf('/kendte/') > -1) || (document.URL.toLowerCase().indexOf('/kendte.aspx') > -1) || (document.URL.toLowerCase().indexOf('/kongelige/') > -1) || (document.URL.toLowerCase().indexOf('/kongelige.aspx') > -1))
{
    var adURL = 'http://shop.billedbladet.dk/?profile=Billedbladet';
    var backgroundImage = 'http://www.billedbladet.dk/~/media/BilledBladet/wallpaper/BBshopWallpaper1600x1500.ashx';
    
    document.body.style.backgroundColor = '#fff';
    document.body.style.backgroundImage = 'url(' + backgroundImage + ')';
    document.body.style.backgroundPosition = 'top center';
    document.body.style.backgroundRepeat = 'no-repeat';

    WallpaperSetup("master", adURL);
}
else if ((document.URL.toLowerCase().indexOf('/barnaby/') > -1) || (document.URL.toLowerCase().indexOf('/barnaby.aspx') > -1))
{
    var adURL = 'http://www.billedbladet.dk/Barnaby.aspx';
    var backgroundImage = 'http://www.billedbladet.dk/~/media/BilledBladet/wallpaper/Barbaby2wallpaperudkast2.ashx';
    
    document.body.style.backgroundColor = '#fff';
    document.body.style.backgroundImage = 'url(' + backgroundImage + ')';
    document.body.style.backgroundPosition = 'top center';
    document.body.style.backgroundRepeat = 'no-repeat';

    WallpaperSetup("master", adURL);
}

//===========================================================================================
//    Aller Common Wallpaper v2 - Two column edition
//===========================================================================================

var onResizeCounter = 0;

function WallpaperSetup(contentDiv, adURL)
{
    addLoadEvent(initializeClickTags, contentDiv, adURL);
    window.onresize=function(){ initializeClickTags(contentDiv, adURL);}
}

function initializeClickTags(contentDiv, adURL)
{
    generateClickTags(contentDiv, adURL)
}

function generateClickTags(contentDiv, adURL)
{
    // Setup general values
    var myContentDiv = document.getElementById(contentDiv);
    var ContentWidth = myContentDiv.offsetWidth;
    var AdWidth = (document.documentElement.clientWidth - ContentWidth) / 2;
    var RightAdLeft = ContentWidth + AdWidth;
    var ContentHeight = myContentDiv.offsetHeight;

	//var openInParentScript = "$(this).click(function() {window.location = '" + adURL + "'; return false; });";
	//var openInParentScript = "window.location = '" + adURL + "'; return false;";
	
    // Generate left column DIV
    var myLeftDiv = document.getElementById('divAdClickLeft');
    myLeftDiv.style.position = 'absolute';
    myLeftDiv.style.left = '0px';
    myLeftDiv.style.top = '0px';
    myLeftDiv.style.zIndex = '10000';
    myLeftDiv.innerHTML = "<a href=" + adURL + " target=\"_blank\"><img src=\"~/media/AllerGlobal/transparent.ashx\" width=" + AdWidth + " height=" + ContentHeight + " border=0></a>";

    // Generate right column DIV
    var myRightDiv = document.getElementById('divAdClickRight');
    myRightDiv.style.position = 'absolute';
    myRightDiv.style.left = RightAdLeft + 'px';
    myRightDiv.style.top = '0px';
    myRightDiv.style.zIndex = '10000';
    myRightDiv.innerHTML = "<a href=" + adURL + " target=\"_blank\"><img src=\"~/media/AllerGlobal/transparent.ashx\" width=" + AdWidth + " height=" + ContentHeight + " border=0></a>";

    // To be sure the wallpaper gets shown, remove possible wallpaper from main form
    document.forms[0].style.background = "none";

    // Remove existing wallpaper from <HTML> tag, if it can be found with the id "html"
    var myHTML = document.getElementById('html');
    if (myHTML != null)
    {
        myHTML.style.background = "none";
    }
//alert("myLeftDiv.style.left: " + myLeftDiv.style.left);
//alert("myRightDiv.style.left: " + myRightDiv.style.left);
//alert(adURL);
}

function addLoadEvent(func, parameter, parameter2)
{
	var oldonload = window.onload;
	if(typeof window.onload != 'function')
	{
		window.onload = function()
		{
		    func(parameter, parameter2);
	    }
	}
	else
	{
		window.onload = function()
		{
			oldonload();
			func(parameter, parameter2);
		}
	}
}

