/* Fonction centerWindow Cette fonction est appelee dans les popups des illustrations. Elle permet, selon les navigateurs, de parametrer les proprietes et d'afficher une image correcte à l'ecran */ function centerWindow() { var url = document.location.search.substring(1); param = url.split("&&"); newRien = param[0].split("=="); newWinL = param[1].split("=="); newWinH = param[2].split("=="); window.resizeTo(newWinL[1],newWinH[1]); var winW = 0, winH = 0; if (parseInt(navigator.appVersion)>3) { if (navigator.appName=="Netscape") { winW = window.innerWidth + 25; winH = window.innerHeight + 35; } if (navigator.appName.indexOf("Microsoft")!=-1) { winW = document.body.offsetWidth; winH = document.body.offsetHeight+20; } } var width = winW; var height = winH; widthmax = screen.width; // ... diminuee de la barre des taches qui peut se trouver à droite ou à gauche de l'ecran // occupation de la barre des taches en pixels = 40 ... widthmax = widthmax - 80; // la hauteur maximale est la hauteur de l'àcran heightmax = screen.height; // ... diminuee de la barre des taches qui peut se trouver en bas ou en haut de l'ecran // occupation de la barre des taches en pixels = 40 ... heightmax = heightmax - 20; // On verifie la hauteur et la largeur de l'image var tooWidth = 0; var tooHeight = 0; if (width>widthmax) {width=widthmax;tooWidth=1} if (height>heightmax) {height=heightmax;tooHeight=1} if ( (tooHeight==1) && (tooWidth==1) ) { //alert("too Height && too Width"); self.moveTo(0,0); self.resizeTo(screen.width,(screen.height-50)); } else if (tooWidth==1) { //alert("too Width"); self.moveTo(0,(screen.height-height)/2); self.resizeTo(screen.width,height+30); } else if (tooHeight==1) { //alert("too Height"); self.moveTo((screen.width-width)/2,0); self.resizeTo((width+20),(screen.height-50)); } else { //alert("Autre"); self.moveTo((screen.width-width)/2,(screen.height-height)/2); self.resizeTo((width+20),(height+20)); } self.focus(); }