jQuery(document).ready(function($){
	
	$("#text-13").click(function(){
		 window.location = "interdynamics/";
	});
	$("#text-7").click(function(){
		 window.location = "producten/interdynamics/";
	});
	
	$("#text-14").click(function(){
		window.location = "perfectmate/";
	});
	$("#text-8").click(function(){
		window.location = "producten/perfectmate/";
	});
	
	$("#text-15").click(function(){
		window.location = "black-power/";
	});
	$("#text-9").click(function(){
		window.location = "producten/black-power/";
	});
	
	$("#effectmask li, #flaremask li").css({ opacity: 0 })
	
	var active = 0;
	
	$(".page_item").mouseover(function(){
		
		var currentButton = $(this).find('a').eq(0).text();
		currentButton = currentButton.toLowerCase();
				
			
				$(this).find('a').eq(0).stop().animate({ queue:false, "color": "#fff"}, 200);
			//		.effect("slide", { direction: "left" }, 400);
				
			
				$("#mask-"+currentButton).stop()
					.animate({ opacity: "1"	}, 400) 
					.animate({ opacity: "0.5" }, 500); 
			
			
	}).mouseout(function() {
		
		$("#effectmask li").stop().animate({ queue:false, opacity: 0 }, 10);
	
		$(this).find('a').stop().animate({ 
			"color": "#b9b9b9", top: 0 }, 1000);		
			
	});
	
	
		
	
	
	aantalPanels = $(".panel").length;
	panelCount = aantalPanels+1;
	
	i = 1;
	
	function slider(i) {
				
		$(".panel .titel").css({
			opacity: "0",
			marginLeft: "-300px",
			top: "50px",
			position: "absolute"		
		});
		
		$(".achtergrond").css({
			opacity: "0.2",	
			top: "50px",
			left: "0px",
			position: "absolute"
		});
		
		$(".product").css({
			opacity: "0",	
			marginTop: "-320px",
			marginLeft: "0px",
			left: "500px",
			position: "absolute"
		});
		
		$(".omschrijving").css({
			opacity: "0",			
			left: "130px",
			top: "130px",
			position: "absolute",
			background: "#000"	
		});
		
	
		$(".panel").hide();	
		
		$("#panel"+i).show();
				
		$("#panel"+i).find(".titel")
			.animate({ marginLeft: "80px" }, { queue: false, duration: 2300 })
		    .animate({ opacity: "1" }, 3000, function() {
		    	$("#panel"+i).find(".omschrijving").animate({
		    		opacity: "0.8"	    		
		    	}, 1000);
		    });
		
		$("#panel"+i).find(".achtergrond")
			.animate({ opacity: "1" }, { queue: true, duration: 3500 })
			.delay(6000)
			.animate({ opacity: "0" }, 2500 );
			
	
			
		$("#panel"+i).find(".product")    
		    .animate({ marginTop: "0px" }, { queue: false, duration: 2300 })
		    .animate({ opacity: "1" }, 5000)
		    .delay(6300)
		    .animate({ marginLeft: "0px" }, 400, function() {
		    	i++;
		    	if(i > aantalPanels){
		    		i = 1;
		    	}
		    	slider(i);
		    });			
			
	}
	
	slider(i);	
	
});	
	
