
/* JQUERY BAR  0.5.6 (c) WebManagement.us */
/* Modified by Alex Spooner, 2009-03-03 10:57:17 EST */

(function($){ 
  var bartmo=false, bartm=3000;
  $.bar = {
    show : function(cnt,clss){
      if (bartmo) clearTimeout(bartmo);
      if (!clss) clss="notify"; 
      $("#bar").stop(1,1);
      $("#bar").slideUp("slow",function(){
        $("#bar").attr("class",clss);
        $("#bar").html(cnt);
        var doc = $(document),pTop=doc.scrollTop(),pLeft=(doc.width()/2)+doc.scrollLeft()-($("#bar").width()/2);
        $("#bar").css({top: pTop, left: pLeft});
        $("#bar").slideDown("slow",function(){
          bartmo = setTimeout("$.bar.hide()",bartm);
        });
      });
    },
    hide : function(speed){
      if (bartmo) clearTimeout(bartmo);
      if (!speed) speed="slow";
      $("#bar").slideUp(speed);
    }
  };
  $(document).ready(function(){
  	if (!$('#bar').length){
  		$('<div id="bar"></div>').appendTo("body");
  	}
    $(window).scroll(function(){ 
      if (bartmo) $.bar.hide("fast");
    });
  });
})(jQuery);
