var sitefunctions = {
   // font resizer
	textresize : function(){
		$j("#paginafuncties").show(); // show text resizing links
      
		var $cookie_name = "JBZ-LetterFormaat";
      
      var bigFontSize = '0.9em';
      var smallFontSize = '0.8em';
      var defFontSize = '0.7em';

      var $getSize = $j.cookie($cookie_name);
		if($getSize) {			// if exists load saved value
			$j("#top,#footer").css({fontSize : $getSize }); 
		}
      // reset link - reset cookie
      //$j("#paginafuncties .FontSizeReset").bind("click", function() {
      //$j("#top,#footer").css("font-size", '');
      //$j.cookie($cookie_name, null,{path: '/'}); // reset cookie
      //sitefunctions.resetpage();
      //return false;
      //		});

 // text “+" link
      $j("#paginafuncties .FontSizeReset").bind("click", function() {
         $j("#top,#footer").css("font-size", smallFontSize);
         $j.cookie($cookie_name, smallFontSize,{path: '/'});
         sitefunctions.resetpage();
         return false;
      });


      // text “+" link
      $j("#paginafuncties .FontSizeInc").bind("click", function() {
         $j("#top,#footer").css("font-size", bigFontSize);
         $j.cookie($cookie_name, bigFontSize,{path: '/'});
         sitefunctions.resetpage();
         return false;
      });

      // text “-" link
      $j("#paginafuncties .FontSizeDec").bind("click", function() {
         $j("#top,#footer").css("font-size", defFontSize);
         $j.cookie($cookie_name, defFontSize,{path: '/'});
         sitefunctions.resetpage();
         return false;
      });
	},
   // functies die herhaald moeten worden na font-resizen
   resetpage : function(){
      // location.reload();  // refreshen om uitklapmenu te herpositioneren
   }
};

var $j = jQuery.noConflict();  
$j(document).ready(function(){

   // font resizer
   sitefunctions.textresize();	
   
   //zoekbox
   $j('#zoeken .field').attr('value','zoeken...').focus(function(){
      $j(this).css('color','#999999');
      if($j(this).attr('value')=='zoeken...'){$j(this).attr('value','')}
      }).blur(function(){
        if($j(this).attr('value')==''){$j(this).attr('value','zoeken...').attr('style','')} 
     });

   // .uitklap lijst
   $j('#zieook ol.klaplijst ol').hide().prev('a').toggle(function(){
      $j(this).parent().addClass('open').find('ol').animate({height:'show',opacity:'show'});
   },function(){
      $j(this).parent().removeClass('open').find('ol').slideUp();
   });
   $j('#zieook ol.klaplijst .open a.jaar').trigger('click');
   
   // jumpmenu
   $j('#kolomwrapper select.jumpmenu').change(function(){
      var url = $j('option:selected', this).attr('value')
      document.location = url;
   });

   // tabel met wisselende rijkleur (class=rijentabel)
   $j('table.rijentabel tr:odd').addClass('alt');
   // tabel met wisselende kolomkleur (class=kolommentabel)
   $j('table.kolommentabel tr').find('td:even').addClass('alt');
   
});
