$(document).ready(function() { // set default variables window.numHeroSlides = 4; window.currHeroSlide = 1; window.heroDuration = 7000; window.slideDuration = 850; if ($("#the-team").length) { $("#the-team").css("overflow-x", "hidden"); $("#the-team").css("overflow", "hidden"); $("#the-team").css("height", "532px"); $("#the-team ol#scroll-groove").css("display", "block"); $("#scroll-groove li").bind("click", clickName); $(".info").hide(); $("#clark").click(); } // start the home hero rotation window.heroInterval = setInterval(home_showNextHero, window.heroDuration); // create the binds for the hero area $(".next-hero").show().bind("click", home_clickNextHero); $(".previous-hero").show().bind("click", home_clickPreviousHero); // create the binds for the scrollTo calls $("body.app .main-navigation ul .scrollLink").click(function(e) { e.preventDefault(); var myAnchor = "#" + $(this).attr("id").split("-")[1]; $.scrollTo(myAnchor, 250); }); var gallery = $("#product-navigation"); var placeholder = gallery.find("#product-detail-window .slider img"); gallery.find("#product-detail-nav ul li a").click(function() { var href = this.href; placeholder.attr("src", href); //placeholder.fadeOut("fast", function() { //$(this).attr("src", href).fadeIn("fast"); //}); return false; }); if ($("#checkout-2-form").length) { $("#checkout-2-form").validate(); $("input#phone").mask("(999) 999-9999"); $("input#zip").mask("99999"); $("input#shipping_zip").mask("99999"); var creditcard = $("#credit_card_number").mask("9999 9999 9999 9999"); $("#payment_type").change( function() { switch ($(this).val()){ case 'American Express': creditcard.unmask().mask("9999 999999 99999"); break; default: creditcard.unmask().mask("9999 9999 9999 9999"); break; } } ); } }); function ame_hideHero(theSlide, theDir) { var newLeft; if (theDir == "next") { newLeft = "-1000px"; } else if (theDir == "previous") { newLeft = "1000px"; } $(theSlide).animate({ "left": newLeft }, { "duration": "slow" }); } function ame_showHero(theSlide, theDir) { var newLeft; if (theDir == "next") { newLeft = "1000px"; } else if (theDir == "previous") { newLeft = "-1000px"; } $(theSlide).css({"left": newLeft}); $(theSlide).animate({ "left": 0 }, { "duration": "slow" }); } function home_clickNextHero(e) { clearInterval(window.heroInterval); home_showNextHero(e); } function home_showNextHero(e) { var currSlide = window.currHeroSlide++; var nextSlide = window.currHeroSlide; if (nextSlide > window.numHeroSlides) { nextSlide = 1; window.currHeroSlide = 1; } ame_hideHero("#slide-" + currSlide, "next"); ame_showHero("#slide-" + nextSlide, "next"); } function home_clickPreviousHero(e) { clearInterval(window.heroInterval); home_showPreviousHero(e); } function home_showPreviousHero(e) { var currSlide = window.currHeroSlide--; var nextSlide = window.currHeroSlide; if (nextSlide < 1) { nextSlide = window.numHeroSlides; window.currHeroSlide = window.numHeroSlides; } ame_hideHero("#slide-" + currSlide, "previous"); ame_showHero("#slide-" + nextSlide, "previous"); } function showInfo(dudeInfo) { $(".info").fadeOut(); /* $(".info span").css({visibility:"hidden"}); */ $(dudeInfo).fadeIn(100); } function clickName(e) { var theDude = $(this).attr("id"); $("ol#scroll-groove li.current").removeClass("current"); $(this).addClass("current") if (theDude == "clark") { $("#image-box").animate({ left: "0px" }, window.slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } if (theDude == "ben") { $("#image-box").animate({ left: "-150px" }, window.slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } if (theDude == "rob") { $("#image-box").animate({ left: "-430px" }, window.slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } if (theDude == "liz") { $("#image-box").animate({ left: "-760px" }, slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } if (theDude == "maria") { $("#image-box").animate({ left: "-1000px" }, window.slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } if (theDude == "andy") { $("#image-box").animate({ left: "-1250px" }, window.slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } if (theDude == "chad") { $("#image-box").animate({ left: "-1500px" }, window.slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } if (theDude == "ryan") { $("#image-box").animate({ left: "-1800px" }, window.slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } if (theDude == "jeremy") { $("#image-box").animate({ left: "-2100px" }, window.slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } if (theDude == "jan") { $("#image-box").animate({ left: "-2325px" }, window.slideDuration, 'easeOutBack', function() { showInfo("#" + theDude + "-info"); }); } }