var forcedvdvar = "";

function closeVideo() {
 if ($('swfholder')) $('swfholder').dispose();
 if ($('blokvideo')) $('blokvideo').dispose();
 if ($('promodiv')) {
  $('promodiv').style.display="block";
  $('promodiv').style.height="300px";
  $('promodiv').morph('.bloksplash-empty');
 }
}

function dodvdhome(movieid) {
 closeVideo();
 if (forcedvdvar!="") movieid = forcedvdvar;
 pageRequest("film-content", "getdvdHome.php", movieid);
}

function dohome(movieid) {
// $('swfholder').innerHTML = "";
// $('blokvideo').innerHTML = "";
// $('promodiv').morph(".height","300px");


// if ($('swfholder')) $('swfholder').style.display="none";
// if ($('blokvideo')) $('blokvideo').style.display="none";

 closeVideo();
 pageRequest("film-content", "getHome.php", movieid);

}

function dovideo(movieid) {
 pageRequest("film-content", "getTrailers.php", movieid);
}

function dobios(bbid) {
 closeVideo();
 pageRequest("film-content", "getSteden.php", bbid);
}

function donieuws(filmid) {
 closeVideo();
 pageRequest("film-content", "getNieuws.php", filmid);
}

function getNieuwsItem(nieuwsid, filmid) {
 closeVideo();
 pageRequest("film-content", "getNieuwsItem.php", nieuwsid+"&back="+filmid);
}

function showPic(movieid) {
 closeVideo();
 pageRequest("film-content", "getFotos.php", movieid);
}

function dopersmap(filmid) {
 closeVideo();
 pageRequest("film-content", "persmap.php", filmid);
}

function dodvdpersmap(filmid) {
 closeVideo();
 pageRequest("film-content", "persmapdvd.php", filmid);
}

function dodvd(dvdcode) {
 closeVideo();
 if (forcedvdvar!="") dvdcode = forcedvdvar;
 pageRequest("film-content", "getDvd.php", dvdcode);
}

function dodvdplus(dvdcode) {
 closeVideo();
 forcedvdvar = dvdcode;
 pageRequest("dvdinfoblok", "getDvdInfoBlok.php", dvdcode);
 pageRequest("film-content", "getDvd.php", dvdcode);

 var my_vid_el = new Element ( 'div' , { 'id' : 'hdr'+dvdcode}) ;
 my_vid_el.injectBefore($('topnav'));
 pageRequest('hdr'+dvdcode, "getDvdHeader.php", dvdcode);
}

function getSteden(filmid) {
 closeVideo();
 pageRequest("film-content", "getSteden.php", filmid);
}


function getTheaters(filmid, stadid) {
 pageRequest("film-content", "getTheaters.php", filmid+"&stadid="+stadid);
}

function getTheaterDetails(filmid, theaterid) {
 pageRequest("film-content", "getTheaterDetails.php", filmid+"&theaterid="+theaterid);
 return false;
}

function detailsReserveer(r, theaterid, datum, tijd, filmid) {
 var myScript = new Asset.javascript('http://ras.belbios.nl/b2b/belbios.js.php?username=afilm', {
    id: 'myScript', 
    onload: function(){
        kaart(r, theaterid, datum, tijd, filmid);
    },
    onerror: function(){
        alert('Er kan geen verbinding met de Belbios server tot stand worden gebracht. Probeer te reserveren via www.belbios.nl of bel met 0900-9363.'); 
    }
 });
}


function createVideoSpace(wat) {
 $('promodiv').style.display="none";

 var my_vid_el = new Element ( 'div' , { 'id' : 'blokvideo', 'class' : 'blokvideo-details'}) ;
 my_vid_el.injectBefore($('promodiv'));


 my_vid_el = new Element ( 'div' , { 'id' : 'swfholder', 'class' : 'swfvideo', 'style':'margin-top:0;'}) ;
 my_vid_el.injectInside($('blokvideo'));

 my_vid_el = new Element ( 'div' , { 'id' : 'vidmenuholder', 'class' : 'splashmenuholder', 'style':'margin-top:0px'}) ;
 my_vid_el.injectInside($('blokvideo'));

 if ($('promomenu')) {
  if (maakMenu) {
   maakMenu('vidmenuholder');
  } else {
   $('vidmenuholder').innerHTML=$('promomenu').innerHTML;
  }
 }

 setTimeout("getTrailer("+wat+")", 300);
 return false;
}

function viewVideo(wat) {

scroll(0,0);

 if ($('promodiv')) {
  $('promodiv').morph('.blokvideo');
 }

// *  var my_vid_el = new Element ( 'div' , { 'class' : 'blokvideo'}) ;
// * my_vid_elb.injectAfter(my_vid_el);

// var my_vid_el = new Element ( 'div' , { 'id' : 'swfholder', 'class' : 'swfvideo'}) ;
// my_vid_el.injectBefore($('promodiv'));

 if (!$('swfholder')) {
  setTimeout("createVideoSpace("+wat+")", 1000);
 } else {
  setTimeout("getTrailer("+wat+")", 300);
 }
 return false;
}



function searchVids(dummy,letter) {
 pageRequest("videototaal", "lastTrailers.php", letter);
 return false;
}











/*
function noCache()
{
var now = new Date();
return now.getFullYear().toString() + ""+now.getDate().toString() + ""+now.getMonth().toString() + ""+now.getHours().toString() + ""+now.getMinutes().toString() + ""+now.getSeconds().toString();
}

function getSteden(filmid) {
 var veldnamen   = new Array("nocache", "filmid");
 var waarden     = new Array(noCache(), filmid);
 makeGetRequest('/belbios/getSteden.php', veldnamen, waarden, 'getStedenB');
}

function getStedenB(retStr) {
 var d = document.getElementById("belbios");
 d.innerHTML = retStr;
}


function getTheaters(filmid, stadid) {
 var veldnamen   = new Array("nocache", "filmid", "stadid");
 var waarden     = new Array(noCache(), filmid, stadid);
 makeGetRequest('/belbios/getTheaters.php', veldnamen, waarden, 'getTheatersB');
}

function getTheatersB(retStr) {
 var d = document.getElementById("belbios");
 d.innerHTML = retStr;
}

function getTheaterDetails(filmid, theaterid) {
 var veldnamen   = new Array("nocache", "filmid", "theaterid");
 var waarden     = new Array(noCache(), filmid, theaterid);
 makeGetRequest('/belbios/getTheaterDetails.php', veldnamen, waarden, 'getTheaterDetailsB');
}

function getTheaterDetailsB(retStr) {
 var d = document.getElementById("belbios");
 d.innerHTML = retStr;
 loadBelbios();
}
*/


function getTweetFilter(filmid, wat) {
 alert(wat);
 closeVideo();
 pageRequest("film-content", "getNieuws-NEW.php", filmid+"&amp;t="+wat);
}

