function var tm var temp cc_on tm ie true tm function id return docume

1
(function(){var tm={};var temp={};/*@cc_on tm.ie=true;@*/tm.$=function(id){return document.getElementById(id)};var $=tm.$;tm.addListener=function(element,event,func){var handler=function(e){var target=e.target||e.srcElement;var e=e||window.event;e.stop=function(){e.cancelBubble=true;e.returnValue=false;e.stopPropagation&&e.stopPropagation();e.preventDefault&&e.preventDefault()};func.call(tm.ie?target:this,e)};tm.ie?element.attachEvent('on'+event,handler):element.addEventListener(event,handler,false)};tm.time=Date.now||function(){return+new Date};tm.fx=function(f,options){this.options={fps:50,duration:500};this.set=f;if(options){for(var o in options){this.options[o]=options[o]}}};tm.fx.compute=function(from,to,delta){return(to-from)*delta+from};tm.fx.prototype={getTransition:function(){return function(p){return-(Math.cos(Math.PI*p)-1)/2}},step:function(){var time=tm.time();if(time<this.time+this.options.duration){var delta=this.transition((time-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,delta))}else{this.set(this.compute(this.from,this.to,1));this.complete()}},set:function(now){tm.log(now)},compute:function(from,to,delta){return tm.fx.compute(from,to,delta)},check:function(caller){if(!this.timer)return true;this.cancel();return true},start:function(from,to){if(!this.check(arguments.callee,from,to))return this;this.from=from;this.to=to;this.time=0;this.transition=this.getTransition();this.startTimer();this.onStart();return this},complete:function(){if(this.stopTimer())this.onComplete();return this},cancel:function(){if(this.stopTimer())this.onCancel();return this},onStart:function(){this.options.onStart&&this.options.onStart()},onComplete:function(){this.options.onComplete&&this.options.onComplete()},onCancel:function(){this.options.onCancel&&this.options.onCancel()},pause:function(){this.stopTimer();return this},resume:function(){this.startTimer();return this},stopTimer:function(){if(!this.timer)return false;this.time=tm.time()-this.time;this.timer=clearInterval(this.timer);return true},startTimer:function(){if(this.timer)return false;this.time=tm.time()-this.time;this.timer=setInterval((function(_this){return function(){_this.step()}})(this),Math.round(1000/this.options.fps));return true}};var current=window.location.href.replace(/^(.+)?#/,'');((current=='')||!$(current))&&(current='about');var pieces=$('menu').getElementsByTagName('a');var items=[];for(var i=pieces.length-1;i>=0;i--){items[i]=pieces[i].href.replace(/^(.+)?#/,'')};var checksizes=function(){for(var i=0,l=items.length;i<l;i++){(i>0)&&(scroller.offsets[items[i]]=scroller.offsets[items[i-1]]+$('tm-'+items[i-1]).offsetHeight)}};var scroller={init:function(items){this.offsets={};this.offsets[items[0]]=0;for(var i=0,l=items.length;i<l;i++){$(items[i]).id='tm-'+items[i];(i>0)&&(this.offsets[items[i]]=this.offsets[items[i-1]]+$('tm-'+items[i-1]).offsetHeight)};var _this=this;this.mover=$('mover');this.content=$('content');var _mover=this.mover;this.fx=new tm.fx(function(value){_mover.style.top=value+'px'},{'onComplete':function(){var partHeight=$('tm-'+_this.lastId).offsetHeight-960;_this.content.style.height=(partHeight>_this.windowHeight?partHeight:_this.windowHeight)+'px'}});var windowHeight=window.innerHeight||document.documentElement.clientHeight;(windowHeight==0)&&(windowHeight=document.body.clientHeight);this.windowHeight=windowHeight;this.content.style.height=windowHeight+'px';return this},moveTo:function(id,force){!force&&checksizes();window.location.href=window.location.href.replace(/#(.+)?$/,'')+'#'+id;if(!force&&(this.lastId==id)){return false}this.lastId=id;var initial=parseInt(this.mover.style.top,10);isNaN(initial)&&(initial=0);!force?this.fx.start(initial,-this.offsets[id]):(this.mover.style.top=-this.offsets[id]+'px')}};var menu={init:function(){this.menu=$('menu');var items=this.menu.getElementsByTagName('a');var pieces=[];this.dots={};for(var i=items.length-1;i>=0;i--){var a=items[i];var id=a.href.replace(/^(.+)?#/,'');a=a.parentNode;var p=a.parentNode.parentNode;(p.tagName.toLowerCase()!='li')&&(p=null);pieces[i]=id;this.dots[id]={a:a,p:p}}items=null;this.active='about';this.changeTo(current);scroller.init(pieces).moveTo(current)},changeTo:function(target){var highlight=this.dots[target];if(!highlight||(target==this.active)){return false}if(this.active){var active=this.dots[this.active];active.a.className='';active.p&&(active.p.className='')}highlight.a.className='active';highlight.p&&(highlight.p.className='parent');this.active=target}};menu.init();var anchorClick=function(e){e.stop();var target=this.href.replace(/^(.+)?#/,'');scroller.moveTo(target);menu.changeTo(target)};for(var i=document.links.length-1;i>=0;i--){var a=document.links[i];(a.href.indexOf('#')!=-1)&&tm.addListener(a,'click',anchorClick)}tm.addListener(window,'resize',function(){checksizes();scroller.moveTo(menu.active,true)});window.scroller=scroller})();