//var ajaxPath_OrderToolBar = "OrderToolBarService.aspx";
var ajaxPath_OrderToolBar = "http://odo.jd.com/order/toolbar_";
//var ajaxPath_OrderToolBar = "toolbar_";
var ajaxPath_OrderToolBar_net = "http://buy.jd.com/Service/OrderToolBarService.aspx";
var OrderToolBar_jd2008web="http://jd2008.jd.com/"; 
var OrderToolBar_tuikuanUrl="http://mymoney.jd.com/refund/refundSubmit?orderId=";
var OrderToolBar_fanxiuUrl="http://myjd.jd.com/repair/ordersearchlist.action?searchString=";

var serverType="java";//切换 整个系统
var typeDefer="off";//切换 延期自提
var typeSplit="off";//切换 有货先发
var typeConfirm = "off";//切换 确认收货

var typeDefer_url="";// 延期自提
var typeSplit_url="";// 有货先发
var typeConfirm_url= "";// 确认收货

var cancelOrderConfirmText = "您确定要取消该订单吗？";
//获得ToolBar
document.domain='jd.com';

function setServerUrl(actionName){
	if(serverType!='net'){
		serverUrl=ajaxPath_OrderToolBar+actionName;
	}else{
		serverUrl=ajaxPath_OrderToolBar_net;
	}
	
	typeDefer_url=serverUrl;// 延期自提
    typeSplit_url=serverUrl;// 有货先发
    typeConfirm_url= serverUrl;// 确认收货

	if(typeDefer!='off' && ((actionName == 'getDeferDate') || (actionName='deferOrder'))){
			if(typeDefer=='java'){
				typeDefer_url=ajaxPath_OrderToolBar+actionName;
			}else if(typeDefer=='net'){
				typeDefer_url=ajaxPath_OrderToolBar_net;
			}
	}
	if(typeSplit!='off' && ((actionName == 'confirmGetOrderTask') || (actionName='confirmSplitOrderTask'))){
			if(typeSplit=='java'){
				typeSplit_url=ajaxPath_OrderToolBar+actionName;
			}else if(typeSplit=='net'){
				typeSplit_url=ajaxPath_OrderToolBar_net;
			}
	}
	if(typeConfirm!='off' && (actionName == 'confirmDeliver')){
			if(typeConfirm=='java'){
				typeConfirm_url=ajaxPath_OrderToolBar+actionName;
			}else if(typeConfirm=='net'){
				typeConfirm_url=ajaxPath_OrderToolBar_net;
			}
	}
};
function GetToolbar1(orderId) {
	setServerUrl();
    $.ajax({
        type: "GET",
        url: serverUrl,
        data: {orderid: escape(orderId) },
        dataType: "jsonp",
        success: function(result) {
            if (result.html)
                $(".toolbar").html(result.html);
        },
        error:function(){
        	alert(2);
        }
    });
};

function GetToolbar(orderId) {
                 $.ajax({
			        type: "GET",
			        url: ajaxPath_OrderToolBar+'showOrderToolBar',
			        data: {action:"showOrderToolBar",orderid:orderId},
			        dataType: "jsonp",
			        success: function(json) {
			            if (json.html)
			                $(".toolbar").html(json.html);
			        }
			    });
};
function GetCancelToolbar(orderId) {
	setServerUrl('shwoCancelOrderButtn');
    $.ajax({
        type: "GET",
        url: serverUrl,
        data: {action: "ShwoCancelOrderButtn",orderid: escape(orderId) },
        dataType: "jsonp",
        success: function(result) {
            if (result.html)
                $(".CancelToolBar").html(result.html);
        }
    });
};
//解锁订单
function UnlockOrder(orderId) {
	setServerUrl('unlockOrder')
    if (orderId > 0) {
        $.ajax({
            type: "GET",
            url: serverUrl,
            data: {action: "unlockOrder",orderid: orderId },
            dataType: "jsonp",
            success: function(result) {
                if (result.html) {
                    alert(result.html);
                    window.location.reload();
                }
            }
        });
    }
};
//取消订单
function CancelOrder(orderId, key) {
    if (orderId > 0 && key) {
    	$.ajax({                
    		type: "GET",
            url: ajaxPath_OrderToolBar+'preCancelOrder',
            data: {action: "preCancelOrder",orderid: orderId , key: key },
            dataType: "jsonp",
            success: function(result) {
            	if (result.html){
            		cancelOrderConfirmText = result.html;
            	}
            	xianhuoCancelConfirm(orderId, key);
            }
        });
    }
};

