(function() {
  var newMethods = {
    check       : function(tf) { return this.each(function(){ this.checked=tf; }) },
    toggleCheck : function()   { return this.each(function(){ this.checked!=this.checked; }) },
    disabled    : function(tf) { return this.each(function(){ this.disabled=tf; }) },
    mostra      : function(tf) { return this.each(function(){ if(tf) {$(this).show();} else {$(this).hide();} }); },
    stile       : function(tf, classe) { return this.each(function(){ if(tf) {$(this).addClass(classe);} else {$(this).removeClass(classe);} }); },
    hoverClass  : function(classe) { return this.each( function(){ $(this).bind("mouseenter", function(){$(this).addClass(classe);})
                                                                          .bind("mouseleave", function(){$(this).removeClass(classe);}); }); }
  };
  jQuery.each(newMethods, function(i) { jQuery.fn[i] = this; });
})();

var x;

$(document).ready(function(){
  $.ajaxSetup({ cache: false });
  $('.indi :text').bind('focus', function(){ $(this).addClass('attivo'); }).bind('blur', function(){ $(this).removeClass('attivo'); });
  $("#moduli").show();
});

function verifica(s){
  var v=$(s).val();
  if (v==0) { $(s).parent("div").css("color",""); } else { $(s).parent("div").css("color","red"); }
  $(".rub").not(s).each(function(){
    var c=$(this).val();
    if (c>0 && v==c) { $(this).val("0").parent("div").css("color",""); };
  });
}
