
var i9sys;if(!i9sys)i9sys={};if(!i9sys.Web)i9sys.Web={};if(!i9sys.Web.Controls)i9sys.Web.Controls={};i9sys.Web.Controls.Scroller=function(name,direction,content,area)
{this.varName=name;this.scrollDirection=direction;this.scrollArea=document.getElementById(area);this.contentElements=new Array();this.contentLength=-1;this.contentSelected=-1;contentElem=document.getElementById(content);if(contentElem!=null&&contentElem.hasChildNodes())
for(var i=0;i<contentElem.childNodes.length;i++)
if(contentElem.childNodes[i].tagName=="DIV")
this.contentElements.push(contentElem.childNodes[i]);this.contentLength=this.contentElements.length;if(this.contentLength>0)this.contentSelected=0;this.ScrollSection=function(link)
{if(this.contentSelected==link){return;}
this.contentSelected=link;position=this.findElementPos(this.contentElements[link]);if(this.contentLength>0){offsetPos=this.findElementPos(this.contentElements[0]);position[0]=position[0]-offsetPos[0];position[1]=position[1]-offsetPos[1];}
if(this.scrollDirection=="horiz"){this.scrollStart(this.scrollArea,this.scrollArea.scrollLeft,position[0]);}else{this.scrollStart(this.scrollArea,this.scrollArea.scrollTop,position[1]);}}
this.ScrollArrow=function(direction)
{if(direction=="left"){if(this.contentSelected-1<0){gotoContent=this.contentLength-1;}else{gotoContent=this.contentSelected-1;}}else{if((this.contentSelected+1)>(this.contentLength-1)){gotoContent=0;}else{gotoContent=this.contentSelected+1;}}
this.ScrollSection(gotoContent);}
this.ScrollLeft=function()
{this.ScrollArrow('left');}
this.ScrollRight=function()
{this.ScrollArrow('right');}
this.scrollanim={time:0,begin:0,change:0.0,duration:0.0,element:null,timer:null};this.scrollStart=function(elem,start,end)
{if(this.scrollanim.timer!=null){clearInterval(this.scrollanim.timer);this.scrollanim.timer=null;}
this.scrollanim.time=0;this.scrollanim.begin=start;this.scrollanim.change=end-start;this.scrollanim.duration=25;this.scrollanim.element=elem;if(this.scrollDirection=="horiz"){this.scrollanim.timer=setInterval(this.varName+".scrollHorizAnim();",15);}else{this.scrollanim.timer=setInterval(this.varName+".scrollVertAnim();",15);}}
this.scrollVertAnim=function()
{if(this.scrollanim.time>this.scrollanim.duration){clearInterval(this.scrollanim.timer);this.scrollanim.timer=null;}
else{move=this.sineInOut(this.scrollanim.time,this.scrollanim.begin,this.scrollanim.change,this.scrollanim.duration);this.scrollanim.element.scrollTop=move;this.scrollanim.time++;}}
this.scrollHorizAnim=function()
{if(this.scrollanim.time>this.scrollanim.duration){clearInterval(this.scrollanim.timer);this.scrollanim.timer=null;}
else{move=this.sineInOut(this.scrollanim.time,this.scrollanim.begin,this.scrollanim.change,this.scrollanim.duration);this.scrollanim.element.scrollLeft=move;this.scrollanim.time++;}}
this.sineInOut=function(t,b,c,d)
{return-c/2*(Math.cos(Math.PI*t/d)-1)+b;}
this.findElementPos=function(elemFind)
{var elemX=0;var elemY=0;do{elemX+=elemFind.offsetLeft;elemY+=elemFind.offsetTop;}while(elemFind=elemFind.offsetParent)
return Array(elemX,elemY);}}
