window.addEvent("load",function(){$$('.fanews_mainwrap').each(function(el,i){var TID=el.getProperty('id');var main=$(TID);var hover=main.hasClass('hover');var animation=false;var $F=$Faboba[TID];if($E('.fanews_full_interface',main)&&$E('.fanews_full_scroll1',main)){var offset=$E('.fanews_full_scroll1',main).getSize().size.x;var scroller_main=new Fx.Scroll($E('.fanews_full_scroll1',main),{duration:$F['animation_speed'],wheelStops:false,wait:false});var blocks=$ES('.fanews_full_tablewrap',main);var actual_main_page=0;var autoanim=(el.hasClass('autoanim'))?true:false;var helpfun=function(){$clear(animation);animation=(function(){if(actual_main_page==blocks.length-1){scroller_main.scrollTo(0,0);$ES('.fanews_full_interface li',main).each(function(elmt,k){if(k!=0)elmt.removeProperty("class");else elmt.setProperty("class","active")});actual_main_page=0}else{actual_main_page++;scroller_main.scrollTo(actual_main_page*offset,0);$ES('.fanews_full_interface li',main).each(function(elmt,k){if(k!=actual_main_page)elmt.removeProperty("class");else elmt.setProperty("class","active")})}}).periodical($F['animation_interval'])};if(autoanim)helpfun();if($E('.fanews_full_interface li',main)){$E('.fanews_full_interface li',main).setProperty("class","active");$ES('.fanews_full_interface li',main).each(function(elm,j){elm.addEvent(hover?"mouseover":"click",function(){if(autoanim)helpfun();scroller_main.scrollTo(j*offset,0);$ES('.fanews_full_interface li',main).each(function(elmt,k){if(k!=j)elmt.removeProperty("class");else elmt.setProperty("class","active");actual_main_page=j})})})}if($E('.fanews_full_prev',main)){$E('.fanews_full_prev',main).addEvent("click",function(){if(autoanim)helpfun();if(actual_main_page==0){scroller_main.scrollTo((blocks.length-1)*offset,0);$ES('.fanews_full_interface li',main).each(function(elmt,k){if(k!=blocks.length-1)elmt.removeProperty("class");else elmt.setProperty("class","active")});actual_main_page=blocks.length-1}else{actual_main_page--;scroller_main.scrollTo(actual_main_page*offset,0);$ES('.fanews_full_interface li',main).each(function(elmt,k){if(k!=actual_main_page)elmt.removeProperty("class");else elmt.setProperty("class","active")})}});$E('.fanews_full_next',main).addEvent("click",function(){if(autoanim)helpfun();if(actual_main_page==blocks.length-1){scroller_main.scrollTo(0,0);$ES('.fanews_full_interface li',main).each(function(elmt,k){if(k!=0)elmt.removeProperty("class");else elmt.setProperty("class","active")});actual_main_page=0}else{actual_main_page++;scroller_main.scrollTo(actual_main_page*offset,0);$ES('.fanews_full_interface li',main).each(function(elmt,k){if(k!=actual_main_page)elmt.removeProperty("class");else elmt.setProperty("class","active")})}})}}})});
