/** * The DHTML Navigation Bar, NavBar-2.4 * Copyright dynarch.com, 2003 * http://dynarch.com/mishoo/menubar.epl * * THIS NOTICE MUST REMAIN INTACT! * * LICENSEE: Dynarch.com * License key: dynarch * Purchase date: Sun Mar 28 10:09:02 2004 GMT * License type: dynarch * * For details on this license please visit * the NavBar homepage at the URL above. */ (function(){ var UA=navigator.userAgent; is_ie=/msie/i.test(UA)&&!(/opera/i.test(UA))&&!(/mac_powerpc/i.test(UA)); is_gecko=/gecko/i.test(UA); is_khtml=/Konqueror|Safari|KHTML/i.test(UA); })(); function NavBar(parent,before,after){ if(!NavBar.initialized){ NavBar.images=new Object(); var names=["arrow-up","arrow-right","arrow-down","arrow-left","plus","minus","sync"]; var iconpath=""; if(typeof _NavBar_url!="undefined")iconpath=_NavBar_url.replace(/\x2f*$/,"/"); iconpath+="icons/"; for(var i=0;i1){div=NavBar.CE("div");this.page=div;while(this.parent.firstChild)div.appendChild(this.parent.firstChild);this.parent.appendChild(div);}else if(this.parent.childNodes.length==1)div=this.page=this.parent.firstChild;else{alert("Parent has no children");return false;}var bw=0;if(this.holder.computedStyle)bw=this.holder.computedStyle.borderRightWidth;else if(document.defaultView&&!is_khtml)bw=document.defaultView.getComputedStyle(this.holder,'').borderRightWidth;bw=parseInt(bw);this.bw=bw;this.parent.insertBefore(this.holder,div);this.width=this.holder.offsetWidth-bw;this.handle_width=14;this.element.style.width=this.width+"px";this._repositionPage();for(var i=0;i=3)&&!self.prefs["auto-hide"];var i_width=this.holder.offsetWidth-this.bw;if(this.anim)this.anim.stop(false);this.anim=new Animation(self.prefs["nb-frames"],self.prefs["nb-fps"],this.element.offsetLeft,f_left);this.anim.onUpdate=function(a){var w=(i_width+a.delta)+"px";self.element.style.left=a.pos+"px";self.holder.style.width=w;if(bloat)self.page.style.marginLeft=w;};this.anim.onStop=finish;this.anim.restart();}; NavBar.prototype.show=function(fast){if(!this.hidden)return true;var self=this;this.hidden=false;for(var i=0;i=3)&&!self.prefs["auto-hide"];var i_width=this.holder.offsetWidth-this.bw;if(this.anim)this.anim.stop(false);this.anim=new Animation(self.prefs["nb-frames"],self.prefs["nb-fps"],this.element.offsetLeft,f_left);this.anim.onUpdate=function(a){var w=(i_width+a.delta)+"px";if(bloat)self.page.style.marginLeft=w;self.element.style.left=a.pos+"px";self.holder.style.width=w;};this.anim.onStop=finish;this.anim.restart();}; NavBar.prototype.toggle=function(){this[this.hidden?"show":"hide"](false);}; NavBar.prototype._repositionPage=function(){this.page.style.marginLeft=this.holder.offsetWidth+"px";}; NavBar.prototype.hideAll=function(fast){for(var i=0;i=this.length)this.restart();else{var self=this;this.clearTimer();this.timerID=Interval.set(function(){self.update();},this.speed);}},restart:function(){this.onStart(this);this.pos=this.pos1;this.step=0;this.diff=this.pos2-this.pos1;this.rad_step=Math.PI/(2*this.length);this.rad_pos=0;this.start();},update:function(){if(this.step=0){var f=this.accel?(1-Math.cos(this.rad_pos)):Math.sin(this.rad_pos);this.delta=Math.round(f*this.diff);this.pos=this.pos1+this.delta;this.percent=Math.round(100*(this.pos-this.pos1)/this.diff);this.onUpdate(this);++this.step;this.rad_pos+=this.rad_step;}else{this.delta=this.pos2-this.pos;this.pos=this.pos2;this.percent=100;this.onUpdate(this);this.stop(true);}},stop:function(call){this.clearTimer();call&&this.onStop(this);},onStart:function(){},onStop:function(){},onUpdate:function(){}};