/**
 * File: DynamicHTML.js
 * JavaScript 
 * Modificato da: Piero Giampani
 * Data della modifica: 14 agosto 2008 
 */

/**
 * Restituisce vero se la stringa contiene solo caratteri numerici, diversamente restituisce falso.
  */
function isOnlyNumeric(string) {
    var invalidCharactersRegExp = /[^\d]/;
    var isValid = !(invalidCharactersRegExp.test(string));
    return isValid;
}

 
function trim(string) {
    return string.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, "");
}

 
function setCursor(cursorType) {
     
    var bodyAll;
    var linkRegExp = /link*./;
    if (document.body && document.body.all) {
        bodyAll = document.body.all;
    } else if (document.body && document.body.getElementsByTagName) {
        bodyAll = document.body.getElementsByTagName('*');
    }
    if (bodyAll) {
        for (var i = 0; i < bodyAll.length; i++) {
            if (linkRegExp.test(bodyAll[i].id)) {
                bodyAll[i].style.cursor = 'pointer';
            } else {
                bodyAll[i].style.cursor = cursorType;
            }
        }
    }
}