function exeCancelOrder(orderId, key){
    jdThickBoxclose();
    $.ajax({
        type: "GET",
        url: ajaxPath_OrderToolBar+'cancelOrder',
        data: {action: "cancelOrder",orderid: orderId , key: key },
        dataType: "jsonp",
        success: function(result) {
            if (result.html && result.html == "0") {
                $.jdThickBox({
                    title: "取消成功",
                    type: "iframe",
                    source: "http://market.jd.com/jdvote/vote1.aspx?voteId=64&ruleid=" + orderId + "&key=" + key + "&showType=window",
                    width: 640,
                    height: 500
                }, function(url, obj) {
                    $.ajax({
                        url: url,
                        success: function(result) {
                            obj.html(result);
                        }
                    });
                });
            }
            else  if (result.html && result.html == "1"){ 
               XianHoCancle(orderId,key);
            }
             else  if (result.html && result.html == "2"){ 
               TuiKuanChuKuIng(orderId,key);
            }
             else  if (result.html && result.html == "3"){ 
               ChuKuTuiKuan(orderId,key);
            }
             else  if (result.html && result.html == "4") {
                $.jdThickBox({
                    title: "订单取消受理中",
                    type: "iframe",
                    source: "http://market.jd.com/jdvote/vote1.aspx?voteId=119&ruleid=" + orderId + "&key=" + key + "&showType=window",
                    width: 640,
                    height: 500
                }, function(url, obj) {
                    $.ajax({
                        url: url,
                        success: function(result) {
                            obj.html(result);
                        }
                    });
                });
            }
            else
                alert(result.html);
        }
    });
}
function XianHoCancle(orderId, key) {
setServerUrl('getCancleOrderVote');
 if (orderId > 0 && key) {
   $.jdThickBox({
        type: "ajax",
        width: 510,
        height: 390,
        title: "取消订单确认",
        source: serverUrl + "?action=getCancleOrderVote&orderid=" + escape(orderId)+"&key="+key+"&callback=?"
    }, function(url, obj, callback) {
        $.getJSON(url,function(json){
            if (json.data){
                obj.html(unescape(json.data));
                callback(); 
            }
        })
        
    });
   }
} 


 
function CanaleOrderOk(orderId, key) {
 setServerUrl('canaleOrderOk');
 if (orderId > 0 && key) { 
   $.jdThickBox({
        type: "ajax",
        width: 220,
        height: 110,
        title: "订单取消成功",
        source: serverUrl + "?action=canaleOrderOk&orderid=" + escape(orderId)+"&key="+key+"&callback=?"
    }, function(url, obj, callback) {
        $.getJSON(url,function(json){
            if (json.data){
                obj.html(unescape(json.data));
                callback(); 
            }
        })
        
    });
   }
} 
function TrueCanaleOrderOk(orderId, key) {
 setServerUrl('trueCanaleOrderOk');
 if (orderId > 0 && key) { 
   $.jdThickBox({
        type: "ajax",
        width: 500,
        height: 150,
        title: "订单取消受理中...",
        source: serverUrl + "?action=trueCanaleOrderOk&orderid=" + escape(orderId)+"&key="+key+"&callback=?"
    }, function(url, obj, callback) {
        $.getJSON(url,function(json){
            if (json.data){
                obj.html(unescape(json.data));
                callback(); 
            }
        })
        
    });
   }
} 




function TrueCanaleOrder(orderId,key){
	   setServerUrl('trueCanaleOrder');
       if (orderId > 0 && key) {
           $.ajax({
                type: "GET",
                url: serverUrl,
                data: {action: "trueCanaleOrder",orderid: orderId },
                dataType: "jsonp",
                success: function(result) {
                    if (result.html && result.html == "1") {
                        TrueCanaleOrderOk(orderId,key);
                         
                    }
                    else
                        alert(result.html);
                }
            });
        }
}
 
