

var topLichtkrant = new Array();
var topLichtkrantIterator = -1;

/* het vullen gebeurt in de template i.v.m. php aanroep */

$(document).ready(function(){
    changeTopLichtkrant();
    
    if ( typeof( windowTimout ) != "undefined") {
        if(windowTimout !== 0){
            setTimeout(function(){ $("#notification_window").fadeOut(); },windowTimout*1000);
        } 
    }
       
});


function changeTopLichtkrant(){
    $("#LichtKrantTop").fadeOut(function(){
        $("#LichtKrantTop").html(topLichtkrant[topLichtkrantIterator]);
        $("#LichtKrantTop").fadeIn();
    });

    topLichtkrantIterator++;
    if(topLichtkrantIterator >= topLichtkrant.length) topLichtkrantIterator = 0;

    setTimeout("changeTopLichtkrant()",6000);
    
    $("#movie_title a.movie_title").click(function(){
        $("#movie_container").hide();
        $("#movie_naw").hide();
        $("#movie_window iframe").attr("src",$(this).attr("href")).show();

        return false;
    });
    
    
}


/* MOVIE */
function loadUrl(id,url){
    closeMovie();
    /*$.get("/objecten/banners/&/view/"+id,'',function(){*/
        $("#movie_title a.movie_title").html("");
        $("#movie_window iframe").show().attr("src",url);
        $("#movie_container").hide();
        $("#movie_naw").hide();
        $("#movie_window").fadeIn();
    /*});*/
}
function loadBanner(id,url,title,href,naw){
    $("#movie_window").fadeIn("medium",function(){
        closeMovie();
        swfobject.embedSWF("/js/mediaplayer/player.swf", "movieReplacer", "800", "400", "9.0.0", "/js/expressInstall.swf", new Array(), {'flashvars':'file='+url+'&autostart=true'}, new Array() );
    }).show();
    $("#movie_title a.movie_title").attr("href",href).html("Klik hier voor de website van deze adverteeerder: "+title);

    $.get("/objecten/banners/&/view/"+id);
    $("#movie_window iframe").hide();
    $("#movie_container").show();
    $("#movie_naw").html(naw).show();
    $("#movie_window").fadeIn();
}

function closeMovie(){
    $('#movie_container').html('<span id=movieReplacer></span>');
}
