/* * FUNCTIONS */ /* * INIT */ $(document).ready( function() { // Slider front $("#innerSlide").cycle({ fx: 'fade', speed:1800, timeout:10000, next:'.next', prev:'.prev', random:false, //pager: '#nav' delay: -5000 }); $("#slider").find(".prev").bind("click",function(){ $("#innerSlide").cycle("pause"); }); $('#messageStack').click(function() { $("#messageStack").hide(); }); $('#messageStack .closer').click(function() { $("#messageStack").hide(); }); $('#SignupPopup').click(function() { $("#authMessage").show(); $("#bgOverall").show(); }); $('#LoginPopup').click(function() { $("#authMessage").show(); $("#bgOverall").show(); $("#authWrapper #login").hide(); $("#authRegister").hide(); $("#authWrapper #register").show(); $("#authLogin").show(); $("#authPass").hide(); }); $('#authMessage span#closer').click(function() { $("#bgOverall").hide(); $("#authMessage").hide(); }); $('#authWrapper #login').click(function() { $("#authWrapper #login").hide(); $("#authRegister").hide(); $("#authWrapper #register").show(); $("#authLogin").show(); $("#authPass").hide(); }); $('#authWrapper #register').click(function() { $("#authWrapper #login").show(); $("#authRegister").show(); $("#authWrapper #register").hide(); $("#authLogin").hide(); $("#authPass").hide(); }); $('#authLogin #newpass').click(function() { $("#authLogin").hide(); $("#authPass").show(); }); $("#checkoutCart").mouseleave(function () { $("#checkoutCart").delay(100).fadeOut(500); }); $("#bagInfo").mouseleave(function () { $("#checkoutCart").delay(100).fadeOut(500); }); // Cart Contents events (show/hide) $("#overview").hoverIntent({ over: makeTall, out: makeShort }); $("#overview").mouseleave(function () { $("#checkoutCart").delay(100).fadeOut(500); }); $("#checkoutCart").mouseleave(function () { $("#checkoutCart").delay(100).fadeOut(500); }); // Style Pulldowns $('.styled').customStyle(); $('.inputText').each(function() { var default_value = this.value; $(this).focus(function(){ if(this.value == default_value) { this.value = ''; } }); $(this).blur(function(){ if(this.value == '') { this.value = default_value; } }); }); // checkout auth $('#checkoutShowLogin').click(function() { $("#checkoutData").hide(); $("#checkoutPassword").hide(); $("#checkoutLogin").show(); }); $('#checkoutShowCreateAccount').click(function() { $("#checkoutData").show(); $("#checkoutLogin").hide(); $("#checkoutPassword").hide(); }); $('#newpass').click(function() { $("#checkoutPassword").show(); $("#checkoutLogin").hide(); $("#checkoutData").hide(); }); $('#checkoutShowCreateAccount2').click(function() { $("#checkoutData").show(); $("#checkoutLogin").hide(); $("#checkoutPassword").hide(); }); // checkout comments $('#kommentar').click(function() { if ($('input[name=comment]').attr('checked')) { $('#comments').show("fast"); } else { $('#comments').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 $("#messageStack").click(function(){ $("#messageStack").slideToggle("slow", function(){ $(this).hide(); }); }); setTimeout(function(){ $("#messageStack").animate({ opacity: 0 }, 3000, function(){ $(this).hide(); }); },7000); }); function makeShort() {} function makeTall() {$("#checkoutCart").fadeIn(500);}