// JavaScript Document //jQuery.noConflict(); jQuery(document).ready(function() { if (jQuery("#TopNews").length) { m=new Shower(jQuery("#TopNews")); } }); Shower=function (ths) { this.Items=new Array(); this.HTMLObject = jQuery(ths); this.CurrentIndex=-1; this.HTMLObject.addClass("Shower"); var self=this; jQuery("#Items > .Item", this.HTMLObject).each(function() { Item = { Title: jQuery('a:first', this), Image: jQuery('img:first', this), Summary: jQuery('.Summary:first', this), Button: null, Link: jQuery('a:first', this)[0].href}; self.Items.push(Item); jQuery(this).remove(); }); this.Count=this.Items.length; jQuery("#Items", this.HTMLObject).remove(); this.Buttons=jQuery(document.createElement("ul")); this.Buttons.addClass("Buttons"); for (var x=0; x < this.Items.length; x++) { Item=this.Items[x]; Item.Button = jQuery(document.createElement("li")); Item.Button.attr('ButtonIndex', x); Item.Button.click(function () { i=parseInt(jQuery(this).attr('ButtonIndex')); o = self.Status; self.Pause(); self.Show(i); if (o==1) self.Play(); }); Item.Button.html( Item.Title.html() ); if (x==0) Item.Button.addClass('first'); else if (x==this.Items.length - 1) Item.Button.addClass('last'); this.Buttons.append(Item.Button); } this.Display = jQuery(".Display", this.HTMLObject); if (this.Display.length==0) { this.Display=jQuery(document.createElement("div")); jQuery(this.Display).addClass("Display"); } this.Proxy = jQuery(".Proxy", this.HTMLObject); if (this.Proxy.length == 0) { this.Proxy=jQuery(document.createElement("div")); this.Proxy.addClass("Proxy"); } this.Proxy.hide(); jQuery(this.HTMLObject).append(this.Display).append(this.Buttons); //.append('
'); this.Text=jQuery(document.createElement("div")); this.Text.addClass("Text"); jQuery(this.Display).append(this.Proxy).append(this.Text); /* Buttons=document.createElement("div"); Display=document.createElement("div"); jQuery(ths).append(Buttons).append(Display); jQuery(Buttons, ths).addClass("Buttons"); jQuery(Display, ths).addClass("Display"); for (x=0; x= 0) { jQuery(this.Items[oldX].Button).removeClass("Selected"); jQuery(this.Proxy).fadeOut("fast", Show2); jQuery(this.Text).animate({ height: "00px" }, "fast"); } else { Show2(); } }, Prev:function() { i = (this.CurrentIndex == 0?this.Count-1:this.CurrentIndex-1); this.Show(i); }, Next:function() { i=(this.CurrentIndex+1) % this.Count; this.Show(i); }, Pause: function () { this.Status = 0; this.Timer.Pause(); } } CTimer=function (Callback, Interval, Params) { this.Interval=Interval; this.Params=Params; this.Callback=Callback; this.Start(); } CTimer.prototype={ Start: function() { if (this.Enabled()) { return; } var self=this; this.TimerId=setInterval(function () { if (self.Params.Scope) { scope=self.Params.Scope; scope._cbFunc=self.Callback; scope._brFunc=function (x,y,z) { this._cbFunc(x,y,z); } scope._brFunc(self.Params, self, this); } else { self.Callback(self.Params, self, this); } }, this.Interval); }, Pause: function () { if (this.TimerId != 0) { clearInterval(this.TimerId); TimerId=0; } }, ResetInterval: function (NewInterval) { this.Interval=NewInterval; if (this.Enabled()) { this.Pause(); this.Start(); } }, Enabled:function () { return this.TimerId?true:false; } }