
function systemConst(content){ /* change le fond de la zone du centre */
    $(document).ready(function(){        
        $("div.system-area-rounded-top").css("background-image","url(/fileadmin/templates/stabilame/images/contenu/background_"+ content +".png)");
        $('#slidesContainer').prepend('<div class="flashBtn"><a href="/fileadmin/datas/flash.php?key='+ content +'" class="popup"><img src="/fileadmin/templates/stabilame/images/carre_plus.png" /></a></div>');
        
        /** Popup flash **/    
        $("a.popup").fancybox({
            'opacity'        : false,
            'overlayShow'    : true,
            'transitionIn'    : 'fade',
            'transitionOut'    : 'fade',
            'overlayColor'        : '#2d2724',
            'overlayOpacity'    : 0.7,
            'margin'            :0,
            'padding'           :0,
            'modal'             :false,
            'showCloseButton'   :false,
            'centerOnScroll'    :false,
            'scrolling' : false,
            'onComplete': function() { 
                $("#fancybox-wrap").css({'top':'100px'});
            }
        });
                
    });
}

function carousselTexte(){
    
}

$(document).ready(function(){

    /** recherche **/
    if($("#tx_indexedsearch").length > 0){
        var _tx = $(this).val();
        $('#tx_indexedsearch > input[type="text"]')
        .focus(function(){            
           $(this).val(''); 
        }).blur(function(){
            if($(this).val() =='' ){
                $(this).val('recherche');
            }
        });
    }
    
    /*$("a.realisation").fancybox({
        'opacity'        : false,
        'overlayShow'    : true,
        'transitionIn'    : 'fade',
        'transitionOut'    : 'fade',
        'overlayColor'        : '#2d2724',
        'overlayOpacity'    : 0.7,
        'margin'            :0,
        'padding'           :10,
        'modal'             :false,
        'showCloseButton'   :true,
        'centerOnScroll'    :false,
        'scrolling' : false,
        'onComplete': function() { 
            $("#fancybox-wrap").css({'top':'40px'});
        }
    });*/
    
    $("#header-right-top a").each(function(){
        $(this).attr("href","javascript:void(0);");
        $(this).attr("target","");
    })
    
    /** open splash **/
    if($("#splash").length > 0){
        $("#splash").hide('fast',function(){
            $(this).html('<div style="text-align:right; padding-right:10px;"><a href="/accueil/qui-sommes-nous/" style="color:white;font-size:11px;text-decoration:none;font-weight:normal;">Vers le site Stabilame</a></div><img src="/fileadmin/templates/stabilame/images/stabisplashpage_OK_web.jpg"  />').css("cursor","pointer");
            $(this).fadeIn(6000);
        }).click(function(){
            document.location.href="/accueil/qui-sommes-nous/";
        });
        
        
    }
    
    // parce en typoscript un pipe est interprété... on le remplace donc en JS
    $("span.pipe").html("|");
    
    // gallerie "nos réalisations" fine tuning
    $("div.galerie_nav span.nxt").prepend('&nbsp;<span class="pipe">|</span> &nbsp;');    
    $("div.galerie_nav span.bck").append('&nbsp;<span class="pipe">|</span> ');
    
    // le dernier pavé des blocks bottom ne doit pas avoir de filet blanc a droite
    $("div.area-rounded-bottom div.csc-default").last().css("background","none");
    
    /** compo bois - bottom pdf */
    $('div.area-rounded-bottom table.csc-uploads td.csc-uploads-fileName p').each(function(){
       // if($(this).attr("class") !='csc-uploads-description') $(this).remove();
    });
    
    $("table.csc-uploads").each(function(){
        var _current = $(this);
        _tds = $(this).children().children().children();
        
        $(_tds).children().each(function(){
            //console.log($(this));
            _link = $(this).find("a").attr("href");
            _txt  = $(this).next("p.csc-uploads-description").html();
            
            if(_txt != null){
                $(_current).replaceWith('<p class="csc-uploads"><a href="'+ _link +'" target="blank">'+ _txt +'</a></p><a href="'+ _link +'" target="blank"><img class="csc-uploads-icone" src="/fileadmin/templates/stabilame/images/cb_pdf.png" /></a>');
            }
            
            
            
        });
                
    });
    
    $("table.csc-uploads").each(function(){
        //$(this).after('<a href="#"><img style="margin-top:10px;" src="/fileadmin/templates/stabilame/images/cb_pdf.png" /></a>');
    });
    
    $("#c138 .csc-mailform-field #mailformLocalite").parent().addClass("mailformLocalite");    
    $("#c138 .csc-mailform-field #mailformCP").parent().addClass("mailformCP");
    
    //logo bois plus
    $("#t3-footer").before('<div style="float:right;margin-right:15px;"><a href="http://boisplus.be/" target="blank"><img src="/fileadmin/templates/stabilame/images/bois_plus.png" /></a></div>');
    
});

