var Utility = Class.create({
  countId : 0,
  getNewId : function() {
    this.countId++;
    return 'objidaut' + this.countId;
  }, 
  toJson : function(str){
    if (str == null || str == '') {
      return null;
    }
    try{
      return eval("(" + str + ")");
    }
    catch(e){
      return null;
    }
  },
  trim : function(stringa) {
    reTrim=/\s+$|^\s+/g;
    return stringa.replace(reTrim,"");
  },
  formatText : function(text) {
    if (text == null) {
      return '';
    }
    text = text.replace(/>/g,'&gt;');
    text = text.replace(/</g,'&lt;');
    return text; 
  }, 
  formatNumero : function(val) {
    val += '';
    if (val.length < 2) {
      val = '0' + val;
    }
    return val;
  }   
});
Utility = new Utility();   
