$(function () {
  
  var tabContainers = $('div.infowrapper > div.tabContainer'); 
  
  $('ul.productTabs a').click(function () {
    tabContainers.hide().filter(this.hash).show();
    $('ul.productTabs li').removeClass('active');
    $(this.parentNode).addClass('active');
    return false;
  }).filter(':first').click().each(function(i) 
  { 
    //evt reageren actief maken omdat we het uit de request halen.   
    if ( location.hash == '' && i == 0 )
      $(this).click();
    else if ( $(this).attr('href') == location.hash )
      $(this).click();
  });
  //;
});


var baseImgUrl = '';
var arrImg = new Array();
var arrOmsch = new Array();
var curIndex = 0;


function volgende()
{
  curIndex++;
  if ( curIndex == arrImg.length )
    curIndex = 0;
  $('#afbeelding').attr('src', baseImgUrl + arrImg[curIndex]);
  $('#omschrijving').attr('innerHTML', arrOmsch[curIndex]);
  $('#huidigepagina').attr('innerHTML', curIndex+1);
}

function vorige()
{
  curIndex--;
  if ( curIndex < 0 )
    curIndex = arrImg.length-1;
  $('#afbeelding').attr('src', baseImgUrl + arrImg[curIndex]);
  $('#omschrijving').attr('innerHTML', arrOmsch[curIndex]);
  $('#huidigepagina').attr('innerHTML', curIndex+1);
}
