$(document).ready(function() { 	   
        $('#row2').minmax();
        $('#row2').pngFix();

	//back to top and pageBrowser Icons
	if($("#content").height() > "600"){
	
		//clone pageBrowser and copy to bottom
		if ( $("#prevButton").length > 0 ){
		
			//copy item
			navItems = $("#pageBrowser").clone();
		
			//rename id
			navItems.attr({id:"pageBrowserBottom"} );
		
			//add item to DOM
			$("#content").append(navItems);
		}

		var pagePath = document.location.toString();
				
		if (!pagePath.match('#')) {// the URL contains an anchor
			pagePath = pagePath + "#";
		}
		$("#content").append('<div class="toTop"><a href="' + pagePath + '">Terug naar boven</a></div>');
	}
	
        //mouseover images
  	if( $('dd.csc-textpic-caption').length > 0 ){
  		var xOffset;
  		var xOffset;
  			
  		$('dd.csc-textpic-caption').parent().css({
  			"cursor": "pointer"
  		});
  		
  		//fade in fade out tooltip
  		$('dd.csc-textpic-caption').parent().hover(function(e){
  			xOffset = 10;
			yOffset = 20;	
  			$("body").append("<div id='tooltip'>Klik voor een vergroting</div>");
  			$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");
				
  		},function(){
  			$('#tooltip').remove();
  		});
  		
  		//update function
  		$('dd.csc-textpic-caption').parent().mousemove(function(e){
			$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px");
		});	
		
		//click event
  		$('dd.csc-textpic-caption').parent().click(function(e){
  			var posY = e.pageY;
			tbShow( $(this).children('dd.csc-textpic-caption').text(), posY );//pass where to apply thickbox
			
  		//},function(){
     
  		});
  	}
}); 

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


