var $j = jQuery.noConflict(); $j(document).ready(function () { mainNav(); styleSelect(); threeBurgerHero(); }); function threeBurgerHero() { //animations for triple burger hero slide on homepage $j(".product_info").each(function () { $j(this).attr({ "ref": Math.abs($j(this).css("top").replace("px", "")) }); }); $j(".hovermap a, .hovermap div").bind("mouseover mouseleave", function (event) { var area_i = ".info" + Math.abs($j(".hovermap *").index(this) + 1); var top = parseFloat($j(area_i).attr("ref")); if (event.type == "mouseleave") { $j(area_i).stop().animate({ "top": (top * -1) }, 400); } else { //mouse over, animates down then up $j(area_i).stop().animate({ "top": ((top - 20) * -1) }, 200).animate({ "top": ((top + 50) * -1) }, 200); } //remove below once "See fresh stories" are added to cards if (!$(this).hasClass("hoverarea4")) { event.preventDefault(); } //^remove "See fresh stories" are added to cards }); //Show/Hide specific elements per product //Product One $j(".hoverarea1").mouseenter(function () { $j(".cta1").hide(); $j(".content1").show(); }); $j(".hoverarea1").mouseleave(function () { $j(".cta1").show(); $j(".content1").hide(); }); //Product Two $j(".hoverarea2").mouseenter(function () { $j(".cta2").hide(); $j(".content2").show(); }); $j(".hoverarea2").mouseleave(function () { $j(".cta2").show(); $j(".content2").hide(); }); //Product Three $j(".hoverarea3").mouseenter(function () { $j(".cta3").hide(); $j(".content3").show(); }); $j(".hoverarea3").mouseleave(function () { $j(".cta3").show(); $j(".content3").hide(); }); } function mainNav() { //hover fix $j("#mainnav li").mouseenter(function () { $j(this).children(".dropdown").addClass("nav_visible"); }); $j("#mainnav li").mouseleave(function () { $j(this).children(".dropdown").removeClass("nav_visible"); }); //insert raquo after each dropdown item $j(".dropdown li a").each(function () { var content = $j(this).html(); $j(this).html(content + ' »'); }); $j("#nav ul:first").children("li").children("a").each(function () { $j(this).parent("li").css({ "background-image": $j(this).css("background-image"), "width": $j(this).css("width") }).end().wrap(""); }); //comment this out to turn off effect $j(".nav2Container ul:first").children("li").children("a").each(function () { if (!$j(this).hasClass("active")) { $j(this).parent("li").css({ "background-image": $j(this).css("background-image"), "background-color": "#F3A654", "width": $j(this).css("width") }).end().wrap(""); } }); $j("#nav li, .nav2Container li").bind("mouseenter mouseleave", function (event) { if (event.type == "mouseleave") { $j(this).children("span").stop().animate({ "opacity": 1 }, 300); } else { //$j(this).css({ "background-position": "center top" }); $j(this).children("span").stop().animate({ "opacity": 0 }, 300); $j(this).children("span").siblings(".subnav_wrap").show(); } }); } function styleSelect() { $j("#language .text").text($j("#language select option:selected").text()).end().find("select").eq(0).css({ "opacity": 0 }); }