
function fill_fields( eventObj, obj)
{
      var select_value = obj.value;
      //alert(friend);
      document.delivery.name.value = friend[select_value][0];
      document.delivery.address.value = friend[select_value][1];
      document.delivery.postcode.value = friend[select_value][2];
      document.delivery.country.value = friend[select_value][3];
      document.delivery.town.value = friend[select_value][4];
      document.delivery.tel.value = friend[select_value][5];
}
function add_value( eventObj, obj)
{
    var customer_value = obj.value;
    document.billing.customfld5.value = customer_value;
}
function add_value2( eventObj, obj,campo)
{
    var customeremail_value = obj.value;
    document.billing.customfld10.value = customeremail_value;
}
function add_value3( eventObj, obj,campo)
{
    var customer_value = obj.value;
    document.billing.customfld7.value = customer_value;
}
function add_value4( eventObj, obj,campo)
{
    var customer_value = obj.value;
    document.billing.customfld8.value = customer_value;
}
function add_value5( eventObj, obj,campo)
{
    var customer_value = obj.value;
    document.billing.customfld9.value = customer_value;
}
function add_value6( eventObj, obj,campo)
{
    var customer_value = obj.value;
    document.billing.customfld10.value = customer_value;
}

function removeElement( div_msg )
{
  document.getElementById(div_msg).style.display="none";
}
function changeVisibility()
{
  document.getElementById(div_msg).style.visibility="hidden";
}
function resetElement()
{
document.getElementById(div_msg).style.display="block";
document.getElementById(div_msg).style.visibility="visible";
}
function div_corretto_required(eventObj,obj,id_div,lunghezza)
{
    valore = obj.value;
    if( (valore != "")&&( valore.length >= lunghezza ) )
    {
         document.getElementById(id_div).style.display="none";
    }
}
function div_corretto_email(eventObj,obj,id_div)
{
    var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
    valore = obj.value;
    if( (valore.match(emailRegex)) ) 
    {
         document.getElementById(id_div).style.display="none";
    }
}
function div_corretto_password(eventObj,obj,obj2,id_div,lunghezza)
{
    valore = obj.value;
    valore2 = obj2.value;
    if( ( valore != "" ) && ( valore.length >= lunghezza ) && ( valore == valore2 ) )
	  {
         document.getElementById(id_div).style.display="none";
    }
}

