function soloNumeri(valore, svn){

if(svn==1){
var validi = new RegExp("[0-9\,]");
}else{
var validi = new RegExp("[0-9]");
}

var verifica;

if(svn==1){var indice = 0;}

for(x = 0; x < valore.value.length; x++){
verifica = validi.test(valore.value.charAt(x));

if(svn==1){
if(valore.value.charAt(x) == ","){indice++;}
}

if(svn==1){
if(indice > 1){verifica = false; indice = 1;}
}

if(verifica == false){
valore.value = valore.value.substr(0,x) + valore.value.substr(x+1,valore.value.length-x+1); x--;
}
}

}

