self.name="jmc_web_page"; cookie_plus= "plus="; /******** Fonction annexes (internes) **************/ function ContientTexte(contenant, contenu) { contenant= contenant.toUpperCase(); contenu= contenu.toUpperCase(); return(contenant.indexOf(contenu)); } /************* Longue fonction d'initialisation ******************/ function Initialise() { //Gestion du titre /* Ancienne version, ne fonctionne pas sous IE t= document.getElementsByTagName("title").item(0).firstChild; if (t != null) { // Non IE document.getElementsByTagName("h1")[0].firstChild.data= t.data; t.data= "Réalisation de sites web : "+t.data; } */ document.getElementsByTagName("h1")[0].firstChild.data= document.title; document.title= "Réalisation de sites web : "+document.title; //Mode affichage : 'simple' par défaut aff_plus= false; //Utilisé ici et comme drapeau pour AffInverse() (voir en fin) if(document.cookie) if ((deb= document.cookie.indexOf(cookie_plus)) >= 0) { deb += cookie_plus.length; fin= document.cookie.indexOf(";", deb); if (fin < 0) fin = document.cookie.length; aff_plus= unescape(document.cookie.substring(deb,fin)) == "visible"; } if (aff_plus) AffPlus() else { elt= document.getElementsByTagName("div"); for (i= 0; i < elt.length; i++) if (elt[i].getAttribute("class") == "plus") elt[i].setAttribute("onClick", "ClicPlus(this)"); AffSimple(); } // Infobulle dans la boîte des renvois elt= document.getElementsByTagName("div"); for (i= 0; i < elt.length; i++) if (elt[i].getAttribute("class") == "renvois") elt[i].setAttribute("title", "Paragraphes de cette page"); //Info bulle et classe pour les liens externes elt= document.getElementsByTagName("a"); for (i= 0; i < elt.length; i++) { att= elt[i].attributes; for (a= 0; a < att.length; a++) if (att[a].nodeValue && att[a].nodeValue != null && att[a].nodeValue.substr(0, 4) == "http") { elt[i].setAttribute("title", "Lien externe : ouverture d'une nouvelle fenêtre / onglet"); elt[i].setAttribute("class", "lien_externe"); } } //Positionnement pour recherche depuis l'index if (recherche_index && recherche_index != null && recherche_index != '') { getClass= document.getElementsByClassName; if (getClass) elt= document.getElementsByClassName("_index_motclef"); else elt= document.getElementsByTagName("span"); //alert(recherche_index+" ("+elt[0].nodeName+")"); for (i= 0; i < elt.length; i++) { //alert("["+elt[i].firstChild.data+"] [" + recherche_index+"] "+ elt[i].firstChild.data.indexOf(recherche_index)); if (elt[i].getAttribute("class") == "_index_motclef" && ContientTexte(elt[i].firstChild.data, recherche_index) != -1 ) { // && elt[i].firstChild.data.indexOf(recherche_index) != -1 ) { el= elt.item(i); el.style.backgroundColor= '#88FF88'; el.scrollIntoView(true); break; } } /* for (j= 0; j < elt[i].attributes.length; j++) if (elt.item(i).attributes[j].nodeValue == "index") { el= elt.item(i); el.style.backgroundColor= '#88FF88'; } */ } } /************* Fin de la fonction d'initialisation ******************/ function Termine() { ; } function OuvreDemo(pg_demo) { fen_demo=window.open("http://web.icioula.org/pages/medias/demo/"+pg_demo, "jmc_web_demo", "height=400, width=620, resizable=yes, scrollbars=yes"); fen_demo.focus(); } function Index() { fen_recherche=window.open("http://web.icioula.org/anx/recherche.php", "jmc_web_recherche", "height=400, width=620, resizable=yes, scrollbars=yes"); fen_recherche.focus(); } function Ecrire() { fen_ecrire=window.open("http://web.icioula.org/anx/ecrire.php", "jmc_web_ecrire", "height=400, width=620, resizable=yes, scrollbars=yes"); fen_ecrire.focus(); } function ClicPlus(elt) { elt.style.height= ""; elt.style.backgroundColor= "#ffffcc"; elt.style.color= "#000000"; } function AffChangement(vis) { elt= document.getElementsByTagName("div"); for (i= 0; i < elt.length; i++) if (elt[i].getAttribute("class") == "plus") { if (vis == "hidden") { elt[i].style.height= "3px"; elt[i].style.backgroundColor= "#ffff44"; elt[i].style.color= "#ffff44"; } else { elt[i].style.height= ""; elt[i].style.backgroundColor= "#ffffcc"; elt[i].style.color= "#000000"; } } document.getElementById("mesg_contenu").firstChild.data= vis == "hidden" ? "simple" : "détaillé"; document.getElementById("lien_contenu").firstChild.data= vis == "hidden" ? "détaillé" : "simple"; //Mémorisation if(document.cookie) document.cookie = cookie_plus + escape(vis); } function AffSimple() { AffChangement("hidden"); } function AffPlus() { AffChangement("visible"); } function AffInverse() { if (aff_plus) AffChangement("hidden"); else AffChangement("visible"); aff_plus = !aff_plus; }