child=false;

function done() {
	fenetre.close();
	child = false;
}

function vue(img, titre, texte, w, h) {
	
	i1 = new Image;
	i1.src = img;

	chaine = new String(texte);
	tl = chaine.length;
	
	if (w >= h) {
		if (tl > 2) {
			charsbyline = 92 * w / 600;
			linestoadd = tl / charsbyline;
			linestoadd = Math.round(linestoadd + .5);
			pixtoadd = 26 * linestoadd;
			h = h +pixtoadd;
		}
		if (child==true) fenetre.close();
		fenetre = window.open("","","height="+h+",width="+w+",left=10,top=10,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,directories=no,titlebar=no");
		child = true;
		setTimeout("done()", 60000);
		fenetre.document.write("<html>\r\n<head>\r\n<title>"+titre+"</title>\r\n<style>TD {font-family:Verdana;font-size:10px;color:#336600;text-align:center;font-weight: bold;}</style>\r\n</head>\r\n<body leftmargin='0' marginwidth='0' topmargin='0' marginheight='0' onBlur=\"self.close()\">\r\n<img src=\'"+img+"\'>\r\n<table>\r\n<tr>\r\n<td>"+texte+"</td>\r\n</tr>\r\n</table>\r\n</body>\r\n</html>");
	} else {
		if (tl > 2) {
			lignesdispo = h / 16;
			lignesdispo = Math.round(lignesdispo - .5)
			charsbyline = tl / lignesdispo;
			pixtoadd = charsbyline * 600 / 84;
			if (pixtoadd < 150) { pixtoadd = 200; }
			w = w +pixtoadd;
		}
		if (child==true) fenetre.close();
		fenetre = window.open("","","height="+h+",width="+w+",left=10,top=10,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,directories=no,titlebar=no");
		child = true;
		setTimeout("done()", 60000);
		fenetre.document.write("<html>\r\n<head>\r\n<title>"+titre+"</title>\r\n<style>TD {font-family:Verdana;font-size:10px;color:#336600;text-align:center;font-weight: bold;}</style>\r\n</head>\r\n<body leftmargin='0' marginwidth='0' topmargin='0' marginheight='0' onBlur=\"self.close()\">\r\n<img src=\'"+img+"\' align='left'>\r\n<table height='100%'>\r\n<tr>\r\n<td valign='bottom'>"+texte+"</td>\r\n</tr>\r\n</table>\r\n</body>\r\n</html>");
	}
}