//取消订单
function CancelOrderTuiKuan(orderId, key) {
	if (orderId > 0 && key) { 
            $.ajax({
                type: "GET",
                url: ajaxPath_OrderToolBar+'getCancelOrderTuiKuan',
                data: {action: "getCancelOrderTuiKuan",orderid: orderId , key: key },
                dataType: "jsonp",
                success: function(result) {
                    if (result.html && result.html == "1"){ 
                       //TuiKuanChuKuIng(orderId,key);
                       if(result.text){
                    	   cancelOrderConfirmText=result.text;
                       }
                       tuikuanCancelConfirm(orderId,key);
                    }
                     else  if (result.html && result.html == "2"){ 
                       //ChuKuTuiKuan(orderId,key);
                       if(result.text){
                      	   cancelOrderConfirmText=result.text;
                       }
                       chukuCancelConfirm(orderId,key);
                    }
                    else
                        alert(result.html);
                }
            });
        }
     
};
function TuiKuanChuKuIng(orderId, key) {
 if (orderId > 0 && key) {
 var html="<div class=\"m mrefund\"><div class=\"mc\"><s class=\"icon-warn03\"></s>";
 html+="<div class=\"fore\"><h3 class=\"ftx-04\">您的订单"+orderId+"已支付，是否确认申请退款？</h3>";
 html+="</div></div><div class=\"btns\"><a href="+OrderToolBar_tuikuanUrl+orderId+" class=\"btn btn-6\"><s></s>确定</a><a href=\"#\" class=\"btn btn-10\"  onclick=\"jdThickBoxclose();\"><s></s>关闭</a></div></div>";
    $.jdThickBox({
        type: "text",
        title: "申请退款确认",
        width: 450,
        height: 150,
        source: html,
        _autoReposi: true
    });
    }
}
function ChuKuTuiKuan(orderId, key) {
 if (orderId > 0 && key) {
 var html="<div class=\"m mrefund\"><div class=\"mc\"><p class=\"ac\">该订单商品已出库，请选择订单签收状态进行下一步操作。</p></div>";
 html+="<div class=\"btns\"><a href="+OrderToolBar_tuikuanUrl+orderId+"  class=\"btn btn-10\"><s></s>订单未签收</a><a href="+OrderToolBar_fanxiuUrl+orderId+" class=\"btn btn-10\"><s></s>订单已签收</a></div></div>";
    $.jdThickBox({
        type: "text",
        title: "申请退款确认",
        width: 450,
        height: 150,
        source: html,
        _autoReposi: true
    });
    }
}
//
function CancelOrderEasyBuy(orderId, key) {
   CancelOrder(orderId,key);
}; 
function voteSuc_default() {
    location.href = "http://www.jd.com.com/";
}
function voteSuc_64() {
	location.href = OrderToolBar_jd2008web+"JdHome/OrderList.aspx";
}
function closeVote() {
	location.href = OrderToolBar_jd2008web+"JdHome/OrderList.aspx";
}
//获得延期时间
function GetDeferDate(orderId) {
	setServerUrl('getDeferDate');
    if (orderId > 0) {
        $.ajax({
            type: "GET",
            url: typeDefer_url,
            data: {action: "getDeferDate",orderid: orderId },
            dataType: "jsonp",
            success: function(result) {
                if (result) {
                	if (result.deferdate) {
                        var dateArray = result.deferdate;
                        var str = "<select id='sele'>";
                        for (var i = 0; i < dateArray.length; i++) {
                            var dt = new Date(dateArray[i]);
                            var s = dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-" + dt.getDate();
                            str += "<option value='" + s + "'>" + s + "</option>";
                        }
                        str += "</select><input type='button' id='deferBtnSubmit' value='申请延期' onclick='DeferOrder(" + orderId + ");'/>";
                        $("#defer_item").html(str);
                        showTip3('#ddyq');
                    }else if(result.html){
                    	alert(result.html);
                    }
                }
            },
            error:function(){
            	alert("访问异常");
            }
        });
    }
};
//延期自提
function DeferOrder(orderId) {
	setServerUrl('deferOrder');
    if (orderId > 0) {
        $.ajax({
            type: "GET",
            url: typeDefer_url,
            data: {action: "deferOrder",orderid: orderId, date: $("#sele").val() },
            dataType: "jsonp",
            success: function(result) {
                if (result.html) {
                    alert(result.html);
                    window.location.reload();
                }
            }
        });
    }
}
//先款订单确认收货
function ConfirmDeliver(orderId) {
	setServerUrl('confirmDeliver');
    if (orderId > 0) {
        if (confirm("如果您已收到货物请确认收货，如果您还没收到货物请取消。")) {
            $.ajax({
                type: "GET",
                url: typeConfirm_url,
                data: {action: "confirmDeliver",orderid: orderId },
                dataType: "jsonp",
                success: function(result) {
                    if (result.html) {
                        alert(result.html);
                        $("#btn_ConfirmDeliver").hide();
                    }
                }
            });
        }
    }
}

