$(window).load(function()
{
	$(".flashBoxCloseLayer, .close").click(function()
	{
			$(".flashBoxCloseLayer").hide();
			$(".flashBox").hide();
			$(".picViewer").html("");
	});
































	$(".picture").click(function()
	{
		$(".picViewer").html("");
		var src = $(this).attr("src");
		$(".picViewer").append("<img src='"+src+"' />");
	});
































































	$(".flashFile").click(function()
	{
		var file = $(this).attr("ref");
		$(".picViewer").html("");
		$(".picViewer").append("<a href='"+file+"' class='player' style='display:block;width:194px;height:146px;'></a>");
		createPlayer();
	});
































	
































});
































































function showPopupInfo(id){
	$(".flashBoxCloseLayer").hide();
	$(".flashBox").hide();
	$(".flashBoxCloseLayer").show();
	
$(".picViewer").html($("#"+id+" .imageBuffer").html());
	$("#"+id).show();
	$("#"+id).slideDown("fast",function(){
		$("#"+id +" .content").jScrollPane();
		$(".draggable").mousedown(function(){
			$("#"+id+"").draggable();
		}).mouseup(function(){
		  $("#"+id+"").draggable("destroy");
		});
































		Cufon.replace('.flashBox h1');
		
		/*Image slide control*/
		$(".mycarouselNext").click(function(){
			element = $(this).parents("div:first");
			$("ul",element).animate({"left": "-=160px"}, "slow");
			
		});
































		$(".mycarouselBack").click(function(){
			element = $(this).parents("div:first");
			$("ul",element).animate({"left": "0px"}, "slow");
		});
	});
}
































function createPlayer()
{
flowplayer("a.player", 
"flowplayer/flowplayer.commercial-3.1.5.swf",
{
key: "#$423b987045772e39764",
clip:  { 
autoPlay: true, 
autoBuffering: true 
} ,
 plugins:  { 
        controls: {             
            all:false, 
            scrubber:true, 
            play:true, 
            mute:false,
			backgroundGradient: 'none', 
			backgroundColor: '#000000', 
			bufferColor: '#000000', 
            progressColor: '#163b34',             
            buttonColor: '#3a9180', 
            buttonOverColor: '#163b34'
        
					} 
			} 
});
}
