stories = { load:function() { }, resort:function(what) { if (what == "All") { var faders = jQuery(".hStory"); } else { var faders = jQuery('.'+what); jQuery(".hStory").hide(); } number = 1000/faders.length; faders.each(function (i) {jQuery(this).fadeIn((number*i)+1);}); } }; feature = { load:function(speed) { this.speed = (speed === undefined) ? 4000 : speed; features = jQuery("#homeFeature > div"); titles = jQuery("#homeFeatureTitles > div"); links = jQuery("#homeFeatureTitles > div > a"); this.featNum = features.length-1; this.pointer = 0; jQuery("#homeFeature > div:not(:first-child)").hide(); jQuery("#homeFeatureTitles > div:not(:first-child)").hide(); jQuery(".featureButOff").eq(0).addClass("featureButOn"); var self = this; jQuery(".featureButOff").each(function (i, el) { jQuery(this).click(function() {self.clickItem(i);}); }); jQuery(".fhomeShareThis").each(function (i, el) { jQuery(this).click(function(event) { event.preventDefault(); event.stopImmediatePropagation(); event.stopPropagation(); }); }); features.each(function(i, el){ jQuery(this).click(function() { window.location = links.eq(i).attr("href"); }); }); jQuery(".fhomeFBShare").each(function (i, el) { jQuery(this).click(function(event) { event.preventDefault(); event.stopImmediatePropagation(); event.stopPropagation(); u = jQuery(this).attr("href"); t = jQuery(this).attr("title"); window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436'); clearInterval(self.changer); }); }); jQuery(".fhomeTWShare").each(function (i, el) { jQuery(this).click(function(event) { event.stopPropagation(); clearInterval(self.changer); }); }); links.each(function(i, el){ jQuery(this).click(function() {});}); this.changer = setInterval("feature.nextItem()", this.speed); }, nextItem:function() { next = (this.pointer === this.featNum) ? 0 : this.pointer+1; jQuery(".featureButOff").removeClass("featureButOn"); jQuery(".featureButOff").eq(next).addClass("featureButOn"); features.eq(this.pointer).fadeOut(400); features.eq(next).fadeIn(800); titles.eq(this.pointer).fadeOut(400); titles.eq(next).fadeIn(800); this.pointer = next; }, clickItem:function(next) { clearInterval(this.changer); jQuery(".featureButOff").removeClass("featureButOn"); jQuery(".featureButOff").eq(next).addClass("featureButOn"); features.eq(this.pointer).fadeOut(90); features.eq(next).fadeIn(180); titles.eq(this.pointer).fadeOut(90); titles.eq(next).fadeIn(180); this.pointer = next; } };