function gererEvenementHistorique(idLocation,donneeHistorique){if (donneeHistorique==null || donneeHistorique=="" || oZoneContenu==null){return ;}masqueContext();var indexPr=donneeHistorique.indexOf("[!]");var serv=donneeHistorique.substring(0,indexPr);var tabP=donneeHistorique.substring(indexPr+3).split("[!]");var servSel=serv;if (tabP[0]!=""){servSel=tabP[0];}if (servSel.indexOf("homePage")==0){ effacerDetailsSiNonListe(); } if (servSel=="lanceDansIFrame"){ if (tabP[1]!=""){ selectionneService(tabP[1]); IU_selectionneBouton(tabP[1]); } return lanceDansIFrame(tabP[2],tabP[1],true); } selectionneService(servSel); IU_selectionneBouton(servSel); var cacheRetouve=false;if (historyStorage.hasKey(idLocation+"cacheHTML")){oZoneContenu.innerHTML=historyStorage.get(idLocation+"cacheHTML");razDefilement(); var DOMReponse=IU_objDom();DOMReponse.loadXML(historyStorage.get(idLocation+"cacheXML")); DOMListeCourante=DOMReponse.documentElement; cacheRetouve=true; if (servSel.indexOf("homePage")==0 && estMoz){ var lesmarq=document.getElementsByTagName("marquee"); for (var i=0;i<lesmarq.length;i++){ lesmarq[i].start(); } } } else { tabP.splice(0,1); afficheService(serv,tabP); } var obsel=null; if (historyStorage.hasKey(idLocation+"objetSel")){ obsel=PF_donneObjet(historyStorage.get(idLocation+"objetSel")); if (obsel!=null){ selectionDansListe(obsel); } } if (historyStorage.hasKey(idLocation+"defilZC")){ var locmm=historyStorage.get(idLocation+"defilZC"); reappliquerDefilZC(locmm); setTimeout("reappliquerDefilZC('"+locmm+"')",180); } else if (obsel && !cacheRetouve){ obsel.scrollIntoView(); while (obsel!=null && obsel.scrollLeft!=null){obsel.scrollLeft=0;obsel=obsel.parentNode;} }}function memoriserPositionZC(){var locAct=dhtmlHistory.getCurrentLocation();if (objSelCourant!=null){historyStorage.put(locAct+"objetSel",objSelCourant.id);} else {historyStorage.remove(locAct+"objetSel");}var resDefil=donneDefilementZC();if (resDefil!=""){historyStorage.put(locAct+"defilZC",resDefil);}}function donneDefilementZC(){var obj=oZoneContenu;var resDefil="DIV,,0";while (obj!=null){if (obj.scrollTop>0){var nbal=obj.nodeName.toUpperCase();if (nbal=="DIV" && obj.id==""){obj.id="dvBaseDefilZC";} resDefil=nbal+","+obj.id+","+obj.scrollTop;break;}obj=obj.parentNode;}return resDefil;}function reappliquerDefilZC(tabP){tabP=tabP.split(",");if (tabP[2]==0){return ;}var oDefil=null;if (tabP[0]=="HTML" || tabP[0]=="BODY"){oDefil=document.getElementsByTagName(tabP[0]).item(0);} else {oDefil=PF_donneObjet(tabP[1]);}if (oDefil!=null){oDefil.scrollTop=tabP[2];}}function StockVar(cle,val){this.cle=cle;this.val=val;}var tabStockVar;window.dhtmlHistory = { initialize: function() { if (this.isInternetExplorer() == false) { return; } if (historyStorage.hasKey("DhtmlHistory_pageLoaded") == false) { this.fireOnNewListener = false; this.firstLoad = true; historyStorage.put("DhtmlHistory_pageLoaded", true); } else { this.fireOnNewListener = true; this.firstLoad = false; } },addListener: function(callback) { this.listener = callback; if (this.fireOnNewListener == true) { this.fireHistoryEvent(this.currentLocation); this.fireOnNewListener = false; } }, add: function(newLocation, historyData) { var self = this; var addImpl = function() { if (self.currentWaitTime > 0) self.currentWaitTime = self.currentWaitTime - self.WAIT_TIME; newLocation = self.removeHash(newLocation); historyStorage.put(newLocation, historyData); self.ignoreLocationChange = true; this.ieAtomicLocationChange = true; self.currentLocation = newLocation; window.location.hash = newLocation; if (self.isInternetExplorer()) self.iframe.src = "blank.html?" + newLocation; this.ieAtomicLocationChange = false;document.title=titreFenGarde; }; window.setTimeout(addImpl, this.currentWaitTime); this.currentWaitTime = this.currentWaitTime + this.WAIT_TIME; }, isFirstLoad: function() { if (this.firstLoad == true) { return true; } else { return false; } }, getCurrentLocation: function() { try{ var currentLocation = this.removeHash(window.location.hash); }catch(e){return "";} return currentLocation; },currentLocation: null,listener: null,iframe: null,ignoreLocationChange: null, WAIT_TIME: 200, currentWaitTime: 0, fireOnNewListener: null, firstLoad: null, ieAtomicLocationChange: null, create: function() { var initialHash = this.getCurrentLocation(); this.currentLocation = initialHash; if (this.isInternetExplorer()) { document.write("<iframe style='border: 0px; width: 1px; " + "height: 1px; position: absolute; bottom: 0px; " + "right: 0px; visibility: visible;' " + "name='DhtmlHistoryFrame' id='DhtmlHistoryFrame' " + "src='blank.html?" + initialHash + "'>" + "</iframe>"); this.WAIT_TIME = 400; } var self = this; window.onunload = function() { self.firstLoad = null; }; if (this.isInternetExplorer() == false) { if (historyStorage.hasKey("DhtmlHistory_pageLoaded") == false) { this.ignoreLocationChange = true; this.firstLoad = true; historyStorage.put("DhtmlHistory_pageLoaded", true); } else { this.ignoreLocationChange = false; this.fireOnNewListener = true; } } else { this.ignoreLocationChange = true; } if (this.isInternetExplorer()) { this.iframe = document.getElementById("DhtmlHistoryFrame"); } var self = this; var locationHandler = function() { self.checkLocation(); }; setInterval(locationHandler, 100); },fireHistoryEvent: function(newHash) { var historyData = historyStorage.get(newHash); this.listener.call(null, newHash, historyData); },checkLocation: function() { if (this.isInternetExplorer() == false && this.ignoreLocationChange == true) { this.ignoreLocationChange = false; return; } if (this.isInternetExplorer() == false && this.ieAtomicLocationChange == true) { return; } var hash = this.getCurrentLocation(); if (hash == this.currentLocation) return; this.ieAtomicLocationChange = true; if (this.isInternetExplorer() && this.getIFrameHash() != hash) { this.iframe.src = "blank.html?" + hash; } else if (this.isInternetExplorer()) { return; } this.currentLocation = hash; this.ieAtomicLocationChange = false; this.fireHistoryEvent(hash); }, getIFrameHash: function() { var historyFrame = document.getElementById("DhtmlHistoryFrame"); var hash=""; try{var doc = historyFrame.contentWindow.document; hash = new String(doc.location.search); }catch(e){} if (hash.length == 1 && hash.charAt(0) == "?") hash = ""; else if (hash.length >= 2 && hash.charAt(0) == "?") hash = hash.substring(1); return hash; }, removeHash: function(hashValue) { if (hashValue == null || hashValue == undefined) return null; else if (hashValue == "") return ""; else if (hashValue.length == 1 && hashValue.charAt(0) == "#") return ""; else if (hashValue.length > 1 && hashValue.charAt(0) == "#") return hashValue.substring(1); else return hashValue; }, iframeLoaded: function(newLocation) { if (this.ignoreLocationChange == true) { this.ignoreLocationChange = false; return; } var hash = new String(newLocation.search); if (hash.length == 1 && hash.charAt(0) == "?") hash = ""; else if (hash.length >= 2 && hash.charAt(0) == "?") hash = hash.substring(1); if (this.pageLoadEvent != true) { window.location.hash = hash; } this.fireHistoryEvent(hash); },isInternetExplorer: function() { var userAgent = navigator.userAgent.toLowerCase(); if (document.all && userAgent.indexOf('msie')!=-1) { return true; } else { return false; } }};window.historyStorage = { debugging: false, storageHash: new Object(), hashLoaded: false, put: function(key, value) { if (this.hasKey(key)){for (var i=0;i<tabStockVar.length;i++){ var oCle=tabStockVar[i]; if (oCle.cle==key){ oCle.val=value; break; } } } else { tabStockVar.push(new StockVar(key,value)); } }, remove: function(key) {for (var i=0;i<tabStockVar.length;i++){ if (tabStockVar[i].cle==key){ tabStockVar.splice(i,1); break; } } }, get: function(key) { var res=""; this.loadHashTable(); for (var i=0;i<tabStockVar.length;i++){ var oCle=tabStockVar[i]; if (oCle.cle==key){res=oCle.val;break;} } return res; }, hasKey: function(key) { this.loadHashTable(); var res=false; this.loadHashTable(); for (var i=0;i<tabStockVar.length;i++){ var oCle=tabStockVar[i]; if (oCle.cle==key){res=true;break;} } return res; }, storageField: null, init: function() { var styleValue = "height:1px;width:1px;margin:0px;overflow:hidden"; var styleTA = "width:1px;height:1px;overflow:hidden;color:gray;font-size:4px;background-color:transparent;border-width:0px"; var newContent ="<div style=\"position:absolute;right:0px;bottom:0px\"><form id=\"historyStorageForm\" method=\"GET\" \"style=\""+styleValue+"\"><textarea id=\"historyStorageFieldMOS\" name=\"historyStorageFieldMOS\" style=\""+styleTA+"\"></textarea></form></div>"; document.write(newContent); this.storageField = document.getElementById("historyStorageFieldMOS"); }, loadHashTable: function() { if (this.hashLoaded == false) { tabStockVar=new Array(); if (this.storageField.value!=""){ var tabCles=this.storageField.value.split("[;]"); for (var t=0;t<tabCles.length;t++){ var tabP=tabCles[t].split("[.]"); tabStockVar[t]=new StockVar(tabP[0],tabP[1]); } } this.hashLoaded = true; } }, sauveChampHisto: function() { var resval=""; var nbV=tabStockVar.length; if (nbV>40){ tabStockVar.splice(2,16); nbV=tabStockVar.length; } for (var i=0;i<nbV;i++){ var oCle=tabStockVar[i]; if (i>0){resval+="[;]";} resval+=oCle.cle+"[.]"+oCle.val; } this.storageField.value = resval; } };window.historyStorage.init();window.dhtmlHistory.create();/*function ecrittabStockVar(){var res="";for (var i=0;i<tabStockVar.length;i++){res+=tabStockVar[i].cle+"/ ";}return res;}*/function reafficherDernierService(){if (dernierServiceIU!=""){return IU_service(dernierServiceIU);}var dloc=historyStorage.get(dhtmlHistory.getCurrentLocation());if (dloc!=""){if (PF_donneObjet("titreListeDyn")){titreListeFuture=XML_texteNoeud(PF_donneObjet("titreListeDyn"));}if (PF_donneObjet("descListeDyn")){descriptionListeFuture=XML_texteNoeud(PF_donneObjet("descListeDyn"));}tab0=dloc.split("[!]");vraiNomService=tab0[1];afficheService(tab0[0],tab0.slice(2));}}
