﻿function PurchaseComplete(result)
{
    var obj = jQuery.parseJSON(result.get_data());
    $('#cart-status-container').fadeIn();
    notify(obj.Text);
}

function notify(html)
{
    $("#content-target").html(html);
    
    $("#notification-banner")
    .slideDown("fast")
    .animate({ opacity: 1.0 }, 3000)
    .slideUp("fast");
}

function removeCartItem(result)
{
    var obj = jQuery.parseJSON(result.get_data());
   
    $(this).animate({
        left: "-100px"
    }, "normal");

    $(this).parents("tr").animate({
        opacity: 0
    }, "slow", function() { $(this).remove(); });

    $("#sub-total").html(obj.TotalAmount)
    .effect("highlight", {}, "slow");
}

function hideShowPaTotal(state)
{
    if (state == 'PA')
    {
        $("#TAWithoutPA").hide();
        $("#TAWithPA").show();
    }
    else
    {
        $("#TAWithoutPA").show();
        $("#TAWithPA").hide();
    }
}
