﻿var open = ""; var fadeTime = 500; var delay = 1000; var cartDefaultHeight = 0; var cartHeight; var cartCount = 0; $(document).ready(function () { hoverAnimate(".nlpMenu a", { height: "32px" }, 200, { height: "12px" }, 200); hoverAnimate(".videoMenu a", { color: "#fff", backgroundPosition: "0 -40px" }, 200, { color: "#000", backgroundPosition: "0px 0px" }, 600); hoverAnimate(".button", { opacity: 0.8 }, 200, { opacity: 1 }, 400); if ($(".sections div.f").first().attr("title") != null) { open = $(".sections div.f").first().attr("title"); $(".sections div.f").css("display", "none"); $(".sections div.f[title|='" + open + "']").delay(delay).slideDown(fadeTime); $(".videoMenu a[title|='" + open + "']").delay(delay).animate({ color: "#fff", backgroundPosition: "0 -40px" }, 200); $(".videoMenu a").each(function () { var a = $(this).attr("title"); $(this).click(function () { switch (a) { case "Bonus": a = "Normal"; $(this).html("Normal video"); $(".normalVideo").addClass("hide"); $(".bonusVideo").removeClass("hide"); break; case "Normal": a = "Bonus"; $(this).html("Bonus video"); $(".normalVideo").removeClass("hide"); $(".bonusVideo").addClass("hide"); break; default: if (a != open) { $(".videoMenu a[title|='" + open + "']").animate({ color: "#000", backgroundPosition: "0px 0px" }, fadeTime); $(".sections div[title|='" + open + "']").slideUp(fadeTime); open = a; $(".sections div[title|='" + open + "']").delay(fadeTime + 20).slideDown(fadeTime / 2) } break } }) }) } }); function hoverAnimate(d, a, b, c, e) { $(d).each(function () { $(this).mouseover(function () { $(this).stop().animate(a, b) }); $(this).mouseout(function () { if ($(this).attr("title") != open || $(this).attr("title") == null) { $(this).stop().animate(c, e) } }) }) } var openElement; function expose(b, a) { if (a) { var c = 500; var d = $(document).height(); $(".grayOut").css({ opacity: 0, display: "block", height: d + "px" }).fadeTo(c, 0.4); $(b).delay(c).fadeIn(c); openElement = b } else { $(b).fadeOut(); $(".grayOut").fadeOut(1000) } };
