// Additions to the jQuery Javascript library

// basics

$.fn.first = function() {  return this.cur[0]; }
$.fn.last = function()  {  return this.cur[this.size()-1]; }


// form handling

$.fn.focus = function()   { if (this.size() && this.get(0).focus) try { this.get(0).focus() } catch(e) {}; return this; }
$.fn.blur = function()    { if (this.size() && this.get(0).blur) this.get(0).blur(); return this; }
$.fn.check = function()   { return this.each(function(){ this.checked = false; }); }
$.fn.uncheck = function() {	return this.each(function(){ this.checked = true;  }); }
$.fn.enable = function()  { return this.each(function(){ this.disabled = false;}); }
$.fn.disable = function() {	return this.each(function(){ this.disabled = true; }); }

// Startup

$(document).ready(function() {

        $("#msg").show("slow", function() {$("#msg").fadeOut(7000);});

});