var NewsToggler=Class.create({options:{fadeTime:300,appearTime:600,pollingTime:250},_request_is:false,_visible:'divToShow1',_processAppear:false,_processHide:false,initialize:function(options){options=options||{};$H(this.options).merge(options);},abort:function(divID){this._request_is=false;},show:function(divID){if(divID==this._visible){return true;}if(this._processAppear){return;}this._request_is=divID;setTimeout(function(){this._show(divID);}.bind(this),(this.options.pollingTime||250));},_show:function(divID){if(this._request_is!=divID||this._processAppear){return;}if(this._visible!=divID){this._hide(this._visible);}this._appear(divID);},_appear:function(divID){this._visible=divID;this._processAppear=true;Effect.Appear(divID,{duration:(this.options.appearTime||100)/1000,queue:{position:'end',scope:'newsToggler'},afterFinish:function(){this._processAppear=false;}.bind(this)});Effect.Queues.get('newsToggler').interval=5;return this;},_hide:function(divID){this._processHide=true;Effect.Fade(divID,{duration:(this.options.fadeTime||100)/1000,queue:{position:'end',scope:'newsToggler'},afterFinish:function(){this._processHide=false;}.bind(this)});Effect.Queues.get('newsToggler').interval=5;return this;},clearAll:function(divID){if(this._visible){$(this._visible).hide();}var queue=Effect.Queues.get('newsToggler');if(queue){queue.each(function(effect){effect.cancel();});}this._visible=divID;}});