/** FUNZIONI PER GESTIONE POPUP ERRORI E MESSAGGI - MENU **/
		var openedWindow = "";
		
		function showHide(idRow, class4Show) {
			var newClass = "";
			var rowNode = document.getElementById(idRow);
			var statusContainer = "";
		
		// if if(rowNode.className=="HideDIV") {
			if(rowNode.className=="hide") {
				newClass = class4Show;
			} else {
		//		newClass = "HideDIV";
				newClass = "hide";
			}
			rowNode.className = newClass;
		
		}
		
		function windowOpen(url) {
			if(openedWindow) {
				openedWindow.close();
			}
			openedWindow = window.open(url);
		}
/** FUNZIONI PER GESTIONE POPUP ERRORI E MESSAGGI - MENU **/


/** FUNZIONI PER GESTIONE POPUP ERRORI E MESSAGGI - START **/
	function getAbsolutePos(el) {
		var SL = 0, ST = 0;
		var is_div = /^div$/i.test(el.tagName);
		if (is_div && el.scrollLeft)
			SL = el.scrollLeft;
		if (is_div && el.scrollTop)
			ST = el.scrollTop;
		var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST };
		if (el.offsetParent) {
			var tmp = getAbsolutePos(el.offsetParent);
			r.x += tmp.x;
			r.y += tmp.y;
		}
		return r;
	};

	function getVisibCommons(obj){
		var value = obj.style.visibility;
		if (value!='visible') {
			if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C
				value = document.defaultView.
				getComputedStyle(obj, "").getPropertyValue("visibility");
			} else if (obj.currentStyle) { // IE
				value = obj.currentStyle.visibility;
			} else
				value = '';
		}
		return value;
	};

	function hideShowSelect(objectHandler, x, y){
		var myObj = objectHandler;
		
		var tags = new Array("applet", "iframe", "select");
	
		var p = getAbsolutePos(myObj);
		var EX1 = p.x;
		var EX2 = myObj.offsetWidth + EX1;
		var EY1 = p.y;
		var EY2 = myObj.offsetHeight + EY1;

		for (var k = tags.length; k > 0; ) {
			var ar = document.getElementsByTagName(tags[--k]);
			var cc = null;
	
			for (var i = ar.length; i > 0;) {
				cc = ar[--i];
	
				p = getAbsolutePos(cc);
				var CX1 = p.x;
				var CX2 = cc.offsetWidth + CX1;
				var CY1 = p.y;
				var CY2 = cc.offsetHeight + CY1;
	
				// alert(myObj.name + "\nEX1=" + EX1 + "\nEY1=" + EY1 + "\nEX2=" + EX2 + "\nEY2=" + EY2 + "\n\n" + cc.name + "\nCX1=" + CX1 + "\nCY1=" + CY1 + "\nCX2=" + CX2 + "\nCY2=" + CY2);
	
				if (cc.style.visibility=='hidden' || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
					if (!cc.__msh_save_visibility) {
						cc.__msh_save_visibility =  getVisibCommons(cc);
					}
					cc.style.visibility = cc.__msh_save_visibility;
				} else {
					if (!cc.__msh_save_visibility) {
						cc.__msh_save_visibility = getVisibCommons(cc);
					}
					cc.style.visibility = "hidden";
				}
			}
		}
	};

	function showMessagePopup(message, event, myclass, mywidth, myheight) {
		// Determino le dimensioni della window 
	  var winW = 0;  
	  var winH = 0;  
		if (navigator.appName=="Netscape") {    
			winW = window.innerWidth;   
		  winH = window.innerHeight;  
		}    
		if (navigator.appName.indexOf("Microsoft")!=-1) { 
		  winW = document.body.offsetWidth;
		  winH = document.body.offsetHeight;    
		}    
	  
		var newClass = "";  
		var tablePopup = document.getElementById('errorPopup');    
		var errorCell = document.getElementById('errorPopupCell');  
	  	errorCell.innerHTML = message;  
		tablePopup.className = 'popupError';
		if(myclass!='') tablePopup.className = myclass;
		tablePopup.position = "absolute"; 
		tablePopup.style.width = mywidth; 
		tablePopup.style.height = myheight;    
		tablePopup.style.left = event.clientX; 
		tablePopup.style.top = event.clientY + document.body.scrollTop;  
		
		// Determino la posizione dell'angolo inferiore dx in base alla dimensione della window   
		var scrollDimension = 21;
		var bottomedge = tablePopup.offsetHeight + event.clientY;  
		if (bottomedge > winH) tablePopup.style.top = (event.clientY+winH)-bottomedge-scrollDimension + document.body.scrollTop;
		var rightedge = document.body.clientWidth-event.clientX;
		if (rightedge < tablePopup.offsetWidth) tablePopup.style.left = document.body.scrollLeft + event.clientX - tablePopup.offsetWidth;
		else tablePopup.style.left = document.body.scrollLeft + event.clientX;	

		hideShowSelect(tablePopup, tablePopup.style.top, tablePopup.style.left);    
	} 

	function hideMessagePopup() {
		var newClass = "";
		var tablePopup = document.getElementById('errorPopup');
		tablePopup.className = "hide";
		hideShowSelect(tablePopup, tablePopup.style.top, tablePopup.style.left);
	} 

/** FUNZIONI PER GESTIONE POPUP ERRORI E MESSAGGI - END **/
