$(document).ready(function() { $.each($("#headlineWrap .headlineContent"), function(i) { var curWidth = $(".headlineContent:eq(" + i + ") img").width(); var curHeight = $(".headlineContent:eq(" + i + ") img").height(); if (curWidth < 661 || curHeight < 278) { //$(".headlineContent:eq(" + i + ")").remove(); } }); headlineItems = $("#headlineWrap .headlineContent").hide().size(); $("#headlineWrap .headlineContent:eq(" + currHeadlineItem + ")").show(); $("#headlineNav li:eq(0)").addClass("active"); if ($(".headlineContent").length > 1) { start_Int(); } custScroll(700, 5000, -180, 'left', '#sponsorWrapper', '.adWrap', 'adWrap .singleAdWrap'); if ($("body").attr("id") == "contactBody") { var contactMap = $("#contactWrap .contentSubWrap:eq(1) iframe:eq(0)"); var curIframeSrc = contactMap.attr("src"); contactMap.attr("src", curIframeSrc + "&z=9"); } }); 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(); } }