﻿/* 
 * wrapScroll
 * Copyright 2007 youmos <youmos.com@gmail.com>
 * http://youmos.com/project/wrapscroll
 * 
 * The wrapScroll is licensed under a 
 * Creative Commons Attribution-NonCommercial-NoDerivs License.
 *
 * http://creativecommons.org/licenses/by-nc-nd/3.0/
 *
 * It is provided "as is" and without warranty of any kind. If you wish to continue to use it,
 * free for personal or non-commercial use, $30 for commercial use,
 * or transform and build your script upon this work to distribute.
 * The permission is valid for all future versions of wrapScroll.
*/

/*
* The license is acquired and used.
* The handle function is added and customized.
*
* [ License holder ]
* Masahiko Shimizu
*
* [ Company that works ]
* (C) COLORS Co.,Ltd. All Rights Reserved.
* http://www.colors.jp/
*
* [ License acquisition day ]
* 2007/08/21 , It has reported.
*/

/*--- wrapscroll.js ---*/
var wrapScroll=function(){this.initialize.apply(this,arguments);};wrapScroll.prototype={Version:'0.9.5',Interval:500,Duration:60,marginTop:0,marginBottom:0,_timer:0,_obj:null,initialize:function(e,p,r){this.attach(window,'load',this.bind(this.prepare,arguments));},prepare:function(e,p,r){if(o=document.getElementById(e)){this._obj={'e':o,'p':(p)?document.getElementById(p):o.parentNode,'r':(r)?document.getElementById(r):null};o.style.position='absolute';if((c=o.offsetTop)!=(v=((o.style.top=o.offsetTop+'px')!='')?o.offsetTop:0)){o.style.marginTop=0;o.style.top=c+(v-c)+'px';}this.callback();}},callback:function(){f=this.event.update(this,this._obj);setTimeout(this.bind(this.callback),(f)?10:this.Interval);},bind:function(method,arg){var _this=this;var _arg=(arg)?arg:[];return function(){method.apply(_this,_arg);}},attach:function(e,name,func,cap){if(e.addEventListener){e.addEventListener(name,func,cap);}else if(e.attachEvent){e.attachEvent('on'+name,func);}},setTween:function(f,d){if(f){this.tween=f;}if(d){this.Duration=d;}},tween:function(t,b,c,d){return c*(t/=d)*t+b;}};wrapScroll.prototype.event={update:function(t,o){var tpos=Math.max(this.scroll(),(o.r)?this.offset(o.r)+this.height(o.r):this.offset(o.p));var bpos=(this.offset(o.p)+this.height(o.p))-(this.height(o.e)+t.marginBottom);var s=this.offset(o.e);var e=Math.min(bpos,tpos+t.marginTop);if((t._prev!=e)||(t._timer>t.Duration)){t._timer=0;}if((t._prev=e)!=s){o.e.style.top=t.tween(t._timer++,s,e-s,t.Duration,o.e.style)+'px';handle(tpos);return true;}return false;},scroll:function(){return document.body.scrollTop||document.documentElement.scrollTop;},height:function(o){return o.offsetHeight||document.body.scrollHeight||document.documentElement.scrollHeight;},offset:function(o){y=o.offsetTop;if(o.style.position=='absolute')return y;while(o=o.offsetParent){y+=o.offsetTop;}return y;}};

eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 p(1){3(1>=0&&1<d){4();2("#r a")}3(1>=d&&1<b){4();2("#m a")}3(1>=b&&1<c){4();2("#l a")}3(1>=c&&1<j){4();2("#t a")}3(1>=j&&1<i){4();2("#s a")}3(1>=i){4();2("#q a")}}7 4(){9 5=$(\'a.6\');3(5.o==0)n;9 e="f";9 k="6";5.h(k);5.g(e)}7 2(8){$(8).h(\'f\');$(8).g(\'6\')}',30,30,'|scrollTop|setClass|if|changeClass|obj|current|function|clsName|var||1074|1761|387|class1|default|addClass|removeClass|3135|2448|class2|fourthFloor|fifthFloor|return|length|handle|firstFloor|sixthFloor|secondFloor|thirdFloor'.split('|'),0,{}))

