// Pushup - http://www.pushuptheweb.com/
var Pushup={Version:"1.0.3",options:{appearDelay:0.5,fadeDelay:6,images:"../images/pushup/",message:"Important browser update available",reminder:{hours:6,message:"Remind me again in #{hours}"},skip:true},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/"},Browser:{IE:!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1),Firefox:navigator.userAgent.indexOf("Firefox")>-1,Safari:navigator.userAgent.indexOf("AppleWebKit/")>-1&&/Apple/.test(navigator.vendor),Opera:navigator.userAgent.indexOf("Opera")>-1}};Pushup.conditions={IE:(function(b){var a=/MSIE ([\d.]+)/.exec(b);return a&&parseFloat(a[1])<7;})(navigator.userAgent),Firefox:Pushup.Browser.Firefox&&parseFloat(navigator.userAgent.match(/Firefox[\/\s](\d+)/)[1])<3,Safari:Pushup.Browser.Safari&&parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1])<500,Opera:Pushup.Browser.Opera&&(!window.opera.version||parseFloat(window.opera.version())<9.5)};(function(){for(var e in Pushup.Browser){if(Pushup.Browser[e]){Pushup._browserUsed=e;}}Pushup._updateBrowser=Pushup.conditions[Pushup._browserUsed]&&Pushup._browserUsed;if(!Pushup._updateBrowser&&Pushup.options.skip){return;}function g(i,k){for(var j in k){i[j]=k[j];}return i;}g(Pushup,{start:function(){if(/^(https?:\/\/|\/)/.test(this.options.images)){this.images=this.options.images;}else{var m=/pushup(?:-[\w\d.]+)?\.js(.*)/,j=document.getElementsByTagName("script");for(var n=0,k=j.length;n<k;n++){var o=j[n];if(o.src&&o.src.match(m)){this.images=o.src.replace(m,"")+this.options.images;}}}if(Pushup._updateBrowser){this.show();}},build:function(){this.pushup=document.createElement("div");d.set(this.pushup,0);this.pushup.id="pushup";this.messageLink=this.pushup.appendChild(document.createElement("a"));this.messageLink.className="pushup_messageLink";this.messageLink.target="_blank";this.messageLink.appendChild(this.icon=document.createElement("div"));this.icon.className="pushup_icon";this.messageLink.appendChild(this.message=document.createElement("span"));this.message.className="pushup_message";this.message.innerHTML=this.options.message;var i=this.options.reminder.hours;if(i&&Pushup.cookiesEnabled){this.pushup.appendChild(this.reminder=document.createElement("a"));this.reminder.href="#";this.reminder.className="pushup_reminder";this.pushup.className="withReminder";var j=i+" hour"+(i>1?"s":""),k=this.options.reminder.message.replace("#{hours}",j);this.reminder.innerHTML=k;}if(Pushup.Browser.Opera&&(!window.opera.version||parseFloat(window.opera.version())<9.25)){this.messageLink.style.cssFloat="none";this.reminder.style.cssFloat="none";}Pushup.setBrowser(Pushup._updateBrowser);document.body.appendChild(this.pushup);Pushup.addEvents();},addEvents:function(){if(this.reminder){a.add(this.reminder,"click",function(i){a.stop(i);Pushup.setReminder(Pushup.options.reminder.hours);Pushup.fade();});}a.add(this.pushup,"mouseover",Pushup.clearFade);a.add(this.pushup,"mouseout",function(){Pushup.fade({delay:Pushup.options.fadeDelay});});},setBrowser:function(i){i=i||"IE";h(this.icon,this.images+i.toLowerCase()+".png");this.messageLink.href=this.updateLinks[i];},show:function(){var j=typeof arguments[0]=="string"?arguments[0]:Pushup._browserUsed||"IE",i=arguments[j?1:0]||{};if(i.resetReminder){Pushup.resetReminder();}if(!i.ignoreReminder&&Pushup.cookiesEnabled&&b.get("_pushupBlocked")){return;}if(!Pushup.pushup){Pushup.build();}d.set(Pushup.pushup,0);Pushup.pushup.style.display="block";if(j){Pushup.setBrowser(j);}this.appear({fadeAfter:true,delay:Pushup.options.appearDelay});},appear:function(j){Pushup.clearFade();var i=arguments[0]||{};return window.setTimeout(function(){c(Pushup.pushup,{afterFinish:function(){if(i.fadeAfter){Pushup.fade({delay:Pushup.options.fadeDelay});}}});},(i.delay||0.01)*1000);},clearFade:function(){if(Pushup._fadeTimer){window.clearTimeout(Pushup._fadeTimer);Pushup._fadeTimer=null;}},fade:function(){var i=arguments[0]||{};Pushup._fadeTimer=window.setTimeout(function(){f(Pushup.pushup);},(i.delay||0.01)*1000);},setReminder:function(i){b.set("_pushupBlocked","blocked",{duration:1/24*i});},resetReminder:function(){b.remove("_pushupBlocked");}});var d={set:function(i,j){i.style.opacity=(j==1||j==="")?"":(j<0.00001)?0:j;},get:function(j){var i=j.style.opacity;return i?parseFloat(i):1;}};if(Pushup.Browser.IE){d.get=function(j){var i=j.style.opacity;if(!i&&j.currentStyle){i=j.currentStyle[i];}if(i=(j.style.filter||"").match(/alpha\(opacity=(.*)\)/)){if(i[1]){return parseFloat(i[1])/100;}}return 1;};d.set=function(j,m){function n(o){return o.replace(/alpha\([^\)]*\)/gi,"");}var i=j.currentStyle;if((i&&!i.hasLayout)||(!i&&j.style.zoom=="normal")){j.style.zoom=1;}var l=j.style.filter,k=j.style;if(m==1||m===""){(l=n(l))?k.filter=l:k.filter="";}else{k.filter=n(l)+"alpha(opacity="+(m*100)+")";}};}function c(j){var k=d.get(j),i=arguments[1]||{};if(j.style.display!="block"){j.style.display="block";}if(k<1){setTimeout(function(){d.set(j,k+=0.05);c(j,i);},0.01);}else{if(Pushup.Browser.IE&&j.style.filter){j.style.removeAttribute("filter");}if(i.afterFinish){i.afterFinish.call();}}}function f(j){var k=d.get(j),i=arguments[1]||{};if(k>0){setTimeout(function(){d.set(j,k-=0.05);f(j,i);},0.01);}else{j.style.display="none";if(i.afterFinish){i.afterFinish.call();}}}function h(k,j){var i=g({align:"top left",repeat:"no-repeat",sizingMethod:"crop",backgroundColor:""},arguments[2]||{});g(k.style,arguments.callee.IEBelow7?{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+j+"'', sizingMethod='"+i.sizingMethod+"')"}:{background:i.backgroundColor+" url("+j+") "+i.align+" "+i.repeat});}h.IEBelow7=Pushup.Browser.IE&&parseFloat(/MSIE ([\d.]+)/.exec(navigator.userAgent)[1])<7;var b={set:function(l,m){var i="",k=arguments[2]||{};if(k.duration){var j=new Date();j.setTime(j.getTime()+k.duration*1000*60*60*24);m+="; expires="+j.toGMTString();}document.cookie=l+"="+m+i+"; path=/";},remove:function(i){this.set(i,"",-1);},get:function(k){var n=document.cookie.split(";"),o=k+"=";for(var m=0,j=n.length;m<j;m++){var p=n[m];while(p.charAt(0)==" "){p=p.substring(1,p.length);}if(p.indexOf(o)==0){return p.substring(o.length,p.length);}}return null;}};Pushup.cookiesEnabled=(function(i){if(b.get(i)){return true;}b.set(i,"test",{duration:15});return b.get(i);})("_pushupCookiesEnabled");var a={add:function(k,j,i){if(k.attachEvent){k["e"+j+i]=i;k[j+i]=function(){k["e"+j+i](window.event);};k.attachEvent("on"+j,k[j+i]);}else{k.addEventListener(j,i,false);}},stop:function(i){if(Pushup.Browser.IE){i.cancelBubble=true;i.returnValue=false;}else{i.preventDefault();i.stopPropagation();}}};a.add(window,"load",function(){Pushup.start();});})();
