// JavaScript Document

function controllo_mail(){
	 
	if(document.getElementById('email').value==""){
		 alert("campo E-MAIL mancante!");
		 document.getElementById('email').focus();
		 return (false);
		 }
	
	StrMail=document.getElementById('email').value;
   if (StrMail.length>6){
	  var pos;
	  var dotpos;
	  pos = StrMail.indexOf("@");
	  if ( (pos >= (StrMail.length-3) ) || (pos < 2) )
		 {
		alert("Il campo email non è stato inserito nel formato corretto.");
		 document.getElementById('email').focus();
		 return (false);		 
		 }
	  pos=pos+1;
	  dotpos = StrMail.indexOf(".", pos);
	  if (dotpos > (StrMail.length-3) )
		 {
		alert("Il campo email non è stato inserito nel formato corretto.");
		 document.getElementById('email').focus();
		 return (false);
		 }
	  Strmail=StrMail.substr(pos);
	  if ( (StrMail.length < 5) || (dotpos <= 0) )
		 {			 
		 alert("Il campo email non è stato inserito nel formato corretto.");
		 document.getElementById('email').focus();
		 return (false);
		 }
	  }
   else
	  {
	  alert("Il campo email non è stato inserito nel formato corretto.");
	  document.getElementById('email').focus();
	  return (false);
	  }
	return (true);
	//window.location='index3.php?idstruttura='+idstr+'&action=invia';
}
 


startMenu = function() {
if (document.all&&document.getElementById) {
cssmenu = document.getElementById("csstopmenu");
for (i=0; i<cssmenu.childNodes.length; i++) {
node = cssmenu.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function(){                  
this.className=this.className.replace(" over", "")
}
}
}
}
}

if (window.attachEvent)
window.attachEvent("onload", startMenu)
else
window.onload=startMenu;