function check_required(eventObj, nome,cognome,email,password,password1,address,town,postcode,number )  {
    //href="javascript:show_validation('ricercaAffittoForm');"
    //alert(nome.value);
    
    var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
    name = nome.value;
    surname = cognome.value;
    posta = email.value;
    pass  = password.value;
    pass1  = password1.value;
    indirizzo  = address.value;
    citta  = town.value;
    cap  = postcode.value;
    tel  = number.value;
    conta = 0;
    errori = new Array();
    corretti = new Array();
    
    
    if( (name == "")||( name.length < 2 ) )
    {
      conta++;      
      errori.push('form_nome');            
    } else{corretti.push('form_nome');}
    if( (surname == "")||( surname.length < 2 ) )
    {
       conta++;      
       errori.push('form_cognome');
    } else{corretti.push('form_cognome');}
    if( (!posta.match(emailRegex)) || (posta == "") ) 
    {
       conta++;      
       errori.push('form_email');
    } else{corretti.push('form_email');}
    if( pass.length < 6 )
	  {
		   conta++;      
       errori.push('form_password');
	  } else{corretti.push('form_password');}
	  if( ( pass1 == "" ) || ( pass1 != pass ) )
	  {
		  conta++;      
       errori.push('form_password1');
	  } else{corretti.push('form_password1');}
	  if( (indirizzo == "")||( indirizzo.length < 2 ) )
    {
      conta++;      
      errori.push('form_address');            
    } else{corretti.push('form_address');}
    if( (citta == "")||( citta.length < 2 ) )
    {
      conta++;      
      errori.push('form_town');            
    } else{corretti.push('form_town');}
    if( (cap == "")||( cap.length < 2 ) )
    {
      conta++;      
      errori.push('form_postcode');            
    } else{corretti.push('form_postcode');}
    if( (tel == "")||( tel.length < 6 ) )
    {
      conta++;      
      errori.push('form_number');            
    } else{corretti.push('form_number');}
	  
    //MOSTRO MESSAGGI
    k=0;
	  while(k<corretti.length) 
    { 
        document.getElementById(corretti[k]).style.display="none";
        k++;
    }	  
    if(conta > 0)
	  {
       i=0;
       
       while(i<errori.length) 
       { 
          //alert(errori[i]);
          //show_validation(errori[i]);
          document.getElementById(errori[i]).style.display="block";
          i++;
       }
       
       return false;
    } 
}
function check_required2(eventObj, nome,cognome,email,address,town,postcode,number )  {
    //href="javascript:show_validation('ricercaAffittoForm');"
    //alert(nome.value);
    
    var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
    name = nome.value;
    surname = cognome.value;
    posta = email.value;
    indirizzo  = address.value;
    citta  = town.value;
    cap  = postcode.value;
    tel  = number.value;
    conta = 0;
    errori = new Array();
    corretti = new Array();
    
    
    if( (name == "")||( name.length < 2 ) )
    {
      conta++;      
      errori.push('form_nome');            
    } else{corretti.push('form_nome');}
    if( (surname == "")||( surname.length < 2 ) )
    {
       conta++;      
       errori.push('form_cognome');
    } else{corretti.push('form_cognome');}
    if( (!posta.match(emailRegex)) || (posta == "") ) 
    {
       conta++;      
       errori.push('form_email');
    } else{corretti.push('form_email');}
    
	  if( (indirizzo == "")||( indirizzo.length < 2 ) )
    {
      conta++;      
      errori.push('form_address');            
    } else{corretti.push('form_address');}
    if( (citta == "")||( citta.length < 2 ) )
    {
      conta++;      
      errori.push('form_town');            
    } else{corretti.push('form_town');}
    if( (cap == "")||( cap.length < 2 ) )
    {
      conta++;      
      errori.push('form_postcode');            
    } else{corretti.push('form_postcode');}
    if( (tel == "")||( tel.length < 6 ) )
    {
      conta++;      
      errori.push('form_number');            
    } else{corretti.push('form_number');}
	  
    //MOSTRO MESSAGGI
    k=0;
	  while(k<corretti.length) 
    { 
        document.getElementById(corretti[k]).style.display="none";
        k++;
    }	  
    if(conta > 0)
	  {
       i=0;
       
       while(i<errori.length) 
       { 
          //alert(errori[i]);
          //show_validation(errori[i]);
          document.getElementById(errori[i]).style.display="block";
          i++;
       }
       
       return false;
    } 
}
function check_required3(eventObj, nome,address,postcode,country,town,number,tel )  {

    name = nome.value;
    indirizzo  = address.value;
    citta  = town.value;
    cap  = postcode.value;
    paese  = country.value;
    telefono  = tel.value;
    conta = 0;
    errori = new Array();
    corretti = new Array();
    
    alert(telefono);
    return false;
    if( (name == "")||( name.length < 2 ) )
    {
      conta++;      
      errori.push('form_nome');            
    } else{corretti.push('form_nome');}
        
	  if( (indirizzo == "")||( indirizzo.length < 2 ) )
    {
      conta++;      
      errori.push('form_address');            
    } else{corretti.push('form_address');}
    
    if( (citta == "")||( citta.length < 2 ) )
    {
      conta++;      
      errori.push('form_town');            
    } else{corretti.push('form_town');}
    
    if( (cap == "")||( cap.length < 2 ) )
    {
      conta++;      
      errori.push('form_postcode');            
    } else{corretti.push('form_postcode');}
    
    if( (paese == "")||( paese.length < 3 ) )
    {
      conta++;      
      errori.push('form_country');            
    } else{corretti.push('form_country');}
    if( (telefono == "")||( telefono.length < 5 ) )
    {
      conta++;      
      errori.push('form_tel');            
    } else{corretti.push('form_tel');}
	  
    //MOSTRO MESSAGGI
    k=0;
	  while(k<corretti.length) 
    { 
        document.getElementById(corretti[k]).style.display="none";
        k++;
    }	  
    if(conta > 0)
	  {
       i=0;
       
       while(i<errori.length) 
       { 
          //alert(errori[i]);
          //show_validation(errori[i]);
          document.getElementById(errori[i]).style.display="block";
          i++;
       }
       
       return false;
    } 
}
function check_required_term_cond(eventObj, term_conditions )  { 
    
    if( document.billing.term.checked == false )
    {
       alert( 'You must accept Terms & Conditions' );      
       return false;        
    }
}
function check_required_bill_q(eventObj, nome,address,email,town,county,postcode,term_conditions )  {

    var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
    name = nome.value;    
    indirizzo  = address.value;
    posta = email.value;
    cap  = postcode.value;
    citta  = town.value;
    county  = county.value;
    conta = 0;
    errori = new Array();
    corretti = new Array();
    
    //tec  = term_conditions.value;  alert( document.billing.term.checked );    
    
    if( document.billing.term.checked == false )
    {
       alert( 'You must accept Term & Condition' );      
       return false;        
    }
    
    if( (name == "")||( name.length < 2 ) )
    {
      conta++;      
      errori.push('form_nome');            
    } else{corretti.push('form_nome');}
    
    if( (indirizzo == "")||( indirizzo.length < 2 ) )
    {
      conta++;      
      errori.push('form_address');            
    } else{corretti.push('form_address');}
    
    if( (!posta.match(emailRegex)) || (posta == "") ) 
    {
       conta++;      
       errori.push('form_email');
    } else{corretti.push('form_email');}
    
    if( (cap == "")||( cap.length < 2 ) )
    {
      conta++;      
      errori.push('form_postcode');            
    } else{corretti.push('form_postcode');}
	  
    if( (citta == "")||( citta.length < 2 ) )
    {
      conta++;      
      errori.push('form_town');            
    } else{corretti.push('form_town');}
    
    if( (county == "")||( county.length < 2 ) )
    {
      conta++;      
      errori.push('form_country');            
    } else{corretti.push('form_country');}

    //MOSTRO MESSAGGI
    k=0;
	  while(k<corretti.length) 
    { 
        document.getElementById(corretti[k]).style.display="none";
        k++;
    }	  
    if(conta > 0)
	  {
       i=0;
       
       while(i<errori.length) 
       { 
          //alert(errori[i]);
          //show_validation(errori[i]);
          document.getElementById(errori[i]).style.display="block";
          i++;
       }
       
       return false;
    } 
}
function check_required_bill(eventObj, nome,address,email,town,county,postcode,card_no,card_expire,cv2 )  {

    var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
    name = nome.value;    
    indirizzo  = address.value;
    posta = email.value;
    cap  = postcode.value;
    citta  = town.value;
    county  = county.value;
    card_no  = card_no.value;
    card_ex  = card_expire.value;
    cv2      = cv2.value;
    conta = 0;
    errori = new Array();
    corretti = new Array();
    
    
    if( (name == "")||( name.length < 2 ) )
    {
      conta++;      
      errori.push('form_nome');            
    } else{corretti.push('form_nome');}
    
    if( (indirizzo == "")||( indirizzo.length < 2 ) )
    {
      conta++;      
      errori.push('form_address');            
    } else{corretti.push('form_address');}
    
    if( (!posta.match(emailRegex)) || (posta == "") ) 
    {
       conta++;      
       errori.push('form_email');
    } else{corretti.push('form_email');}
    
    if( (cap == "")||( cap.length < 2 ) )
    {
      conta++;      
      errori.push('form_postcode');            
    } else{corretti.push('form_postcode');}
	  
    if( (citta == "")||( citta.length < 2 ) )
    {
      conta++;      
      errori.push('form_town');            
    } else{corretti.push('form_town');}
    
    if( (county == "")||( county.length < 2 ) )
    {
      conta++;      
      errori.push('form_country');            
    } else{corretti.push('form_country');}
    
    if( (card_no == "")||( card_no.length < 16 ) )
    {
      conta++;      
      errori.push('form_card_num');            
    } else{corretti.push('form_card_num');}
    
    if( (card_ex == "")||( card_ex.length < 4 ) )
    {
      conta++;      
      errori.push('form_card_expire');            
    } else{corretti.push('form_card_expire');}
    
    if( (cv2 == "")||( cv2.length > 3 )||( cv2.length < 3 ) )
    {
      conta++;      
      errori.push('form_card_cv2');            
    } else{corretti.push('form_card_cv2');}
    
    
	  
    //MOSTRO MESSAGGI
    k=0;
	  while(k<corretti.length) 
    { 
        document.getElementById(corretti[k]).style.display="none";
        k++;
    }	  
    if(conta > 0)
	  {
       i=0;
       
       while(i<errori.length) 
       { 
          //alert(errori[i]);
          //show_validation(errori[i]);
          document.getElementById(errori[i]).style.display="block";
          i++;
       }
       
       return false;
    } 
}
function check_required_deliver_q(eventObj, nome,address,postcode,country,town,data,tel )  {

    name = nome.value;
    indirizzo  = address.value;
    citta  = town.value;
    cap  = postcode.value;
    paese  = country.value;
    data_deliver = data.value;
    telefono = tel.value;
    conta = 0;
    errori = new Array();
    corretti = new Array();
    
    
    if( (name == "")||( name.length < 2 ) )
    {
      conta++;      
      errori.push('form_nome');            
    } else{corretti.push('form_nome');}
        
	  if( (indirizzo == "")||( indirizzo.length < 2 ) )
    {
      conta++;      
      errori.push('form_address');            
    } else{corretti.push('form_address');}
    
    if( (citta == "")||( citta.length < 2 ) )
    {
      conta++;      
      errori.push('form_town');            
    } else{corretti.push('form_town');}
    
    if( (cap == "")||( cap.length < 2 ) )
    {
      conta++;      
      errori.push('form_postcode');            
    } else{corretti.push('form_postcode');}
    if( ( (paese == "")||( paese.length < 3 ) )&&( citta != "London") )
    {
      conta++;      
      errori.push('form_country');            
    } else{corretti.push('form_country');}
    if( (data_deliver == "") )
    {
      conta++;      
      errori.push('form_data');            
    } else{corretti.push('form_data');}
    if( (telefono == "")||( telefono.length < 5 ) )
    {
      conta++;      
      errori.push('form_tel');            
    } else{corretti.push('form_tel');}
	  
    //MOSTRO MESSAGGI
    k=0;
	  while(k<corretti.length) 
    { 
        document.getElementById(corretti[k]).style.display="none";
        k++;
    }	  
    if(conta > 0)
	  {
       i=0;
       
       while(i<errori.length) 
       { 
          //alert(errori[i]);
          //show_validation(errori[i]);
          document.getElementById(errori[i]).style.display="block";
          i++;
       }
       
       return false;
    } 
}
function check_required_deliver(eventObj,amico, nome,address,postcode,country,town,data,tel )  {
    
    friend = amico.value;
    name = nome.value;
    indirizzo  = address.value;
    citta  = town.value;
    cap  = postcode.value;
    paese  = country.value;
    data_deliver = data.value;
    telefono = tel.value;
    conta = 0;
    errori = new Array();
    corretti = new Array();

    if( (name == "")||( name.length < 2 ) )
    {
      conta++;      
      errori.push('form_nome');            
    } else{corretti.push('form_nome');}
        
	  if( (indirizzo == "")||( indirizzo.length < 2 ) )
    {
      conta++;      
      errori.push('form_address');            
    } else{corretti.push('form_address');}
    
    if( (citta == "")||( citta.length < 2 ) )
    {
      conta++;      
      errori.push('form_town');            
    } else{corretti.push('form_town');}
    
    if( (cap == "")||( cap.length < 2 ) )
    {
      conta++;      
      errori.push('form_postcode');            
    } else{corretti.push('form_postcode');}
    if( (paese == "")||( paese.length < 3 ) )
    {
      conta++;      
      errori.push('form_country');            
    } else{corretti.push('form_country');}
    if( (data_deliver == "") )
    {
      conta++;      
      errori.push('form_data');            
    } else{corretti.push('form_data');}
    if( (telefono == "")||( telefono.length < 5 ) )
    {
      conta++;      
      errori.push('form_tel');            
    } else{corretti.push('form_tel');}
    if( (data_deliver == "") )
    {
      conta++;      
      errori.push('form_data');                  
    } 
    else
    {
      corretti.push('form_data');      
    }
	               
 
    //MOSTRO MESSAGGI
    k=0;
	  while(k<corretti.length) 
    { 
        document.getElementById(corretti[k]).style.display="none";
        k++;
    }	  
    if(conta > 0)
	  {
       i=0;
       
       while(i<errori.length) 
       { 
          //alert(errori[i]);
          //show_validation(errori[i]);
          document.getElementById(errori[i]).style.display="block";
          i++;
       }
       
       return false;
    }
    else return true; 
}
function check_required_deliver_OLD(eventObj,amico, nome,address,postcode,country,town,data,tel )  {
    
    friend = amico.value;
    name = nome.value;
    indirizzo  = address.value;
    citta  = town.value;
    cap  = postcode.value;
    paese  = country.value;
    data_deliver = data.value;
    telefono = tel.value;
    conta = 0;
    errori = new Array();
    corretti = new Array();
    
    /*if( (friend == 0 ) )
    {
      conta++;      
      errori.push('form_friend');            
    } else{corretti.push('form_friend');} */

  if( (friend == 0 ) )
  {
    if( (name == "")||( name.length < 2 ) )
    {
      conta++;      
      errori.push('form_nome');            
    } else{corretti.push('form_nome');}
        
	  if( (indirizzo == "")||( indirizzo.length < 2 ) )
    {
      conta++;      
      errori.push('form_address');            
    } else{corretti.push('form_address');}
    
    if( (citta == "")||( citta.length < 2 ) )
    {
      conta++;      
      errori.push('form_town');            
    } else{corretti.push('form_town');}
    
    if( (cap == "")||( cap.length < 2 ) )
    {
      conta++;      
      errori.push('form_postcode');            
    } else{corretti.push('form_postcode');}
    if( (paese == "")||( paese.length < 3 ) )
    {
      conta++;      
      errori.push('form_country');            
    } else{corretti.push('form_country');}
    if( (data_deliver == "") )
    {
      conta++;      
      errori.push('form_data');            
    } else{corretti.push('form_data');}
    if( (telefono == "")||( telefono.length < 5 ) )
    {
      conta++;      
      errori.push('form_tel');            
    } else{corretti.push('form_tel');}
	               
  }
  else
  {
    if( (data_deliver == "") )
    {
      conta++;      
      errori.push('form_data');                  
    } 
    else
    {
      corretti.push('form_data');      
    }
    //QUI AZZERO
      corretti.push('form_nome');
      corretti.push('form_address');
      corretti.push('form_town');
      corretti.push('form_postcode');
      corretti.push('form_country');
      corretti.push('form_tel');
    
  } 
    //MOSTRO MESSAGGI
    k=0;
	  while(k<corretti.length) 
    { 
        document.getElementById(corretti[k]).style.display="none";
        k++;
    }	  
    if(conta > 0)
	  {
       i=0;
       
       while(i<errori.length) 
       { 
          //alert(errori[i]);
          //show_validation(errori[i]);
          document.getElementById(errori[i]).style.display="block";
          i++;
       }
       
       return false;
    }
    else return true; 
}

