jQuery.fn.extend({
   findPos : function() {
       obj = $(this).get(0);
       var curleft = obj.offsetLeft || 0;
       var curtop = obj.offsetTop || 0;
       while (obj = obj.offsetParent) {
                curleft += obj.offsetLeft
                curtop += obj.offsetTop
       }
       return {x:curleft,y:curtop};
   }
});

function clicking(th){
	leftCliker				=		th.css('left')
	expLeftClicker			=		leftCliker.split('.');
	leftPos					=		expLeftClicker[0];
	leftPos					=		leftPos.replace('px','')
	
	topCliker				=		th.css('top')
	expTopClicker			=		topCliker.split('.');
	topPos					=		expTopClicker[0];
	topPos					=		topPos.replace('px','')
	
	$('#contentLink').css({'left':leftPos+'px','top':topPos+'px'})
	//$('#holder_images').children('img').fadeOut(700);
	$('#carousel').children().fadeOut(250);
	
	$('#contentLink').animate({'width':'500','height':'500'},250)
	
	videoLink				=	th.attr('longdesc')
	
	videoHTML				=	"<div style=\"width:530px;border:1px solid #000000;background-color:#ffffff\"><div id=\"videoHeader\" style=\"text-align:right;margin:10px 10px 0px 0px;\"><a style=\"color:#0066CA;font-weight:bold;\" href=\"javascript:closeVideo()\">Fermer</a></div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"530\" height=\"440\"><param name=movie value=\""+videoLink+"\"><param name=quality value=high><embed src=\""+videoLink+"\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"530\" height=\"440\"></embed> </object></div>";
	$('#contentLink').html(videoHTML)
	
}

function closeVideo(){
	$('#contentLink').html('')
	$('#contentLink').animate({'left':'0px','top':'0px','width':'10px','height':'10px'},250,function(){$('#carousel').children().fadeIn(700);})
	
	
	//$('#contentLink').css()
	
}
