function isNumber(valore) {
    for (i = 0; i < valore.length; i++) {
        if (!isdigit(valore.charAt(i)))
            return false;
    }

    return true;
}


function ControllaDigit(txtI) {
    var kc = event.keyCode;

    if (kc >= 96 && kc <= 105) {    		//* Tastierino numerico
        kc -= 48;
    }

    var di = (
				kc == 39 || 				//* Tasti cursore
				kc == 37 ||
				(kc >= 48 && kc <= 57) ||     //* Numeri
				kc == 9 ||                  //* Tab
				kc == 35 ||                 //* Fine
				kc == 36 ||                 //* Inizio
				kc == 8 ||
				kc == 107 ||                //* + tastierino numerico
				kc == 109 ||                //* - tastierino numerico
				kc == 187 ||                //* +
				kc == 188 ||                //* ,
				kc == 189 ||                //* - 
				kc == 46                    //* Delete
			);

    if (!di) {
        event.returnValue = false;
    }
}

function ControllaInteri(txtI) {

    ControllaDigit(txtI);

    if (event.returnValue != true) {
        var kc = event.keyCode;
        if (kc == '.' || kc == ',' ||
				kc == 107 ||              //* + tastierino numerico
				kc == 109 ||              //* - tastierino numerico
				kc == 187 ||              //* +
				kc == 188 ||              //* ,
				kc == 189)                //* - 
        {
            event.returnValue = false;
        }
    }
}

function nuovaPagina(mypage, myname, w, h, propr) {
    var win = null;
    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
    TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
    settings = 'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + propr
    win = window.open(mypage, myname, settings)
    if (win.window.focus) { win.window.focus(); }
}