// -------------------
//我的京东支持
var jsonServiceUrl = OrderToolBar_jd2008web+"purchase/orderflowservice.aspx";
function g(objId) {
    return document.getElementById(objId);
}
function showTip3(proobj) {
	var display4 = false;
    var TipDivW = $(proobj).width();
    var TipDivH = $(proobj).height();
    var TipDiv = $("<div id='c04tip' style='z-index:20000000;position:absolute;width:" + eval(TipDivW + 5) + "px;height:" + eval(TipDivH + 5) + "px;'><div style='position:absolute;margin:5px 0 0 5px;width:" + TipDivW + "px;height:" + TipDivH + "px;background:#BCBEC0;z-index:20001;'></div></div>")
    if (display4 == false) {
        TipDiv.append($(proobj));
        $(document.body).prepend(TipDiv);
        $(proobj).show();
        display4 = true;
    } else {
        $("#c04tip").show();
    }
    $("#c04tip").css({ top: parseInt(document.documentElement.scrollTop + (document.documentElement.clientHeight - $("#c04tip").height()) / 2) + "px", left: (document.documentElement.clientWidth - $("#c04tip").width()) / 2 + "px" })
    $("#Tip_apply,#Tip_continue,.Tip_Close").click(function() {
        $("#c04tip").fadeOut();
    });
}

//解锁
function unLockOrder(orderId) {

    var js = document.createElement('script');
    js.type = 'text/javascript';
    js.src = jsonServiceUrl + '?roid=' + Math.random() + '&action=unLockOrder&orderId=' + orderId;
    document.getElementsByTagName('head')[0].appendChild(js);

}
function unLockOrder_callback(obj) {

    if (obj != null) {
        if (obj.json.length == 0) {
            alert('解锁失败！'); return;
        } else {

            if (obj.json[0].result == "0") {
                alert(obj.json[0].message);
                return;
            }
            if (obj.json[0].result == "1") {
                alert(obj.json[0].message);
                window.location.reload();
            }

        }
    }
}
//合并
function combinOrder(orderId, combineUrl) {
    var js = document.createElement('script');
    js.type = 'text/javascript';
    // js.src = jsonServiceUrl + '?roid=' + Math.random() + '&action=GetCanCombinByOrderId&orderId=' + orderId;
    js.src = combineUrl;
    document.getElementsByTagName('head')[0].appendChild(js);
}
function combin_callback(obj) {

    if (obj) {
        if (obj.json.length == 0) {
            alert('操作失败！'); return;
        } else {
            if (obj.json[0].result != null) {
                alert(obj.json[0].message);
                return;
            }
            if (obj.json.length == 1) {
                alert('没有订单可以与之合并！');
                return;
            }
            var html = "<table width='100%' cellpadding='0' cellspacing='0' class='table_1'>";
            html += "<tr>";
            html += "<th width='10%'>&nbsp;</th>";
            html += "<th width='15%'>编号</th>";
            html += "<th width='15%'>收货人姓名</th>";
            html += "<th width='15%'>支付方式</th>";
            html += "<th width='15%'>下单时间</th>";
            html += "<th width='17%'>状态</th>";
            html += "<th>金额</th>";
            html += "</tr>";

            html += "<tr bgcolor='#FCEA89'>";
            html += "<td width='10%'><strong>主订单</strong></td>";
            html += "<td width='15%'><span id='mainOrderId'>" + obj.json[0].OrderId + "</span></td>";
            html += "<td width='15%'>" + obj.json[0].Name + "</td>";
            html += "<td width='15%'>" + obj.json[0].Payment + "</td>";
            html += "<td width='15%'>" + obj.json[0].Date + "</td>";
            html += "<td width='17%'>" + obj.json[0].State + "</td>";
            html += "<td><font color='#FF6600'>" + obj.json[0].Price + "</font></td>";
            html += "</tr>";
            html += "</table>";
            g("combin_main").innerHTML = html;
            html = "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" class=\"table_1\">";
            for (var i = 1; i < obj.json.length; i++) {
                html += "<tr>";
                html += "<td width='10%'><input name='chk_combinItem' type='checkbox' value='" + obj.json[i].OrderId + "' onclick='setCombinLink();' /></td>";
                html += "<td width='15%'>" + obj.json[i].OrderId + "</td>";
                html += "<td width='15%'>" + obj.json[i].Name + "</td>";
                html += "<td width='15%'>" + obj.json[i].Payment + "</td>";
                html += "<td width='15%'>" + obj.json[i].Date + "</td>";
                html += "<td width='17%'>" + obj.json[i].State + "</td>";
                html += "<td><font color='#FF6600'>" + obj.json[i].Price + "</font></td>";
                html += "</tr>";
            }
            g("combin_item").innerHTML = html;
            showTip3('#hbdd');
        }
    }
}
function setCombinLink() {
    var items = document.getElementsByName('chk_combinItem');
    var checkedIds = "";
    for (var i = 0; i < items.length; i++) {
        if (items[i].checked) {
            checkedIds += items[i].value + ",";
        }
    }
    if (checkedIds == "") {
        g("combinBtn").href = "javascript:alert('请选择要合并的订单！')";
        g("combinBtn").target = '_self';
    } else {
        g("combinBtn").href = jsonServiceUrl + "?action=combinOrderByUser&mainOrderId=" + g('mainOrderId').innerHTML + "&orderid=" + checkedIds;
        g("combinBtn").target = '_blank';
    }
}

