function sfHover(){
    var sfEls = $("#nested li");
    $.each(sfEls, function(i,n){
        sfEls[i].onmouseover = function () {this.className += " sfhover";};
        sfEls[i].onmouseout = function () {this.className = this.className.replace(new RegExp(" sfhover\\b"), "");};
    });
}
function Put_chapopicture(){
    var chapopicture = $(".chapo_picture img").attr("src");
    if(chapopicture){
        var src_chapopicture = chapopicture.replace("thumbnails\/", "");
        $(".chapo_picture img").attr("src",src_chapopicture);
    }
}
function Put_legend(){
    $(".legend").hide();
    var ListMedia = $("#main #text .mediapicture");
    ListMedia.each(function(i,ele){
        var legend = $(ele).children(".legend").text();
        if(legend.length <= 5){
            $(ele).children(".legend").remove;
        }else{
            
            var picturewidth = $(ele).children("img").width();
            $(ele).children(".legend").css("width",(picturewidth-3)+"px");
            $(ele).children(".legend").show();
        }
    });
}

function Put_separator(){
    $("#text > .separator").css("visibility","visible");
    $("#text > .separator").css("height","3px");
    $("#text > .separator").css("margin","0 0 10px 0");
}

function PutNewsletter(){
    var title = $("body.newsletter #newsletter .chapo p").text();
    $("body.newsletter #newsletter .article_title").text(title);
    $("body.newsletter #newsletter .chapo p").remove();
    $("body.newsletter #newsletter .article_title").before($("body.newsletter #newsletter .formulaire #chapterpicture"));
    //alert($("body.newsletter #newsletter .chapo p").text().length);
}

function zerocontenu(){
    var test = $("#main > p").text().length;
    if(test>0){
            $("#main").css("margin","240px 0pt 0pt 40px");
    }
}