/* This file was compressed using sharpNet performance and health module. http://www.tiagodherbe.eu */ 
var Notifier=function(JQ){var options;var defaults={dismissMessage:'<br />(Click to dismiss)',duration:5000,fadeInSpeed:350,fadeOutSpeed:500,icon:'error',iconClass:'grumbleIcon',message:'Your message here',messageClass:'grumbleMessage',noteClass:'grumbleNote',right:10,spacing:5,sticky:false,title:'Your title here',titleClass:'grumbleTitle',top:10}
function removeNote(note){if(note.data('mouseOver')){setTimeout(removeNote,1000,note);}else{JQ(note).fadeOut(options.fadeOutSpeed,function(){JQ(note).remove();});}}
function show(customOptions){options=JQ.extend({},defaults,customOptions);var thisNote,thisNoteTop,tops=[],bottoms=[window.scrollY],firstNoteTop,lastNoteBottom;thisNote=JQ('<div><div class="'+options.iconClass+' '+options.icon+'"></div><div class="'+options.titleClass+'">'+options.title+'</div><div class="'+options.messageClass+'">'+options.message+'</div></div>');if(options.sticky){thisNote.find('.'+options.messageClass).append(options.dismissMessage);}
thisNote.css({right:options.right,display:'none',position:'fixed'});thisNote.appendTo('body');thisNote.addClass(options.noteClass);var thisNoteHeight=thisNote.height();var thisNoteBorderWidth=parseInt(thisNote.css('border-top-width'))+parseInt(thisNote.css('border-bottom-width'));var thisNotePadding=parseInt(thisNote.css('padding-top'))+parseInt(thisNote.css('padding-bottom'));spaceNeeded=thisNoteHeight+thisNoteBorderWidth+thisNotePadding+options.spacing;thisNote.removeClass(options.noteClass);if(JQ('.'+options.noteClass).length==0){thisNoteTop=options.top;}else{JQ('.'+options.noteClass).each(function(){var currNote=JQ(this);var currPosition=currNote.offset();var currTop=currPosition.top;var currHeight=currNote.height();var currBorderWidth=parseInt(currNote.css('border-top-width'))+parseInt(currNote.css('border-bottom-width'));var currPadding=parseInt(currNote.css('padding-top'))+parseInt(currNote.css('padding-bottom'));var currBottom=currTop+currHeight+currBorderWidth+currPadding;tops.push(currTop);bottoms.push(currBottom);});tops.sort(function(a,b){return a-b});bottoms.sort(function(a,b){return a-b});for(var i=0;i<tops.length;i++){var space=tops[i]-bottoms[i];if(space>spaceNeeded){thisNoteTop=bottoms[i];if(i==0){thisNoteTop+=options.top;}else{thisNoteTop+=options.spacing;}
break;}}
if(thisNoteTop==undefined){lastBottom=bottoms.pop();thisNoteTop=lastBottom+options.spacing;}}
thisNote.addClass(options.noteClass);thisNoteTop=thisNoteTop-window.scrollY;thisNote.css({top:thisNoteTop});thisNote.data('mouseOver',false);thisNote.hover(function(){thisNote.data('mouseOver',true);},function(){thisNote.data('mouseOver',false);});thisNote.click(function(){thisNote.data('mouseOver',false);removeNote(thisNote);});thisNote.fadeIn(options.fadeInSpeed,function(){if(!options.sticky){setTimeout(removeNote,options.duration,thisNote);}});}
return{defaults:defaults,show:show}}(jQuery);