/* functies gids2  */
function actVstGids2(sessie,bestelcode,vst,rang,genre,elementid) {
  // wat is het aantal?
  //alert(elementid);
  var aantal = $F(elementid);
  //alert(elementid + ': ' + aantal);
  // code komt
  tmpUrl = 'actGids2.cfm?action=choose&sessie='+sessie+'&code='+bestelcode+'&vst='+vst+'&rang='+rang+'&genre='+genre+'&aantal='+aantal;
  req = new Ajax.Request(
  tmpUrl,
  {
    method: "post",
    parameters: tmpUrl,
    asynchronous: "true",
    onComplete: toonavail
  }
  );

  // werk de winkelmand bij
  idSubmitionTimer = setTimeout('showBasketShort(\''+sessie+'\');',500);
}

/* functies gids2  */
function removeVst(sessie,bestelcode,vst,rang,genre,aantal) {
  tmpUrl = 'actGids2.cfm?action=remove&sessie='+sessie+'&code='+bestelcode+'&vst='+vst+'&rang='+rang+'&genre='+genre+'&aantal='+aantal;
  req = new Ajax.Request(
  tmpUrl,
  {
    method: "post",
    parameters: tmpUrl,
    asynchronous: "true",
    onComplete: toonavail
  }
  );

  // werk de winkelmand bij
  idSubmitionTimer = setTimeout('showBasketShort(\''+sessie+'\');',500);
}

function toggleBestelcode(sessie,bestelcode,genre,elementid)
{
  //alert(serie);
  if ($(elementid).checked == true)
  { 
    selectBestelcode(sessie,bestelcode,genre); 
  }
  else
  { 
    /* check of deze bestelcode geselecteerd is: dan alert tonen, anders niet */
    reactie = confirm("Let op! U gaat deze voorstelling uit uw bestelling verwijderen. Weet u het zeker?");
    if (reactie  !=0)
    {
      unselectBestelcode(sessie,bestelcode,genre); 
    }
    else
    {
      $(elementid).checked = true;
    }
  }

  //alarmbel();
  // werk de winkelmand bij
  idSubmitionTimer = setTimeout('showBasketShort(\''+sessie+'\');',500);
}

function selectBestelcode(sessie,code,genre)
{
  tmpUrl = 'actGids2.cfm?action=select&sessie='+sessie+'&code='+code+'&g='+genre;
  req = new Ajax.Request(
  tmpUrl,
  {
    method: "post",
    parameters: tmpUrl,
    asynchronous: "true",
    onComplete: toonavail
  }
  );

  //checkAvailSeries(sessie,serie);
  /* open of sluit de voorstellingen div */
  meerInfo(code);
  //expandSerie('vstkeuze_'+code);

}

function unselectBestelcode(sessie,code,genre)
{
  tmpUrl = 'actGids2.cfm?action=unselect&sessie='+sessie+'&code='+code+'&g='+genre;
  req = new Ajax.Request(
  tmpUrl,
  {
    method: "post",
    parameters: tmpUrl,
    asynchronous: "true",
    onComplete: toonavail
  }
  );

  if ( $('checkbox_'+code) != null )
  { $('checkbox_'+code).checked = false; }

  /*
  if ( $('vstkeuze_'+code) != null )
  { Effect.BlindUp('vstkeuze_'+code,{duration: 0.4}); }

  var expanddiv = 'expand_'+code;
  if ( $(expanddiv) != null )
  { $(expanddiv).hide(); }
  */
  //alert($('longview_'+code));
  if ( $('longview_'+code) )
  {
    //alert(code);
    minderInfo(code);
  }
  //checkAvailSeries();
  //checkAvailSeries(sessie,serie);

  // werk de winkelmand bij
  idSubmitionTimer = setTimeout('showBasketShort(\''+sessie+'\');',500);
}


function activateButton(cookie,bestelcode,vst,rang,genre,element) {
  aantal = $F('aantal_'+vst+'_'+rang+'_form');
  if (aantal > 0) {
    $(element).update("<a href=\"javascript:actVstGids2('"+cookie+"','"+bestelcode+"','"+vst+"','"+rang+"','"+genre+"','aantal_"+vst+"_"+rang+"_form')\" title=\"Voeg toe aan bestelling\" class=\"btn_toevoegen float_left\"></a>");
  } else {
    alert("U moet het aantal personen kiezen");
  }
}

/* verwijderen voorstelling in overzicht_gids2.cfm */
function removeVstGids2(genre) {
  //location.href = 'removeVstGids2.cfm?sessie='+cookie+'&code='+bestelcode;  
  location.href = 'index.cfm?page=gids2&g='+genre;  
}

/* carrousel bannnrs*/
function bannerCarrousel() {
  jQuery('#bannerdiv').innerfade({ animationtype: 'fade', speed: 500, timeout: 10000, type: 'sequence', containerheight: '100px' }); 
}

function showKeuzevan(url) {
  parent.document.location.href = url;
}

