var formimg = ""; function ajaxid(param, page, id) { if(document.all) { var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ; } else { var XhrObj = new XMLHttpRequest(); } var content = document.getElementById(id); XhrObj.open("POST", page); XhrObj.onreadystatechange = function() { if (XhrObj.readyState == 4 && XhrObj.status == 200) { if (XhrObj.responseText == "EXPIRE") { window.location.href = '/sp_admin.htm'; } else { content.innerHTML = XhrObj.responseText; } } else { /*content.innerHTML = "
\"\"  ????????????????



 




"; */ } } XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); XhrObj.send(param); } function dynajmanuel(type,session) { ajaxid('type='+type,'/dains/dns_ajmanuel.php?'+session,'dyn_manuel'); } function dynnav(data,nav,session) { ajaxid(data+'&'+nav,'/dains/dns_ajmanuel.php?'+session,'dyn_manuel'); } function finform(e) { formimg = e; if(document.getElementById(formimg)==undefined) { } else { setTimeout("document.getElementById(formimg).style.visibility='none';document.getElementById(formimg).style.display='none';",1500); } } function ajaxformid(param, page, id) { if(document.all) { var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ; } else { var XhrObj = new XMLHttpRequest(); } var content = document.getElementById(id); XhrObj.open("POST", page); XhrObj.onreadystatechange = function() { if (XhrObj.readyState == 4 && XhrObj.status == 200) { if (XhrObj.responseText == "EXPIRE") { window.location.href = '/sp_admin.htm'; } else { content.innerHTML = XhrObj.responseText; var ajaction99 = eval(content); //alert(ajaction99); var aj = id+'_result'; if(document.getElementById(aj)==undefined) { } else { finform(aj); } } } else { /* content.innerHTML = "
\"\" 



 




"; */ } } XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); XhrObj.send(param); } function valuebox(field) { var tmp = ""; var box=document.getElementsByName(field); for (i = 0; i < box.length; i++) { if((box[i].value!="") && (box[i].value!=undefined) && (box[i].checked==true)) { tmp += box[i].value+','; } } return tmp; } function display(e) { displayMessage(e+'&iframe=yes&id_de_session=707bd59d103d8a4c749a46203b3a440a','modalDialog_transparentDivs'); } function displayadmin(e) { displayadminMessage(e+'&iframe=yes&id_de_session=707bd59d103d8a4c749a46203b3a440a','modalDialog_transparentDivs'); } function refreshpendinglist(e) { if(parent.document.getElementById('temlist')!=undefined) { if(parent.document.getElementById('temlist').value=="oui") { setTimeout("parent.dynajmanuel('listeattente','id_de_session=707bd59d103d8a4c749a46203b3a440a'),1000"); } } } function iframeverification(retour) { // Sur le modal, on choisi d'annuler et de sortir. Donc on ferme le modal et on reinit le mode add if(retour=="cancel") { // Appel sur Modal Ajax : alert(document.getElementById('DHTMLSuite_modalBox_contentDiv').innerHTML); // Appel sur Modal Fixe : alert(document.getElementById('DHTMLSuite_modalBox_contentDiv').divs_content.innerHTML); refreshpendinglist('lamda'); closeMessage(); } else { } } function checkAll(field) { var tmp; var box=document.getElementsByName(field); for (i = 0; i < box.length; i++) { box[i].checked = true ; } } function uncheckAll(field) { var tmp; var box=document.getElementsByName(field); for (i = 0; i < box.length; i++) { box[i].checked = false ; } } function popup(maj_popup) { origine = window.open(maj_popup,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes,left=50,screenX=50,top=150,screenY=150,width=700,height=650'); } var enableCache = false; var jsCache = new Array(); var dynamicContent_ajaxObjects = new Array(); function ajax_showContent(divId,ajaxIndex,url) { var targetObj = document.getElementById(divId); targetObj.innerHTML = dynamicContent_ajaxObjects[ajaxIndex].response; if(enableCache){ jsCache[url] = dynamicContent_ajaxObjects[ajaxIndex].response; } dynamicContent_ajaxObjects[ajaxIndex] = false; ajax_parseJs(targetObj) } function ajax_loadContent(divId,url) { /* if(enableCache && jsCache[url]){ document.getElementById(divId).innerHTML = jsCache[url]; return; } */ var ajaxIndex = dynamicContent_ajaxObjects.length; document.getElementById(divId).innerHTML = "
\"\" 



 




"; dynamicContent_ajaxObjects[ajaxIndex] = new sack(); dynamicContent_ajaxObjects[ajaxIndex].requestFile = url; // Specifying which file to get dynamicContent_ajaxObjects[ajaxIndex].onCompletion = function(){ ajax_showContent(divId,ajaxIndex,url); }; // Specify function that will be executed after file has been found dynamicContent_ajaxObjects[ajaxIndex].runAJAX(); // Execute AJAX function } function ajax_admin_loadContent(divId,url) { var ajaxIndex = dynamicContent_ajaxObjects.length; document.getElementById(divId).innerHTML = "
\"\" Chargement ...



Chargement 
Chargement, patientez svp ...



"; dynamicContent_ajaxObjects[ajaxIndex] = new sack(); dynamicContent_ajaxObjects[ajaxIndex].requestFile = url; // Specifying which file to get dynamicContent_ajaxObjects[ajaxIndex].onCompletion = function(){ ajax_showContent(divId,ajaxIndex,url); }; // Specify function that will be executed after file has been found dynamicContent_ajaxObjects[ajaxIndex].runAJAX(); // Execute AJAX function } function ajax_parseJs(obj) { var scriptTags = obj.getElementsByTagName('SCRIPT'); var string = ''; var jsCode = ''; for(var no=0;no=0){ jsCode = jsCode + scriptTags[no].text + '\n'; } else jsCode = jsCode + scriptTags[no].innerHTML; } } if(jsCode)ajax_installScript(jsCode); } function ajax_installScript(script) { if (!script) return; if (window.execScript){ window.execScript(script) }else if(window.jQuery && jQuery.browser.safari){ // safari detection in jQuery window.setTimeout(script,0); }else{ window.setTimeout( script, 0 ); } } function $m(theVar){ return document.getElementById(theVar) } function remove(theVar){ var theParent = theVar.parentNode; theParent.removeChild(theVar); } function addEvent(obj, evType, fn){ if(obj.addEventListener) obj.addEventListener(evType, fn, true) if(obj.attachEvent) obj.attachEvent("on"+evType, fn) } function removeEvent(obj, type, fn){ if(obj.detachEvent){ obj.detachEvent('on'+type, fn); }else{ obj.removeEventListener(type, fn, false); } } function isWebKit(){ return RegExp(" AppleWebKit/").test(navigator.userAgent); } function ajaxUpload(form,url_action,id_element){ var detectWebKit = isWebKit(); form = typeof(form)=="string"?$m(form):form; var erro=""; if(form==null || typeof(form)=="undefined"){ erro += "The form of 1st parameter does not exists.\n"; }else if(form.nodeName.toLowerCase()!="form"){ erro += "The form of 1st parameter its not a form.\n"; } if($m(id_element)==null){ erro += "The element of 3rd parameter does not exists.\n"; } if(erro.length>0){ alert("Error in call ajaxUpload:\n" + erro); return; } var iframe = document.createElement("iframe"); iframe.setAttribute("id","ajax-temp"); iframe.setAttribute("name","ajax-temp"); iframe.setAttribute("width","0"); iframe.setAttribute("height","0"); iframe.setAttribute("border","0"); iframe.setAttribute("style","width: 0; height: 0; border: none;"); form.parentNode.appendChild(iframe); window.frames['ajax-temp'].name="ajax-temp"; var doUpload = function(){ removeEvent($m('ajax-temp'),"load", doUpload); var cross = "javascript: "; cross += "window.parent.$m('"+id_element+"').innerHTML = document.body.innerHTML; void(0);"; $m(id_element).innerHTML = '[DaiNS] : ERROR #199 - Please Advise us!'; $m('ajax-temp').src = cross; if(detectWebKit){ remove($m('ajax-temp')); }else{ setTimeout(function(){ remove($m('ajax-temp'))}, 250); } } addEvent($m('ajax-temp'),"load", doUpload); form.setAttribute("target","ajax-temp"); form.setAttribute("action",url_action); form.setAttribute("method","post"); form.setAttribute("enctype","multipart/form-data"); form.setAttribute("encoding","multipart/form-data"); $m(id_element).innerHTML = ''; form.submit(); }