<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>我的购物车-{aspcms:sitetitle}- Powered by {aspcms:version}</title>
    <meta name="Keywords" content="{aspcms:sortkeyword}">
    <meta name="Description" content="{aspcms:sortdesc}">
    <link rel="stylesheet" type="text/css" href="{aspcms:sitepath}/Templates/{aspcms:defaulttemplate}/css/metinfo_ui.css" id="metuimodule" data-module="3" />
    <link rel="stylesheet" type="text/css" href="{aspcms:sitepath}/Templates/{aspcms:defaulttemplate}/images/css/metinfo.css" />


    <link type="text/css" href="/css/order.css" rel="stylesheet" />
    <script type="text/javascript" src="/js/jquery.js"></script>
    <script type=text/javascript>
        // Navigation Menu
        $(function() {
            $(".menu ul").css({
                display: "none"
            }); // Opera Fix
            $(".menu li:first").addClass("homepage");
            $(".menu li").hover(function() {
                $(this).find('ul:first').css({
                    visibility: "visible",
                    display: "none"
                }).slideDown("normal");
            }, function() {
                $(this).find('ul:first').css({
                    visibility: "hidden"
                });
            });

            $("div.amount a.minus").click(function() {
                var vcount = document.getElementById(this.getAttribute("data"))
                if (Number(vcount.value) > 1) {
                    vcount.value = Number(vcount.value) - 1;
                    //$("#debug").html(vcount.selector);
                    changePrice(vcount, this.getAttribute("md"));
                }
            })
            $("div.amount a.plus").click(function() {
                var vcount = document.getElementById(this.getAttribute("data"))

                vcount.value = Number(vcount.value) + 1;
                //$("#debug").html(vcount.selector);
                changePrice(vcount, this.getAttribute("md"));
            })


        });

        // Bookmark
        function bookmark(title, url) {
            if (document.all)
                window.external.AddFavorite(url, title);
            else if (window.sidebar)
                window.sidebar.addPanel(title, url, "")

        }

    </SCRIPT>
    <script>
        String.prototype.startWith = function(str) {
            if (str == null || str == "" || this.length == 0 || str.length > this.length)
                return false;
            if (this.substr(0, str.length) == str)
                return true;
            else
                return false;
            return true;
        }
        String.prototype.endWith = function(s) {
            if (s == null || s == "" || this.length == 0 || s.length > this.length)
                return false;
            if (this.substring(this.length - s.length) == s)
                return true;
            else
                return false;
            return true;
        }


        function changePrice(input, id) {
            var curtotal = document.getElementById("curtotal" + id);
            var price = document.getElementById("price" + id);
            curtotal.innerHTML = input.value * price.innerHTML;

            changeall()


            var _url = "cartsession.asp?action=add2cart&proid=" + id + "&count=" + input.value + "&price=" + price.innerHTML;
            $.get(_url, false, function(html) {
                $("#debug").append(html);
            });

            //alert(_url)
        }

        function deleteItem(id, a) {
            var _url = "cartsession.asp?action=delete&proid=" + id
            $.get(_url, false, function(html) {
                //$("#debug").append(html);
            });

            var table = a.parentNode.parentNode.parentNode;
            var tr = a.parentNode.parentNode;
            $(table).remove($(tr).rowIndex);



            changeall()
        }

        function changeall() {

            var spans = $("em.value[id]");
            var alltotal = $("em#alltotal");
            var inputs = $("input.input[id]");
            var allcount = $("em#allcount");
            var t = 0,
                c = 0;
            for (var i = 0; i < spans.length; i++) {
                t += Number(spans.eq(i).html());
            }
            for (i = 0; i < inputs.length; i++) {
                c += Number(inputs[i].value);
            }

            alltotal.html(t);
            allcount.html(c);
        }

    </script>
</head>

<body>
    {aspcms:top}
    <div class="layer layer-guide">
        <div class="layout screen">
            <div class="mod mod-stage-forward">
                <div class="content">
                    <div class="unit-stage unit-stage-orange">
                        <ul class="list five-stage">
                            <li class="stage-node stage-first-current">
                                <div class="stage-label"> 我的购物车 </div>
                            </li>
                            <li class="stage-bar stage-bar-then">
                                <div class="stage-far"></div>
                            </li>
                            <li class="stage-node stage-then">
                                <div class="stage-label"> 确认订单信息 </div>
                            </li>
                            <li class="stage-bar stage-bar-then">
                                <div class="stage-far"></div>
                            </li>
                            <li class="stage-node stage-then">
                                <div class="stage-label"> 付款 </div>
                            </li>
                            <li class="stage-bar stage-bar-then">
                                <div class="stage-far"></div>
                            </li>
                            <li class="stage-node stage-then">
                                <div class="stage-label"> 确认收货 </div>
                            </li>
                            <li class="stage-bar stage-bar-then">
                                <div class="stage-far"></div>
                            </li>
                            <li class="stage-node stage-last-then">
                                <div class="stage-label"> 完成 </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layer layer-main">

        <!-- 购物车状态 -->
        {aspcms:cartlist}
    </div>

    <div class="layout screen">
        <div class="mod mod-help">
            <div class="content">
                <p> 去官方淘宝店购买，享受更多优惠！</p>
            </div>
        </div>
    </div>


    <div class="wrap list_wrap singel_wrap">
        <div class="column_m">
            <DIV class=" single" id=post-2>

                <!--content-->

                <!--content end-->

                <DIV class=clear></DIV>
            </DIV>
        </div>
        <div class="clearboth"></div>
    </div>
    {aspcms:foot}
</body>

</html>
