jQuery(document).ready(function() {
   /* DD_belatedPNG.fix('#header, #content, #bottom');
    DD_belatedPNG.fix('.fist_li');
    //$('.first_li').pngfix();*/
    $('li[rel*=menu1]').hover(function(e){
        var cat_id = $(this).attr('id');
        var lien = $('#lien_' + cat_id);
        var ul_fils = $('#ss' + cat_id);

        ul_fils.show();

    }, function(){
        var cat_id = $(this).attr('id');
        var ul_fils = $('#ss' + cat_id);
        ul_fils.hide();
    });
    $('#backtotop').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });
    jQuery('#diaporama_actu').jcarousel({
        scroll: 1
    });
});

function create_fond(width, height, url, lien) {
    jQuery(document).ready(function() {
        var demi_largeur = Math.ceil(width/2);
       $('#container').after('<a href="' + lien + '" target="_blank" id="lien_fond"></a>');
       $('#lien_fond').css({
           width                : width + 'px',
           height               : height + 'px',
           'background-image'   : 'url("' + url + '")',
           left                 : '50%',
           'margin-left'        : '-' + demi_largeur + 'px'
       });
       $('#lien_fond').show();
    });
}

jQuery.fn.extend({
    findPos : function() {
        obj = jQuery(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};
    }
 });
