window.onload=show;
var timeout; 
function show(id) {
        var d = document.getElementById(id);
        for (var i = 1; i<=10; i++) {
             if (document.getElementById('smenu'+i)) {
                document.getElementById('smenu'+i).style.display='none';
             }
        }
        if (d) {d.style.display='block';}
}
function CacherDelai() {
        timeout = setTimeout('show()',650);
}
function AnnulerCacher() {
        if (timeout) {
                clearTimeout(timeout);
        }
}
function CacherMenus() {
        for(i=1;i<=nbmenu;i++) {
                if (document.getElementById("smenu"+i))//undefined
                        document.getElementById("smenu"+i).style.display='none';
        }
}
// http://rajshekhar.net/blog/archives/85-Rasmus-30-second-AJAX-Tutorial.html
// 
function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}
var http = createRequestObject();

function sendRequest(action) {
    http.open('get','postit.php?action='+action);
    http.onreadystatechange = handleResponse;
    http.send(null);
}

function handleResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        var update = new Array();
        if(response.indexOf('|' != -1)) {
            update = response.split('|');
            document.getElementById(update[0]).innerHTML = update[1];
        }
    }
}
// deplacer cadre (composant "postit")
//
function deplacer(cible,x,y) {
    if(document.getElementById) {
         var addr = "";
         hautimage += y;
         gaucheimage += x;
         sendRequest("set&id="+cible+"&top="+hautimage+"&left="+gaucheimage);
         document.getElementById(cible).style.top = hautimage;
         document.getElementById(cadre).style.left = gaucheimage;
     }
}
// marquee 
// http://moncastel.9online.fr/marquee/defil_v.html
<!--
// pas de défilement :
var pas=1
// hauteur de la partie visible
var h_fen="120px"

function scrollmrq(){
if ( parseInt(mrq.style.top) > -h_mrq )
mrq.style.top = parseInt(mrq.style.top)-pas+"px"
else
mrq.style.top=fen.offsetHeight
}

function init_mrq(){
mrq=document.getElementById("marquee"); 
fen=document.getElementById("fenetre"); 
fen.onmouseover=function(){stoc=pas;pas=0};
fen.onmouseout=function(){pas=stoc};fen.style.height=h_fen;
h_mrq=mrq.offsetHeight;
with(mrq.style){position="absolute";top=h_fen;}
setInterval("scrollmrq()",50);
}
function addEvent(obj,evType,fn,capt){ // ajoute un événement sans écraser l'éxistant.
if(obj.addEventListener){obj.addEventListener(evType,fn,capt);return true;} // NS6+
else if(obj.attachEvent)obj.attachEvent("on"+evType,fn) // IE 5+
else {return false;}
} 

addEvent(window,"load",init_mrq) 
//-->
function ident() {
    var wil = window.open ("../admin/cman.php?demande=ident", "wil", "width=500,  height=680,scrollbars=yes") ;
}

function wident(id,domain) {
 var wil = window.open ("../admin/cman.php?demande=ident&page_id="+id+"&domain="+domain, "wil", 
           "width=560,height=130,scrollbars=yes") ;
}
function lostpasswd(lang,domain) {
 var wil = window.open ("../admin/cman.php?demande=lostpasswd&lang="+lang+"&domain="+domain, "wil", 
           "top=240px,left=240px,width=560,height=130,scrollbars=yes") ;
}
function profil ()	{
  var wil = window.open ("../admin/cman.php?demande=creation", "wil", 
           "width=500,height=560,scrollbars=yes") ;
}
function mdp()	{
  var wil = window.open ("../admin/cman.php?demande=updpwd", "wil", 
           "width=500,height=560,scrollbars=yes") ;
}
function map(id,domain) {
    var wil = window.open ("../publi/map.php?id="+id+"&domain="+domain, "sitemap",
           "width=530,height=740,scrollbars=yes") ;
}