//拆单完成提示
function ConfirmExecuteSpilOrder(orderId) {
    /*
    ExecuteSplitOrder(orderId);
    jdThickBoxclose();
    $.jdThickBox({
        type: "text",
        width: 500,
        height: 100,
        title: "用户确认",
        source: "申请成功！<br />由于数据延迟，您会在1-2分钟后在订单列表页面看到拆分后的订单，请您耐心等待。"
    });
    */
	setServerUrl('confirmSplitOrderTask');
    var url = serverUrl + "?action=confirmSplitOrderTask&orderid=" + orderId+ "&callback=?"
    $.getJSON(url, function(json) {
        if (json.data) {
            jdThickBoxclose();
            $.jdThickBox({
                type: "text",
                width: 500,
                height: 100,
                title: "用户确认",
                source: unescape(json.data)
            });
        }
    });

}

///显示拆单内容
function ShowSplitOrderManage(orderId,key) {
	setServerUrl('confirmGetOrderTask');
    $.jdThickBox({
        type: "ajax",
        width: 500,
        height: 200,
        title: "提示",
        source: serverUrl + "?action=confirmGetOrderTask&orderid=" + escape(orderId)+ "&key=" + key +"&callback=?"
    }, function(url, obj,callback) {
        $.getJSON(url,function(json){
            if (json.data){
                obj.html(unescape(json.data));
                callback();
                var h1 = obj.height(), h2 = obj.parent().height(), h3 = $(".separate-order").height();
                obj.height(h3);
                obj.parent().height(h2 - h1 + h3);
            }
        })
        
    });
}

function ExecuteSplitOrder(orderId) {
	setServerUrl('confirmGetOrderTask');
    var url = serverUrl + "?action=confirmGetOrderTask&orderid=" + orderId + "&callback=?"
    $.getJSON(url, function(json) {
        if (1111) {
            $(".toobar").html(unescape(json.data));
            // setTimeout("closeVote()", 5000);
        }
    });
}
function GoToOrderList() {
    location.href = OrderToolBar_jd2008web+"JdHome/OrderList.aspx";
}
 
