//really not important (the first two should be small for Opera's sake)
PositionX = 100;
PositionY = 10;
defaultWidth  = 440;
defaultHeight = 440;

//kinda important
var AutoClose = true;

//don't touch
function popImage(imageURL,imageTitle,imageText){
	var imgWin = window.open('','_blank','scrollbars=no,resizable=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
	if( !imgWin ) { return true; } //popup blockers should not cause errors
	imgWin.document.write('<html><head><title>'+imageTitle+'<\/title>');
	imgWin.document.write('<style type="text\/css">\n'+
												'<!--\n body {\n'+
												'	font-family: Arial, Helvetica, sans-serif; \n'+
												'	color: #ffffff;	background-color: #000000;\n'+
												'	margin: 5px;	padding: 0px;\n	}\n'+	
												'p {font-size: 80%; margin-top: 10px;}\n -->\n'+
                        '<\/style><\/head>');
	imgWin.document.write('<body '+(AutoClose?' onblur="self.close();"':'')+'>');
  imgWin.document.write('<table><tr valign="middle">'+
												'<td align="center" width="'+(defaultWidth-10)+
												'" height="'+(defaultHeight-10)+'">\n');
	imgWin.document.write('<img src='+imageURL+' alt="Loading image ..."><br>\n');
	imgWin.document.write('<p>'+imageText+'<\/p>\n');
	imgWin.document.write('<\/td><\/tr><\/table>\n');
	imgWin.document.write('<\/body><\/html>');
	imgWin.document.close();
	if( imgWin.focus ) { imgWin.focus(); }
	return false;
}


function popCitta(qry){
	// determina la larghezza dello schermo
	  var scrL = 0, scrH = 0;
	  var pX = 0, pY = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		scrL = window.innerWidth;
		scrH = window.innerHeight;
	  } else if( document.documentElement &&
		  ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		scrL = document.documentElement.clientWidth;
		scrH = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		scrL = document.body.clientWidth;
		scrH = document.body.clientHeight;
	  }
	pX = scrL * 0.25
	pY = scrH * 0.25
    scrL = scrL * 0.40
	scrH = scrH * 0.40
	var indirizzo = '/citta/popinfo.asp'
	if (qry!=null){
		indirizzo = indirizzo + '?ct=' + qry;
    }
	var imgWin = window.open(indirizzo,'_blank','scrollbars=yes,resizable=1,width='+scrL+',height='+scrH+',left='+pX+',top='+pY);
	if( !imgWin ) { return true; } //popup blockers should not cause errors
	if( imgWin.focus ) { imgWin.focus(); }
	return false;
}