﻿/// <reference path="../jquery-1.5.1-vsdoc.js" />

//jshowoff available here: http://ekallevig.com/jshowoff/
$(document).ready(function () {

    $("#AddToCartWorkingIndicator").hide();

    $("form[action$='AddToCart']").submit(function (evt) {
        // we check the sku because this is built in the parts pages, if is empty bail out.
        var skuVal = $(this).children().filter('input:hidden').first().val();
        //var sku = document.getElementById("SKU").value;
        if (skuVal == "" || skuVal == undefined) {
            return false;
        }

        $("#AddToCartWorkingIndicator").show();
        $.post($(this).attr("action"), $(this).serialize(), function (response) {
            $("#cart").html(response);
            $("#AddToCartWorkingIndicator").hide();
        });
        return false; // so that the form does not submit in traditional way
    });


    $('#PromotionGallery').jshowoff({
        links: false,
        controls: false,
        effect: 'none',
        speed: 6000
    });

});


