﻿$(document).ready(function() { $("a#search").click(function() { if ($("#openCloseIdentifier").is(":hidden")) { $(".cart").animate({ marginTop: "-43px" }, 500); $("#openCloseIdentifier").show() } else { $(".cart").animate({ marginTop: "0px" }, 500); $("#openCloseIdentifier").hide() } }) }); $(function() { $("#jCarousel1").jCarouselLite({ btnNext: ".next1", btnPrev: ".prev1", visible: 4 }) }); $(function() { $("#jCarouselFooter").show(); $("#jCarouselFooter").jCarouselLite({ visible: 1, auto: 6E3, speed: 4E3 }) }); $(function() { var a = $("div.tabs > div.tab-content"); a.hide().filter(":first").show(); $("div.tabs ul.nav li.tab a").click(function() { a.hide(); a.filter(this.hash).show(); $("div.tabs ul.nav li.tab").removeClass("active"); $(this).parent().addClass("active"); SetupAccordion(this.hash); return false }).filter(":first").click() }); $(function() { $("#news-ticker").jCarouselLite({ vertical: true, visible: 2, auto: 8E3, speed: 1E3 }) }); $(function() { $("ul.data.vehicles li").find("span").animate({ left: "0", opacity: 0 }, 1); $("ul.data.vehicles li").hover(function() { $(this).find("span").stop().animate({ left: "-130", opacity: 1 }, 300).css("display", "block") }, function() { $(this).find("span").stop().animate({ left: "0", opacity: 0 }, 200).css("display", "none").css("left", "0") }) }); $(document).ready(function() { $("#fader").show().fadeTransition() }); (function(a) { a.fn.extend({ accordion: function() { return this.each(function() { function c(d, e, f) { a(d)[f || "parent"]("li").toggleClass("active").siblings().removeClass("active").children("ul, div").slideUp("fast"); a(d).siblings("ul, div")[e || "slideToggle"](!e ? "fast" : null) } if (a(this).data("accordiated")) return false; a.each(a(this).find("ul, li>div"), function() { a(this).data("accordiated", true); a(this).hide() }); a.each(a(this).find("a:not(.foo)"), function() { a(this).click(function(d) { c(d.target) }) }); var b = false; if (location.hash) b = a(this).find("a[href=" + location.hash + "]")[0]; else if (a(this).find("li.current")) b = a(this).find("li.current a")[0]; if (b) { c(b, "toggle", "parents"); a(b).parents().show() } }) } }) })(jQuery); function SetupAccordion(a) { if (a == "#second") { $("#jCarousel2").show(); $("#jCarousel2").jCarouselLite({ btnNext: ".next2", btnPrev: ".prev2", visible: 4 }) } } function redirectTo(a) { if (a != null) { a = a.options[a.selectedIndex].value; if (a != "") location.href = a } } function checkSelected(a) { a = document.getElementById(a); if (a.options[a.selectedIndex].value.length < 1) { alert("Please select an option from the list"); return false } return true } function confirmRemove(a) { var c = $("#quantity_" + a).val(); a = $("#name_" + a).text(); var b = "Are you sure you want to remove "; b += c > 1 ? "these " + c + " '" + a + "' vehicles from your basket?" : "'" + a + "' from your basket?"; return confirm(b) } $(function() { $("a.new-window").click(function() { window.open(this.href); return false }) }); (function(a) { a.fn.fadeTransition = function(c) { c = a.extend({ pauseTime: 1E4, transitionTime: 3E3 }, c); Trans = function(b) { function d() { var i = (g + 1) % h.length | 0; a(h[g]).fadeOut(c.transitionTime); a(h[i]).fadeIn(c.transitionTime); g = i; e() } function e() { if (a("> *", b).length < 2) return false; f && clearTimeout(f); f = setTimeout(d, c.pauseTime) } var f = null, g = 0, h = a("> *", b).css("display", "none").css("left", "0").css("top", "0").css("position", "absolute"); a(b).css("position", "relative"); a(h[g]).css("display", "block"); e() }; return this.each(function() { new Trans(this) }) } })(jQuery);
