var tt_VFU={timerId:[],s:[],default_s:[],fast_s:[],obj:[],upObj:[],downObj:[],cssPostfix:[],started:[],stopped:[],stopByEnd:[],delay:0,init:function(id,scrollerPostfix,cssPostfix,s,ss){var is_ie,rv;tt_VFU.s[id]=s;tt_VFU.default_s[id]=s;tt_VFU.fast_s[id]=ss;tt_VFU.obj[id]=document.getElementById(id);tt_VFU.upObj[id]=document.getElementById('vscrUp'+scrollerPostfix);tt_VFU.downObj[id]=document.getElementById('vscrDown'+scrollerPostfix);tt_VFU.cssPostfix[id]=cssPostfix;tt_VFU.started[id]=0;tt_VFU.stopped[id]=0;tt_VFU.stopByEnd[id]=0;is_ie=((navigator.userAgent.toLowerCase().indexOf("msie")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("opera")==-1));if(is_ie){rv=-1;var ua=navigator.userAgent;var re=new RegExp(/MSIE ([0-9]{1,}[\.0-9]{0,})/);if(re.exec(ua)!==null){rv=parseInt(RegExp.$1,10)}if(rv<9){this.delay=10}else{this.delay=50}}else{this.delay=50}tt_VFU.play(id)},play:function(id){if(tt_VFU.obj[id].scrollTop===0){tt_VFU.upObj[id].className='vscrUpOff'+tt_VFU.cssPostfix[id];tt_VFU.downObj[id].className='vscrDown'+tt_VFU.cssPostfix[id];if(tt_VFU.stopByEnd[id]===1){tt_VFU.stop(id);return}if(tt_VFU.started[id]===1){tt_VFU.pausecomp(id,1000);tt_VFU.started[id]=0;tt_VFU.s[id]=tt_VFU.s[id]*-1}}else if(tt_VFU.obj[id].scrollTop===tt_VFU.obj[id].scrollHeight-parseInt(tt_VFU.obj[id].style.height,10)){tt_VFU.upObj[id].className='vscrUp'+tt_VFU.cssPostfix[id];tt_VFU.downObj[id].className='vscrDownOff'+tt_VFU.cssPostfix[id];tt_VFU.started[id]=1;if(tt_VFU.stopByEnd[id]===1){tt_VFU.stop(id);return}else{tt_VFU.pausecomp(id,1000);tt_VFU.started[id]=0;tt_VFU.s[id]=tt_VFU.s[id]*-1}}else{tt_VFU.started[id]=1;tt_VFU.upObj[id].className='vscrUp'+tt_VFU.cssPostfix[id];tt_VFU.downObj[id].className='vscrDown'+tt_VFU.cssPostfix[id]}tt_VFU.obj[id].scrollTop=tt_VFU.obj[id].scrollTop+tt_VFU.s[id];tt_VFU.timerId[id]=setTimeout(function(){tt_VFU.play(id)},tt_VFU.delay)},stop:function(id){clearTimeout(tt_VFU.timerId[id]);tt_VFU.stopped[id]=1},up:function(id){tt_VFU.s[id]=-tt_VFU.default_s[id];tt_VFU.stopByEnd[id]=1;if(tt_VFU.stopped[id]===1){tt_VFU.stopped[id]=0;tt_VFU.play(id)}},down:function(id){tt_VFU.s[id]=tt_VFU.default_s[id];tt_VFU.stopByEnd[id]=1;if(tt_VFU.stopped[id]===1){tt_VFU.stopped[id]=0;tt_VFU.play(id)}},fast:function(id){if(tt_VFU.s[id]>0){tt_VFU.s[id]=tt_VFU.fast_s[id]}else{tt_VFU.s[id]=-tt_VFU.fast_s[id]}},slow:function(id){if(tt_VFU.s[id]>0){tt_VFU.s[id]=tt_VFU.default_s[id]}else{tt_VFU.s[id]=-tt_VFU.default_s[id]}},mover:function(id){tt_VFU.stop(id)},mout:function(element,event,id){var current_mouse_target=null;if(event.toElement){current_mouse_target=event.toElement}else if(event.relatedTarget){current_mouse_target=event.relatedTarget}if(!tt_VFU.is_child_of(element,current_mouse_target)&&element!==current_mouse_target){tt_VFU.stopByEnd[id]=0;if(tt_VFU.stopped[id]===1){tt_VFU.stopped[id]=0;tt_VFU.play(id)}}},pausecomp:function(id,millis){if(tt_VFU.obj[id].id===id){var dt=new Date();var i=0;while((new Date())-dt<=millis){i++}}},is_child_of:function(parent,child){if(child!==null){while(child.parentNode){if((child=child.parentNode)==parent){return true}}}return false}};