//关闭当前页
function closeme(){ 
var browserName=navigator.appName; 
 if (browserName=="Netscape") {
  window.open('','_parent',''); window.close(); 
  }else if (browserName=="Microsoft Internet Explorer") {
   window.opener = "whocares"; window.close();
    }
 }
 
 
 
  function questionSubmit()
    {
        var i = 0;
        var j=0;
        var x = 0;
        var y = 0;
        var z = 0;
        var n = 0;
        var messages = '';
        var radiov ;  //问卷文本框
        var radiovs;
        var radio;    //单选
        var radios;   //单选组
        var radioq;   //问题文本框
        var radioqs;
        
        var checks ;
        var checkboxs;
        
        var hischeck ;
        var hcountf;
        var hischeckvalue;
        var hcountfvalue;
        
        var htitle;
        var htitlecontent;
        
        for(i=0;i<30;i++)
        { 
            
            radiov = 'radiov'+i;
            //radioq = 'radioq'+i;
            //checks = 'checkbox'+i;
            htitle = 'htitle'+i;
            hischeck = 'hischeck'+i;
            hcountf = 'hcountf'+i;
            
            if(document.getElementById(hischeck) != null) //判断问题的是否必选隐藏
            {
                hischeckvalue = document.getElementById(hischeck).value;  //得到是否必选的值
                if(hischeckvalue != '' && hischeckvalue == '1')              //判断是否是必选
                {
                    if(document.getElementById(hcountf) != null)          //判断必选下面的比选项的编号值是否存在
                    {
                        hcountfvalue = document.getElementById(hcountf).value;
                        radio = 'radio_option'+hcountfvalue;
                        if(document.getElementsByName(radio) != null)
                        {
                            radios = document.getElementsByName(radio);
                            if(radios.length > 0)
                            {
                                y = 0;
                                y = y+1;
                                for(j=0;j<radios.length;j++)
                                {
                                    if(radios[j] != undefined)
                                    {
                                        if(radios[j].checked)
                                        {
                                           y = y-1;
                                           break;  
                                        } 
                                    } 
                                }
                                if(y > 0)
                                {
                                    if(document.getElementsByName(htitle) != null)
                                    {
                                        messages =messages+ document.getElementById(htitle).value+'\n';
                                        //return false;
                                    }
                                }
                                
                            }
                        }
                        
                    }
                }
            }
            //判断复选必选项
            if(document.getElementById(hischeck) != null)
            {
                 hischeckvalue = document.getElementById(hischeck).value;
                 if(hischeckvalue != '' && hischeckvalue == '1')              //判断是否是必选
                 {
                     hcountfvalue = document.getElementById(hcountf).value;
                     checkboxs = 'checkbox'+hcountfvalue;
                     if(document.getElementsByName(checkboxs) != null)
                     {
                        checks = document.getElementsByName(checkboxs);
                        if(checks.length > 0)
                        {
                            x = 0;
                            x = x+1;
                             for(n=0;n<checks.length;n++)
                             {
                                if(checks[n] != undefined)
                                {
                                    if(checks[n].checked)
                                    {
                                      x = x-1;
                                       break;  
                                    } 
                                } 
                             }
                             if(x > 0)
                             {
                                messages = messages + document.getElementById(htitle).value+'\n';
                             }
                        }
                     }
                 }
            }
            
            
            
             //判断问题文本必填项
             //debugger
            if(document.getElementById(hischeck) != null)
            {
                 hischeckvalue = document.getElementById(hischeck).value;
                 if(hischeckvalue != '' && hischeckvalue == '1')              //判断是否是必选
                 {
                     hcountfvalue = document.getElementById(hcountf).value;
                     radioq = 'radioq'+hcountfvalue;
                     if(document.getElementById(radioq) != null)
                     {
                         if(document.getElementById(radioq).value == '')
                         {
                            messages = messages + document.getElementById(htitle).value+'\n';
                         }
                     }
                 }
            }
        }
        if(messages != '')
        {
            messages = messages + '为必填项';
            alert(messages);
            return;
        }

 


 
    }
    var openSuitList="";
    
    function setSuitShows(suitId,style)
    {
    questionSubmit();
       if(g('txt'+suitId)==null){return;}
       if(style == 0)
       {
             g('txt'+suitId).style.display='none';
       }
       else
       {
            g('txt'+suitId).style.display='';
       }
    }
    
    function setSuitShowcheck(suitId,style)
    {
       if(g('txtcheck'+suitId)==null){return;}
       
       if(g('txtcheck'+suitId).style.display=='none')
        {
          if(openSuitList.indexOf(suitId)<0)
          {
             openSuitList+=suitId;
          }
          g('txtcheck'+suitId).style.display='';
        
       }else
       {
          openSuitList=openSuitList.replace(suitId,'');
          g('txtcheck'+suitId).style.display='none';
         
       }
    }
    
     function questionSubmitGo(orderid,key)
        {
        try{
            document.domain='jd.com';
            var voteid=64,ruleid=orderid;
            var data =   $("#form1Vote").serialize();          
            $.getJSON("http://market.jd.com/jdvote/SubmitVote.aspx?voteid=" + voteid + "&ruleid=" + ruleid+ "&r=" + Math.random()+"&m=submitvote&callback=?",data,
            function(json){     
                    if (json) {  
                                var obj = eval(json); 
                                if (obj.flag) 
                                     TrueCanaleOrder(orderid,key);  
                                else
                                {
                                    alert(obj.msg);
                                }                    
                            }
                    
            });  
            }
            catch(e){
            TrueCanaleOrder(orderid,key);  
            }        
        }  
     
     function questionSubmitGoJava(orderid)
        {
        try{
            document.domain='jd.com';
            var voteid=64,ruleid=orderid;
            var key = $("#tb_cancleOrderVote_key").val();
            var data =   $("#form1Vote").serialize();          
            $.getJSON("http://market.jd.com/jdvote/SubmitVote.aspx?voteid=" + voteid + "&ruleid=" + ruleid+ "&r=" + Math.random()+"&m=submitvote&callback=?",data,
            function(json){     
                    if (json) {  
                                var obj = eval(json); 
                                if (obj.flag) 
                                     TrueCanaleOrder(orderid,key);  
                                else
                                {
                                    alert(obj.msg);
                                }                    
                            }
                    
            });  
            }
            catch(e){
            TrueCanaleOrder(orderid,key);  
            }     
        }
     
