// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function OpenPopup(sPicURL)
{    window.open("http://www.ggweb.nl/popup.php?"+sPicURL, "Vergroting", "resizable=0,HEIGHT=220,WIDTH=220");
} 
function changeImage(Obj)
{
	if( document.getElementById('big') ) 
	{
		document.getElementById('big').src = Obj.src;
	}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

jQuery(document).ready(function($){

	if($('#gallery').length>0){
	   	$('#gallery').nivoSlider({
	        effect:'fold,sliceDownLeft', // Specify sets like: 'fold,fade,sliceDown'
	        slices:8, // For slice animations
	        boxCols: 2, // For box animations
	        boxRows: 4, // For box animations
	        animSpeed:1000, // Slide transition speed
	        pauseTime:4000, // How long each slide will show
	        startSlide:0, // Set starting Slide (0 index)
	        directionNav:true, // Next & Prev navigation
	        directionNavHide:false, // Only show on hover
	        controlNav:true, // 1,2,3... navigation
	        controlNavThumbs:false, // Use thumbnails for Control Nav
	        controlNavThumbsFromRel:false, // Use image rel for thumbs
	        keyboardNav:false, // Use left & right arrows
	        pauseOnHover:false, // Stop animation while hovering
	        manualAdvance:false, // Force manual transitions
	
	        prevText: 'Vorige', // Prev directionNav text
	        nextText: 'Volgende' // Next directionNav text
	    });
	    }
	    

	if($('#topimage').length>0){
	   	$('#topimage').nivoSlider({
	        effect:'fold,sliceDownLeft', // Specify sets like: 'fold,fade,sliceDown'
	        slices:8, // For slice animations
	        boxCols: 2, // For box animations
	        boxRows: 4, // For box animations
	        animSpeed:1000, // Slide transition speed
	        pauseTime:4000, // How long each slide will show
	        startSlide:0, // Set starting Slide (0 index)
	        directionNav:false, // Next & Prev navigation
	        directionNavHide:false, // Only show on hover
	        controlNav:false, // 1,2,3... navigation
	        controlNavThumbs:false, // Use thumbnails for Control Nav
	        controlNavThumbsFromRel:false, // Use image rel for thumbs
	        keyboardNav:false, // Use left & right arrows
	        pauseOnHover:false, // Stop animation while hovering
	        manualAdvance:false, // Force manual transitions
	
	        prevText: 'Vorige', // Prev directionNav text
	        nextText: 'Volgende' // Next directionNav text
	    });
	    }
	    

	//menu behavior
	if($('#leftmenu').length>0){
	
		//hide all submenus
		$(".nav li ul").hide();
		
		//show active and relevant submenus
		$('.nav li ul li a.link_active').parent().parent().show();
		$('.nav li a.link_active').parent().find('> ul').show();
	
		$('.nav li').mouseover(function() {
	  		$(this).find('> ul').show('fast');
		}).mouseout(function(){
  			//$(this).find('> ul').hide();
  		});

	}

	
	jQuery("a.photobox").fancybox({
		'zoomSpeedIn':	0, 
		'zoomSpeedOut':	0,
		'overlayShow': true,
		'overlayOpacity': 0.7
	}); 
	jQuery("a.videolink").fancybox({
		'zoomSpeedIn':	100, 
		'zoomSpeedOut':	100,
		'frameWidth': 720,
		'frameHeight': 576,
		'overlayShow': true,
		'overlayOpacity': 0.8,
		'hideOnContentClick': false
	}); 
	jQuery("a.autopopup").fancybox({
		'zoomSpeedIn':	0, 
		'zoomSpeedOut':	0,
		'frameWidth':	700, 
		'frameHeight':	500,
		'overlayShow': true,
		'overlayOpacity': 0.8,
		'hideOnContentClick': false
	}); 

	if(jQuery("a#autopopup").length>0){
        if(jQuery.cookie('autopopup')==null){ // eerste bezoek
             jQuery.cookie('autopopup', 'true', { expires: 1, path: '/', domain: 'kudding.nl'});
             jQuery("a#autopopup").click();
             // setTimeout("jQuery.fn.fancybox.close()", 5000); // automatisch sluiten
        }
    }      
});
