	function hideCombo() {
		var listacombo = document.getElementsByTagName('SELECT');
		for(i=0; i < listacombo.length; i++)	{
			var tmp = listacombo[i];
			tmp.infotnprevstyledisplay=tmp.style.visibility;
			tmp.style.visibility='hidden';
		}		
	}
	function showAllCombo() {
		var listacombo = document.getElementsByTagName('SELECT');
		for(i=0; i < listacombo.length; i++)	{
			var tmp = listacombo[i];
			if (tmp.infotnprevstyledisplay!=null) tmp.style.visibility=tmp.infotnprevstyledisplay;
		}		
	}
	// visualizza le combo contenute in un div
	function showCombo(root) {
		var listacombo = root.getElementsByTagName('SELECT');
		for(i=0; i < listacombo.length; i++)	{
			var tmp = listacombo[i];
			if (tmp.infotnprevstyledisplay!=null) tmp.style.visibility=tmp.infotnprevstyledisplay;
		}		
	}

	// retrocompatibile per non dare errore
	function ITOpenModal(objid,withEffect,topPosPixel)
	{
		ITOpenModal(objid,withEffect);
	}

	function ITOpenModal(objid,withEffect) {
		document.documentElement.style.overflow="hidden";
		document.documentElement.style.height ="100%";
		document.body.style.height ="100%";
		var div_prof = document.getElementById(objid);		
		var current_scroll = document.body.scrollTop;
		var current_hscroll = document.body.scrollLeft;
		var current_screen_width = document.body.clientWidth;
		if (document.documentElement && document.documentElement.scrollTop) {  current_scroll  = document.documentElement.scrollTop; }
		if (document.documentElement && document.documentElement.scrollLeft) {  current_hscroll  = document.documentElement.scrollLeft; }
		if (document.documentElement && document.documentElement.clientWidth) { current_screen_width  = document.documentElement.clientWidth; }
		hideCombo();
		showCombo(div_prof);
		if (document.getElementById("infotnsfondoneroportlet-"+objid)!=null) {
			var tmp=document.getElementById("infotnsfondoneroportlet-"+objid);
			document.body.removeChild(tmp);
		}
		// creo il div nero
		var newdiv = document.createElement("DIV");
		newdiv.id = "infotnsfondoneroportlet-"+objid;
		newdiv.style.position = "absolute";
		newdiv.style.width = "100%";
		newdiv.style.height = "100%";
		newdiv.style.top = ""+current_scroll+"px";
		newdiv.style.left = ""+current_hscroll+"px";
		newdiv.style.backgroundColor = "#000000";
		newdiv.style.zIndex = 100;
		newdiv.style.display = "none";
		newdiv.className = "infotnsfondoneroportlet";
		document.body.appendChild(newdiv);
		// creo il div assoluto opaco e lo posiziono sotto il body
		var newdiv1 = document.createElement("DIV");
		newdiv1.id = "infotnsfondoopacoportlet-"+objid;
		newdiv1.style.position = "absolute";
		newdiv1.style.width = "100%";
		newdiv1.style.height = "100%";
		newdiv1.style.overflow = "auto";
		newdiv1.style.top = ""+current_scroll+"px";
		newdiv1.style.left = ""+current_hscroll+"px";
		newdiv1.style.zIndex = 200;
		newdiv1.style.display = "none";
		newdiv1.className = "infotnsfondoopacoportlet";		
		if (navigator.userAgent.indexOf("Firefox")>=0)
			newdiv1.style.textAlign = "-moz-center";
		else
			newdiv1.style.textAlign = "center";
		document.body.appendChild(newdiv1);
		// metto un placeholder al posto del div originale
		var newdivph = document.createElement("DIV");
		newdivph.id = "placeholder-"+objid;
		newdivph.style.display = "none";
		div_prof.parentNode.appendChild(newdivph);
		// metto il div di profilazione sotto l'opaco
		newdiv1.appendChild(div_prof);		
		// nascdondo il div di profilazione
		div_prof.style.display = "none";
		// faccio apparire
		document.getElementById("infotnsfondoopacoportlet-"+objid).style.display='block';
		if (withEffect) {
			Effect.Appear("infotnsfondoneroportlet-"+objid, { duration :0.2,from: 0, to: 0.75  });
			Effect.Appear(objid, { duration :0.2});
		} else {
			div_prof.style.display='block';
			document.getElementById("infotnsfondoneroportlet-"+objid).style.display='block';
		}
	}

	function ITCloseModal(objid,withEffect) {	
		// recupero gli oggetti interessanti
		var sfondonero=document.getElementById("infotnsfondoneroportlet-"+objid);
		var sfondoopaco= document.getElementById("infotnsfondoopacoportlet-"+objid);
		var div_prof = document.getElementById(objid); 
		var div_ph = document.getElementById("placeholder-"+objid); 

		// ripristino le scrollbar
		document.documentElement.style.overflow="auto";
		// nascondo il div di profilazione
		if (div_prof!=null)
			div_prof.style.display='none';
		if (div_ph!=null) { 
			// rimetto il div di profilazione sotto il suo parent originale
			div_ph.parentNode.appendChild(div_prof);
		}		
		if (sfondonero!=null) {
			document.body.removeChild(sfondonero);		
			document.body.removeChild(sfondoopaco);	
		}
		if (div_ph!=null) {
	 		div_prof.parentNode.removeChild(div_ph);
		}
		showAllCombo();
	}
