$(document).ready(function() { //if ($(".testiFeedWrap .testiContent").length > 1) //custScroll(700, 5000, -32, 'top', '.testiFeedWrap', '.testiFeedSub', 'testiFeedSub .testiContent'); //if ($("#sponsorWrapper .singleAdWrap").length > 6) //custScroll(700, 5000, -158, 'left', '#sponsorWrapper', '.adWrap', 'adWrap .singleAdWrap'); if ($("body").attr("ID") == 'homeBody') { $(".quickMessageWrap").addClass("clearfix"); $(".quickMessageWrap").each(function() { if($(this).children().length == 0) $(this).parent().hide(); }); $("#headlineNav").prepend(""); $(".headlinePic a").each(function() { var href = $(this).attr("href"); $(this).parent().next().children().append("Learn More"); }); } headlineItems = $("#headlineWrap .headlineContent").hide().size(); $("#headlineWrap .headlineContent:eq(" + currHeadlineItem + ")").show(); $("#headlineNav li:eq(0)").addClass("active"); start_Int(); }); var headlineItems; var currHeadlineItem = 0; var intVal = ""; function tickHeadline() { $("#headlineWrap .headlineContent:eq(" + currHeadlineItem + ")").fadeOut("slow"); $("#headlineNav li:eq(" + currHeadlineItem + ")").removeClass("active"); currHeadlineItem = ++currHeadlineItem % headlineItems; $("#headlineNav li:eq(" + currHeadlineItem + ")").addClass("active"); $("#headlineWrap .headlineContent:eq(" + currHeadlineItem + ")").fadeIn("slow"); } function setHeadline(newItem) { stop_Int(); $("#headlineWrap .headlineContent:eq(" + currHeadlineItem + ")").hide(); $("#headlineNav li:eq(" + currHeadlineItem + ")").removeClass("active"); currHeadlineItem = newItem; $("#headlineNav li:eq(" + newItem + ")").addClass("active"); $("#headlineWrap .headlineContent:eq(" + currHeadlineItem + ")").show(); start_Int(); } function stop_Int() { if (intVal != "") { clearInterval(intVal); intVal = ""; } } function start_Int() { if (intVal == "") { intVal = setInterval("tickHeadline()", 10000); } else { stop_Int() } }