// [FONCTION] tof v4.2
// popUp dynamique image
function tof(monImage){

    var AddXPH = 0;
    
    var chercheXP       = new RegExp("Windows NT 5.1","gi");// cherche XP pr agrandir les popUp
    var chercheVISTA    = new RegExp("Windows NT 6.0","gi");// cherche Vista pr agrandir les popUp
    if(chercheXP.test(navigator.appVersion)==true){
        AddXPH = 25;
        } else if (chercheVISTA.test(navigator.appVersion)==true){
        AddXPH = 50;
        }

    Lwindow = 700;
    Hwindow = 500;
	posX = (((screen.width)-Lwindow)/2);
	posY = (((screen.height)-Hwindow)/2);
    
	w = window.open('','chargement','width='+Lwindow+',height='+Hwindow+',scrollbars=1,status=no,top='+posY+',left='+posX);
	w.document.write( "<html><head><title>Photo</title>\n" );
	w.document.write( "<script language='JavaScript'>\n");
	w.document.write( "IE5=NN4=NN6=false;\n");
	w.document.write( "if(document.all)IE5=true;\n");
	w.document.write( "else if(document.getElementById)NN6=true;\n");
	w.document.write( "else if(document.layers)NN4=true;\n");
	w.document.write( "function autoSize() {\n");
	w.document.write( "LI = document.images[0].width; HI = document.images[0].height;\n");     // Image
	w.document.write( "LS = screen.width; HS = screen.height;\n");                             // Screen
	w.document.write( "LF = LI; HF = HI+50;\n");                                                  // Fenetre (si on ajoute pas de la hauteur, l'image est coupe)
	w.document.write( "moveToX = ((LS-LF)/2); moveToY = ((HS-HF)/2);\n");                        // Position Fenetre
	w.document.write( "if (LI>=LS){LF=LS-10;moveToX=0;}\n");
	w.document.write( "if (HI>=HS){HF=HS-30;moveToY=0;LF=LF+20;}\n");
	w.document.write( "self.moveTo(moveToX,moveToY);\n");  // on deplace avant de redimentionner sinon Pb
	w.document.write( "if(IE5) self.resizeTo(LF+10, HF+"+AddXPH+" );\n");
	w.document.write( "else window.resizeTo(LF, HF+15+"+ AddXPH+" );\n");
	w.document.write( "self.focus();\n");
	w.document.write( "document.getElementById('photo').style.display = 'none';\n");
	w.document.write( "if (moveToX!=0 && moveToY!=0) {document.body.style.overflow='hidden';}\n");
	w.document.write( "" );
	w.document.write( "}\n</scri");
	w.document.write( "pt>\n");
    w.document.write( "<meta http-equiv='imagetoolbar' content='no'>\n");
	w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();'>" );
	w.document.write( "<div id=photo style='position:absolute;top:0;left:0;z-index:10;width:"+Lwindow+";text-align:center;background-color:#FF6600;color:#000000;font-weight:bold;'><br>Chargement...<br><br></div>" );
	w.document.write( "<a href='javascript:window.close();'><img src='"+monImage+"' border=0 alt='Cliquez pour FERMER'></a>");
	w.document.write( "</body></html>" );
	w.document.close();
	}
