// JavaScript Document - opens image in new window and sizes window automatically

imagepath='';
function popdetail(imgurl) {
	detailwin=window.open("about:blank","","height=200,width=200")
	imagepath=imgurl;
	setTimeout('updatesize()',500)
}

function updatesize() {
doc=detailwin.document;
doc.open('text/html');
doc.write('<html><head><title>Enlarged Image<\/title><link href="css/imagedetail.css" rel="stylesheet" type="text/css"><\/head><body onLoad="if  (self.resizeTo)self.resizeTo((document.images[0].width+20),(document.images[0].height+100))" topmargin="4" leftmargin="4" rightmargin="4" bottommargin="4"><table border="0" cellspacing="0" cellpadding="0"><tr><td>');
doc.write('<img src="' + imagepath + '"><\/td><\/tr><tr><td><form name="detail"><input type="button" align="right" value="Close Window" onClick="self.close()"><\/td><\/tr><\/table>');
doc.write('<\/form><\/body><\/html>');
doc.close();
}
