var win
// funzione che apre una finestra
function openDep (Indirizzo,varWidth,varHeight, ResizeYesNo,nome) {
		
		var SistemaWidth = 1
		var SistemaHeight = 1
		
		if (varWidth==null){
			varWidth = screen.availWidth - 10;
			SistemaWidth = 0
		}
		
		if (varHeight==null){
			varHeight = screen.availHeight - 30;
			SistemaHeight = 0
		}
		
		var width = varWidth
		var height = varHeight
		
		var str = ",height=" + height + ",innerHeight=" + height;
		str += ",width=" + width + ",innerWidth=" + width;
		
		if (window.screen) {
		
			var ah = screen.availHeight - 30;
			var aw = screen.availWidth - 10;
			
			var xc = (aw - width) / 2;
			var yc = (ah - height) / 2;
			
			str += ",left=" + xc + ",screenX=" + xc;
			str += ",top=" + yc + ",screenY=" + yc;
		}
		
		if (win && win.open && !win.closed) {
			win.close();
		}
		
		win=window.open (Indirizzo,nome,'resizable=' + ResizeYesNo + ', toolbar=no, dependent, directories=no, menubar=no, scrollbars=yes ' + str);
	}
// funzione che chiude la finestra figlia nel caso venga chiusa quella padre
// va inserita nel body onUnLoad=closeDep()
function closeDep(){
		if (win && win.open && !win.closed) {
			win.close();
		}
	}