$(document).ready(function(){ 
    $("ul.sf-menu").supersubs({ 
      minWidth:    6,    // minimum width of sub-menus in em units 
      maxWidth:    14,   // maximum width of sub-menus in em units 
      extraWidth:  0.1     // extra width can ensure lines don't sometimes turn over due to slight rounding differences and font-family 
    }).superfish();  // call supersubs first, then superfish, so that subs are not display:none when measuring. Call before initialising containing tabs for same reason. 
  }); 
  
    $(document).ready(function(){ 
    $("ul.sf-menu2").supersubs({ 
      minWidth:    6,    // minimum width of sub-menus in em units 
      maxWidth:    14,   // maximum width of sub-menus in em units 
      extraWidth:  0.1     // extra width can ensure lines don't sometimes turn over due to slight rounding differences and font-family 
    }).superfish({ 
            delay:       1200,                            // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       'fast',                          // faster animation speed 
            autoArrows:  false                           // disable generation of arrow mark-up 
        }); 
    }); 

  
  $(document).ready(function(){
	$(".nlp-nieuws").click(function(){
		$("#nlp-boxnieuws").slideToggle(300)
		$("#nlp-boxbottom2").show()
		return false;
	});
	
	$("#nlp-nieuwsclose").click(function(){
		$("#nlp-boxnieuws").slideToggle(300)
		$("#nlp-boxbottom2").hide()
		return false;
	});
	
	$(".nlp-boeken").click(function(){
		$("#nlp-boxboeken").slideToggle(300)
		$("#nlp-boxbottom2").show()
		return false;
	});
	
	$("#nlp-boekenclose").click(function(){
		$("#nlp-boxboeken").slideToggle(300)
		$("#nlp-boxbottom2").hide()
		return false;
	});
	
	$(".nlp-boekeneng").click(function(){
		$("#nlp-boxboekeneng").slideToggle(300)
		$("#nlp-boxbottom2").show()
		return false;
	});
	
	$("#nlp-boekencloseeng").click(function(){
		$("#nlp-boxboekeneng").slideToggle(300)
		$("#nlp-boxbottom2").hide()
		return false;
	});
	
	$(".nlp-sitemap").click(function(){
		$("#nlp-boxsitemap").slideToggle(300)
		$("#nlp-boxbottom2").show()
		return false;
	});
	
	$("#nlp-sitemapclose").click(function(){
		$("#nlp-boxsitemap").slideToggle(300)
		$("#nlp-boxbottom2").hide()
		return false;
	});
});

$(document).ready(
		function(){
			$('.nlpgallery').innerfade({
			    animationtype: 'fade',
				speed: 4000,
				timeout: 12000,
				type: 'random',
				containerheight: '240px'
			});
		}
	);
	
$(document).ready(function(){

//Page Flip on hover

	$("#pageflip").hover(function() {
		$("#pageflip img , .msg_block").stop()
			.animate({
				width: '139px', 
				height: '144px'
			}, 500); 
		} , function() {
		$("#pageflip img").stop() 
			.animate({
				width: '60px', 
				height: '62px'
			}, 220);
		$(".msg_block").stop() 
			.animate({
				width: '60px', 
				height: '60px'
			}, 200);
	});

	
});

$(document).ready(function(){
  $(function() {             
    // initialize scrollable  
    $("div.scrollable").scrollable({ 
      size: 3
    });
  });
});

