// da includere con <script language="JavaScript" src="javascript/newwindow.js"></script>


//Funzione che permette di aprire una nuova finestra centrata rispetto allo schermo
// utilizzo href="javascript:NewWindow('url','finestra','larghezza','altezza','scrollbar yes/no')"

// file creato il 20/11/2000 da MP

function NewWindow(mypage,myname,w,h,scroll){

var win = null;

LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable,status=yes'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
	}

// Apre la finestra in alto a destra da usare come preview
// 23/11/2000
function NewWindowPreview(mypage,myname,w,h,scroll){

var win = null;

LeftPosition =  0;
TopPosition =  0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
	}
// fine del file

function LinkAndClose(source,url)
	{
	source.opener.location = url;
	source.close();
	}

