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

var adtype = 'wallpaper';
//var adtype = 'expwallpaper';

if (isdefined('adtype')){
    // skyscraper rechts am leaderboard (standard)
    if (adtype == 'wallpaper'){
        $('#leaderboard').css('text-align', 'right');
        $('#skyscraper').css('margin-top', '-'+$('#leaderboard').height()+'px');
        $('#skyscraper').css('margin-left', '0px');
    }
    // skyscraper unter dem leaderboard
    if (adtype == 'expwallpaper'){
        $('#leaderboard').css('text-align', 'right');
        $('#leaderboard').css('margin-left',$('#skyscraper').width()+'px');
        $('#skyscraper').css('margin', '0px')
    }




    if (adtype == 'wallpaper' || adtype == 'expwallpaper'){
        if (isdefined('bgcolor')){
            document.body.style.cssText = 'background-color:' + 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;
                });

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

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

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

