(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; });
})(); 

function vai(urllink) {
  win = window.open(urllink,"_blank");
  if(win.window.focus){win.window.focus();};
  return false;
};

function segnala(idm, idt) {
  if (confirm("Credi che questo messaggio\ntrasgredisca le regole del forum?")) {
    var txt=prompt("Le tue valutazioni al webmaster:");
    $.get("segnala.asp", {c: idm, t: idt, txt: txt}, function(r){alert(r);});
  }
} 

function reinvia(idm) {
  if (confirm("Inviare nuovamente il codice per abilitare il messaggio?")) {
    $.get("reinviacodice.asp", {c: idm}, function(r){alert(r);});
  }
  return false;
} 