$(document).ready(function(){
	
	// alle spots hide
	$(".spot").hide();
	$(".foto_link").hide();
	
	// spot van de pagina show
	if ( page == "index" ) {
		$(".spothome").addClass("spot_link");
		$("#headl").addClass("hover");
	}
	if ( page == "workshop" ) {
		$("#oog1-1").addClass("hover");
		$(".spotlink1").addClass("spot_link");
	}
	if ( page == "voorstellingen-en-regie" ) {
		$("#oog2-1").addClass("hover");
		$(".spotlink2").addClass("spot_link");
	}
	if ( page == "trainingsactrice" ) {
		$("#oog3-1").addClass("hover");
		$(".spotlink3").addClass("spot_link");
	}
	if ( page == "improducties" ) {
		$("#oog4-1").addClass("hover");
		$(".spotlink4").addClass("spot_link");
	}
	if ( page == "fotos" ) {
		$(".spotfoto").addClass("spot_link");
		$("#headr").addClass("hover");
	}
	
	// de spot onder de icons in de header
	if ( page != "index" ) {
		$("#headl").mousemove(function(){
			$(this).addClass("hover");
			$(".spothome").addClass("spot_link");
		});
		$("#headl").mouseout(function(){
			$(this).removeClass("hover");
			$(".spothome").removeClass("spot_link");
		});
	}
	if ( page != "workshop" ) {
		$("#oog1").mousemove(function(){
			$("#oog1-1").addClass("hover");
			$(".spotlink1").addClass("spot_link");
		});
		$("#oog1").mouseout(function(){
			$("#oog1-1").removeClass("hover");
			$(".spotlink1").removeClass("spot_link");
		});
	}
	if ( page != "voorstellingen-en-regie" ) {
		$("#oog2").mousemove(function(){
			$("#oog2-1").addClass("hover");
			$(".spotlink2").addClass("spot_link");
		});
		$("#oog2").mouseout(function(){
			$("#oog2-1").removeClass("hover");
			$(".spotlink2").removeClass("spot_link");
		});
	}
	if ( page != "trainingsactrice" ) {
		$("#oog3").mousemove(function(){
			$("#oog3-1").addClass("hover");
			$(".spotlink3").addClass("spot_link");
		});
		$("#oog3").mouseout(function(){
			$("#oog3-1").removeClass("hover");
			$(".spotlink3").removeClass("spot_link");
		});
	}
	if ( page != "improducties" ) {
		$("#oog4").mousemove(function(){
			$("#oog4-1").addClass("hover");
			$(".spotlink4").addClass("spot_link");
		});
		$("#oog4").mouseout(function(){
			$("#oog4-1").removeClass("hover");
			$(".spotlink4").removeClass("spot_link");
		});
	}
	if ( page != "fotos" ) {
		$("#headr").mousemove(function(){
			$(this).addClass("hover");
			$(".spotfoto").addClass("spot_link");
		});
		$("#headr").mouseout(function(){
			$(this).removeClass("hover");
			$(".spotfoto").removeClass("spot_link");
		});
	}
	
	// de hover over de thumbs in de gehele website
	$(".div_thumb, .div_thumb2").hover(function(){
		$(this).find('.thumbnail img').addClass("foto_thumb_hover");
		$(this).find('.foto_link').show();
	},function() {
		$(this).find('.thumbnail img').removeClass("foto_thumb_hover");
		$(this).find('.foto_link').hide();
	});
	
	// de overlay van de galerij oproepen
	$(".thumbnail").overlay({ target: "#gallery", expose: "#222222" }).gallery({ speed: 1000 });
	
});



function allScripts() {

	if(document.getElementsByTagName) {

	      matchHeight();

	}
				
}



matchHeight=function(){

     var divs,contDivs,maxHeight,divHeight,d;

     // get all div elements in the document

     divs=document.getElementsByTagName('div');

     contDivs=[];

     // initialize maximum height value

     maxHeight=0;

     // iterate over all <div> elements in the document

     for(var i=0;i<divs.length;i++){

          // make collection with <div> elements with class attribute 'content'

          if(/\bcontent\b/.test(divs[i].className)){

                d=divs[i];

                contDivs[contDivs.length]=d;

                // determine height for <div> element

                if(d.offsetHeight){

                     divHeight=d.offsetHeight;

                }

                else if(d.style.pixelHeight){

                     divHeight=d.style.pixelHeight;

                }

                // calculate maximum height

                maxHeight=Math.max(maxHeight,divHeight);

          }

     }

     // assign maximum height value to all of container <div> elements

     for(var i=0;i<contDivs.length;i++){

          contDivs[i].style.height=maxHeight+'px';

     }

}
