function popupCenter(url,name,attributes,width,height)
{
	topx=(screen.height-height)/2;
	leftx=(screen.width-width)/2;
	if (attributes.length > 0)
		if (attributes.substr(attributes.length-1,1) != ',')
			attributes += ','
	var w = window.open(url, name, attributes + 'width='+width+',height='+height+',screenx='+leftx+',screeny='+topx+',top='+topx+',left='+leftx);
	w.focus();
	return w;
}

function popupFoto(title, credits, image, width, height) {
	scrollbars=0;
	if ( width > 550 ) {
		width = 550;
		scrollbars=1;
	}
	if ( height > 550 ) {
		height = 550;
		scrollbars=1;
	}
	winname=Math.round(Math.random()*10000000); 
	w = popupCenter('',winname, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+scrollbars+',resizable=0', width, height);
	w.document.write(	"<html><head><style>\n" + 
"body { font-family: \"Verdana\", \"Arial\", \"Helvetica\", \"sans-serif\"; font-size: 10px; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; color: #000000 }" + "\n" + 
"table { font-family: \"Verdana\", \"Arial\", \"Helvetica\", \"sans-serif\"; font-size: 10px; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; color: #000000 }" + "\n" + 
"a { color: red ; text-decoration: underline }" + "\n" + 
".pad { padding-top: 3px; padding-left: 3px; padding-right: 3px;}" + "\n" + 
"</style><title>" + title + "</title>" +
"</head><body bgcolor='white' topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 style='margin: 0px 0px';><table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td valign='top' colspan='2'><img src='" + image + "' /></td></tr><tr><td class='pad' align='left' valign='middle'>" + credits +
"</td><td class='pad' align='right'><a href='#' onclick='self.close();'>close</a></td></tr></body></html>");
w.document.close();
}