function getXMLHTTP(){ var xhr=null; if(window.XMLHttpRequest) // Firefox et autres xhr = new XMLHttpRequest(); else if(window.ActiveXObject){ // Internet Explorer try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e1) { xhr = null; } } } return xhr; } var _xmlHttp = null; var _adresseRecherche = "/includes/javascript/calendrier_builder.php"; var cache_calendrier = false; var liste_calendriers = new Array(); function timer_kill_calendrier(id) { cache_calendrier = setTimeout("hide_calendrier("+id+")",200); } function hide_calendrier(id) { document.getElementById('calendrier_'+id).innerHTML = ''; } function annuler_cacher_calendrier() { if (cache_calendrier) clearTimeout(cache_calendrier); } function menage_calendriers(id) { //Supprime tous les calendriers de la page visible sauf id for ( keyVar in liste_calendriers ) { if (keyVar != id ) hide_calendrier(keyVar); } } function build_calendrier(id,element) { if (!liste_calendriers[id]) liste_calendriers[id] = true; if (arguments[2] && arguments[3] && arguments[4]) { var day = arguments[2]; var month = arguments[3]; var year = arguments[4]; } else { var ma_date = new Date(); var day = ma_date.getDate(); var month = ma_date.getMonth("m")+1; var year = ma_date.getFullYear("Y"); if (document.getElementById(element) && document.getElementById(element).value!='') { var chaineDate = document.getElementById(element).value; var ladate = (chaineDate).split("/"); if ((ladate.length == 3) && !isNaN(parseInt(ladate[0])) && !isNaN(parseInt(ladate[1])) && !isNaN(parseInt(ladate[2]))) { var day = parseInt(ladate[0]); var month = parseInt(ladate[1]); var year = parseInt(ladate[2]); } } } if(_xmlHttp&&_xmlHttp.readyState!=0){ _xmlHttp.abort() } _xmlHttp=getXMLHTTP(); if(_xmlHttp){ _xmlHttp.open("GET",_adresseRecherche+"?id="+id+"&element="+element+"&day="+day+"&month="+month+"&year="+year,true); _xmlHttp.onreadystatechange=function() { if(_xmlHttp.readyState==4 && _xmlHttp.responseText) { var resultat = _xmlHttp.responseText; menage_calendriers(id); document.getElementById(element).focus(); document.getElementById('calendrier_'+id).innerHTML = resultat; } }; _xmlHttp.send(null); } } function kill_calendrier(id,element,valeur) { document.getElementById(element).value=valeur; document.getElementById('calendrier_'+id).innerHTML = ''; } var tooltipMsg = new Array(); function show_help(id) { calque = document.getElementById("popup_inline"); var sTexteAide; sTexteAide = ""; if (tooltipMsg[id]) { sTexteAide = tooltipMsg[id]; } sTexteAide += "
Masquer la fenêtre
"; calque.innerHTML = sTexteAide; calque.style.display = 'block'; } function hide_help() { calque = document.getElementById("popup_inline"); calque.style.display = 'none'; } function popup(src,width,height) { window.open(src,'','width='+width+',height='+height+',scrollbars=yes'); } timer_histo = null; timer_histo_resize = null; function show_historique() { if (timer_histo_resize == null) { cancel_hide_historique(); visibility = document.getElementById("historique_liste").style.visibility; if (visibility=="" || visibility=="hidden") resize('historique_liste',0,width_historique); } } function hide_historique() { resize('historique_liste',width_historique,0); } function launch_hide_historique() { if (timer_histo_resize == null) timer_histo = setTimeout("hide_historique()","200"); } function cancel_hide_historique() { if (timer_histo_resize == null) { if (timer_histo) clearTimeout(timer_histo); } } function resizer(id,dsize,time,start,end) { if (end 0) { document.getElementById(id).style.width= newsize + 'px'; timer_histo_resize = setTimeout("resizer('"+id+"','"+dsize+"','"+time+"','"+start+"','"+end+"')",""+time+""); } else { document.getElementById(id).style.visibility='hidden'; document.getElementById(id).style.width=start+'px'; timer_histo_resize = null; } } else { document.getElementById(id).style.visibility='visible'; newsize = parseInt(document.getElementById(id).offsetWidth) + parseInt(dsize); if (newsize < end) { document.getElementById(id).style.width= newsize + 'px'; timer_histo_resize = setTimeout("resizer('"+id+"','"+dsize+"','"+time+"','"+start+"','"+end+"')",""+time+""); } else { document.getElementById(id).style.width=end+'px'; timer_histo_resize = null; } } } function resize(id,start,end) { if (end1) { if (document.forms["poster"].elements["pdfcheck"].checked==true) for (i = 0; i < choix.length; i++) choix[i].checked = true; if (document.forms["poster"].elements["pdfcheck"].checked==false) for (i = 0; i < choix.length; i++) choix[i].checked = false; } else { if (document.forms["poster"].elements["pdfcheck"].checked==true) choix.checked = true; if (document.forms["poster"].elements["pdfcheck"].checked==false) choix.checked = false; } } } function checkformatdate(element) { valeur = element.value; if (valeur.length==2) valeur+='/'; if (valeur.length==5) valeur+='/20'; element.value = valeur; } function maint_ident() { var ajax = new XHR(); ajax.setSendMethod("GET"); ajax.send("includes/javascript/ajax_maint_ident.php"); ajax.complete = function (xhr) { if (xhr.responseText != '') document.getElementById("conteneur_ajax").innerHTML = eval(xhr.responseText); } setTimeout("maint_ident()","10000"); }