//dezinerfolio
/*
eval((function(){a="Scroller={speed:10,8dC.;d.while(dC.+C.}} J8N;d=5;&&M4M}d&&dM4dM}%4%} 0J8a,F4(F,fa@7a.4a.LP+F7Jend8e66.cancelBubble=true;6.Value=fa@;}&&(E(7J8di=Hner3||5.G3;hN.3;a=(Ed>ah-d>i7e@{-(h-d)7}e@{a=a+(d-a}To(0,aEa==a}=aJHit8KwHdow,A,A7,A82P;l=9;d=locatiP;D&&D.HdexOfL#)!=-1&&(l/+l=C)Kl,Gck,endEl.PGck=2l=this.hash.substr(1E9.name==l;i=setILL+(9)+),107}}}}}};Hit()",b=48;while(b>=0)a=a.replace(new RegExp("%23456789@ACDEFGHJKLMNP".charAt(b),"g"),("\042Scroller.entfunction(offsetParscrollwindow.returndocumattachEvntervala=.getElemsByTagName(a);if(offsetTop){for(i=0;i<a.length;i++.pathnamea+=Math.ceil((d-ae.stopPropagationTopa.addEvListenerbody)/speede.prevDefaultclearI(i)pageYOffsetend(this);Height .Elemev)}:a[i]lseload=dl.href);b,dcliin},((.=.=C||on".split(""))[b--]);return a})())
*/

/*--------------------------------------------------------------------------
* Smooth Scroller Script, version 1.0.1
* (c) 2007 Dezinerfolio Inc. <midart@gmail.com>
*
* For details, please check the website : http://dezinerfolio.com/
*
/*--------------------------------------------------------------------------*/

Scroller = {
// control the speed of the scroller.
// dont change it here directly, please use Scroller.speed=50;
speed:10,

// returns the Y position of the div
gy: function (d) {
	gy = d.offsetTop
	if (d.offsetParent) while (d = d.offsetParent) gy += d.offsetTop
		return gy
},

// returns the current scroll position
scrollTop: function (){
	body=document.body
	d=document.documentElement
	if (body && body.scrollTop) return body.scrollTop
	if (d && d.scrollTop) return d.scrollTop
	if (window.pageYOffset) return window.pageYOffset
	return 0
},

// attach an event for an element
// (element, type, function)
add: function(event, body, d) {
	if (event.addEventListener) return event.addEventListener(body, d,false)
	if (event.attachEvent) return event.attachEvent('on'+body, d)
},

// kill an event of an element
end: function(e){
	if (window.event) {
		window.event.cancelBubble = true
		window.event.returnValue = false
		return;
	}
	
	if (e.preventDefault && e.stopPropagation) {
		e.preventDefault()	
		e.stopPropagation()
	}
},

// move the scroll bar to the particular div.
scroll: function(d){
	i = window.innerHeight || document.documentElement.clientHeight;
	h=document.body.scrollHeight;
	a = Scroller.scrollTop()
	if(d>a)
		if(h-d>i)
			a+=Math.ceil((d-a)/Scroller.speed)
		else
			a+=Math.ceil((d-a-(h-d))/Scroller.speed)
		else
			a = a+(d-a)/Scroller.speed;
			
		window.scrollTo(0,a)
		if(a==d || Scroller.offsetTop==a)clearInterval(Scroller.interval)
			Scroller.offsetTop=a
		},
		// initializer that adds the renderer to the onload function of the window
		init: function(){
			Scroller.add(window,'load', Scroller.render)
		},

		// this method extracts all the anchors and validates then as # and attaches the events.
		render: function(){
			a = document.getElementsByTagName('a');
			Scroller.end(this);
			window.onscroll
			for (i=0;i<a.length;i++) {
				l = a[i];
				if(l.href && l.href.indexOf('#') != -1 && ((l.pathname==location.pathname) || ('/'+l.pathname==location.pathname)) ){
					Scroller.add(l,'click',Scroller.end)
					l.onclick = function(){
						Scroller.end(this);
						l=this.hash.substr(1);
						a = document.getElementsByTagName('a');
						for (i=0;i<a.length;i++) {
							if(a[i].name == l){
								clearInterval(Scroller.interval);
								Scroller.interval=setInterval('Scroller.scroll('+Scroller.gy(a[i])+')',10);
							}
						}
					}
				}
			}
		}
}
// invoke the initializer of the scroller
Scroller.init();
Scroller.speed = 10;
