

var styleDisplayWhenVisible='inline';

function aprilayer(evId) {
    ele = document.getElementById(evId);
	
    if (!(ele != null && ele.style.display != null)) {
        //alert('non trovo display di trEvento'+evId);
        return false;
    }
    if (ele.style.display != 'none') {
        ele.style.display = 'none';
    } else {
        ele.style.display = styleDisplayWhenVisible;
    }
 					
    return true;
}

//

// Funzione per mostrare/nascondere un layer
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
 // this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
 // this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
 // this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}

function refresh() {
  // refresh della pagina corrente  
document.location.reload();
}
// imposto il timeout per il prossimo refresh
// espresso in millisecondi (1000 = 1 secondo)

//window.setTimeout("refresh();", 1000);

/* ************** validation iscrizione newletter ************** */

	var newsletterForm;

	//Attach an "onLoad" event to the current window
	window.onload = init;
	
	//Initialization function
	function init() {
		//Attaching the onSubmit event to the newsletter form
		newsletterForm = document.getElementById('newsletter');
		newsletterForm.onsubmit = function () {
			return canSubmit(this);
		}
		
		//Setting focus to the user field
		newsletterForm.nome.focus();
	}

	function filled(field) {
		if (field.value == "" || field.value == null) {
			return false;
		} else {
			return true;
		}
	}
	
	function canSubmit(form) {
		if (!filled(form.nome)) {
			alert("Prego, inserisci il tuo nome.");
			form.nome.focus();
			return false;
		}
		
		if (!filled(form.cognome)) {
			alert("Prego, inserisci il tuo cognome.");
			form.cognome.focus();
			return false;
		}

		if (!filled(form.email)) {
			alert("Prego, inserisci il tuo indirizzo e-mail.");
			form.email.focus();
			return false;
		}

		return true;
	}

/* ************** fine validation iscrizione newletter ************** */



<!--
var username_box=0
var username_box1=0
function stoperror() { return true } window.onerror=stoperror
//-->
 
function SendMail_NL(ObjForm){
	var MailValue = ObjForm.EMail.value;
	if(MailValue.length==0){
		alert("Areaimpresa.eu\n\nInserisci un indirizzo e-mail corretto.");
		return false;	
	}
	if (MailValue.indexOf("@") == -1){
		alert("Areaimpresa.eu\n\nInserisci un indirizzo e-mail corretto.");
		return false;	
	}
	
	ObjForm.EMail.value=MailValue;
	return true;
}




