function oScroller(b,c){var a=this;this.container=document.getElementById(b);if(!b||this.container==null){return false}this.step=(c&&c.step?c.step:2);this.timeout=(c&&c.timeout?c.timeout:40);this.delay=(c&&c.delay?c.delay:3);this.mousectl=(c&&typeof(c.mousectl)!="undefined"?c.mousectl:true);this.dir=(c&&c.dir?c.dir:"rtl");this.continuous=(c&&typeof(c.continuous)!="undefined"?c.continuous:false);this.autostart=(c&&typeof(c.autostart)!="undefined"?c.autostart:true);this.timer;this.start=function(){a.timer=setTimeout(a.move,a.timeout)};this.stop=function(){clearTimeout(a.timer)};this.move=function(){if(a.continuous){switch(a.dir){case"rtl":if(parseInt(a.wrapper.style.left)<=a.wrapCell.offsetWidth*(-1)){a.wrapper.style.left="0px"}else{a.wrapper.style.left=(parseInt(a.wrapper.style.left)-a.step)+"px"}break;case"ltr":if(parseInt(a.wrapper.style.left)>=0){a.wrapper.style.left=a.wrapCell.offsetWidth*(-1)+"px"}else{a.wrapper.style.left=(parseInt(a.wrapper.style.left)+a.step)+"px"}break}a.timer=setTimeout(a.move,a.timeout)}else{switch(a.dir){case"rtl":if(parseInt(a.wrapper.style.left)<a.wrapper.offsetWidth*(-1)){a.wrapper.style.left=a.container.offsetWidth+"px";a.timer=setTimeout(a.move,a.delay*1000)}else{a.wrapper.style.left=(parseInt(a.wrapper.style.left)-a.step)+"px";a.timer=setTimeout(a.move,a.timeout)}break;case"ltr":if(parseInt(a.wrapper.style.left)>a.container.offsetWidth){a.wrapper.style.left=a.wrapper.offsetWidth*(-1)+parseInt(a.container.paddingLeft)+"px";a.timer=setTimeout(a.move,a.delay*1000)}else{a.wrapper.style.left=(parseInt(a.wrapper.style.left)+a.step)+"px";a.timer=setTimeout(a.move,a.timeout)}break}}};this.content=this.container.innerHTML;this.wrapper=document.createElement("table");this.wrapper.style.position="relative";this.wrapCell=document.createElement("td");this.wrapCell.style.whiteSpace="nowrap";this.wrapRow=document.createElement("tr");this.wrapRow.appendChild(this.wrapCell);this.wrapper.appendChild(this.wrapRow);this.wrapCell.innerHTML=this.content;this.container.innerHTML="";this.container.style.overflow="hidden";this.container.appendChild(this.wrapper);if(this.continuous){this.repeatX=Math.ceil(this.container.offsetWidth/this.wrapper.offsetWidth);this.repeatY=Math.ceil(this.container.offsetHeight/this.wrapper.offsetHeight)-1;if(this.dir=="rtl"||this.dir=="ltr"){for(i=0;i<this.repeatX;i++){var d=document.createElement("td");d.style.whiteSpace="nowrap";d.innerHTML=this.content;this.wrapRow.appendChild(d)}}}if(this.mousectl){this.container.onmouseover=function(){a.stop()};this.container.onmouseout=function(){a.start()}}if(!this.continuous){switch(this.dir){case"rtl":this.wrapper.style.left=this.container.offsetWidth+"px";break;case"ltr":this.wrapper.style.left=this.wrapper.offsetWidth*(-1)+"px";break}}else{switch(this.dir){case"rtl":this.wrapper.style.left="0px";break;case"ltr":this.wrapper.style.left=this.wrapCell.offsetWidth*(-1)+"px";break}}if(this.autostart){this.move()}};
