﻿
/* ------------------------------------------------------------------ */
/* --- Functies: onLoad --------------------------------------------- */
/* ------------------------------------------------------------------ */

$(document).ready(function() {
  // Lightbox activeren
  $(".lightbox").lightbox();

  if ($('#actueel_home_inner').length > 0) {
    /* Carousel op home activeren */
    var deinnerfade = $('#actueel_home_inner').innerfade({
      speed: 'slow',
      timeout: 10000,
      type: 'sequence',
      containerheight: '143px'
    },$("#actueel_home_volgende"),$("#actueel_home_vorige"));
  }
  
  if ($('#verhalencarousel_inner').length > 0) {
    /* Carousel op home activeren (oude versie) */
    var deinnerfade = $('#verhalencarousel_inner').innerfade({
      speed: 'slow',
      timeout: 10000,
      type: 'sequence',
      containerheight: '221px'
    });
  }

  // Veelgestelde vragen (faq) initialiseren (indien aanwezig)
  $("#faq .antwoord").css({ "position": "absolute", "left": "-9001px" });
  $("#faq .show").css({ "position": "absolute", "left": "0px" });


  //Flash banner
  $(".banner_flash .flash").flash(null, { version: 9 }, function(htmlOptions) {
    var $this = $(this);
    htmlOptions.src = "/upload/" + $(this).html();
    htmlOptions.width = 217;
    htmlOptions.height = 162;
    htmlOptions.allowFullscreen = 'true';
    htmlOptions.wmode = 'transparent';
    htmlOptions.allowScriptAccess = 'always';
    $(this).html('');
    $(this).prepend($.fn.flash.transform(htmlOptions));
  });
});


/* ------------------------------------------------------------------ */
/* --- Functies: Algemeen ------------------------------------------- */
/* ------------------------------------------------------------------ */

function ToggleDoorstuurformulier() {
  $('#doorsturen_outer').toggle();
}


/* ------------------------------------------------------------------ */
/* --- Functies: Veelgestelde Vragen (faq) -------------------------- */
/* ------------------------------------------------------------------ */

function toggleFaqAntwoord(object) {
  $(object).toggleClass("vraag_actief");
  if ($(object).next().css("position") == "absolute") {
    $(object).next().css("display", "none");
    $(object).next().css("position", "static");
  }
  $(object).next().slideToggle(200);
}
