<!-- controlla se un campo contiene esclusivamente caretteri numerici. Accetta in ingresso il componente -->

function isNumeric(comp){  
    var str = comp.value;
    var re = /[\D]/g
    if (re.test(str)) {
        alert("Il campo deve contenere caratteri numerici"); 
        comp.focus(); 
        return false; 
    }
    else {return true;}
}



<!-- sostituzione caratteri -->

function sostcar(comp,repstr,pattern,attr){
var cc= comp;
var regexpobj = new RegExp(pattern,attr);
var val = new String(cc.value);
cc.value = val.replace(regexpobj,repstr);
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
