function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}/* Nasconde il Layer indicato dall'indice iCnt.Se nell'array è presente un Layer sbagliato, notifica l'errore con un allert.*/function _AT_HideLayer(iCnt, Contenuti, Links){	if (isNaN(iCnt) || (iCnt > Contenuti.length)){		alert('Indice ' + iCnt + ' non numerico o non trovato');		return;	} else {			if ((MM_findObj(Contenuti[iCnt]))!=null) { 			//if (objLayer.style) {objLayer = objLayer.style;}			//objLayer.display = 'none'; 			MM_findObj(Contenuti[iCnt]).style.display = "none"			MM_findObj(Links[iCnt]).className = " "			} else {			alert('Oggetto ' + Contenuti[iCnt] + ' non trovato.');			return;		}	}}/* Scorre l'array del Layer e li nasconde tutti.Se nell'array è presente un Layer sbagliato, notifica l'errore con un allert.*/function AT_HideLayers(Contenuti, Links){	for (iCnt = 0; iCnt < Contenuti.length; iCnt++){		_AT_HideLayer(iCnt,Contenuti, Links)	}}/* Inverte lo stato del Layer passato, aggiorna l'aspetto del link e dell'icona.Se il Layer non esiste notifica l'errore con un allert.Se bCloseOther è true, chiude tutti gli altri Layer indipendentemente dal loro stato, aggiornando l'aspetto sia del link che dell'icona*/function AT_ChangeStatus(aLayer, aLink, Contenuti, Links, bCloseOther, bCloseSelf){	if (MM_findObj(aLayer) != null)	{			if ( MM_findObj(aLayer).style.display == "none")			{					MM_findObj(aLayer).style.display = ""					MM_findObj(aLink).className = "selected"			}			else			{					if(bCloseSelf)					{					 MM_findObj(aLayer).style.display = "none"					 MM_findObj(aLink).className = " "					}					 			}				}	// Imposta il campo hidden per mantenere lo stato	// in caso di postback (salvataggio ad esempio)	/*	MM_findObj('TxtCurrentLayerId').value = -1;		if (objLayer.display ==''){		for (iCnt = 0; iCnt < lstContenuti.length; iCnt++){			if (lstContenuti[iCnt] == aLayer) 				{				MM_findObj('TxtCurrentLayerId').value = iCnt;				break				}		}	}	*/  		if (bCloseOther) {		for (iCnt = 0; iCnt < Contenuti.length; iCnt++){		    if (Contenuti[iCnt] != aLayer) _AT_HideLayer(iCnt,Contenuti, Links)		}	}	}/* ========== Fine Gestione Layer e apertura / chiusura ========== */function ValidateForm() {	var email = document.mailinglist.email.value;	var filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;		if(email == "") {		document.getElementById('emailEmpty').className = "error";		document.getElementById('emailWrong').className = "hide";		document.mailinglist.email.focus();		return false;	}	else if (!filtro.test(email)) {		document.getElementById('emailEmpty').className = "hide";		document.getElementById('emailWrong').className = "error";		document.mailinglist.email.focus();		return false;	}	else{		document.mailinglist.action = "contacts-insert.php";		document.mailinglist.submit();		return true;	}}
