$(document).ready(function() {

	$('.close-boxje').click(function() {
		$('.overlay2').fadeOut(1000);
		$('.boxje').fadeOut(1000);
	});

}); 
function removeone(orderarray,id){
	x=orderarray.indexOf(id,0);
	y=id.length;
	z=orderarray.length;
	res1=orderarray.substr(0,x)+orderarray.substr((x+y),z-(x+y-1));
	return res1;
}

function shopaction(id,action){
	a=document.forms['shopform'].orderarray.value;
	if(action=="add"){
		document.forms['shopform'].orderarray.value=a+id+",";
	}
	if(action=="del"){
		newarray=removeone(a,id+",");
		document.forms['shopform'].orderarray.value=newarray;
	}
	if(action=="clear"){
		document.forms['shopform'].orderarray.value='';
	}
	document.forms['shopform'].orderaction.value=action;
	document.forms['shopform'].submit();
}

function togglediv(id){
	a=document.getElementById(id).style.display;
	
	if(a==''){
		document.getElementById(id).style.display='none';
	} else {
		document.getElementById(id).style.display='';
	}
}

function multidiv(name,id,max){
	a=document.getElementById(name+id).style.display;
	
	i=0;
	while(i<max){
		document.getElementById(name+i).style.display='none';
		i++;
	} 
	if(a==''){
		document.getElementById(name+id).style.display='none';
	} else {
		document.getElementById(name+id).style.display='';
	}
	document.getElementById('productdetail').style.display='none';
}

function changelan(id){
	loc=document.URL;
	pos=loc.indexOf("?");
	final=loc.substring(0,pos);
	document.location.href=final+'?lan='+id;
}


function getpageHeight(){	
	return window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:null;	
}


		var currentSpon = 1;
		
		$(document).ready(function() {
     	
     		$('.btn-twit').click(function() {
     			if($('.tweets').is(":visible")) {
     				
     			} else {
     				$('.wall').fadeOut(500, function() {
     					$('.tweets').fadeIn(500);
     				});
     			}
     		});
     		
     		$('.btn-face').click(function() {
     			if($('.wall').is(":visible")) {
     			} else {
     				$('.tweets').fadeOut(500, function() {
     					$('.wall').fadeIn(500);
     				});
     			}
     		});
     		
     		var liefde=setInterval("changeSponsors()",5000);
     		
     		$('.opennewsbrief').click(function() {
     			$('.overlay').fadeIn(500);
     		});
     		
     		$('.closebtn').click(function() {
     			$('.overlay').fadeOut(500);
     		});
     		
			
			$('.groteknop1').animate({"margin-top":"0px"},1200);
			
			$('.groteknop2').animate({"margin-top":"0px"},1550);
     	
     	});
     	
     	function changeSponsors() {
     		if(currentSpon==3) {
     			currentSpon=0;
     			$('.bigbox').animate({"margin-top":"0px"},1000);	
     		} else {
     			$('.bigbox').animate({"margin-top":"-=100px"},1000);
     		}
     		currentSpon++;
     	}
		
		


		function makeEmail(addr1,addr2){
			linktext=addr1+'@'+addr2;
			document.write("<a href=" + "mail" + "to:" + linktext + ">" + linktext + "</a>");
		}

   	  	AudioPlayer.setup("http://www.nbe.nl/assets/player.swf", {  
			width: 250,  
			initialvolume: 100,  
			transparentpagebg: "yes",  
			left: "ed1c24",  
			lefticon: "ffffff",
			leftbg: "ed1c24",
			leftbghover: "ed1c24",
			lefticonhover: "ffffff",
         
         	right: "ed1c24",
        	 righticon: "ffffff",
         	rightbg: "ed1c24",
         	rightbghover: "ed1c24",
        	 righticonhover: "ffffff",
         
        	text: "000000",
        	 slider: "000000",
         	track: "ffffff",
         	loader: "333333"
     	}); 


			function Afmelden(){
				document.form1.fid.value="afmelden";
				document.form1.submit();
			}

			function Aanmelden(){
				document.form1.fid.value="aanmelden";
				document.form1.submit();
			}
	
