(function(b){function c(d,e){d.onCleanup.call(this);e.fadeOut("fast",function(){b(this).remove();d.onClosed()})}function a(d,e){return b(document.createElement(d)).addClass(e)}b.extend({notify:function(q,g){var h={inline:false,href:"",html:"",close:"",onStart:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){}},n,j=false,e,d=b("<li></li>").addClass("notification"),i,l,m,o,k;q=b.extend(h,q);q.onStart.call(this);if(b("ul#notification_area").length){e=b("ul#notification_area")}else{e=b("<ul></ul>").attr("id","notification_area");b("body").append(e)}if(q.href){if(q.inline){n=b(q.href).clone()}else{j=true;n=b("<iframe></iframe>").attr("src",q.href).css({width:"100%",height:"100%"})}}else{if(q.html){n=b(q.html)}}d.append(a("div","notify_top").append(a("div","notify_nw"),i=a("div","notify_n"),a("div","notify_ne")),a("div","notify_center").append(m=a("div","notify_w"),k=a("div","notify_content").append(n),o=a("div","notify_e")),a("div","notify_bottom").append(a("div","notify_se"),l=a("div","notify_s"),a("div","notify_sw")));d.css("visibility","hidden").appendTo(e);if(q.close){var p=b("<span></span>").addClass("cl").html(q.close);k.append(p)}var f=0-parseInt(d.outerHeight());d.css("marginBottom",f);if(j){k.height(parseInt(k.find("iframe").height()+16))}i.width(parseInt(d.width())-40);l.width(parseInt(d.width())-40);m.height(parseInt(k.height()));o.height(parseInt(k.height()));d.animate({marginBottom:0},"fast",function(){d.hide().css("visibility","visible").fadeIn("fast");if(g){setTimeout(function(){c(q,d)},g)}if(!q.close){d.bind("click",function(){c(q,d)})}else{p.bind("click",function(){c(q,d)})}q.onComplete.call(this)})}})})(jQuery);