function RemindTheSellerShipped(orderId,key) {
	setServerUrl('remindTheSellerShipped');
        $.ajax({
            type: "GET",
            url: serverUrl,
            data: { action: "RemindTheSellerShipped", orderid: orderId , key: key },
            dataType: "jsonp",
            success: function(result) {
                if (result.html) {
                 $("#btn_SellerShipped").hide();
                    alert(result.html); 
                }
            }
        });
};

function modifyOrder(url){
	//var orderId = $("#orderId").val();
	$.jdThickBox({
		type: "iframe",
		width: 658,
		height: 490,
		source: url,
		title: "订单修改",
		_close_val: "×",
		_titleOn: true
	});
}

//先货取消确认
function xianhuoCancelConfirm(orderId,key){
	$.jdThickBox({
		type: "text",
		width: 320,
		height: 150,
		source: "<div class=\"m flex-quan\"><div class=\"mc\"><s class=\"icon-warn02\"></s><div class=\"fore\"><h3 class=\"ftx-04\">您确定要取消订单么？</h3><p class=\"ftx-03\">提示："+cancelOrderConfirmText+"</p></div></div><div class=\"btns\"><a href=\"#\" class=\"btn btn-11\" onclick=\"exeCancelOrder("+orderId+",'"+key+"');\"><s></s>确定</a><a href=\"#\" class=\"btn btn-11\" onclick=\"jdThickBoxclose();\"><s></s>关闭</a></div></div>",
		title: "申请取消确认",
		_close_val: "×",
		_titleOn: true,
		_fastClose: false
	});
}
//退款前确认
function tuikuanCancelConfirm(orderId,key){
	if (orderId > 0 && key) {
		$.jdThickBox({
		    type: "text",
		    width: 400,
		        height: 150,
		      source: "<div class=\"m flex-quan\"><div class=\"mc\"><s class=\"icon-warn02\"></s><div class=\"fore\"><h3 class=\"ftx-04\">您的订单"+orderId+"已支付，是否确认申请退款？</h3><p class=\"ftx-03\">提示："+cancelOrderConfirmText+"</p></div></div><div class=\"btns\"><a href=\""+OrderToolBar_tuikuanUrl+orderId+"\" class=\"btn btn-11\"><s></s>确定</a><a href=\"#\" class=\"btn btn-11\" onclick=\"jdThickBoxclose();\"><s></s>关闭</a></div></div>",
		    title: "申请退款确认",
		    _close_val: "×",
		    _titleOn: true,
		    _fastClose: false
		});
	}
}
//已出库商品 取消前确认
function chukuCancelConfirm(orderId,key){
	if (orderId > 0 && key) {
		$.jdThickBox({
			type: "text",
			width: 390,
			height: 150,
			source: "<div class=\"m flex-quan01\"><div class=\"mc\"><div class=\"fore\"><h3>该订单商品已出库，请选择订单签收状态进行下一步操作。</h3><p class=\"ftx-03\">提示："+cancelOrderConfirmText+"</p></div></div><div class=\"btns\"><a href=\""+OrderToolBar_tuikuanUrl+orderId+"\" class=\"btn btn-11\"><s></s>订单未签收</a><a href=\""+OrderToolBar_fanxiuUrl+orderId+"\" class=\"btn btn-11\"><s></s>订单已签收</a></div></div>",
			title: "申请退款确认",
			_close_val: "×",
			_titleOn: true,
			_fastClose: false
		});
	}
}

