function openImagePopup_NON_FUNZIONA(url,title)
{
	image=new Image();
	image.src=url;
	
	popup=window.open(url, "", 'scrollbars=no, resizable=no, width='+image.width+', height='+image.height+', status=no, location=no, toolbar=no');
	html='<html>';
	//html+='<script language="JavaScript">if (popup.document.foo.refresh.value==0){selft}</script>';
	html+='<body leftmargin="0" rightmargin="0" bottommargin="0" topmargin="0" onBlur="self.close();">';
	html+='<form name="foo"><input type="hidden" name="refresh" value="0"></form>';
	html+='<img src="'+url+'" /></body>';
	html+='</html>';
	
	popup.document.write(html);
	//popup.resizeBy(image.width-popup.document.body.clientWidth , image.height-popup.document.body.clientHeight);
	popup.focus();
}

function openImagePopup_NON_FUNZIONA2(url,title)
{
image=new Image();
image.src=url;

popup=window.open(url, "", 'scrollbars=no, resizable=no, width='+image.width+', height='+image.height+', status=no, location=no, toolbar=no');
popup.close();
popup=window.open(url, "", 'scrollbars=no, resizable=no, width='+image.width+', height='+image.height+', status=no, location=no, toolbar=no');
popup.focus();
}

function openImagePopup_NON_FUNZIONA3(url,title)
{
	image=new Image();
	image.src=url;
	
	popup=window.open(url, "", 'scrollbars=no, resizable=no, width='+image.width+', height='+image.height+', status=no, location=no, toolbar=no');
	html='<html>';
	//html+='<script language="JavaScript">if (popup.document.foo.refresh.value==0){selft}</script>';
	html+='<body leftmargin="0" rightmargin="0" bottommargin="0" topmargin="0" onBlur="self.close();">';
	html+='<form name="foo"><input type="hidden" name="refresh" value="0"></form>';
	html+='<img src="'+url+'" /></body>';
	html+='</html>';
	
	popup.document.write(html);
	//popup.resizeBy(image.width-popup.document.body.clientWidth , image.height-popup.document.body.clientHeight);
	popup.close();

	popup=window.open(url, "", 'scrollbars=no, resizable=no, width='+image.width+', height='+image.height+', status=no, location=no, toolbar=no');
	popup.document.write(html);
	//popup.resizeBy(image.width-popup.document.body.clientWidth , image.height-popup.document.body.clientHeight);

	popup.focus();
}

function openImagePopup(imageURL,imageTitle){
	// Script Source: CodeLifter.com
	// Copyright 2003,2006
	// Do not remove this notice.
	
	// MODIFIED: Timed closure added 04.05.2006 - etLux
	
	// SETUPS:
	// ===============================
	
	// Set the horizontal and vertical position for the popup
	
	PositionX = 0;
	PositionY = 0;
	
	// Set these value approximately 20 pixels greater than the
	// size of the largest image to be used (needed for Netscape)
	
	defaultWidth  = 500;
	defaultHeight = 380;
	
	// Set autoclose true to have the window close automatically
	// Set autoclose false to allow multiple popup windows
	
	var AutoClose = true;
	
	// Set the value in milliseconds to close the window
	// automatically after this amount of time
	// 1000 milliseconds equals one second
	// 0 per non impostare il timeout
	
	var closeTime = 0;
	
	// Do not edit below this line...
	// ================================
	var closeCode = "";
	if (closeTime != 0)
		closeCode = ";setTimeout('self.close()',"+closeTime+")";
	if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
	var optNN='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
	var optIE='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
	
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
		writeln('<sc'+'ript>');
		
		writeln('var isNN,isIE;');
		writeln('var scrollbarsNeededIE = false;');
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('  isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('  isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;');
		writeln('}');
		writeln('function reSizeToImage(){');
		/*
		writeln('  if (isIE){');
		writeln('    window.resizeTo(500,400);');
		writeln('    width=100-(document.body.clientWidth-document.images[0].width);');
		writeln('    height=100-(document.body.clientHeight-document.images[0].height);');
		//writeln('    alert ("reSizeToImage: width = " + width);');
		//writeln('    alert ("reSizeToImage: height = " + height);');
		writeln('    if (width > screen.width || height > screen.height)');       
		writeln('      scrollbarsNeededIE = true;');
		writeln('    window.resizeTo(500,400);');
		writeln('  }');
		*/
		
		writeln('  if (isNN){');
		writeln('    width=document.images["George"].width;');
		writeln('    height=document.images["George"].height;');
		//writeln('    alert ("reSizeToImage: width = " + width);');
		//writeln('    alert ("reSizeToImage: height = " + height);');
		writeln('    if (width > screen.width || height > screen.height) {');
		writeln('      width=screen.width-5;');
		writeln('      height=screen.height;');
		writeln('    }');
		//writeln('    alert ("reSizeToImage: width = " + width);');
		//writeln('    alert ("reSizeToImage: height = " + height);');
		writeln('    window.innerWidth=500;');
		writeln('    window.innerHeight=400;');
		writeln('  }');
		writeln('}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');

		//Aggiunge le scrollbars se necessario
		// Le scrollbars sono sempre abilitate per netscape/mozilla, perché è il browser che le nasconde quando non servono.
		// Per Internet Explorer invece, bisogna abilitarle solo se necessario, quindi di default non sono abilitate (<body scroll="no">).
		writeln('function addScrollbarIE(){');
		//writeln('  alert ("scrollbarsNeededIE = " + scrollbarsNeededIE);');
		writeln('  if (isIE && scrollbarsNeededIE) {');
		writeln('    document.body.scroll="yes";');
		writeln('  }');
		writeln('}');

		writeln('</sc'+'ript>');
		if (!AutoClose)
		  writeln('</head><body bgcolor=ffffff scroll="no" onload="doTitle();self.focus();reSizeToImage();addScrollbarIE();'+closeCode+'">')
		else
			writeln('</head><body bgcolor=ffffff scroll="no" onload="doTitle();self.focus();reSizeToImage();addScrollbarIE();'+closeCode+'" onblur="self.close()">');
		writeln('<img name="George" src='+encodeURI(imageURL)+' style="display:block">');

		writeln('</body></html>');
		close();		
	}
}

function openImagePopupDef(imageURL,imageTitle,options){
// Script Source: CodeLifter.com
// Copyright 2003,2006
// Do not remove this notice.

// MODIFIED: Timed closure added 04.05.2006 - etLux

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Set the value in milliseconds to close the window
// automatically after this amount of time
// 1000 milliseconds equals one second
// 0 per non impostare il timeout

var closeTime = 0;

// Do not edit below this line...
// ================================
var closeCode = "";
if (closeTime != 0)
	closeCode = ";setTimeout('self.close()',"+closeTime+")";
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

if(options!=''){
	imgWin=window.open('about:blank','',options);
}else{
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');

writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width+30,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=660000 scroll="no" onload="doTitle();self.focus();'+closeCode+'">')
else writeln('</head><body bgcolor=660000 scroll="no" onload="doTitle();self.focus();'+closeCode+'" onblur="self.close()">');
writeln('<img name="George" src='+encodeURI(imageURL)+' style="display:block"></body></html>');
close();		
}}

