window.addEvent("domready",function(){Fx.Height=Fx.Style.extend({initialize:function(a,b){$(a).setStyle('overflow','hidden');this.parent(a,'height',b)},toggle:function(){var a=this.element.getStyle('height').toInt();return this.start((a>0)?(a,0):(0,this.element.scrollHeight))},show:function(){return this.set(this.element.scrollHeight)}});Fx.Opacity=Fx.Style.extend({initialize:function(a,b){this.now=1;this.parent(a,'opacity',b)},toggle:function(){return this.start((this.now>0)?(1,0):(0,1))},show:function(){return this.set(1)}});$ES('.gk_news_highlighter').each(function(b,i){var c=b.getProperty("id");var d=$Gavick["gk_news_highlighter"+c];var f=b;var g,prev=false;var h=false;if($E('.gk_news_highlighter_interface',b)){g=$E('.next',f);prev=$E('.prev',f)}if(d['animationType']==0){var k=$E('.nowrap',f);var w=0;$ES('.nowrap span').each(function(a,i){w+=a.getSize().size.x});var l=(w/d['animationSpeed'])*1000;var m=l;var n=new Fx.Style(k,'margin-left',{duration:l,transition:Fx.Transitions.linear,onComplete:function(){n.set(b.getSize().size.x);n.start(b.getSize().size.x,-w)}});if(d['mouseover']){k.addEvent("mouseenter",function(){n.stop();l=((w+k.getStyle('margin-left').toInt())/d['animationSpeed'])*1000;n=new Fx.Style(k,'margin-left',{duration:l,transition:Fx.Transitions.linear,onComplete:function(){n.options.duration=m;n.set(b.getSize().size.x);n.start(b.getSize().size.x,-w)}})});k.addEvent("mouseleave",function(){n.start(k.getStyle('margin-left').toInt(),-w)})}n.set(b.getSize().size.x);n.start(b.getSize().size.x,-w)}if(d['animationType']!=0){var o=$ES('.gk_news_highlighter_item',b);o.each(function(a){a.setStyle('display','block')});var p=[];var q=[];var r=0;var s=false;var t=(function(){if(s==false){p[r].toggle();if(d['animationType']==2)q[r].start(0,-24);else if(d['animationType']==3)q[r].start(0,24);else if(d['animationType']==4)q[r].start(0,780);r++;if(r>o.length-1)r=0;p[r].toggle();if(d['animationType']==2||d['animationType']==6)q[r].start(24,0);else if(d['animationType']==3||d['animationType']==7)q[r].start(-24,0);else if(d['animationType']==4||d['animationType']==5)q[r].start(-780,0)}}).periodical(d['animationInterval']);if(g){g.addEvent('click',function(e){new Event(e).stop();if(!h){h=true;(function(){h=false}).delay(d['animationSpeed']);p[r].toggle();if(d['animationType']==2)q[r].start(0,-24);else if(d['animationType']==3)q[r].start(0,24);else if(d['animationType']==4)q[r].start(0,780);r++;if(r>o.length-1)r=0;p[r].toggle();if(d['animationType']==2||d['animationType']==6)q[r].start(24,0);else if(d['animationType']==3||d['animationType']==7)q[r].start(-24,0);else if(d['animationType']==4||d['animationType']==5)q[r].start(-780,0);$clear(t);t=(function(){if(s==false){p[r].toggle();if(d['animationType']==2)q[r].start(0,-24);else if(d['animationType']==3)q[r].start(0,24);else if(d['animationType']==4)q[r].start(0,780);r++;if(r>o.length-1)r=0;p[r].toggle();if(d['animationType']==2||d['animationType']==6)q[r].start(24,0);else if(d['animationType']==3||d['animationType']==7)q[r].start(-24,0);else if(d['animationType']==4||d['animationType']==5)q[r].start(-780,0)}}).periodical(d['animationInterval'])}});prev.addEvent('click',function(e){new Event(e).stop();if(!h){h=true;(function(){h=false}).delay(d['animationSpeed']);p[r].toggle();if(d['animationType']==2)q[r].start(0,-24);else if(d['animationType']==3)q[r].start(0,24);else if(d['animationType']==4)q[r].start(0,780);(r==0)?r=o.length-1:r--;p[r].toggle();if(d['animationType']==2||d['animationType']==6)q[r].start(24,0);else if(d['animationType']==3||d['animationType']==7)q[r].start(-24,0);else if(d['animationType']==4||d['animationType']==5)q[r].start(-780,0);$clear(t);t=(function(){if(s==false){p[r].toggle();if(d['animationType']==2)q[r].start(0,-24);else if(d['animationType']==3)q[r].start(0,24);else if(d['animationType']==4)q[r].start(0,780);r++;if(r>o.length-1)r=0;p[r].toggle();if(d['animationType']==2||d['animationType']==6)q[r].start(24,0);else if(d['animationType']==3||d['animationType']==7)q[r].start(-24,0);else if(d['animationType']==4||d['animationType']==5)q[r].start(-780,0)}}).periodical(d['animationInterval'])}})}o.each(function(a,j){a.setStyle('z-index',o.length-j);p[j]=new Fx.Opacity(a,{duration:d['animationSpeed'],transition:d['animationFun']});if(d['animationType']==2||d['animationType']==3||d['animationType']==6||d['animationType']==7){q[j]=new Fx.Style(a,'top',{duration:d['animationSpeed'],transition:d['animationFun']})}else if(d['animationType']==4||d['animationType']==5){q[j]=new Fx.Style(a,'left',{duration:d['animationSpeed'],transition:d['animationFun']})}if(j!=0)p[j].hide();if(d['animationType']>1)q[j].set(0)});if(d['mouseover']){o.addEvent("mouseenter",function(){s=true});o.addEvent("mouseleave",function(){s=false})}}})});
