
/***************************************
* FONCTION * AJOUT DU SITE AUX FAVORIS *
***************************************/

function ART_fav(url,lbl) {
    if ( navigator.appName != 'Microsoft Internet Explorer' ){
        window.sidebar.addPanel(lbl,url,"");
    }else{
        window.external.AddFavorite(url,lbl);
    }
}



/***************************************************
* infobulle
****************************************************/
this.tooltip = function(){    
    /* CONFIG */        
        xOffset = 10;
        yOffset = 20;        
        // these 2 variable determine popup's distance from the cursor
        // you might want to adjust to get the right result        
    /* END CONFIG */        
    $(".tooltip").hover(function(e){                                              
        var reg=new RegExp("(-_-)","g");
        if(this.tar==undefined){
            this.tar = this.title.split('-_-');
            this.t = "<span>"+this.tar.shift()+"</span><br />"+this.tar.join('<br />');
        } 
        this.title = "";                                      
        tT_div = document.createElement("tooltip");
        tT_div.id = "tooltip";
        tT_div.className = 'tooltip_box'; 
        tT_div.style.position = "absolute";
        tT_div.style.zIndex = 1500;
        tT_div.innerHTML = this.t;
        tT_div.style.display = 'none'; 
        document.body.appendChild(tT_div);
        
        $("#tooltip")
            .css("top",(e.pageY - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px") 
            .fadeIn("fast");        
    },
    function(){
        this.title = this.t;        
        $("#tooltip").remove();
    });    
    $(".tooltip").mousemove(function(e){
        $("#tooltip")
            .css("top",(e.pageY - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px");
    });            
};



// starting the script on page load
$(document).ready(function(){
    tooltip();
    $('#menucell td').click(function() { 
        $(this).find('a').each(function(){ window.location = this.href; });
    });
    
    $('#sous_menu td').click(function() { 
        $(this).find('a').each(function(){ window.location = this.href; });
    });
    
    $('#menu_08').click(function() { 
        $(this).find('a').each(function(){ window.location = this.href; });
    });
    
    $('#td_logo').click(function() { 
        $(this).find('a').each(function(){ window.location = this.href; });
    }); 
    
    
    jQuery.fn.centerScreen = function(loaded) {
        var obj = this;
        var dx = 15;
        var dy = 0;
        if(!loaded) {
            obj.css('top', ($(window).height()/2-this.height()/2)+$(window).scrollTop()+dy);
            obj.css('left', $(window).width()/2-this.width()/2+dx);
            $(window).resize(function(){ obj.centerScreen(!loaded); });
            $(window).scroll(function(){ obj.centerScreen(!loaded); });
        } else {
            obj.stop();
            obj.animate({ top: ($(window).height()/2-this.height()/2)+$(window).scrollTop()+dy, left: $(window).width()/2-this.width()/2+dx}, 200, 'linear');
        }
    }
    
    $("#photo_div").fadeOut('fast'); 
       
});
/*    $("#table_menu td").hoverIntent({
        sensitivity: 3, 
        interval: 200, 
        over: makeTall, 
        timeout: 500, 
        out: makeShort
    });
}); // close document.ready

function makeTall(){ 
  ART_showMenu(Mid,Mbtn,Mtable_menu);
}
function makeShort(){} */

function ART_getGalerie(swf,w,h,xml,id){
    id = 'galerie_'+id;
    $('#'+id).css('left',(450-w)/2);
    if($('#'+id).is(":visible")) $('#'+id).empty();
    $('#'+id).slideToggle('slow', function(){
         if($('#'+id).is(":visible")) ART_setGalerie(swf,w,h,xml,id); 
    });

}


function ART_getImage(src,texte,w,h){
    $("#photo_loader").css({'width':w+'px','height':h+'px'});
    $("#photo_loader").empty();
    $("#photo_comment").html(texte);
    $("#photo_div").fadeIn('fast');
    $("#photo_div").centerScreen();
    var img = new Image();
    img.src = src; 
    $(img).load(function(){
        $(this).hide();
        $("#photo_loader").append(this);
        $(this).fadeIn("medium"); 
    });
}

function ART_unloadImage(){
    $("#photo_div").fadeOut('slow',function(){
         $("#photo_loader").empty();
         $("#photo_comment").empty();
    });
}

