function switchtab(nummer,aantal) {
	for(i=1; i<= aantal;i++) {
		document.getElementById('tab'+i).style.display='none';
		document.getElementById('bi'+i).className='rightTabBtnImg';
	}
	document.getElementById('tab'+nummer).style.display='block';
	document.getElementById('bi'+nummer).className='rightTabBtnImg_on';
}

$(document).ready(function(){
	jQuery(function(){jQuery(document).pngFix();});
}); 


function checkform(form) {
	var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
	var error=0;
	for (var x=0; form.elements[x]; x++ ) {
		if(form.elements[x].title == "verplicht") {
			if (form.elements[x].type == 'select-one'){
				if (form.elements[x].options[form.elements[x].selectedIndex].value == "") error++;
			}else if (form.elements[x].type == 'checkbox'){
				if (!form.elements[x].checked) error++;
			}else{
				if(form.elements[x].name=="email"){
					if (emailfilter.test(form.elements[x].value)==false) error++
				}else{
					if (form.elements[x].value == "") error++;
				}
			}
			if(error>0){
				alert( "U heeft het verplichte veld '" + form.elements[x].id + "' niet ingevuld." );
	        		form.elements[x].focus();
			        return false ;
			}
		}
	}        
}
$(document).ready(function(){
  $("#navmenu-h li,#navmenu-v li").hover(
    function() { $(this).addClass("iehover"); },
    function() { $(this).removeClass("iehover"); }
  );
});

$(document).ready(function() {
	$("a.zoom").fancybox();
	$("a.iframe").fancybox({
		'hideOnContentClick': false,
		'overlayOpacity': 0.6,
		'overlayColor': '#000',
		'frameWidth': 800,
		'frameHeight': 430
	});
	$("a.iframe-kerstkaart").fancybox({
		'hideOnContentClick': false,
		'overlayOpacity': 0.6,
		'overlayColor': '#000',
		'frameWidth': 800,
		'frameHeight': 500
	});
	
});
function pageload(hash) {
	// alert("pageload: " + hash);
	// hash doesn't contain the first # character.
	if(hash) {
		// restore ajax loaded state
		if($.browser.msie) {
			// jquery's $.load() function does't work when hash include special characters like aao.
			hash = encodeURIComponent(hash);
		}
		$("#contentArea").load("/load_mensen.php?v="+hash, function() { Cufon.replace('h2'); $("#loader").fadeTo("fast", 0, nxt)});
		function nxt(){$("#loader").hide();}
	} else {
		// start page
		$("#contentArea").load("/load_mensen.php?v="+hash, function() { Cufon.replace('h2'); $("#loader").fadeTo("fast", 0, nxt)});
		function nxt(){$("#loader").hide();}
	}
}

$(document).ready(function(){
	// Initialize history plugin.
	// The callback is called at once by present location.hash. 
	$.historyInit(pageload, "/jquery_history.html");
	
	// set onlick event for buttons
	$("a[rel='history']").click(function(){
		// 
		var hash = this.href;
		hash = hash.replace(/^.*#/, '');
		// moves to a new page. 
		// pageload is called at once. 
		// hash don't contain "#", "?"
		$.historyLoad(hash);
		return false;
	});
});
