$(function(){
	var pageTracker;
	
	flowplayer("player1", "res/video/flowplayer-3.2.2.swf");				
	flowplayer("player2", "res/video/flowplayer-3.2.2.swf");				
	flowplayer("player3", "res/video/flowplayer-3.2.2.swf");				
	flowplayer("player4", "res/video/flowplayer-3.2.2.swf");
					
	//$("#scrollAreaFunzionalita").jScrollPane();
	//$("#scrollAreaSicurezza").jScrollPane();
	
	
	$("#content .links a").live("click", function(){
		$(this).css("background-position","top");
		source = $(this).attr("class");
		bigImg = $(this).attr("href");
		video = $("#layer-"+source+" .thumbs a").eq(0).attr("rel");
	
		$("#layer-"+source+" .images .big .video").show();			

		$.fancybox({
			padding: 0,
			autoscale: false,
			overlayColor: "#000",
			overlayOpacity: 0.5,
			scrolling: "no",
			href:"#layer-"+source,
			onStart:function(){$("#layer-"+source).show(); $("#flash").hide();},
			onClosed:function(){$(".layer").hide(); $("#flash").show();}
		})
	
		track("layer-"+source);
	
		return false;
	});
	
	
	$("a.thumb").live("click", function(){
		if(this.rel=="img"){
			img = $(this).attr("href");
			$($(this).parent(".thumbs").parent(".images").children(".big").children(".pic")).html('<img src="'+img+'" alt="" title="" />');
			$($(this).parent(".thumbs").parent(".images").children(".big").children(".video")).hide();
			$($(this).parent(".thumbs").parent(".images").children(".big").children(".pic")).show();
			$("a.thumb").removeClass("active");
			$(this).addClass("active");
		}
		else{		
			$($(this).parent(".thumbs").parent(".images").children(".big").children(".pic")).hide();
			$($(this).parent(".thumbs").parent(".images").children(".big").children(".video")).show();
		}
		return false;
	});
});

function track(uri)
			{
				try 
				{
					pageTracker._trackPageview(uri);
				}
				catch(err)
				{}
			}
			
	
