(function(){
	
	var $ = jQuery;
	
	$(function(){
	
	

		  $(".js-accordeon-faq").accordeon({
			  oneOpen: true,
			  speed: "slow"
		  });
		
		 // $(".js-accordeon-event").accordeon({
		//	  oneOpen: true,
		//	  speed: 1
		//  });
		  
		  
		  if($("#cam"))
			{
				CamChange("http://rudycam.tcnpp.com/record/current.jpg?rand=", "Keulsekade Caf&#233;");
					
				$("#cam_1").click(function () {
					CamChange("http://rudycam.tcnpp.com/record/current.jpg?rand=", "Keulsekade Caf&#233;");
				});
				
				
				$("#cam_2").click(function () {
					CamChange("http://89.146.0.30/axis-cgi/jpg/image.cgi?resolution=400x300&dummy=", "De Bieb");
				});
				
					
				$("#cam_3").click(function () {
					CamChange("http://89.146.0.31/axis-cgi/jpg/image.cgi?resolution=400x300&dummy=", "RudyCam!");
				});
			}
		
	});
	
	
	
	function CamChange( url, camTitle ){
		$("#cam").attr({ src: url + Math.floor(Math.random()*10000000)});
		$("#camtitle").html(camTitle);
		$(document).stopTime();
		$(document).everyTime(1000, function(i) {							 
			$("#cam").attr({ src: url + i, alt: "" });
		}, 0);
		
	}
	
	/* Embeds flash movies and applications using JSON descriptors in the HTML
	 * 
	 */
	jQuery('.flash-properties').each(function(){
    	var json = jQuery.parseJSON(this.innerHTML);
    	jQuery(this)
    		.prev('.flash-media')
    		.flash(json[0], json[1]);
    });
	
	
	

})();