var Pushup={Version:'1.0.3',options:{appearDelay:.20,fadeDelay:20,images:'../images/pushup/',message:'تتوفر ترقية مهمة لمتصفحك',reminder:{hours:6,message:'ذكرني بها فيما بعد'},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(a){var b=/MSIE ([\d.]+)/.exec(a);return b&&parseFloat(b[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 f in Pushup.Browser)if(Pushup.Browser[f])Pushup._browserUsed=f;Pushup._updateBrowser=Pushup.conditions[Pushup._browserUsed]&&Pushup._browserUsed;if(!Pushup._updateBrowser&&Pushup.options.skip)return;function Extend(a,b){for(var c in b)a[c]=b[c];return a}Extend(Pushup,{start:function(){if(/^(https?:\/\/|\/)/.test(this.options.images))this.images=this.options.images;else{var a=/pushup(?:-[\w\d.]+)?\.js(.*)/,scripts=document.getElementsByTagName('script');for(var i=0,l=scripts.length;i<l;i++){var s=scripts[i];if(s.src&&s.src.match(a))this.images=s.src.replace(a,'')+this.options.images}}if(Pushup._updateBrowser)this.show()},build:function(){this.pushup=document.createElement('div');g.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 a=this.options.reminder.hours;if(a&&Pushup.cookiesEnabled){this.pushup.appendChild(this.reminder=document.createElement('a'));this.reminder.href='#';this.reminder.className='pushup_reminder';this.pushup.className='withReminder';var H=a+' hour'+(a>1?'s':''),message=this.options.reminder.message.replace('#{hours}',H);this.reminder.innerHTML=message}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){j.add(this.reminder,'click',function(a){j.stop(a);Pushup.setReminder(Pushup.options.reminder.hours);Pushup.fade()})}j.add(this.pushup,'mouseover',Pushup.clearFade);j.add(this.pushup,'mouseout',function(){Pushup.fade({delay:Pushup.options.fadeDelay})})},setBrowser:function(a){a=a||'IE';setPngBackground(this.icon,this.images+a.toLowerCase()+'.png');this.messageLink.href=this.updateLinks[a]},show:function(){var a=typeof arguments[0]=='string'?arguments[0]:Pushup._browserUsed||'IE',options=arguments[a?1:0]||{};if(options.resetReminder)Pushup.resetReminder();if(!options.ignoreReminder&&Pushup.cookiesEnabled&&h.get('_pushupBlocked'))return;if(!Pushup.pushup)Pushup.build();g.set(Pushup.pushup,0);Pushup.pushup.style.display='block';if(a)Pushup.setBrowser(a);this.appear({fadeAfter:true,delay:Pushup.options.appearDelay})},appear:function(a){Pushup.clearFade();var b=arguments[0]||{};return window.setTimeout(function(){Appear(Pushup.pushup,{afterFinish:function(){if(b.fadeAfter)Pushup.fade({delay:Pushup.options.fadeDelay})}})},(b.delay||0.01)*1000)},clearFade:function(){if(Pushup._fadeTimer){window.clearTimeout(Pushup._fadeTimer);Pushup._fadeTimer=null}},fade:function(){var a=arguments[0]||{};Pushup._fadeTimer=window.setTimeout(function(){Fade(Pushup.pushup)},(a.delay||0.01)*1000)},setReminder:function(a){h.set('_pushupBlocked','blocked',{duration:1/24*a})},resetReminder:function(){h.remove('_pushupBlocked')}});var g={set:function(a,b){a.style.opacity=(b==1||b==='')?'':(b<0.00001)?0:b},get:function(a){var b=a.style.opacity;return b?parseFloat(b):1.0}};if(Pushup.Browser.IE){g.get=function(a){var b=a.style.opacity;if(!b&&a.currentStyle)b=a.currentStyle[b];if(b=(a.style.filter||'').match(/alpha\(opacity=(.*)\)/))if(b[1])return parseFloat(b[1])/100;return 1.0};g.set=function(b,c){function stripAlpha(a){return a.replace(/alpha\([^\)]*\)/gi,'')}var d=b.currentStyle;if((d&&!d.hasLayout)||(!d&&b.style.zoom=='normal'))b.style.zoom=1;var e=b.style.filter,style=b.style;if(c==1||c==='')(e=stripAlpha(e))?style.filter=e:style.filter='';else style.filter=stripAlpha(e)+'alpha(opacity='+(c*100)+')'}}function Appear(a){var b=g.get(a),options=arguments[1]||{};if(a.style.display!='block')a.style.display='block';if(b<1){setTimeout(function(){g.set(a,b+=0.05);Appear(a,options)},0.01)}else{if(Pushup.Browser.IE&&a.style.filter)a.style.removeAttribute('filter');if(options.afterFinish)options.afterFinish.call()}}function Fade(a){var b=g.get(a),options=arguments[1]||{};if(b>0){setTimeout(function(){g.set(a,b-=0.05);Fade(a,options)},0.01)}else{a.style.display='none';if(options.afterFinish)options.afterFinish.call()}}function setPngBackground(a,b){var c=Extend({align:'top left',repeat:'no-repeat',sizingMethod:'crop',backgroundColor:''},arguments[2]||{});Extend(a.style,arguments.callee.IEBelow7?{filter:'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+b+'\'\', sizingMethod=\''+c.sizingMethod+'\')'}:{background:c.backgroundColor+' url('+b+') '+c.align+' '+c.repeat})}setPngBackground.IEBelow7=Pushup.Browser.IE&&parseFloat(/MSIE ([\d.]+)/.exec(navigator.userAgent)[1])<7;var h={set:function(a,b){var c='',options=arguments[2]||{};if(options.duration){var d=new Date();d.setTime(d.getTime()+options.duration*1000*60*60*24);b+='; expires='+d.toGMTString()}document.cookie=a+"="+b+c+"; path=/"},remove:function(a){this.set(a,'',-1)},get:function(a){var b=document.cookie.split(';'),nameEQ=a+"=";for(var i=0,l=b.length;i<l;i++){var c=b[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null}};Pushup.cookiesEnabled=(function(a){if(h.get(a))return true;h.set(a,'test',{duration:15});return h.get(a)})('_pushupCookiesEnabled');var j={add:function(a,b,c){if(a.attachEvent){a['e'+b+c]=c;a[b+c]=function(){a['e'+b+c](window.event)};a.attachEvent('on'+b,a[b+c])}else a.addEventListener(b,c,false)},stop:function(a){if(Pushup.Browser.IE){a.cancelBubble=true;a.returnValue=false}else{a.preventDefault();a.stopPropagation()}}};j.add(window,'load',function(){Pushup.start()})})();
