(function(b){var a={set:function(f,g){var c="",e=arguments[2]||{},d;if(e.duration){d=new Date();d.setTime(d.getTime()+e.duration*1000*60*60*24);g+="; expires="+d.toGMTString()}document.cookie=f+"="+g+c+"; path=/"},remove:function(c){this.set(c,"",-1)},get:function(e){var g=document.cookie.split(";"),h=e+"=",f,d,j;for(f=0,d=g.length;f<d;f++){j=g[f];while(j.charAt(0)===" "){j=j.substring(1,j.length)}if(j.indexOf(h)===0){return j.substring(h.length,j.length)}}return null}};b.pushup={Version:"1.0.3",options:{appearDelay:0.5,fadeDelay:6,images:"images/",message:"Important browser update available",reminder:{hours:6,message:"Remind me again in #{hours}"}},activeBrowser:null,updateLinks:{IE:"http://www.microsoft.com/windows/downloads/ie/",Firefox:"http://www.getfirefox.com",Safari:"http://www.apple.com/safari/download/",Opera:"http://www.opera.com/download/"},browsVer:{Firefox:(navigator.userAgent.indexOf("Firefox")>-1)?parseFloat(navigator.userAgent.match(/Firefox[\/\s](\d+)/)[1]):false,IE:(b.browser.msie)?parseFloat(b.browser.version):false,Safari:(b.browser.safari)?parseFloat(b.browser.version):false,Opera:(b.browser.opera)?parseFloat(b.browser.version):false},browsers:{Firefox:3,IE:7,Opera:9.5,Safari:3},init:function(){b.each(b.pushup.browsVer,function(d,c){if(c&&c<b.pushup.browsers[d]){b.pushup.activeBrowser=d;if(!b.pushup.options.ignoreReminder&&b.pushup.cookiesEnabled&&a.get("_pushupBlocked")){return}else{var e=(b.pushup.options.appearDelay!==undefined)?b.pushup.options.appearDelay*1000:0;setTimeout(b.pushup.show,e)}}})},show:function(){var d,i,h,f,l,m,k,j,o,g,e,n,c;d=b(document.createElement("div")).attr("id","pushup").hide().appendTo("body");f=b(document.createElement("a")).addClass("pushup_messageLink").attr("target","_blank").attr("href",b.pushup.updateLinks[b.pushup.activeBrowser]).appendTo(d);i=b(document.createElement("div")).addClass("pushup_icon").appendTo(f);h=b(document.createElement("span")).addClass("pushup_message").html(b.pushup.options.message).appendTo(f);l=b.pushup.options.reminder.hours;if(l&&b.pushup.cookiesEnabled){m=l+" hour"+(l>1?"s":"");k=b.pushup.options.reminder.message.replace("#{hours}",m);j=b(document.createElement("a")).attr("href","#").addClass("pushup_reminder").html(k);d.append(j);j.click(function(p){b.pushup.setReminder(b.pushup.options.reminder.hours);b.pushup.hide();p.preventDefault()})}if(/^(https?:\/\/|\/)/.test(b.pushup.options.images)){o=b.pushup.options.images}else{b("script[src]").each(function(q,r){var p=b(r);if(/jquery\.pushup/.test(p.attr("src"))){g=p.attr("src").replace("jquery.pushup.js","");o=g+b.pushup.options.images}})}e=o+b.pushup.activeBrowser.toLowerCase();n=(b.pushup.browsVer.IE<7&&b.pushup.browsVer.IE)?{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e+".png'', sizingMethod='crop')"}:{background:"url("+e+".png) no-repeat top left"};i.css(n);d.fadeIn("slow");if(b.pushup.options.fadeDelay!==undefined){c=b.pushup.options.fadeDelay*1000;setTimeout(b.pushup.hide,c)}},hide:function(){b("#pushup").fadeOut("slow")},setReminder:function(c){a.set("_pushupBlocked","blocked",{duration:1/24*c})},resetReminder:function(){a.remove("_pushupBlocked")}};b.pushup.cookiesEnabled=(function(c){if(a.get(c)){return true}a.set(c,"test",{duration:15});return a.get(c)}("_pushupCookiesEnabled"));b(function(){b.pushup.init()})}(jQuery));
