function createLoader(img){
	var loaderImg = document.createElement('IMG');
	loaderImg.id = "loaderImg";
	loaderImg.src = img;
  loaderImg.style.width = '32px';
  loaderImg.style.height = '32px';
	var loaderText = document.createElement('DIV');
	loaderText.id = "loaderText";
	loaderText.innerHTML = "caricamento in corso";
	loaderText.style.font = '10px Verdana, Arial, sans-serif';
	loaderText.style.color = '#666';	
	var loader = document.createElement('DIV');
	loader.id = "loader";
	document.body.insertBefore(loader,document.body.firstChild);	
	loader.appendChild(loaderImg);// immagine
	loader.appendChild(loaderText);// testo
	// stile testo
	loaderText.style.textAlign = 'center';
	loaderText.style.marginTop = '10px';
	// stile loader
	loader.style.padding = '10px 30px 10px 30px';
	loader.style.position = "absolute";
	loader.style.top = "50%";
	loader.style.marginTop = -loader.offsetHeight/2 + "px";
	loader.style.left = "50%";	
	var menuWidth = 160;
	loader.style.marginLeft = - loader.offsetWidth/2 + menuWidth/2 + "px";
	loader.style.border = "1px solid #cfcfcf";
	loader.style.backgroundColor = '#FBEDC2';
  loader.style.textAlign = 'center';
	loader.style.display = 'none';
}
function showLoader(id, text){
	if(id){
		var image = getElement(id + "_image");
		if(image) image.style.backgroundImage = "";
	}
	var loader = getElement("loader");
	if(loader){
	 if(text){
	   var loaderText = getElement("loaderText");
     loaderText.innerHTML = text;
   }
   loader.style.display = 'block';
  }
} 
function hideLoader(){
	var loader = getParentElement("loader");
	if(loader){loader.style.display = 'none';}
}
function adjust(id, img){
	var image = getElement(id + '_image');
	if(image){
		image.onclick = "";		
		var aImageInfo = getImageInfo(id);
		if(aImageInfo['width'] <= image.offsetWidth && aImageInfo['height'] <= image.offsetHeight){
      var showBtnTmp = getParentElement(id + '_showBtn');
			if(showBtnTmp){image.removeChild(showBtnTmp);}
			image.style.backgroundPosition = 'center';
		} else {image.style.backgroundPosition = 'top left';}
	}
}
function adjustParent(id, img){
	var image = getParentElement(id + '_image');
	if(image){
		image.onclick = "";		
		aImageInfo = getImageInfoParent(id);
		if(aImageInfo['width'] <= image.offsetWidth && aImageInfo['height'] <= image.offsetHeight){
			var showBtnTmp = getParentElement(id + '_showBtn');
			if(showBtnTmp) image.removeChild(showBtnTmp);
			image.style.backgroundPosition = 'center';
		} else {image.style.backgroundPosition = 'top left';}
	}
}
function getImageInfoParent(id){
	var image = getParentElement(id + '_image');
	if(image){
		bgImg = image.style.backgroundImage;
		bgImg = bgImg.replace('url(', '');
		bgImg = bgImg.replace(')', '');
		var fullImage = window.parent.document.createElement('IMG');
		fullImage.src = bgImg;
		window.parent.document.body.appendChild(fullImage);
		width = fullImage.offsetWidth;
		height = fullImage.offsetHeight;
		window.parent.document.body.removeChild(fullImage);
		var aInfo = new Array();
		aInfo['width'] = width;
		aInfo['height'] = height;
		return aInfo;
	}	
	return '';
}
function createFullImageParent(id, img){ 
	var container = window.parent.document.createElement('DIV');
	var closeBtn = window.parent.document.createElement('DIV');
	var fullImage = window.parent.document.createElement('IMG');
	var image = getParentElement(id + '_image');

	if(container){
		container.id = id + '_fullImage';
		container.style.position = 'absolute';
		container.style.width = window.screen.width - 100 + "px";
		container.style.height = window.screen.height - 350 + "px";
		var scrollY = (window.scrollY)?window.scrollY:window.parent.document.documentElement.scrollTop;
		container.style.top = 88 + scrollY + "px";
		container.style.border = "1px solid #000";
		container.style.backgroundColor = '#FFFFD1';
		window.parent.document.body.appendChild(container);
		container.style.left = window.parent.document.body.offsetWidth / 2 - container.offsetWidth / 2 + "px";
		var bgImg = image.style.backgroundImage;
		bgImg = bgImg.replace('url(', '');
		bgImg = bgImg.replace(')', '');
		fullImage.src = bgImg;
		container.appendChild(fullImage);
		fullImage.style.marginTop = container.offsetHeight / 2 - fullImage.offsetHeight / 2 + "px";
		fullImage.style.marginLeft = container.offsetWidth / 2 - fullImage.offsetWidth / 2 + "px";
		if(fullImage.offsetWidth > container.offsetWidth || fullImage.offsetHeight > container.offsetHeight){container.style.overflow = 'scroll';}
		closeBtn.innerHTML = "clicca sull'immagine per chiuderla";
		closeBtn.style.position = 'absolute';
		var width = 180;
		closeBtn.style.top = container.offsetTop - 15 + "px"; 
		closeBtn.style.left = container.offsetLeft + container.offsetWidth - width + "px";
		closeBtn.style.width = width + 'px';
		closeBtn.style.height = '14px'; 
		closeBtn.style.color = '#000';
		closeBtn.style.textAlign = 'center';
		closeBtn.style.font = 'bold 9px Verdana, Arial, sans-serif';
		container.onclick = function(){ 
			window.parent.document.body.removeChild(container); 
			window.parent.document.body.removeChild(closeBtn); 
			setPointer(this.id, 'out')
		};
		container.onmouseover = function(){setPointer(this.id, 'over')};
		container.onmouseout = function(){setPointer(this.id, 'out')}; 
		window.parent.document.body.appendChild(closeBtn);
	}
	return true;
}
function getImageInfo(id){
	var image = getElement(id + '_image');
	if(image){
		bgImg = image.style.backgroundImage;
		bgImg = bgImg.replace('url(', '');
		bgImg = bgImg.replace(')', '');
		var fullImage = document.createElement('IMG');
		fullImage.src = bgImg;
		document.body.appendChild(fullImage);
		width = fullImage.offsetWidth;
		height = fullImage.offsetHeight;
		document.body.removeChild(fullImage);
		var aInfo = new Array();
		aInfo['width'] = width;
		aInfo['height'] = height;
		return aInfo;
	}	
	return '';
}
function createFullImage(id, img, width, height){ 
	var container = document.createElement('DIV');
	var closeBtn = document.createElement('DIV');
	var image = getElement(id + '_image');
	if(container){
		container.id = id + '_fullImage';
		container.style.position = 'absolute';
		container.style.width = window.screen.width - 100 + "px";
		container.style.height = window.screen.height - 350 + "px";
		var scrollY = (window.scrollY)?window.scrollY:document.documentElement.scrollTop;
		container.style.top = 88 + scrollY + "px";
		container.style.border = "1px solid #666";
		container.style.backgroundColor = '#FFFFD1';
		document.body.appendChild(container);
		container.style.left = document.body.offsetWidth / 2 - container.offsetWidth / 2 + "px";
    if(getExtension(img) == 'swf'){
      var fullImage = document.createElement('DIV');
      fullImage.innerHTML = "<embed width='" + width + "' height='" + height + "' src='" + img + "'>";
      fullImage.style.textAlign = 'center';
    } else {
      var fullImage = document.createElement('IMG');
      var bgImg = image.style.backgroundImage;
  		bgImg = bgImg.replace('url(', '');
  		bgImg = bgImg.replace(')', '');
      bgImg = bgImg.replace(/"/g, '');
  		fullImage.src = bgImg;
    }
    container.appendChild(fullImage);
		fullImage.style.marginTop = container.offsetHeight / 2 - fullImage.offsetHeight / 2 + "px";
		fullImage.style.marginLeft = container.offsetWidth / 2 - fullImage.offsetWidth / 2 + "px";
		if(fullImage.offsetWidth > container.offsetWidth || fullImage.offsetHeight > container.offsetHeight){container.style.overflow = 'scroll';}
		closeBtn.innerHTML = "clicca sull'immagine per chiuderla";
		closeBtn.style.position = 'absolute';
		var width = 200;
		closeBtn.style.top = container.offsetTop + 2 + "px"; 
		closeBtn.style.left = container.offsetLeft + container.offsetWidth - width - 6 + "px";
    closeBtn.style.padding = '2px';
		closeBtn.style.width = width + 'px';
		closeBtn.style.height = '14px'; 
    closeBtn.style.backgroundColor = '#FBEDC2';
		closeBtn.style.color = '#000';
		closeBtn.style.textAlign = 'center';
		closeBtn.style.font = '9px Verdana, Arial, sans-serif';
		container.onclick = function(){ document.body.removeChild(container); document.body.removeChild(closeBtn); setPointer(this.id, 'out')};
		container.onmouseover = function(){ setPointer(this.id, 'over')};
		container.onmouseout = function(){ setPointer(this.id, 'out')}; 
		document.body.appendChild(closeBtn);
	}
	return true;
}	
function onLoad_selectImage(id, browser, loader, img){
	var container = getElement(id + '_container');
	var image = getElement(id + "_image");
	var text = getElement(id + "_text");
	var btnSfoglia = getElement(id + "_btnSfoglia");
	var inputSfoglia = getElement(id);
	var margin = 10;
	if(image){
		image.style.margin = margin + "px";
		image.style.marginTop = 0 + "px";
		image.style.marginBottom = 0 + "px";
		if(container){
			var imageWidth = container.offsetWidth - btnSfoglia.offsetWidth - margin * 2 - 18;
			image.style.width = imageWidth + "px";
		}
	}
	if(text){
		text.style.marginTop = 1 + "px";
		text.style.width = imageWidth - 4 + "px";
		if(browser == 'Internet Explorer 7'){text.style.marginTop = -21 + "px";}
	}
	inputSfoglia.style.width = btnSfoglia.offsetWidth + "px";
	inputSfoglia.style.height = btnSfoglia.offsetHeight + "px";
	if(browser !== 'Internet Explorer 7'){
		inputSfoglia.style.position = 'absolute';
	} else {
		inputSfoglia.style.position = 'relative';
		inputSfoglia.style.top = - text.offsetTop + "px";
	}
	if(browser == 'Chrome'){inputSfoglia.style.left = btnSfoglia.offsetLeft - margin + "px";}
	else{inputSfoglia.style.left = btnSfoglia.offsetLeft + "px";}
	container.style.height = image.offsetHeight + text.offsetHeight + 10 + "px";
	if(browser == 'FireFox'){inputSfoglia.style.left = btnSfoglia.offsetLeft - margin - 145 + "px";}
	if(!getElement('loader')){createLoader(loader);}
	adjust(id, img);
}
function onload_module(){
	var testata = getElement('testata');
	var module = getElement('module');
	var menu = getElement('menu');
	var piede = getElement('piede');		
	if(testata && module && menu && piede){
		var pageHeight;
		if(window.innerHeight) pageHeight = window.innerHeight - testata.offsetHeight - piede.offsetHeight;
		else pageHeight = document.documentElement.clientHeight - testata.offsetHeight - piede.offsetHeight;
		if(pageHeight < menu.offsetHeight) pageHeight = menu.offsetHeight;
		if(module.offsetHeight > pageHeight){menu.style.height = module.offsetHeight + "px";} 
    else {
			menu.style.height = pageHeight + "px";
			module.style.height = pageHeight + "px";
		}
		if(menu.offsetHeight < module.offsetHeight){menu.style.height = module.offsetHeight + "px";}
	}
	var actionResult = getElement('actionResult');
	if(actionResult){actionResult.style.height = pageHeight + "px";}
}
function mostraSchedaCliente(containerID, contenutoScheda){
	if(!getElement(containerID + '_schedaCliente')){
		var scheda = document.createElement('DIV');
		var container = getElement(containerID);
		scheda.id = containerID + '_schedaCliente';
		scheda.style.color = '#666';
		scheda.style.font = '10px Verdana, Arial, sans-serif';
		scheda.style.marginTop = "0px";
		scheda.innerHTML = formatHtml(contenutoScheda);
		if(container){// sostituzione pulsante
			container.appendChild(scheda);
			nascondi('schedaCliente_btnDettagli_' + containerID);
			mostra('schedaCliente_btnChiudi_' + containerID); 
			// correzione altezza modulo e menu
			var module = getElement('module');
			var menu = getElement('menu');
			var endmodule = getElement('distanziale');
			if(module && endmodule && menu){ 
				var endmoduleBottom = endmodule.offsetTop + endmodule.offsetHeight;
				if(module.offsetHeight < endmoduleBottom){module.style.height = endmoduleBottom + 'px';}
				if(menu.offsetHeight < endmoduleBottom){menu.style.height = endmoduleBottom + 'px';}
			}
		} 		
	}
}
function nascondiSchedaCliente(containerID){
	var scheda = getElement(containerID + '_schedaCliente');
	var container = getElement(containerID);
	if(scheda && container){container.removeChild(scheda);}
	// sostituzione pulsante
	if(container){ 
		nascondi('schedaCliente_btnChiudi_' + containerID);
		mostra('schedaCliente_btnDettagli_' + containerID); 
	} 
}
function mostraSchedaInfo(containerID, contenutoScheda){
	if(!getElement(containerID + '_schedaInfo')){
		var scheda = document.createElement('DIV');
		var container = getElement(containerID);
		scheda.id = containerID + '_schedaInfo';
		scheda.style.color = '#666';
		scheda.style.font = '10px Verdana, Arial, sans-serif';
		scheda.style.marginTop = "0px";
		scheda.innerHTML = formatHtml(contenutoScheda);
		// sostituzione pulsante
		if(container){ 
			container.appendChild(scheda);
			nascondi(containerID + '_schedaInfo_btnDettagli');
			mostra(containerID + '_schedaInfo_btnChiudi'); 
			// correzione altezza modulo e menu
			var module = getElement('module');
			var menu = getElement('menu');
			var endmodule = getElement('distanziale');
			if(module && endmodule && menu){ 
				var endmoduleBottom = endmodule.offsetTop + endmodule.offsetHeight;
				if(module.offsetHeight < endmoduleBottom) module.style.height = endmoduleBottom + 'px';
				if(menu.offsetHeight < endmoduleBottom) menu.style.height = endmoduleBottom + 'px';
			}
		} 		
	}
}
function nascondiSchedaInfo(containerID){
	var scheda = getElement(containerID + '_schedaInfo');
	var container = getElement(containerID);
	if(scheda && container){container.removeChild(scheda);}
	// sostituzione pulsante
	if(container){ 
		nascondi(containerID + '_schedaInfo_btnChiudi');
		mostra(containerID + '_schedaInfo_btnDettagli'); 
	} 
}
function replaceTextarea(textarea, dim, root){
  var brw = '/extlib/ckeditor/filemanager/browser/default/browser.html';
  var connector = '/extlib/ckeditor/filemanager/connectors/php/upload.php';
  
  CKEDITOR.replace(textarea, 
    {
      customConfig : 'myconfig.js',
      filebrowserBrowseUrl : brw + '?Connector=' + root + '//extlib/ckeditor/filemanager/connectors/php/connector.php',
      filebrowserImageBrowseUrl : brw + '?Type=Image&Connector=' + root + '//extlib/ckeditor/filemanager/connectors/php/connector.php',
      filebrowserFlashBrowseUrl : brw + '?Type=Flash&Connector=' + root + '//extlib/ckeditor/filemanager/connectors/php/connector.php',   
	    filebrowserUploadUrl  : root + connector + '?Type=File',
	    filebrowserImageUploadUrl : root + connector + '?Type=Image',
	    filebrowserFlashUploadUrl : root + connector + '?Type=Flash'             
    }
  );
}
function mostraSelezionato(select, eliminaCheck){
	var len = select.length;
	var eliminaCheckLabel = getElement(eliminaCheck + "_label");
	eliminaCheck = getElement(eliminaCheck);
	if(eliminaCheck){
		if(select.value == 0){ 
			eliminaCheckLabel.style.display = 'none';
			eliminaCheck.style.display = 'none';
		} else { 
			eliminaCheckLabel.style.display = 'block';
			eliminaCheck.style.display = 'block';
		}
	} 
 	for(var i=0;i<len;i++) {
		var group = getElement(select.options[i].value + "_group");
 		if(group){
	 		if(select.options[i].value == select.value){group.style.display = 'block';}
      else{group.style.display = 'none';}
 		}
	}
}
function setNameInput(input, value){
	if(!value) value = '';
	input = getElement(input);
	if(!input){return false;}
	if(input.value == '[aggiungi]'){input.value = value;}
	return true;
}
function tipoSpedGest(tipoSped, importo, importoPerc, limitePeso, prezzoKg){
	tipoSped = getElement(tipoSped);
	var importoLabel = getElement(importo + "_label");
	importo = getElement(importo);
	var importoPercLabel = getElement(importoPerc + "_label");
	importoPerc = getElement(importoPerc);
	var limitePesoLabel = getElement(limitePeso + "_label");
	limitePeso = getElement(limitePeso);
	var prezzoKgLabel = getElement(prezzoKg + "_label");
	prezzoKg = getElement(prezzoKg);
	if(importo && importoPerc && importoPercLabel && limitePeso && limitePesoLabel && prezzoKg && prezzoKgLabel){
		switch(tipoSped.value){
			case "fisso":
				limitePeso.style.display = 'none';
				limitePesoLabel.style.display = 'none';
				prezzoKg.style.display = 'none';
				prezzoKgLabel.style.display = 'none';
				importo.style.display = 'block';
				importoLabel.style.display = 'block';
				importoPerc.style.display = 'none';
				importoPercLabel.style.display = 'none';
			break;
			case "percentuale":
				limitePeso.style.display = 'none';
				limitePesoLabel.style.display = 'none';
				prezzoKg.style.display = 'none';
				prezzoKgLabel.style.display = 'none';
				importo.style.display = 'none';
				importoLabel.style.display = 'none';
				importoPerc.style.display = 'block';
				importoPercLabel.style.display = 'block';
			break;
			case "a peso":
				limitePeso.style.display = 'block';	
				limitePesoLabel.style.display = 'block';
				prezzoKg.style.display = 'block';
				prezzoKgLabel.style.display = 'block';
				importo.style.display = 'block';
				importoLabel.style.display = 'block';
				importoPerc.style.display = 'none';
				importoPercLabel.style.display = 'none';
			break;
		}
	}	
}
function eliminaOnClick(check, dati){
	dati = getElement(dati);
	if(dati){
		if(check.checked){dati.style.display = 'none';}
		else{dati.style.display = 'block';}
	}
}
function moduleSelectAll(check){
	var aElements = document.getElementsByTagName('INPUT');
	var numElements = aElements.length;
	var elem;
	for(var i=0; i < numElements; i++){
		elem = aElements[i];
		if(elem !== check && elem.type == 'checkbox' && !elem.disabled){elem.checked = check.checked;}
	}
}
function submitFilter(formName, edit){
	edit = getElement(edit);
	if(edit){edit.value = 1;} 
	submitForm(formName);
}
function submitPage(formName, nPagine, edit){
	edit = getElement(edit);
	if(edit){ 
		if(edit.value <= nPagine && edit.value > 0){submitForm(formName);}
		else{alert('n° di pagina inesistente');}
	}
}
function submitElimina(formName, edit){
	if(confirm('Tutti gli eventi selezionati verranno cancellati, procedere?')){
		setParam('formName', formName);
		setParam('runAction', 'true');
		setParam('operazione', 'elimina');
		edit = getElement(edit);
		if(edit){edit.value = 1;} 
		submitForm(formName);		
	}	
}
function submitCerca(formName, edit){
	edit = getElement(edit);
	if(edit){ 
		edit.value = 1; 
		submitForm(formName);
	}
}
function caricaTema(loader){
	if(confirm('Vuoi caricare i valori di default del tema?')){caricaRisorseTema(loader, false, 'si');} 
  else{caricaRisorseTema(loader);}
}
function caricaRisorseTema(loader, rif, resp){
	var CodProfilo = getElement('profili');
	if(!CodProfilo){return false;}
	CodProfilo = CodProfilo.value;
	var id = 'CodProfilo|' + CodProfilo + '|Tema|profili';
	var tema = getElement(id);
	if(!tema){return false;}
	showLoader(loader);
	var params = 'Tema=' + tema.value + '&CodProfilo=' + CodProfilo;
	if(rif){
		var aID = rif.id.split('_');
		aID.pop();
		params += '&id=' + aID.join('_');
	}
	if(resp){params += '&resp=si';}
	ajaxGet('metodi/caricaRisorseTema.php?' + params, gestCaricaRisorseTema, CodProfilo);
}
function setSelectImage(id, imageURL){
	var paramImage, textImage, elem;
	paramImage = 'image|' + id;
	textImage = id + '_text';
	id = id + '_image';
	loadImage(id, imageURL)
	elem = getElement(paramImage);
	aImageName = imageURL . split('/');
	imageName = aImageName[aImageName.length-1];  
	if(elem){elem.value = imageName;}
	elem = getElement(textImage);
	if(elem){elem.innerHTML = imageName;}	
}
function gestCaricaRisorseTema(content, CodProfilo){
	var aContent = content.split(',');// content = Classe|Tipo|Nome=Valore,Classe|Tipo|Nome=Valore, ...
	var len = aContent.length;
	var aRes, id, elem;
	for(var i = 0;i < len; i++){
		aRes = aContent[i].split('=');
		aKeys = aRes[0].split('|');
		id = CodProfilo + '|' + aRes[0];
		switch(aKeys[0]){
			case 'colori':
				id = 'color|' + id;
				elem = getElement(id);
				if(!elem) break;
				elem.value = aRes[1];
				makeColorSelector(elem);
        elem = getElement(id + '_label');
        if(!elem) break;
        elem.innerHTML = aRes[2];
				break;
			case 'banners':
			case 'immagini':
				setSelectImage(id, aRes[1]);
				break;
		}
	}
	hideLoader();
}
function caricaAnteprima(formName){
	setParam('operazione', 'caricaAnteprima');
	setParam('formName', formName);
	setParam('runAction', 'true');
	submitForm(formName, '_blank');
}
function resetAnteprima(){
	var elem = getOpenerElement('operazione');
	if(elem){elem.value = '';}
}
function submitSvuota(formName, edit, msg){
	if(!msg){msg = 'Tutti gli elementi verranno cancellati, procedere?';} 
	if(confirm(msg)){
		setParam('formName', formName);
		setParam('runAction', 'true');
		setParam('operazione', 'svuota');
		edit = getElement(edit);
		if(edit){edit.value = 1;} 
		submitForm(formName);		
	}	
}
function submitNumRows(formName, edit){
	edit = getElement(edit);
	if(edit){ 
		edit.value = 1; 
		submitForm(formName);
	}
}
function submitOrder(formName, ordinamento){
	var pagina = getElement('pagina');
	if(pagina){pagina.value = 1;}	
	var order = getElement('order');
	if(order){order.value = ordinamento;} 
	submitForm(formName);
}
function saveForm(formName){
	var msg = document.createElement('DIV');
	msg.style.width = '200px';
	msg.style.font = '12px Verdana, Arial, sans-serif';
	msg.style.position = 'absolute';
	msg.style.top = '40%';
	msg.style.left = '50%';
	msg.style.marginLeft = '-100px';
	msg.style.padding = '40px';
	msg.style.textAlign = 'center';
	msg.style.border = '3px solid #cfcfcf';
	msg.style.color = '#666';
	msg.style.backgroundColor = '#FBEDC2';
	msg.innerHTML = 'salvataggio in corso...'
	document.body.appendChild(msg); 
	var pagina = getElement('pagina');
	if(pagina){pagina.value = 1;}
	submitFormTimeOut(formName, 1000);
}
function submitOtherActions(formName, edit){
	var action = getElement('otherAction');
	var aAction = action.value.split('|');
	var msg = aAction[1];
	if(!msg || (msg && confirm(msg))){
		setParam('runOtherAction', 'true');
		saveForm(formName);
	}else{action.value = 'default';}
}
function reloadTable(location){
	var runAction = getElement('runAction');
	if(runAction){runAction.value = 'false';}
	var runOtherAction = getElement('runOtherAction');
	if(runOtherAction){runOtherAction.value = 'false';}
	redirect(location);
} 
function submitAlphaFilter(formName, filter, edit){
	edit = getElement(edit);
	if(edit){edit.value = 1;}
	setParam('alphaFilter', filter) 
	submitForm(formName);
}
function submitDecPage(formName, edit){
	edit = getElement(edit);
	if(edit){
		val = edit.value;
		val--;
		if(val > 0){
			edit.value--; 
			submitForm(formName);
		}
	}
}
function submitIncPage(formName, nPagine, edit){
	edit = getElement(edit);
	if(edit){
		val = edit.value;
		val++;
		if(val <= nPagine){
			edit.value++; 
			submitForm(formName);
		}
	}
}
function chiudiAvviso(avviso){
	nascondi(avviso);	
	// correzione altezza modulo e menu
	var module = getElement('module');
	var menu = getElement('menu');
	if(module && menu && menu.offsetHeight > module.offsetHeight){module.style.height = menu.offsetHeight + 'px';}
	var aAvviso = avviso.split("|");
	ajaxGet("metodi/gestioneAvvisi.php?Tipo=" + aAvviso[0] + "&ValoreChiave=" + aAvviso[1] + "&Valore=" + aAvviso[2], gestioneAvvisi);
}
function gestioneAvvisi(content){
	var aContent = content.split("|");
	if(aContent[0] == 'errore'){alert("Errore: " + aContent[1]);}
}
function showModuleSection(formName, item){
  setParam('selectedSection', item) 
	submitForm(formName);
}