	$(document).ready(function() {
		
		if($("#leaderboard").height() < 30) {
			$("#promo-top").hide();
		}
		
		$('#recent-items').cycle({
			fx:    'scrollHorz',
			speed:  1600,
			pause:   1,
			timeout:       6000,
			next:   '#cycle-next', 
			prev:   '#cycle-prev'	
		});
	

		$("#s").focus(function () { 
			if ($(this).val() == 'Trefwoord') $(this).val('');	
		});
		$("#menu .inner").clone().prependTo("#footer-navigation .inner");

		
      function addMega(){

		 $(this).addClass("hovering");
		 $(this).children().children("#menu div.mega-container-content").dropShadow().bgiframe();
		// $(this).children(".mega-container-content").dropShadow();
		 //$(".mega-container-content").dropShadow();
        }

      function removeMega(){
		 $(this).children().children("#menu div.mega-container-content").removeShadow();		  
		$(this).removeClass("hovering");


        }
	
		var megaConfig = {
			 interval: 100,
			 sensitivity: 4,
			 over: addMega,
			 timeout: 500,
			 out: removeMega
		};
	
		$("#menu li.mega").hoverIntent(megaConfig)

  $("#comment-form").submit(function(){
  	if ($("#fldComment").val().indexOf("www.") >= 0 || $("#fldComment").val().indexOf("http") >= 0  ){
		alert('In uw reactie mag u helaas ivm misbruik geen website adressen gebruiken');
		return false;	
	}	
  });
 
  $("#btnPrint a").click(function(){
  	window.print();
	return false;	
  });
    // add a "rel" attrib if Opera 7+   
    if(window.opera) {   
        if ($("#btnBookmark a").attr("rel") != ""){ // don't overwrite the rel attrib if already set   
            $("#btnBookmark a").attr("rel","sidebar");   
        }   
    }   
  
    $("#btnBookmark a").click(function(event){   
        event.preventDefault(); // prevent the anchor tag from sending the user off to the link   
        var url = this.href;   
        var title = this.title;   
  
        if (window.sidebar) { // Mozilla Firefox Bookmark   
            window.sidebar.addPanel(title, url,"");   
        } else if( window.external ) { // IE Favorite   
            window.external.AddFavorite( url, title);   
        } else if(window.opera) { // Opera 7+   
            return false; // do nothing - the rel="sidebar" should do the trick   
        } else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)   
             alert('Unfortunately, this browser does not support the requested action,'  
             + ' please bookmark this page manually.');   
        }   
  
    });   
 
 			var onMouseOutOpacity = 0.50;
			$('#thumbs-adv ul.thumbs li').css('opacity', onMouseOutOpacity)
				.hover(
					function () {
						$(this).not('.selected').fadeTo('fast', 1.0);
					}, 
					function () {
						$(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
					}
				);
				// Initialize Advanced Galleriffic Gallery
				var galleryAdv = $('#gallery-adv').galleriffic('#thumbs-adv', {
					delay:                  4800,
					numThumbs:              7,
					preloadAhead:           8,
					enableTopPager:         false,
					enableBottomPager:      true,
					imageContainerSel:      '#slideshow-adv',
					controlsContainerSel:   '#controls-adv',
					captionContainerSel:    '#caption-adv',
					loadingContainerSel:    '#loading-adv',
					renderSSControls:       true,
					renderNavControls:      true,
					playLinkText:           '<img src="/images/controlbl_play.png" alt="Afspelen"/>',
					pauseLinkText:          '<img src="/images/controlbl_pause.png" alt="Pauseren"/>',
					prevLinkText:           '<img src="/images/controlbl_prev.png" alt="Vorige"/>',
					nextLinkText:           '<img src="/images/controlbl_next.png" alt="Volgende"/>',
					nextPageLinkText:       '| Volgende 7 &rsaquo;',
					prevPageLinkText:       '&lsaquo; Vorige 7 |',
					enableHistory:          true,
					autoStart:              false,
					onChange:               function(prevIndex, nextIndex) {
						$('#thumbs-adv ul.thumbs').children()
							.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
							.eq(nextIndex).fadeTo('fast', 1.0);
					},
					onTransitionOut:        function(callback) {
						$('#slideshow-adv, #caption-adv').fadeOut('fast', callback);
					},
					onTransitionIn:         function() {
						$('#slideshow-adv, #caption-adv').fadeIn('fast');
					},
					onPageTransitionOut:    function(callback) {
						$('#thumbs-adv ul.thumbs').fadeOut('fast', callback);
					},
					onPageTransitionIn:     function() {
						$('#thumbs-adv ul.thumbs').fadeIn('fast');
					}
				});

 
 
  // Reset Font Size
  var originalFontSize = $('.article').css('font-size');
  $(".resetFont").click(function(){
  $('html').css('font-size', originalFontSize);
  });
  // Increase Font Size
  $(".increaseFont").click(function(){
  	var currentFontSize = $('.article').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.2;
	if (newFontSize < 26 ){
		$('.article').css('font-size', newFontSize);
		$('.article').css('line-height', 1.5);	
		$('img.decreaseFont').attr('src','/images/icon-text-size-down.gif');
	} else{
		this.src = '/images/icon-text-size-up-inactive.gif';		
	}
	return false;
  });
  // Decrease Font Size
  $(".decreaseFont").click(function(){
  	var currentFontSize = $('.article').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum/1.2;	
	if (newFontSize > 6 ){
		$('.article').css('font-size', newFontSize);
		$('.article').css('line-height',1.5);	
		$('img.increaseFont').attr('src','/images/icon-text-size-up.gif');
	} else{
		this.src = '/images/icon-text-size-down-inactive.gif';
	}
	return false;
  });
      
    });

	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-1831675-28']);  
	_gaq.push(['_trackPageview']);  
	(function() {    
			  var ga = document.createElement('script'); 
			  ga.type = 'text/javascript'; 
			  ga.async = true;    
			  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';    
			  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);  
	})();

	var ord = Math.random()*10000000000000000;