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

  //var adtype = 'expwallpaper';



if (isdefined('adtype')){

    $(document).ready(function(){
        if (adtype == 'wallpaper'){
		    //sky neben leaderboard (oben bündig)
            $('.bei-wall-ausblenden').hide();
            $('#leaderboard').css({
                textAlign: 'right'
                });
            $('#skyscraper').css({
                marginTop: '-' + ($('#leaderboard').height() + 10) + 'px',
                textAlign: 'left'
                });

        }


        if (adtype == 'expwallpaper'){
		    //sky unter leaderboard rechtsbündig
            $('.bei-wall-ausblenden').hide();
            $('#leaderboard').css({
                paddingLeft: $('#skyscraper').width()+'px',
                textAlign: 'right'
                });
            $('#skyscraper').css({
                marginTop: '-10px',
                textAlign: 'left'
                });


        }

        if (adtype == 'expushape'){
            //um das layout leader über skys
            $('.bei-wall-ausblenden').hide();


            $('#page').css({
                marginLeft: 'auto',
                marginRight: 'auto'
                });

            $('#leaderboard').css({
                marginLeft: 'auto',
                marginRight: 'auto',
                textAlign: 'left',
                width: '1256px'
                });

            $('#right_side').css('left', '1013px');
            $('#skyscraper').css('margin-top', '-10px');

            $('#left_skyscraper').css({
                display: 'block',
                top: '-10px',
                right: '1013px'
                });

        }





        if (isdefined('bgcolor')){
              $('body').css('background', bgcolor);
              $('#header_bottom').css('background-color', '#f0f0f0');
              $('#stage').css('background-color', '#f0f0f0');

        }




        if (isdefined('adclick')){

            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;
                    }
                }
            });

        }
    });
}


