(function($){$.fn.below=function(x,y){$(this).hide();var below=document.elementFromPoint(x,y);$(this).show();return $(below)};$.fn.is_hovering=function(x,y){var el=$(this);var r=el.offset();r.bottom=r.top+el.height();r.right=r.left+el.width();return(x>=r.left&&x<=r.right&&y>=r.top&&y<=r.bottom)};$.notify=function(options){var li=$("<li/>");var inner=$("<div/>").addClass("inner").appendTo(li);if(options.icon){var img=$("<img alt='icon' />").attr("src",options.icon);inner.append($("<div/>").addClass("icon").append(img));li.addClass("withicon")}if(options.title){inner.append($("<div/>").addClass("title").text(options.title))}if(options.text){inner.append($("<div/>").addClass("text").text(options.text))}with(li){bind("notify_mouseover",function(){$(this).fadeTo(200,0.15)});bind("notify_mouseout",function(){$(this).fadeTo(200,0.85)});mousemove(function(e){var below=$(this).parent().below(e.pageX,e.pageY);$(this).css("cursor",below.css("cursor"))});click(function(e){$(this).parent().below(e.pageX,e.pageY).click()})}setTimeout(function(){li.fadeTo("slow",0,function(){$(this).slideUp("fast",function(){$(this).remove();$("#notifications:empty").remove()})})},options.delay||5000);li.appendTo($._notify.getContainer());if($.boxModel){$.jcorners(inner,{radius:6})}else{$.jcorners(inner,{radius:3})}return li};$._notify={getContainer:function(){var c=$("#notifications");if(!c.length){c=$('<ul id="notifications"></ul>').appendTo(document.body)}return c},init:function(){$(document).mousemove(function(e){$("#notifications li").each(function(){if($(this).is_hovering(e.pageX,e.pageY)){if(!$(this).data("notify_hover")){$(this).trigger("notify_mouseover");$(this).data("notify_hover",true)}}else{if($(this).data("notify_hover")){$(this).trigger("notify_mouseout");$(this).data("notify_hover",false)}}})})}}})(jQuery);$(document).ready(function(){$._notify.init()});
