/* * FUNCTIONS */ /* * INIT */ $(document).ready( function() { // index benefits // $('#benefits h2').click(function() { // $("#benefits ul").show(); // }); $('.account #login .password').click(function() { $("#.account #password").show(); }); $("#contact a.email").each(function() { e = this.rel.replace("/#/","@"); this.href = "mailto:" + e; $(this).text(e); }); // checkout auth $('#checkoutLogin #newpass').click(function() { $("#checkoutPassword").show(); }); // checkout comments $('#comments').click(function() { if ($('input[name=comment]').attr('checked')) { $('#comments div').show("fast"); } else { $('#comments div').hide("fast"); } }); // checkout shipping $('#checkoutShipping ul').click(function() { if ($('#face2face').attr('checked')) { $('#face2faceAccount').show("fast"); } else { $('#face2faceAccount').hide("fast"); } }); // product listing preview of image_big screenshotPreview(); // closeCartMessage $("span#closer").click(function(){ $("#addtoCartMessage").animate({ opacity: 0 }, 500, function(){ $(this).hide(); }); $("#bgOverall").hide(); }); // fadeOutmessageStack $('#messages .closer').click(function() { $("#messages").hide(); }); $("#messages").click(function(){ $("#messages").animate({ opacity: 0 }, 1000, function(){ $(this).hide(); }); }); setTimeout(function(){ $("#messages").animate({ opacity: 0 }, 3000, function(){ $(this).hide(); }); },7000); $('.trigger').not('.trigger_active').next('.toggle').hide(); $('.trigger').click( function() { var trig = $(this); if ( trig.hasClass('trigger_active') ) { trig.next('.toggle').slideToggle('fast'); trig.removeClass('trigger_active'); } else { $('.trigger_active').next('.toggle').slideToggle('fast'); $('.trigger_active').removeClass('trigger_active'); trig.next('.toggle').slideToggle('fast'); trig.addClass('trigger_active'); }; return false; }); $('#submitOffer').click(function() { $("#submitOffer").hide(); $("#submitWait").show(); setTimeout(displaySubmitButton, 30000) }); function displaySubmitButton() { $("#submitOffer").show(); $("#submitWait").hide(); } }); function makeShort() {} function makeTall() {$("#checkoutCart").fadeIn(500);}