function findPos(obj) {
        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};
}

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};
   }
});




jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        vertical: true,
        scroll: 2,
    });
    
    jQuery('#mycarousel2').jcarousel({
        vertical: false,
        scroll: 2,
    });
    
 $("li.projetJq").hover(
      function () {
        pos = $(this).findPos();
        idThis = $(this).attr("id");
        $(".projet-"+idThis).css('background-color','white');
        $(".projet-"+idThis).css('position','absolute');
        $(".projet-"+idThis).css('border','solid 1px black');
        $(".projet-"+idThis).css('left','120px');
        $(".projet-"+idThis).css('top',(pos.y-180)+'px');
        $(".projet-"+idThis).show("fast");
      }, 
      function () {
      	idThis = $(this).attr("id");
        $('body').find(".projet-"+idThis).hide("slow");
      }
    );
    


});

