 
  $(document).ready(function() {
    $('.cImages a').lightBox({txtImage:'Afbeelding',txtOf:'v/d'});
	
    $('.click_goto_a').click(function() {
      document.location = $(this).find('a:first').attr('href');
    });
    
    $('#input_zoeken').click(function() {
      if($(this).val() == $(this).attr('default_val') || $(this).val() == $(this).attr('error')) {
        $(this).val('');
        $(this).css('color', $(this).attr('textcolor'));
      }
    });
    
    $('#input_zoeken').blur(function() {
      if($(this).val() == '') {
        $(this).val($(this).attr('default_val'));
      }
    });
    
    $('#div_zoeken img').click(function() {
      if($('#input_zoeken').val() == '' || $('#input_zoeken').val() == $('#input_zoeken').attr('default_val')) {
        $('#input_zoeken').val($('#input_zoeken').attr('error'));
        $('#input_zoeken').css('color', '#FF0000');
      } else {
        $('#div_zoeken form').submit();
      }
    });
    
    var iHuidigNieuwsId = $('#table_footer_nieuws .div_kleine_foto_gradient:hidden').parents('.td_kleine_foto:first').attr('nieuws_id');
    
    // --- footer laatste nieuwsitems
    $('#table_footer_nieuws .td_kleine_foto').hover(function() {
      var iNieuwsId = $(this).attr('nieuws_id');
      
      if(iNieuwsId == iHuidigNieuwsId) {
        return false;
      } else {
        iHuidigNieuwsId = iNieuwsId;
        $('#table_footer_nieuws .div_kleine_foto_gradient:animated').stop().fadeTo('slow', 0.5, function() {});
        $('#table_footer_nieuws .div_nieuws_tekst:animated').stop().fadeTo('slow', 0.5, function() {});
        $('#table_footer_nieuws .img_groot_nieuws:animated').stop().fadeTo('slow', 1, function() {});
      }
      
      // grote foto
      $('#table_footer_nieuws .img_groot_nieuws:visible').fadeOut();
      $('#table_footer_nieuws #img_nieuws_id_'+iNieuwsId).fadeTo('slow', 1, function() {});
      
      // gradient
      $('#table_footer_nieuws .div_kleine_foto_gradient').show();
      $(this).children().find('.div_kleine_foto_gradient').hide();
      
      // teksten
      $('#table_footer_nieuws .div_nieuws_tekst:visible').hide();
      $('#table_footer_nieuws #div_nieuwstekst_id_'+iNieuwsId).fadeIn();
    });
    
    // --- footer fotoimpressie
    $('#table_footer_fotoimpressie td').hover(function() {
      if($(this).children().find('.div_fotoimpressie_gradient').is(':hidden')) {
        return false;
      }
      
      $('#table_footer_fotoimpressie .div_fotoimpressie_gradient').show();
      
      $(this).children().find('.div_fotoimpressie_gradient:first').hide();
    }, function() {
      $('#table_footer_fotoimpressie .div_fotoimpressie_gradient:hidden').show();
    });
    
    // footer fotoalbums
    $('#table_footer_albums .td_album_naam').hover(function() {
      $(this).addClass('td_album_naam_hover');
      $.post('/ajax/getAlbumDescription.php', {aid: $(this).attr('aid')}, function(data) {
        document.getElementById('div_album_titeltekst').innerHTML=data;
      });
    }, function() {
      $(this).removeClass('td_album_naam_hover');
    });
    
    $('#table_footer_albums .td_album_foto').hover(function() {
      $(this).next().addClass('td_album_naam_hover');
      $.post('/ajax/getAlbumDescription.php', {aid: $(this).attr('aid')}, function(data) {
        document.getElementById('div_album_titeltekst').innerHTML=data;
      });
    }, function() {
      $(this).next().removeClass('td_album_naam_hover');
    });
    
  });
