    var shopLocation = "shop/";
    function cartAction(itemId, action) {
        $.post("/shop/cart",{
            id: itemId,
            action: action},
            function(xml) {
                var status = updateCart(xml);
                $('#cartmessage').css('display','none');
                $('#cartAddItem').css('display','none');
                $('#cartRemoveItem').css('display','none');
                $('#itemAlreadyInCart').css('display','none');
                if(status == 1) {
                    if(action == "addItem") {
                        $('#cartAddItem').css('display','');
                    } else if(action == "removeItem") {
                        $('#cartRemoveItem').css('display','');
                    }
                } else {
                    $('#itemAlreadyInCart').css('display','');
                }
        });
    }

    function updateCart(xml) {
        if($("status",xml).text() == "-1") return -1;
        count = $("itemscount",xml).text();
        total = $("total",xml).text();
        var html = "";
        var itemId, itemName, itemPrice;
        if(total > 0) {
          html += "<div class=\"cart box round\" style=\"width:97%;\">";
          html += "<table>";
          $("result",xml).each(function(id) {
              result = $("result",xml).get(id);
              itemId = $("itemId",result).text();
              itemPrice = $("itemPrice",result).text();
              itemName = $("itemName",result).text();
              html += "<tr>";
              //html += "  <td><a href=\"" + shopLocation + itemId + "\">" + itemName + "</a></td>";
              html += "  <td>" + itemName + "</td>";
              html += "  <td>$" + itemPrice + "</td>";
              html += "  <td><a href=\"javascript:cartAction(" + itemId + ", 'removeItem')\"><img src=\"/images/icons/silk/cart_delete.png\" alt=\"Delete\" title=\"Delete\" /></a></td>";
              html += "</tr>";
          });
          html += "</table>";
          html += "<p align=\"right\" class=\"total\";\">Total: <strong>$" + total + "</strong> USD</p>";
          $('#cartcheckout').css('display','');
        }
        $('#cartcontent').html(html);
        return 1;
    }

