function inizio(max) 
 {
  var day = new Date();
  num = (day.getTime() % max)+1;
  //document.pluto.src = "img/img"+num+".gif";
  document.write("<table background='img/img"+num+".jpg' border='0' cellspacing='0' cellpadding='0'><tr><td width='524' valign='top' class='testonav'>");  
}
function fine()
{
  document.write("<td width='10'><img src='img/trasp.gif' width='10' height='212'></td></tr></table>");
}
function popnewsletter()
{
	page = "popnewsletter.asp";

	slidewin = window.open(page,"pop1","top=50,left=20,width=384,height=291,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");
	slidewin.focus();
}
function popnewsletter_eng()
{
	page = "popnewsletter_eng.asp";

	slidewin = window.open(page,"pop1","top=50,left=20,width=384,height=291,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");
	slidewin.focus();
}	
function controllinewsletter(lingua)
{
		/*if (document.frm.nome.value == "")
		{
		   if (lingua== "ita")
			   {
			   alert("ATTENZIONE!! Bisogna necessariamente inserire il nome!!");
				}
				else
				{
			   alert("ATTENTION PLEASE! You have to put a valid name!");
				}
			document.frm.nome.focus();
			document.frm.nome.select();
			return false;
		}
		if (document.frm.cognome.value == "")
		{
		   if (lingua== "ita")
			   {
			   alert("ATTENZIONE!! Bisogna necessariamente inserire il cognome!!");
				}
				else
				{
			   alert("ATTENTION PLEASE! You have to put a valid last name!");
				}
			document.frm.cognome.focus();
			document.frm.cognome.select();
			return false;
		}*/



		if (document.frm.mail.value == "")
		{
		   if (lingua== "ita")
			   {
				alert("ATTENZIONE!! Bisogna necessariamente inserire un indirizzo mail valido!");
				}
				else
				{
				alert("ATTENTION PLEASE! You have to put a valid mail address!");
				}
			document.frm.mail.focus();
			document.frm.mail.select();
			return false;
		}

	if (!document.frm.cprivacy.checked)
	{
		if (lingua== "ita")
			   {
				alert("ATTENZIONE!! Bisogna necessariamente accettare la privacy!");
				}
				else
				{
				alert("ATTENTION PLEASE! You have to put check the privacy!");
				}
			document.frm.cprivacy.focus();
			return false;
	}

		return chkmail(lingua);

	return true;
}	
function chkmail(lingua)
	{ 
	  txt = document.frm.mail.value;
	  if (document.frm.mail.value !="")
	  {
	     if (txt.indexOf("@")<1)
	       {
		   if (lingua== "ita")
			   {
			   alert("ATTENZIONE!! La mail non è stata inserita correttamente!!");
				}
				else
				{
			   alert("ATTENTION PLEASE! Your mail address is not correct!");
				}
			document.frm.mail.focus();
			document.frm.mail.select();
		   return false;
	       }
	       punto=txt.indexOf("@") 
	       if (txt.indexOf(".",punto)<1)
	       {
		   if (lingua= "ita")
			   {
			   alert("ATTENZIONE!! La mail non è stata inserita correttamente!!");
				}
				else
				{
			   alert("ATTENTION PLEASE! Your mail address is not correct!");
				}
				document.frm.mail.focus();
				document.frm.mail.select();
			return false;
	       }
	  }
	  return true;
	}
