$(document).ready(function() { initDDNav(); $(".deptWrap h4").addClass("clearfix").wrapInner("").append(""); custScroll(700, 4000, -160, 'left', '.brandsFeedWrap', '.brandsFeedSub', 'brandsFeedContent'); if ($("body").attr("id") == "homeBody") { $(".pushItemWrap, .homeFeeds").addClass("clearfix"); $(".newsFeedWrap .newsFeedSub").append("View All News"); $(".pushItemWrap h2").text("Featured Items From Highline Performance").addClass("clearfix").wrapInner("").append(""); headlineItems = $("#headlineWrap .headlineContent").hide().size(); $("#headlineWrap .headlineContent:eq(" + currHeadlineItem + ")").show(); $("#headlineNav li:eq(0)").addClass("active"); if($("#headlineWrap .headlineContent").length > 1) 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() } } function initDDNav() { 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*) $("#ddNav 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" }