(function(b){b.fn.ticker=function(q){var e=b.extend({},b.fn.ticker.defaults,q),m="#"+b(this).attr("id"),n=b(this).attr("tagName");return this.each(function(){function h(c){var d=0,f;for(f in c)c.hasOwnProperty(f)&&d++;return d}function i(c){if(e.debugMode)window.console&&window.console.log?window.console.log(c):alert(c)}function r(){if(a.contentLoaded==false)if(e.ajaxFeed)e.feedType=="xml"?b.ajax({url:e.feedUrl,cache:false,dataType:e.feedType,async:true,success:function(c){for(var d=count=0;d'+f+""};count++;d=f=false}}}if(h(a.newsArr<1)){i("Couldn't find any content from the XML feed for the ticker to use!");return false}j();a.contentLoaded=true}}):i("Code Me!");else if(e.htmlFeed)if(b(m+" LI").length>0){b(m+" LI").each(function(c){a.newsArr["item-"+c]={type:e.titleText,content:b(this).html()}});j()}else{i("Couldn't find HTML any content for the ticker to use!");return false}else{i("The ticker is set to not use any types of content! Check the settings for the ticker."); return false}}function j(){a.contentLoaded=true;b(a.dom.titleElem).html(a.newsArr["item-"+a.position].type);b(a.dom.contentID).html(a.newsArr["item-"+a.position].content);if(a.position==h(a.newsArr)-1)a.position=0;else a.position++;distance=b(a.dom.contentID).width();time=distance/e.speed;b(a.dom.wrapperID).find(a.dom.titleID).fadeIn().end().find(a.dom.titleElem).fadeIn("slow",s)}function s(){if(a.play){var c=b(a.dom.titleElem).width()+20;b(a.dom.revealID).css("left",c+"px");if(e.displayType=="fade")b(a.dom.revealID).hide(0, function(){b(a.dom.contentID).css("left",c+"px").delay(20).fadeIn("slow",k)});else e.displayType!="scroll"&&b(a.dom.revealElem).show(0,function(){b(a.dom.contentID).css("left",c+"px").show();b(a.dom.revealID).css("margin-left","0px").delay(20).animate({marginLeft:distance+"px"},time,"linear",k)})}else return false}function k(){if(a.play){b(a.dom.contentID).delay(e.pauseOnItems).fadeOut("slow");e.displayType=="fade"?b(a.dom.contentID).fadeOut(e.fadeOutSpeed,function(){b(a.dom.wrapperID).find(a.dom.revealElem+ ","+a.dom.contentID).hide().end().find(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID).show().end().find(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID).removeAttr("style");j()}):b(a.dom.revealID).hide(0,function(){b(a.dom.tickerID).delay(e.pauseOnItems).fadeOut(e.fadeOutSpeed,function(){b(a.dom.wrapperID).find(a.dom.titleElem+","+a.dom.revealElem+","+a.dom.contentID).hide().end().find(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID).show().end().find(a.dom.tickerID+","+a.dom.revealID+ ","+a.dom.titleID).removeAttr("style");j()})})}else b(a.dom.revealElem).hide()}function l(){a.play=false;b(a.dom.tickerID+","+a.dom.revealID+","+a.dom.titleID+","+a.dom.titleElem+","+a.dom.revealElem+","+a.dom.contentID).stop(true,true);b(a.dom.revealID+","+a.dom.revealElem).hide();b(a.dom.wrapperID).find(a.dom.titleID+","+a.dom.titleElem).show().end().find(a.dom.contentID).show()}function o(){a.play=true;a.paused=false;k()}function p(c){l();switch(c){case "prev":if(a.position==0)a.position=h(a.newsArr)- 2;else if(a.position==1)a.position=h(a.newsArr)-1;else a.position-=2;b(a.dom.titleElem).html(a.newsArr["item-"+a.position].type);b(a.dom.contentID).html(a.newsArr["item-"+a.position].content);break;case "next":b(a.dom.titleElem).html(a.newsArr["item-"+a.position].type);b(a.dom.contentID).html(a.newsArr["item-"+a.position].content)}if(a.position==h(a.newsArr)-1)a.position=0;else a.position++}var a={position:0,time:0,distance:0,newsArr:{},play:true,paused:false,contentLoaded:false,dom:{contentID:"#ticker-content", titleID:"#ticker-title",titleElem:"#ticker-title SPAN",tickerID:"#ticker",wrapperID:"#ticker-wrapper",revealID:"#ticker-swipe",revealElem:"#ticker-swipe SPAN",controlsID:"#ticker-controls",prevID:"#prev",nextID:"#next",playPauseID:"#play-pause"}};if(n!="UL"&&e.htmlFeed===true){i("Cannot use <"+n.toLowerCase()+"> type of element for this plugin - must of type