
isdefined = function(variable){
    return this[variable] === undefined ? false : true;
}




if (isdefined('adtype')){


    var leaderboard       = document.getElementById('leaderboard');
    var leaderboard_inner = document.getElementById('leaderboard_inner');
    var page_body         = document.getElementById('page_body');
    var skyscraper         = document.getElementById('skyscraper');


    $(document).ready(function(){
        if (adtype == 'wallpaper'){
		    //sky neben leaderboard (oben bündig)
            leaderboard.style.marginBottom = '0px';
            leaderboard_inner.style.textAlign = 'right';
            page_body.style.background = 'none';
            skyscraper.style.margin = '0px 0px 10px 0px'; 
            $('.bei-wall-ausblenden').hide();  
        }


        if (adtype == 'expwallpaper'){
		    //sky unter leaderboard rechtsbündig
            leaderboard.style.marginBottom = '10px';
            leaderboard.style.paddingLeft = $('#skyscraper').width()+'px';    
            leaderboard_inner.style.textAlign = 'right';
            page_body.style.background = 'none';
            skyscraper.style.margin = $('#leaderboard').height()+'px 0px 10px 0px';
            $('.bei-wall-ausblenden').hide();
            skyscraper.style.textAlign = 'right';
        }


        if (isdefined('bgcolor')){
            leaderboard.style.backgroundColor = bgcolor;
            page_body.style.background = 'none';
            page_body.style.background = bgcolor;
        }

    }); 


    if (isdefined('adclick')){
        $(document).ready(function(){
            var n       = 0;
            var pointer = true;

            $('html, body').mouseover(function()
            {
                if (pointer)
                {
                    $(this).css('cursor','pointer');
                }
                pointer = true;
            });

            $('#leaderboard, #page, #skyscraper').mouseover(function()
            {
                $('body').css('cursor', 'default');
                pointer = false;
            });

            $('*').click(function()
            {
                n++;

                if (n == 1 && ($(this).parent().is('html') || $(this).is('html') || $(this).is('#page_body')))
                {
                    window.open(adclick);
                }
                else
                {
                    if ($(this).is('html'))
                    {
                        n = 0;
                    }
                }
            });
        });
    }
}

