function Popola_SysReloadParent()
 {
	var bClose = undefined;

	// controlle se esiste la funzione
	if (window.parent.top.Get_bClose) {
		bClose = this.parent.top.Get_bClose();
	}
	
	if (bClose==undefined){
		bClose = 0
	}

// carpire l'errore!!!!!!!!!!!!
// ### getElementById

	if (document.all("SysReloadParent")) {
		document.all("SysReloadParent").value = bClose;
	}
}


// old function
//var bGotFocus=true;

// viene utilizzata dalla pagina che sta navigando 
// spedisce solo la form per il reload
function funReloadIF() {
//	if (!bGotFocus) {
//		bGotFocus=true;
		if (document.all("SysModeReg").value != undefined) {
			document.all("SysModeReg").value = 1;
			document.all("Invia").click();
		}
//	}
}

// viene utilizzata dopo il salva, su pulsante chiudi
// gestisce automaticamente il reload o la chiusura della window
function funAggiornaPu() {
	if (window.parent.frames[0]!=undefined) {
		
/*		var loc = window.parent.frames[0].parent.location+' '
		if (loc.indexOf("console.asp")!=-1) {
			window.parent.loadSource(sSysAsp, sSysRequest);
		} else {
*/
			this.parent.top.funAggiornaIF();
//		}
	} else {
		self.close();
	}
}

function funCloseIf () {	
	var doc = window.parent.frames[0]	
	if (doc!=undefined)
		if (doc.SysNumAspAttiva!=undefined)
			bClose[doc.SysNumAspAttiva.value-1] = 1
	if (this.parent.top.funAggiornaPu)
		this.parent.top.funAggiornaPu();
	else
		this.parent.top.close();
	
}

