function dataCheck (dataStr) {

var anno;
var mese;
var giorno;
var barra;

	barra=dataStr.substr(2,1);
	if ( barra != "/" )
	{
     alert("Manca il primo slash \nUsate il formato data : gg/mm/yyyy");
     return false;
	}
	
	barra=dataStr.substr(5,1);
	if ( barra != "/" )
	{
     alert("Manca il secondo slash \nUsate il formato data : gg/mm/yyyy");
     return false;
	}



	anno   = dataStr.substr(6,4);
	mese   = dataStr.substr(3,2);
	giorno = dataStr.substr(0,2);
	
	if ( isNaN(anno) )
	{
     alert("L'Anno non è corretto");
     return false;
	
	}
	
	if ( isNaN(mese) )
	{
     alert("Il mese non è corretto");
     return false;
	
	}
	
	if ( isNaN(giorno) )
	{
     alert("Il giorno non è corretto");
     return false;
	}
	

	if ( anno.length < 4 )
	{
     alert("L'Anno deve essere di 4 cifre");
     return false;
	}
	
	if ( mese > 12 )
	{
      alert("Il mese non deve essere maggiore di 12");
      return false;
	}

	if ( mese < 1 )
	{
      alert("Il mese non deve essere minore di 1");
      return false;
	}


	if ( giorno > 31 )
	{
      alert("Il giorno non deve essere maggiore di 31");
      return false;
	}

	if ( giorno < 1 )
	{
      alert("Il giorno non deve essere minore di 1");
      return false;
	}

 return true;
 
}