$(document).ready(function(){
	$(".nlp-imagelistfirst").hover(
		function(){
			var iconName = $(this).find("img").attr("src");
			var origen = iconName.split(".jpg")[0];
			$(this).find("img").attr({src: "" + origen + "o.jpg"});
			$(".nlp-imagelistfirst").find("img").animate({opacity: 1}, {queue:false, duration:300});
			$(".nlp-imagelistsecond").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
			$(".nlp-imagelistthird").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
			$(".nlp-imagelistlast").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
		}, 
		function(){
			var iconName = $(this).find("img").attr("src");
			var origen = iconName.split("o.")[0];
			$(this).find("img").attr({src: "" + origen + ".jpg"});
			$(".nlp-imagelistfirst").find("img").animate({opacity: 1}, {queue:false, duration:300});
			$(".nlp-imagelistsecond").find("img").animate({opacity:1}, {queue:false, duration:300});
			$(".nlp-imagelistthird").find("img").animate({opacity:1}, {queue:false, duration:300});
			$(".nlp-imagelistlast").find("img").animate({opacity:1}, {queue:false, duration:300});
		});
	$(".nlp-imagelistsecond").hover(
		function(){
			var iconName = $(this).find("img").attr("src");
			var origen = iconName.split(".jpg")[0];
			$(this).find("img").attr({src: "" + origen + "o.jpg"});
			$(".nlp-imagelistsecond").find("img").animate({opacity: 1}, {queue:false, duration:300});
			$(".nlp-imagelistfirst").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
			$(".nlp-imagelistthird").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
			$(".nlp-imagelistlast").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
		}, 
		function(){
			var iconName = $(this).find("img").attr("src");
			var origen = iconName.split("o.")[0];
			$(this).find("img").attr({src: "" + origen + ".jpg"});
			$(".nlp-imagelistsecond").find("img").animate({opacity: 1}, {queue:false, duration:300});
			$(".nlp-imagelistfirst").find("img").animate({opacity:1}, {queue:false, duration:300});
			$(".nlp-imagelistthird").find("img").animate({opacity:1}, {queue:false, duration:300});
			$(".nlp-imagelistlast").find("img").animate({opacity:1}, {queue:false, duration:300});
		});
	$(".nlp-imagelistthird").hover(
		function(){
			var iconName = $(this).find("img").attr("src");
			var origen = iconName.split(".jpg")[0];
			$(this).find("img").attr({src: "" + origen + "o.jpg"});
			$(".nlp-imagelistthird").find("img").animate({opacity: 1}, {queue:false, duration:300});
			$(".nlp-imagelistsecond").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
			$(".nlp-imagelistfirst").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
			$(".nlp-imagelistlast").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
		}, 
		function(){
			var iconName = $(this).find("img").attr("src");
			var origen = iconName.split("o.")[0];
			$(this).find("img").attr({src: "" + origen + ".jpg"});
			$(".nlp-imagelistthird").find("img").animate({opacity: 1}, {queue:false, duration:300});
			$(".nlp-imagelistsecond").find("img").animate({opacity:1}, {queue:false, duration:300});
			$(".nlp-imagelistfirst").find("img").animate({opacity:1}, {queue:false, duration:300});
			$(".nlp-imagelistlast").find("img").animate({opacity:1}, {queue:false, duration:300});
		});
	$(".nlp-imagelistlast").hover(
		function(){
			var iconName = $(this).find("img").attr("src");
			var origen = iconName.split(".jpg")[0];
			$(this).find("img").attr({src: "" + origen + "o.jpg"});
			$(".nlp-imagelistlast").find("img").animate({opacity: 1}, {queue:false, duration:300});
			$(".nlp-imagelistsecond").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
			$(".nlp-imagelistthird").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
			$(".nlp-imagelistfirst").find("img").animate({opacity: 0.75}, {queue:false, duration:300});
		}, 
		function(){
			var iconName = $(this).find("img").attr("src");
			var origen = iconName.split("o.")[0];
			$(this).find("img").attr({src: "" + origen + ".jpg"});
			$(".nlp-imagelistlast").find("img").animate({opacity: 1}, {queue:false, duration:300});
			$(".nlp-imagelistsecond").find("img").animate({opacity:1}, {queue:false, duration:300});
			$(".nlp-imagelistthird").find("img").animate({opacity:1}, {queue:false, duration:300});
			$(".nlp-imagelistfirst").find("img").animate({opacity:1}, {queue:false, duration:300});
		});
});

window.onload = function () { 
  compactMenu('nlpmenu',false,''); 
}

