// inizio funzione che modifica le stelle di gradimento

function ShoWin(url)
{
	popupWin = window.open(url, 'Catalogo', 'scrollbars,resizable,width=640,height=400,top=0, left=0')
}

function UpDateItem(Action,FormName)
{
    if (Action =='up')
       {
	   if (isNaN(document.getElementById(FormName).qta.value))
	      {
	       alert("Valore digitato in modo scorretto !");
	       document.getElementById(FormName).qta.focus();
	      }
	      else
	       {
	       document.getElementById(FormName).submit();
	       }
	   }    
	   else if (Action =='de')   
	           {
	            document.getElementById(FormName).action.value="del";
	            document.getElementById(FormName).submit();
	           }
}

function ValidateForm()
 {
   var Nominativo = document.getElementById("txnome")
   if(Nominativo.value=="")
     {
      document.getElementById(Nominativo.name.toUpperCase()+'1').style.display='inline';
      Nominativo.focus();
      return false;
     }
   var Indirizzo = document.getElementById("txindirizzo")
   if(Indirizzo.value=="")
     {
      document.getElementById(Indirizzo.name.toUpperCase()+'1').style.display='inline';
      Indirizzo.focus();
      return false;
     }
   var Cap = document.getElementById("txcap")
   if(Cap.value=="")
     {
      document.getElementById(Cap.name.toUpperCase()+'1').style.display='inline';
      Cap.focus();
      return false;
     }
   var Citta = document.getElementById("txcitta")
   if(Citta.value=="")
     {
      document.getElementById(Citta.name.toUpperCase()+'1').style.display='inline';
      Citta.focus();
      return false;
     }      
   var Provincia = document.getElementById("txprovincia")
   if(Provincia.value=="")
     {
      document.getElementById(Provincia.name.toUpperCase()+'1').style.display='inline';
      Provincia.focus();
      return false;
     }      
   var Telefono = document.getElementById("txtelefono")
   if(Telefono.value=="")
     {
      document.getElementById(Telefono.name.toUpperCase()+'1').style.display='inline';
      Telefono.focus();
      return false;
     }  
   var Email = document.getElementById("txemail1")
   if(Email.value=="")
     {
      document.getElementById(Email.name.toUpperCase()+'1').innerHTML='<br>(Campo obbigatorio)';
      document.getElementById(Email.name.toUpperCase()+'1').style.display='inline';
      Email.focus();
      return false;
     }else if(!Email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/))
           {
            document.getElementById(Email.name.toUpperCase()+'1').innerHTML='<br>(Email errata)';
            document.getElementById(Email.name.toUpperCase()+'1').style.display='inline';
            Email.focus();
            return false;
           }
   var EmailConferma = document.getElementById("txemail2")
   if(EmailConferma.value!=Email.value)
     {
      document.getElementById(EmailConferma.name.toUpperCase()+'1').style.display='inline';
      EmailConferma.focus();
      return false;
     }          
 }