/*
	Written by Bugimus, http://bugimus.com/
	
	This function is used for the photo gallery.
	Popup window with the picture, resized on the fly
*/
function showPic(imgName, imgCaption, imgWidth, imgHeight, textColor, bgColor) 
{
   if(imgWidth<=100)imgWidth=100
   if(imgHeight<=100)imgHeight=100
	winHeight=imgHeight+20;
	w = window.open('','Pic','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,width='+imgWidth+',height='+winHeight);
	w.document.write( "<html><head><title>"+imgCaption+"</title>" );
	w.document.write( "<style type='text/css'>" );
	w.document.write( "a {font-family: verdana; font-size: 10px; color: "+textColor+"; text-decoration : none;}" );
	w.document.write( "a:visited {font-family: verdana;font-size: 10px; color: "+textColor+"; }" );
	w.document.write( "a:active {font-family: verdana; font-size: 10px; color: "+textColor+"; }" );
	w.document.write( "a:hover {font-family: verdana; font-size: 10px; color: #990000; }" );
	w.document.write( "img {margin: 4px; border: 2px #000 solid;}" );
	w.document.write( "body {margin: 0px; padding: 0px; font-family: verdana; font-size: 10px; color: "+textColor+"; background-color: "+bgColor+"; }" );
	w.document.write( "</style>" );
	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( "	if(IE5) self.resizeTo(document.images[0].width+30,document.images[0].height+70)\n");
	w.document.write( "	else if(NN6) resizeTo(document.images[0].width+40, document.images[0].height+80);\n");
	w.document.write( "	else top.window.resizeTo(document.images[0].width,document.images[0].height+20)\n");
	w.document.write( "	self.focus()\n");
	w.document.write( "}\n</script>\n");;
	w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad=" );
	w.document.write( "'javascript:autoSize();'>" );
	w.document.write( "<div align='center'><img src='"+imgName+"' alt='"+imgCaption+"'></div>" );
	w.document.write( "<div align='center'><a href='javascript:top.window.close();'>close window</a></div>" );
	w.document.write( "</table></body></html>" );
	w.document.close();
}