function popImg(url,title){
	wnd=window.open("","imgWnd","scrollbars=no,width=400,height=300");
	wnd.document.write(
		"<title>Chargement...</title>"+
		"<style>body{margin:0px}</style>"+
		"<script>"+
			"var title=\""+title.replace(/\"/g,"\\"+'"')+"\";"+
			"function wndsize(){"+
				"x=document.images[0].width;"+
				"y=document.images[0].height;"+
				"if(x>800){"+
					"y=document.images[0].height*=800/x;"+
					"x=document.images[0].width=800;"+
				"}"+
				"if(y>600){"+
					"x=document.images[0].width*=600/y;"+
					"y=document.images[0].height=600;"+
				"}"+
				"if(window.innerWidth){"+
					"wx=window.innerWidth;"+
					"wy=window.innerHeight;"+
				"}else{"+
					"wx=document.body.clientWidth;"+
					"wy=document.body.clientHeight;"+
				"}"+
				"wx=x-wx;"+
				"wy=y-wy;"+
				"window.moveTo(0,0);"+
				"window.resizeBy(wx,wy);"+
			"}"+
		"</script>"+
		"<body bgcolor=black onload='wndsize();document.title=title;self.focus()'>"+
			"<img src='"+url+"' name='img' id='img' title='Cliquez ici pour fermer cette fen&ecirc;tre...' onclick=self.close()>"+
		"</body>"
	);
	wnd.document.close();
	return false;
}

function tbl(i){
	if(i==0) document.write("<table id='pics'><tr>");
	if(i==1) document.write("</tr><tr>");
	if(i==2) document.write("</tr></table>");
}

function pic(id,text){
	document.write(
		"<td>"+
			"<a href='img.php?pid="+id+"&full' title=\""+text.replace(/\"/g,"&quot;")+"\" onclick='return popImg(this.href,this.title)'>"+
				"<img src='img.php?pid="+id+"'><br>"+
				text.replace(/</g,"&lt;")+
			"</a>"+
			(admin?"<br><input type='checkbox' name='del["+id+"]' value='1'>":"")+
		"</td>"
	);
}