function MM_goToURL() { 
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

var openLists = [], oIcount = 0;
function compactMenu(oID,oAutoCol,oPlMn,oMinimalLink) {
	if( !document.getElementsByTagName || !document.childNodes || !document.createElement ) { return; }
	var baseElement = document.getElementById( oID ); if( !baseElement ) { return; }
	compactChildren( baseElement, 0, oID, oAutoCol, oPlMn, baseElement.tagName.toUpperCase(), oMinimalLink && oPlMn );
}
function compactChildren( oOb, oLev, oBsID, oCol, oPM, oT, oML ) {
	if( !oLev ) { oBsID = escape(oBsID); if( oCol ) { openLists[oBsID] = []; } }
	for( var x = 0, y = oOb.childNodes; x < y.length; x++ ) { if( y[x].tagName ) {
		//for each immediate LI child
		var theNextUL = y[x].getElementsByTagName( oT )[0];
		if( theNextUL ) {
			//collapse the first UL/OL child
			theNextUL.style.display = 'none';
			//create a link for expanding/collapsing
			var newLink = document.createElement('A');
			newLink.setAttribute( 'href', '#' );
			newLink.onclick = new Function( 'clickSmack(this,' + oLev + ',\'' + oBsID + '\',' + oCol + ',\'' + escape(oT) + '\');return false;' );
			//wrap everything upto the child U/OL in the link
			if( oML ) { var theHTML = ''; } else {
				var theT = y[x].innerHTML.toUpperCase().indexOf('<'+oT);
				var theA = y[x].innerHTML.toUpperCase().indexOf('<A');
				var theHTML = y[x].innerHTML.substr(0, ( theA + 1 && theA < theT ) ? theA : theT );
				while( !y[x].childNodes[0].tagName || ( y[x].childNodes[0].tagName.toUpperCase() != oT && y[x].childNodes[0].tagName.toUpperCase() != 'A' ) ) {
					y[x].removeChild( y[x].childNodes[0] ); }
			}
			y[x].insertBefore(newLink,y[x].childNodes[0]);
			y[x].childNodes[0].innerHTML = oPM + theHTML.replace(/^\s*|\s*$/g,'');
			theNextUL.MWJuniqueID = oIcount++;
			compactChildren( theNextUL, oLev + 1, oBsID, oCol, oPM, oT, oML );
} } } }
function clickSmack( oThisOb, oLevel, oBsID, oCol, oT ) {
	if( oThisOb.blur ) { oThisOb.blur(); }
	oThisOb = oThisOb.parentNode.getElementsByTagName( unescape(oT) )[0];
	if( oCol ) {
		for( var x = openLists[oBsID].length - 1; x >= oLevel; x-=1 ) { if( openLists[oBsID][x] ) {
			openLists[oBsID][x].style.display = 'none'; if( oLevel != x ) { openLists[oBsID][x] = null; }
		} }
		if( oThisOb == openLists[oBsID][oLevel] ) { openLists[oBsID][oLevel] = null; }
		else { oThisOb.style.display = 'block'; openLists[oBsID][oLevel] = oThisOb; }
	} else { oThisOb.style.display = ( oThisOb.style.display == 'block' ) ? 'none' : 'block'; }
}
function stateToFromStr(oID,oFStr) {
	if( !document.getElementsByTagName || !document.childNodes || !document.createElement ) { return ''; }
	var baseElement = document.getElementById( oID ); if( !baseElement ) { return ''; }
	if( !oFStr && typeof(oFStr) != 'undefined' ) { return ''; } if( oFStr ) { oFStr = oFStr.split(':'); }
	for( var oStr = '', l = baseElement.getElementsByTagName(baseElement.tagName), x = 0; l[x]; x++ ) {
		if( oFStr && MWJisInTheArray( l[x].MWJuniqueID, oFStr ) && l[x].style.display == 'none' ) { l[x].parentNode.getElementsByTagName('a')[0].onclick(); }
		else if( l[x].style.display != 'none' ) { oStr += (oStr?':':'') + l[x].MWJuniqueID; }
	}
	return oStr;
}
function MWJisInTheArray(oNeed,oHay) { for( var i = 0; i < oHay.length; i++ ) { if( oNeed == oHay[i] ) { return true; } } return false; }
function selfLink(oRootElement,oClass,oExpand) {
	if(!document.getElementsByTagName||!document.childNodes) { return; }
	oRootElement = document.getElementById(oRootElement);
	for( var x = 0, y = oRootElement.getElementsByTagName('a'); y[x]; x++ ) {
		if( y[x].getAttribute('href') && !y[x].href.match(/#$/) && getRealAddress(y[x]) == getRealAddress(location) ) {
			y[x].className = (y[x].className?(y[x].className+' '):'') + oClass;
			if( oExpand ) {
				oExpand = false;
				for( var oEl = y[x].parentNode, ulStr = ''; oEl != oRootElement && oEl != document.body; oEl = oEl.parentNode ) {
					if( oEl.tagName && oEl.tagName == oRootElement.tagName ) { ulStr = oEl.MWJuniqueID + (ulStr?(':'+ulStr):''); } }
				stateToFromStr(oRootElement.id,ulStr);
} } } }
function getRealAddress(oOb) { return oOb.protocol + ( ( oOb.protocol.indexOf( ':' ) + 1 ) ? '' : ':' ) + oOb.hostname + ( ( typeof(oOb.pathname) == typeof(' ') && oOb.pathname.indexOf('/') != 0 ) ? '/' : '' ) + oOb.pathname + oOb.search; }