function validate_login(eventObj, email,pass) {

  var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;  
  
  if( (!email.value.match(emailRegex)) || (email.value == "") || (pass.value == "") )
  {
  	document.getElementById('form_login').style.display="block";
  	document.getElementById('form_email').style.display="block";
  	document.getElementById('form_password').style.display="block";
		return false;
  }
}
function verifica_password_div(eventObj, pass1,pass2) {

  var password1 = pass1.value;
  var password2 = pass2.value;
  
  if( (password1 == "")||(password2 == "")||(password1 < 6)||(password2 < 6)||(password1 != password2) )
	{
		document.getElementById('form_password').style.display="block";
		document.getElementById('form_password1').style.display="block";
		return false;
	}
  
}

	/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Justin Barlow | http://www.netlobo.com */

function show_validation(whichLayer) {
  var elem, vis;
  if(document.getElementById) // this is the way the standards work
    elem = document.getElementById(whichLayer);
  else if(document.all) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if(document.layers) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
function toUpcase(stringa) {
  var ritorno = "";
  ritorno = stringa.value.toUpperCase();
  if (ritorno!=stringa.value) {
    stringa.value = ritorno;
  }
}
function validate_login2(eventObj, email,pass) {

  var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
  
  
  if( (!email.value.match(emailRegex)) || (email.value == "") || (pass.value == "") )
  {
  	alert('Yor input has invalid format.Please retry.');
		return false;
  }
}
function verifica_password(eventObj, obj,pass) {
  //alert(pass.value);
  //alert(obj.value);
  var password = pass.value;
  
  if( password == "" )
	{
		alert('Please fill password field.');
		return false;
	}
  
  if( pass.value == obj.value )
  {return true;}
  else
  {  	
	alert('Password incorrect, please rewrite.');
	obj.value = '';
	return false;
  }
  
}
function verifica_password2(eventObj, pass1,pass2) {
  //alert(pass.value);
  //alert(obj.value);
  var password1 = pass1.value;
  var password2 = pass2.value;
  
  if( (password1 == "")||(password2 == "") )
	{
		alert('Please fill password field.');
		return false;
	}
  
  if( pass1.value == pass2.value )
  {return true;}
  else
  {  	
	alert('Password incorrect, please rewrite.');
	return false;
  }
  
}
function verifica_password_digit(eventObj, pass) {
  
  if( pass.value.length < 6 )
	{
		alert('Password occour at least six digits.');
		return false;
	}  
}
function verifica_email(eventObj, obj) {
  
  var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
  email = obj.value;
  
  if((!email.match(emailRegex))||(email == "")) {
    
    alert('Email format incorrect, please rewrite.');
	return false;
  }
}
function change_hidden() {
   
  alert('ciao');
}
function verificaInteroConZero(eventObj, obj) {
  var codice;
  if (document.all) { 
	codice = eventObj.keyCode;
  }
  else {
	codice = eventObj.which;
    if ((codice==8)||(codice==0)) {
      return true;
    }	
  }
     //apice doppio "  
   if((codice==34)) {
	    return false;
   }
  if((codice<48 || codice>58)) {
	return false;
  }
  return true;
}

function verificaIntero(eventObj, obj) 
{
  var codice;
  
  if (document.all) 
  { 
	codice = eventObj.keyCode;
  }
  
  else 
  {
	codice = eventObj.which;
    if ((codice==8)||(codice==0)) 
	{
      return true;
    }	
  }

  if((codice<48 || codice>58)) 
  {
	return false;
  }
  if ((obj.value=="")&&(codice==48)&&(codice==34)) 
  {
	return false;
  }
  return true;
}

//var valorePrecedente = "";

function verificaNumero(eventObj, obj, interi, decimali) {
  
var valorePrecedente = "";  
var codice;
  if (document.all) { 
    // IE
	codice = eventObj.keyCode;
  }
  else {
    // Netscape
	codice = eventObj.which;
	// Premuto backspace o un tasto di movimento
    if ((codice==8)||(codice==0)) {
      return true;
    }
  }

  valorePrecedente = obj.value;
  
  var numero = obj.value;
  if(codice == 46) { 
    // Solo un punto è ammesso
	if ((numero.indexOf(".")>0)||(numero.charAt(0)=='.')) {
	  return false;
	}
  }
  
  else {

    // La parte intera deve essere limitata in lunghezza al massimo previsto
    if (numero.indexOf(".")>0) {
      if (numero.substr(0,numero.indexOf(".")).length>=interi) {
	    if (numero.charAt(interi)!='.') {
          return false; 
		}
      }
    }
    else if (numero.charAt(0)!='.'){
      if (numero.length>=interi) {
        return false; 
      }
    }
 
  }
 
  // Deve essere una cifra o un punto  	
  if((codice<48 || codice>58) && (codice!=46)) {
	return false
  }

  
  return true;
}

function verificaLettera(eventObj, obj, lunghezza_max) {
  var codice;
  if (document.all) { 
	codice = eventObj.keyCode;	
  }
  else {
	codice = eventObj.which;
    if ((codice==8)||(codice==0)) {
      return false;
    }
  }
  
  var stringa = obj.value;
  if (obj.value.length>=lunghezza_max) {
    return false;
  }	
   if((codice>47)&&(codice<58)) {
   
	    return false;
   }
   //apice doppio "  
   if((codice==34)) {
	    return false;
   }	   

  //alert(codice);
  return true;
}

