// Walcam Webworks : www.walcam.co.uk/webworks
//
// Pop up a window to contain a picture....
// Find the picture, deduce the size, then adapt the window to hold the picture
// Version 2.5 08may09
// Version 2.6 07Jun10:include window move to (4,4)
//
var newwin;

function picpop(url, txt) {
	newwin = window.open("","","height=0,width=0,screenX=1,screenY=1");
	newwin.document.write("<html><title>Photos</title><style rel='stylesheet' type='text/css'>");
	newwin.document.write("body {background-color: #000000; font-family:verdana; color:#ffffff; }");
	newwin.document.write(".t {font-family:verdana;font-size:12px; font-weight:bold; color:#ffffff; text-decoration:none; background-color:#993333;padding: 0px 10px 0px 10px;}");
	newwin.document.write(".t:hover {color: yellow;background-color: #993300;padding: 0px 10px 0px 10px;text-decoration:none;}</style>");
	newwin.document.write ("<body topmargin='0' leftmargin='0' onBlur='window.focus()' ><div align='center'>&nbsp;<br /><img src='" + url +"'");
	newwin.document.write( " onload='opener.changesize();'>" +"<br />" + txt );
	newwin.document.write( " <br /><br /><a href='JavaScript:window.close()' class='t'>CLOSE WINDOW</a>" );
	newwin.document.write( "</div></body></html>" );
}

function changesize() {
	newwin.moveTo(4,4);
	var theheight = newwin.document.images[0].height ;
	var thewidth = newwin.document.images[0].width ;
	newwin.resizeTo(thewidth+40,theheight+200) ;
	newwin.focus() ;
	return true;
}

