$(document).ready(function() { initNav(); $(".sideVid a").colorbox({iframe:true, width:'80%', height:'80%'}); if ($("#affWrap .singleAdWrap").length > 6){ custScroll(900, 5500, -85, 'top', '#affWrap', '.adWrap', 'singleAdWrap'); } headlineItems = $("#headlineWrap .headlineContent").hide().size(); $("#headlineWrap .headlineContent:eq(" + currHeadlineItem + ")").show(); $("#headlineNav li:eq(0)").addClass("active"); if ($(".headlineContent").length > 1) start_Int(); if ($("body").attr("ID") == "homeBody") { $(".homeBoxWrap .featureWrap").each(function () { if ($(this).children().length == 0){ $(this).parent().hide(); } }); } }); 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()", 7000); } else { stop_Int() } } function initNav() { var config = { over: showSubMenu, // function = onMouseOver callback (REQUIRED) timeout: 150, // number = milliseconds delay before onMouseOut out: hideSubMenu// function = onMouseOut callback (REQUIRED) }; //$("#mainNav ul.subnav").parent().append(""); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*) $("#mainNav li").hoverIntent(config); } function showSubMenu() { //Following events are applied to the subnav itself (moving subnav up and down) $(this).find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click $(this).addClass("active"); //On hover over, add class "subhover" } function hideSubMenu() { $(this).find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up $(this).removeClass("active"); //On hover out, remove class "subhover" }