	
	var aperta= false;
	
function popup_i(image, profondita, altezza) 
	{  
	 if (aperta) galleria.close();
	 imag = new Image();
	 imag.src=image;
	 
	 //profondita=(imag.width+10);
	 //altezza=(imag.height+10);
	 profondita+=3;
	 altezza+=3;
	 //alert (altezza+' '+profondita)
	 galleria=window.open('', 'galleria', 'width=' + profondita + ',height=' + altezza +',scrollbars=yes,menubar=no,status=no,toolbar=no,location=no,resizable=yes');
	 aperta=true;
	 galleria.onunload="opener.aperta=false"
	 
	  var gal=galleria.document;
	 gal.open();
	 gal.write('<html><head><title>');
	 gal.write('A.C. Firenze Rondinella S.P.A.');
	 gal.write('</title></head>');
	 gal.write('<body style="margin:5px; padding:0px; border:1px; background-image: url(<?=$root?>immagini/trama3.jpg);" >');
	  gal.write('<center><img src="'+imag.src+'" alt="'+imag+'" style="margin:1px; padding:1px; border:1px; border-color:#990000;"></center>');
	 gal.write('</body>');
	 gal.write('</html>');
	 gal.close();
	  
	 galleria.moveTo(5,5);
	 galleria.focus();
	}
	
function popup(url, name, width, height)
{
settings="toolbar=no,location=no,directories=no,"+"status=no,menubar=no,scrollbars=yes,"+"resizable=no,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}


function popup_g(url, name, width, height)
{
settings="toolbar=no,location=no,directories=no,"+"status=yes,menubar=no,scrollbars=yes,"+"resizable=yes,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}

//function trim(x) 
//{ var stringa;	
//	stringa=x.toString();
//    stringa.replace(/^[ \t\r\n]*/,"");
// 	stringa.replace(/[ \t\r\n]*$/,"");
//  return stringa
//}

function trim(x) {
return x.toString().replace(/^[ \t\r\n]+/,'').replace(/[ \t\r\n]+$/,'');
}

//function trim2(stringa)
// {
//  return stringa.toString().replace(/^[\t\r\n]+/,'').replace(/[\t\r\n]+$/,'')
// }
