﻿function AddToCart(id) {
    var url = ("CartHandler.ashx?action=AddToCart&auid=" + auid + "&data=" + id);
    $.ajaxSetup({ cache: false });
    $.getJSON(url, function (data) {
        if (data.IsSuccess != 'undefined' && data.IsSuccess == 'true')
            GoToCart();
    });
}

function ChangeButton(id) {
    var button = $("#productLink" + id).first();
    button.removeClass("addToCart");
    button.addClass("viewCart");
    button.attr("href", "Cart.aspx");
    GoToCart();
}

function GoToCart() {
    location.href = "Cart.aspx";
}
