//打开购物车
function CartOpen(id, language) {
    var url = "Cart.aspx?id=" + id + "&Language=" + language;
    var features = "width=" + screen.width - 100 + ",height=" + screen.height / 2 + ",scrollbars=yes,resizable=yes"
    var features = "width=700,height=500,scrollbars=yes,resizable=yes"
    var cartWindow = window.open(url, "cart", features, true);
    cartWindow.focus();
    //cartWindow.moveTo(0,0) 
    //cartWindow.resizeTo(screen.width-40, screen.height-200) 
    return false;
}
function CartLink(id, language) {
    var url = "Cart.aspx?id=" + id + "&Language=" + language;
    var features = "width=" + screen.width - 100 + ",height=" + screen.height / 2 + ",scrollbars=yes,resizable=yes"
    var features = "width=700,height=500,scrollbars=yes,resizable=yes"
    var cartWindow = window.open(url, "cart", features, true);
    cartWindow.focus();
}
//提交订单页模拟回发
function DeliverySubmit(cmd) {
    var hiddenField = document.getElementById("DeliverySubmitButtonSpan").getElementsByTagName("input")[1];
    hiddenField.value = "1";
    eval(cmd);
}
//提交订单页回发后还原单选的选择
function DeliveryRadiochecked() {
    if (!(document.getElementById("DeliveryRepeaterTd") == null)) {
        var deliveryRadio = document.getElementById("DeliveryRepeaterTd").getElementsByTagName("input");
        var hiddenFieldStr = document.getElementById("DeliverySubmitButtonSpan").getElementsByTagName("input")[1].value;

        for (var i = 0; i < deliveryRadio.length; i++) {
            if (deliveryRadio[i].value == hiddenFieldStr) {
                deliveryRadio[i].checked = true;
                return;
            }
        }
    }
}
//提交信息之前设置标识
function MessageSubmit() {
    if (!(document.getElementById("messageSubmitSpan") == null)) {
        var isMessageSubmit = document.getElementById("messageSubmitSpan").getElementsByTagName("input")[0];
        isMessageSubmit.value = 1;
    }
}
//加入收藏
function AddFavorite() {
    var sTitle = document.title;
    var sURL = document.location.href;
    try {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e) {
        try {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e) {
        }
    }
}
$(function() {
    $(".shanrui").show();
});
