// -----------------------------------------------------------------------------
// Variables globales
var g_domaine = window.location.href.match(/:\/\/(.[^/]+)/)[1];
var g_errajax = "Ajax: Échec de la récupération des données";
// -----------------------------------------------------------------------------


$(function(){

//$("table.result tr:nth-child(2n)").addClass('paire');

/*
$("#menu >ul>li a").mouseover(function(){ 
    $(this).stop().animate({backgroundPosition:"(100% -40px)"},300); 
}); 
$("#menu >ul>li a").mouseout(function(){ 
    $(this).stop().animate({backgroundPosition:"(100% 0px)"},500); 
}); 
*/


$('#menu>ul>li>a').each(function(){
     if (!$(this).parent().hasClass("on")){

          $(this).css( {backgroundPosition: "100% 0px"} ) 
.mouseover(function(){ 
$(this).stop().animate({backgroundPosition:"(100% -40px)"}, {duration:500}) 
}) 
.mouseout(function(){ 
$(this).stop().animate({backgroundPosition:"(100% 0px)"}, {duration:500}) 
}) }

});








$(".animBout a").mouseover(function(){ 
    $(this).stop().animate({backgroundPosition:"(0px -44px)"},500); 
}); 

$(".animBout a").mouseout(function(){ 
    $(this).stop().animate({backgroundPosition:"(0px 0px)"},500); 
}); 

$("#wrapperNews").css("height",22).css("overflow","hidden").css("cursor","pointer").css("position","relative");
$("#inscritNewsletter a").click(function(){
        $(this).css("cursor","pointer").removeAttr("href");
        $("#inscritNewsletter form").stop().animate({"top": "-29px"}, "slow");
});

$("a.prevNews").click(function(){
        $("#inscritNewsletter form").stop().animate({"top": "0px"}, "slow");
});

$('.selectPrint').css("cursor","pointer");

$('.selectPrint').click(function() {
        var sUrl = "http://" + g_domaine + "/admin/egcDatasXML.php";
        var numdoss = $("#iddossier").html();
        $.ajax({
            type: "POST",
            url: sUrl,
            data: "commutateur=verrouille&dossier=" + numdoss,
            success: 
                function (responseXML) {
                    node = responseXML.getElementsByTagName('verrouille').item(0);
                    if (node != null) {
                        if (node.firstChild.data == "oui")
                            return;
                    }
                    else {
                        alert("La validation du dossier à échoué");
                    }
                },
            error: function () { alert(g_errajax); }
        });
        $("#inter").jqprint({importCSS: true});
});

$("link[type='application/rss+xml']").remove();

}); 
