﻿
/* ---------------------------------------------------------------------------------- */
/* ----- Functies: onLoad ----------------------------------------------------------- */
/* ---------------------------------------------------------------------------------- */

$(document).ready(function() {
  $('#mycarousel').jcarousel({
    scroll: 2,
    auto: 10,
    wrap: 'last'
  });
  
  // Initialiseren Formulier validatie
  if ($("div.regel-button").length > 0) {
    formtest = $().formtest($("div.regel-button a"));
  }
  
  // Lightbox activeren
  if ($("a[rel*='lightbox']").length > 0) {
    $("a[rel*='lightbox']").lightbox();
  }
});

/* ---------------------------------------------------------------------------------- */
/* ----- Functies: Algemeen --------------------------------------------------------- */
/* ---------------------------------------------------------------------------------- */

// Default-tekst in tekstveld verbergen onFocus
function textFieldFocus(object, defaultValue) {
  if (object.value == defaultValue) {
    object.value = "";
  }
}

// Default-tekst in tekstveld herstellen onBlur
function textFieldBlur(object, defaultValue) {
  if (object.value == "") {
    object.value = defaultValue;
  }
}

// Zoekfunctie.
function zoek(strDefaultvalue){
  //var inpZoek = $('header-search input');
  var strZoek = $('#header-search input').val();
  if(strZoek.length>0 && strZoek != strDefaultvalue){
    strZoek = escape(strZoek);
    strZoek = strZoek.replace(/ /g,'+').replace(/\%20/g,'+');
    document.location.href = '/pages/zoeken.aspx?z='+strZoek;
  }
}
