var js_rolling=function(a){if(a.nodeType==1)this.this_s=a;else this.this_s=document.getElementById(a);this.is_rolling=false;this.direction=1;this.children=null;this.move_gap=1;this.time_dealy=100;this.time_dealy_pause=1000;this.time_timer=null;this.time_timer_pause=null;this.mouseover=false;this.init();this.set_direction(this.direction)};js_rolling.prototype.init=function(){this.this_s.style.position='relative';this.this_s.style.overflow='hidden';var a=this.this_s.childNodes;for(var i=(a.length-1);0<=i;i--){if(a[i].nodeType==1)a[i].style.position='relative';else this.this_s.removeChild(a[i])}var b=this;this.this_s.onmouseover=function(){b.mouseover=true;if(!b.time_timer_pause)b.pause()};this.this_s.onmouseout=function(){b.mouseover=false;if(!b.time_timer_pause)b.resume()}};js_rolling.prototype.set_direction=function(a){this.direction=a;if(this.direction==2||this.direction==4)this.this_s.style.whiteSpace='nowrap';else this.this_s.style.whiteSpace='normal';var b=this.this_s.childNodes;for(var i=(b.length-1);0<=i;i--){if(this.direction==1)b[i].style.display='block';else if(this.direction==2){b[i].style.textlign='right';b[i].style.display='inline'}else if(this.direction==3)b[i].style.display='block';else if(this.direction==4)b[i].style.display='inline'}this.init_element_children()};js_rolling.prototype.init_element_children=function(){var a=this.this_s.childNodes;this.children=a;for(var i=(a.length-1);0<=i;i--){if(this.direction==1)a[i].style.top='0px';else if(this.direction==2)a[i].style.left='-'+this.this_s.firstChild.offsetWidth+'px';else if(this.direction==3)a[i].style.top='-'+this.this_s.firstChild.offsetHeight+'px';else if(this.direction==4)a[i].style.left='0px'}};js_rolling.prototype.act_move_up=function(){for(var i=0,m=this.children.length;i=0){this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);this.init_element_children();this.pause_act()}};js_rolling.prototype.move_down=function(){if(this.direction!=1&&this.direction!=3)return false;this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);this.init_element_children();this.pause_act()};js_rolling.prototype.act_move_left=function(){for(var i=0,m=this.children.length;i=0){this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);this.init_element_children();this.pause_act()}};js_rolling.prototype.move_right=function(){if(this.direction!=2&&this.direction!=4)return false;this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);this.init_element_children();this.pause_act()};js_rolling.prototype.start=function(){var a=this;this.stop();this.is_rolling=true;var b=function(){if(a.is_rolling){if(a.direction==1)a.act_move_up();else if(a.direction==2)a.act_move_right();else if(a.direction==3)a.act_move_down();else if(a.direction==4)a.act_move_left()}};this.time_timer=setInterval(b,this.time_dealy)};js_rolling.prototype.pause_act=function(){if(this.time_dealy_pause){var a=this;var b=function(){a.resume();a.time_timer_pause=null};if(this.time_timer_pause)clearTimeout(this.time_timer_pause);this.time_timer_pause=setTimeout(b,this.time_dealy_pause);this.pause()}};js_rolling.prototype.pause=function(){this.is_rolling=false};js_rolling.prototype.resume=function(){if(!this.mouseover)this.is_rolling=true};js_rolling.prototype.stop=function(){this.is_rolling=false;if(!this.time_timer)clearInterval(this.time_timer);this.time_timer=null};