jQuery.fn.loading = function( status, func ) {

  var elem = $( this );
  var id = elem.attr( "id" ) + "_loading";

  if( status != false ) {

    elem
      .css( {
        opacity: .25,
        filter: "alpha( opacity = 25 )"
      } )
      .after( "<p id=\"" + id + "\" class=\"loading\">Loading ...</p>" );

    $( "#" + id ).css( {
      "height": elem.parent().height(),
      "margin-top": -elem.parent().height(),
      "width": elem.parent().width(),
      "z-index": 9999
    } );

  } else {

    $( "#" + id ).remove();

    elem.css( {
      opacity: 1,
      filter: "alpha( opacity = 100 )"
    } );

  }


  if( typeof func == "function" ) {
    func();
  }

  return elem;

};