(function($){$.fn.jnotice=function(custom){var defaults={openClickElement:'',toggleClickElement:'',closeClickElement:'',animation:"none",animationSpeed:200,autoClose:0,autoOpen:0,position:"bottom",openNow:false,openCallback:'',closeCallback:''};var settings=$.extend({},defaults,custom);var noticebox=$(this);$(this).hide();if($.browser.msie){$(this).css("position","absolute");}else{$(this).css("position","fixed");}
if(settings.position=="top"){$(this).css("top",0);}else{$(this).css("bottom",0);}
$(this).css("left",0);if(settings.openClickElement!=""){$(settings.openClickElement).bind('click',showNotice);}
if(settings.closeClickElement!=""){$(settings.closeClickElement).bind('click',hideNotice);}
if(settings.toggleClickElement!=""){$(settings.toggleClickElement).bind('click',toggleNotice);}
if(settings.autoOpen>0){setTimeout(function(){showNotice();},settings.autoOpen);}
if(settings.openNow){showNotice();}
function showNotice(){if(settings.animation=="none"){noticebox.show();setAutoClose();}
if(settings.animation=="slide"){noticebox.slideDown(settings.animationSpeed,setAutoClose);}
if(settings.animation=="fade"){noticebox.fadeIn(settings.animationSpeed,setAutoClose);}
if(settings.animation=="size"){noticebox.show(settings.animationSpeed,setAutoClose);}}
function hideNotice(){if(settings.animation=="none"){noticebox.hide();setCloseCallback();}
if(settings.animation=="slide"){noticebox.slideUp(settings.animationSpeed,setCloseCallback);}
if(settings.animation=="fade"){noticebox.fadeOut(settings.animationSpeed,setCloseCallback);}
if(settings.animation=="size"){noticebox.hide(settings.animationSpeed,setAutoClose);}}
function toggleNotice(){if((noticebox.css('display'))=='none'){showNotice();}else{hideNotice();}}
function setAutoClose(){if(settings.openCallback!=''){settings.openCallback();}
if(settings.autoClose>0){setTimeout(function(){hideNotice();},settings.autoClose);}}
function setCloseCallback(){if(settings.openCallback!=''){settings.closeCallback();}}
return this;}})(jQuery);
