function isInteger(evt) { <!-- 0-9 -->
	evt = (evt) ? evt : window.event;
	var charCode = (evt.which) ? evt.which : evt.keyCode;
	if (charCode > 31 && (charCode < 48 || charCode > 57)) {
		return false;
	}
	return true;
}
function isNumber(evt) { <!-- 0-9 , -->
	evt = (evt) ? evt : window.event;
	var charCode = (evt.which) ? evt.which : evt.keyCode;
	if (charCode > 31 && charCode != 43 && charCode != 44 && charCode != 45 && (charCode < 48 || charCode > 57)) {
		return false;
	}
	return true;
}
function isLetter(evt) {
	evt = (evt) ? evt : window.event;
	var charCode = (evt.which) ? evt.which : evt.keyCode;
	if ((charCode >= 65 && charCode <= 90) || (charCode >= 97 || charCode <= 122)) {
		return true;
	}
	return false;
}
function setCursor(w, c) {
	var elems = w.document.getElementsByTagName("body");
	if (elems) {
		if (elems.length > 0) {
			elems[0].style.cursor = c;
		}
	}
	for (var i = 0; i < w.frames.length; i++) {
		setCursor(w.frames[i], c);
	}
}
function askUserConfirmation(target, msg) {
	var result = confirm(msg);
	if (result) {
	
		__doPostBack(target, "OK");
	}
	else {
		__doPostBack(target, "KO");
	}
	return true;
}
function suspend(suspendedPage) {
	top.controlRegistry = new Object();
	top.controlRegistry.controls = new Array();
	top.controlRegistry.urls = new Array();
	top.controlRegistry.suspendedPage = suspendedPage; // opzionale
	disableControls(top);
	setWait();
}
function isSuspended(suspendedPage) {
	if (top.controlRegistry) {
		if (top.controlRegistry.suspendedPage) {
			return (suspendedPage.URL == top.controlRegistry.suspendedPage.URL);
		}
	}
	return false;
}
function showIfNotSuspended() {
	if (!isSuspended(document)) {
		unsetWait();
	}
}
function disableControls(w) {
	for (var i = 0; i < w.document.all.length; i++) {
		var ctl = w.document.all[i];
		if (ctl.tagName == "A" ||
			ctl.tagName == "SELECT" ||
			(ctl.tagName == "INPUT" && (ctl.type == "submit" || ctl.type == "button"))) {
			disableControl(ctl);
		}
	}
	for (var y = 0; y < w.frames.length; y++) { // ricorsione sui frames annidati
		disableControls(w.frames[y]);
	}
}
function disableControl(ctl) {
	top.controlRegistry.controls[top.controlRegistry.controls.length] = ctl;
	if (ctl.tagName == "A") {
		// memorizza url allo stesso indice del relativo elemento
		top.controlRegistry.urls[top.controlRegistry.controls.length - 1] = ctl.href;
		ctl.href = "#";
	} else {
		ctl.disabled = true;
	}
}
function release(doc) {
    setCursor(top, 'auto');
	if (doc) {
		try {
			doc.all("layout_wait").style.visibility = "hidden";
			doc.all("layout_main").style.visibility = "visible";
		} catch(ex) {}
	} else {
		try {
			doc = top.controlRegistry.suspendedPage;
			doc.all("layout_wait").style.visibility = "hidden";
			doc.all("layout_main").style.visibility = "visible";
		} catch(ex) {}
	}
	try {
		var ctl;
		for (var i = 0; i < top.controlRegistry.controls.length; i++) {
			ctl = top.controlRegistry.controls[i];
			if (ctl.tagName == "A") {
				// url originale memorizzato allo stesso indice del relativo elemento
				ctl.href = top.controlRegistry.urls[i];
			} else {
				ctl.disabled = false;
			}
		}
	} catch(ex2) {}
}
var disableSetWait = false;
function setWait() {
	if (!disableSetWait) {
		setCursor(top, 'wait');
		try {
			document.all("layout_main").style.visibility = "hidden";
			document.all("layout_wait").style.visibility = "visible";
		} catch(ex) {}
    }
    disableSetWait = false;
}
function unsetWait() {
	try {
        document.all("layout_wait").style.visibility = "hidden";
        document.all("layout_main").style.visibility = "visible";
    } catch(ex) {}
    setCursor(top, 'auto');
}
