﻿document.domain = "519.com";

function chkNum(res) {
    if (isNaN(res)) {
        alert("只能输入数字！\nCan only enter a number!");
        $("#product_qut").attr("value", 1);
    }
    else
        if (res.trim().length > 2) {
        alert("最大只能是99瓶，大单货物请联系客服 +86-21-3617-4882\nMost only 99 bottles, large single-goods, please contact customer service +86-21-3617-4882");
        $("#product_qut").attr("value", 1);
    }

}
//读取评论相关信息
function getCommentSummary(pid) {
    $.getJSON("http://service.519.com/product/review.aspx?action=loadSummary&callback=?&productID=" + pid,
      function(summartResult) {
          var summary = summartResult.Summary;
          $("#totalCommentsNum").text(summary.PctTotal);
          $("#comments_all_number").text(summary.PctTotal + " ");

          $("#lblPctPos").css("width", summary.PctPositive + "%");
          $("#txtPctPosition").text(summary.PctPositive + "%");

          $("#lblPctNeutral").css("width", summary.PctNeutral + "%");
          $("#txtPctNeutral").text(summary.PctNeutral + "%");

          $("#lblPctNegative").css("width", summary.PctNegative + "%");
          $("#txtPctNegative").text(summary.PctNegative + "%");

          $("#comments_bar_loading").remove();
          $("#comments_bar").css("display", "inline");
          $(".comments_bg_p01_div02").css("display", "inline");
      })
}

function getComments(pid, mType) {
    $.getJSON("http://service.519.com/product/review.aspx?action=reviewList&callback=?&productID=" + pid + "&mType=" + mType + "&Language=ch",
      function(commentsResult) {
          $("#comments_body" + mType).html("");
          var comments = commentsResult.ReviewList;
          if (comments.length > 0) {
              $(comments).each(function() {
                  var comment = "<table width='100%' border='0' cellspacing='0' cellpadding='0' class='comment_table'>";
                  comment += "<thead>";
                  comment += "<tr>";
                  comment += "<th width='12%'>用户名</th>";
                  comment += "<th width='88%'>";
                  comment += "<div class='left'>评论</div>";
                  comment += "<div class='right'>" + this.mDate + "</div>";
                  comment += "</th>";
                  comment += "</tr>";
                  comment += "</thead>";
                  comment += "<tbody>";
                  comment += "<tr>";
                  comment += "<td class='td02'>";
                  comment += "<p class='p01'>" + this.NickName; +"</p>";
                  comment += "<p class='p02'>" + this.CustomerLevelName + "</p>";
                  comment += "</td>";
                  comment += "<td class='td01'>";
                  comment += "<span>" + this.tTitle + "</span>";
                  comment += "<div>";

                  for (var i = 0; i < this.pMark; i++)
                      comment += "<img src=\"http://www.519.com/images/star02.gif\" />";
                  for (var i = 0; i < 5 - this.pMark; i++)
                      comment += "<img src=\"http://www.519.com/images/star01.gif\" />";

                  comment += "</div>";
                  comment += "<p class='clear'>" + this.tContent;
                  comment += "</td>";
                  comment += "</tr>";
                  comment += "</tbody>";
                  comment += "</table>";

                  $("#comments_body" + mType).append(comment);
                  $("#comments_list_loading" + mType).remove();
                  $("#comments_body" + mType).css("display", "inline");
              });
          } else {
              $("#comments_list_loading" + mType).remove();
              $("#comments_body" + mType).css("display", "inline");
          }
      })
}

function getInquiries(pid) {
    var i = 0;
    $.getJSON("http://service.519.com/product/inquiries.aspx?action=InquiriesList&callback=?&productID=" + pid + "&Language=ch",
      function(inquiriesResult) {
          $("#inquiriesBody").html("");
          var inquiries = inquiriesResult.InquiriesList;
          var j = 1;
          if (inquiries.length > 0) {
              $(inquiries).each(function() {
                  if (j % 2 == 0) {
                      var inquiry = "<li>" +
                                          "<div class='que'><a href='#' class='email'>" + this.NickName + "</a>" + this.ip + "<span class='date'>" + this.mDate + "</span></div>" +
                                          "<div class='quecontent'>" + this.tContent + "</div>" +
                                          "<div class='ans'>519客服<span class='date'>" + this.rDate + "</span></div>" +
                                          "<div class='anscontent'>" + this.rContent + "</div>" +
                                      "</li>";
                      $("#inquiriesBody").append(inquiry);
                      $("#inquiriesBody_loading").remove();
                      $("#inquiriesBody").css("display", "inline");
                  }
                  else {
                      var inquiry = "<li class='odd'>" +
                                          "<div class='que'><a href='#' class='email'>" + this.NickName + "</a>" + this.ip + "<span class='date'>" + this.mDate + "</span></div>" +
                                          "<div class='quecontent'>" + this.tContent + "</div>" +
                                          "<div class='ans'>519客服<span class='date'>" + this.rDate + "</span></div>" +
                                          "<div class='anscontent'>" + this.rContent + "</div>" +
                                      "</li>";
                      $("#inquiriesBody").append(inquiry);
                      $("#inquiriesBody_loading").remove();
                      $("#inquiriesBody").css("display", "inline");
                  }
                  j++;
              });
          } else {
              $("#inquiriesBody_loading").remove();
              $("#inquiriesBody").css("display", "inline");
          }
      })
}

function getReviews(pid, mType) {
    $.getJSON("http://service.519.com/product/review.aspx?action=reviewList&callback=?&productID=" + pid + "&mType=" + mType + "&Language=ch",
      function(commentsResult) {
          $("#comments_body" + mType).html("");
          var comments = commentsResult.ReviewList;
          var j = 1;
          if (comments.length > 0) {
              $(comments).each(function() {
                  if (j % 2 == 0) {
                      var comment = "<li>" +
                                                "<div class='author'><span>" + this.NickName + "</span>" + this.ip + "</div>" +
                                                "<div class='ptitle'><p class='link'><a href='#'>" + this.tTitle + "</a></p><p class='toscore'>";
                      for (var i = 0; i < this.pMark; i++)
                          comment += "<img src='http://www.519.com/519images/r_05.gif' />";
                      for (var i = 0; i < 5 - this.pMark; i++)
                          comment += "<img src='http://www.519.com/519images/r_06.gif' />";
                      comment += "</p><span class='fright'>" + this.mDate + "</span></div>" +
                                                "<div class='scontent'>" + this.tContent + "</div></li>";
                      $("#comments_body" + mType).append(comment);
                      $("#comments_list_loading" + mType).remove();
                      $("#comments_body" + mType).css("display", "inline");
                  }
                  else {
                      var comment = "<li class='odd'>" +
                                                "<div class='author'><span>" + this.NickName + "</span> " + this.ip + "</div>" +
                                                "<div class='ptitle'><p class='link'><a href='#'>" + this.tTitle + "</a></p><p class='toscore'>";
                      for (var i = 0; i < this.pMark; i++)
                          comment += "<img src='http://www.519.com/519images/r_05.gif' />";
                      for (var i = 0; i < 5 - this.pMark; i++)
                          comment += "<img src='http://www.519.com/519images/r_06.gif' />";
                      comment += "</p><span class='fright'>" + this.mDate + "</span></div>" +
                                                "<div class='scontent'>" + this.tContent + "</div></li>";
                      $("#comments_body" + mType).append(comment);
                      $("#comments_list_loading" + mType).remove();
                      $("#comments_body" + mType).css("display", "inline");
                  }
                  j++;
              });
          }
          else {
              $("#comments_list_loading" + mType).remove();
              $("#comments_body" + mType).css("display", "inline");
          }
      })
}

function selectOneLayer_ajax(Oneli, One, Num, mType, pid) {
    getComments(pid, mType);
    for (i = 1; i < 5; i++) {
        if (i == Num) {
            document.getElementById(Oneli + i).className = "intabcurrent"; document.getElementById(One + i).style.display = "block";
        }
        else {
            document.getElementById(Oneli + i).className = ""; document.getElementById(One + i).style.display = "none";
        }
    }
}
function formLoad(productID) {
    //    var options = {
    //        zoomWidth: 400,
    //        zoomHeight: 360,
    //        showEffect: 'show',
    //        hideEffect: 'fadeout',
    //        fadeoutSpeed: 'slow',
    //        title: false,
    //        xOffset: 5,
    //        yOffset: 1
    //    }
    //    $(".jqzoom").jqzoom(options);
    //    getCommentSummary(productID);
    //    getComments(productID, 1);
    //getInquiries(productID);
    // getProductUnite(productID);
}
var groupprice = 0;

function getProductUnite(pid) {

    groupprice = 0;
    var id = 0;
    var productUnite = "";
    var productTable = "";
    var buygroupline = "";

    $.getJSON("http://service.519.com/product/productUnite.aspx?action=getProductUnite&callback=?&ProductID=" + pid,
     function(json) {
         for (var i = 0; i < json.length; i++) {

             id++;
             if (i == 0) { getProductByID(pid); }

             if (json.length == 2) {
                 productUnite += "<li class='winzh_kj_lidiv03'><img src='http://www.519.com/519images/jf_03.gif' /></li>";
                 productUnite += "<li><div class='winzh_kj_lidiv01'><img src='http://www.519.com/519ErpImages/" + json[i].ImgSmall2 + "' width='74' height='79' /></div><div class='winzh_kj_lidiv02'><input  id=chb" + json[i].ProductID + " value=" + json[i].MemberPrice + " name='chickbuy' onclick='javascript:void(0);checkclick(" + pid + ",this);'  name='' type='radio' value='' /><span>" + json[i].ChineseName + "</span></div></li>";
                 buygroupline = json[i].ProductID + ",";

             }
             else {
                 productUnite += "<li class='winzh_kj_lidiv03'><img src='http://www.519.com/images/img_177.gif' /></li>";

                 productUnite += "<li><div class='winzh_kj_lidiv01'><img src='http://www.519.com/519ErpImages/" + json[i].ImgSmall2 + "' width='74' height='79' /></div><div class='winzh_kj_lidiv02'><input  id=chb" + json[i].ProductID + " value=" + json[i].MemberPrice + " name='chickbuy' onclick='javascript:void(0);checkclick(" + pid + ",this);'  checked='checked' name='' type='checkbox' value='' /><span>" + json[i].ChineseName + "</span></div></li>";
                 buygroupline += json[i].ProductID + ",";
                 groupprice += Math.round(json[i].MemberPrice);
             }
         }
         if (id != 0) {
             $("#P_Unite").show();
             if (id == 2)
                 $("#buyline").attr("href", "javascript:buy('" + pid + "','1')");
             else
                 $("#buyline").attr("href", "javascript:buy('" + pid + "," + buygroupline.substring(0, buygroupline.length - 1) + "','1,1,1,1')");

             $("#productUnite").append(productUnite);
             $("#pprice").text("￥" + Math.round(groupprice + primaryprice));

         }
     })
}

function getProductUnite2(pid) {

    groupprice = 0;
    var id = 0;
    var productUnite = "";
    var productTable = "";
    var buygroupline = "";

    $.getJSON("http://service.519.com/product/productUnite.aspx?action=getProductUnite&callback=?&ProductID=" + pid,
     function(json) {
         for (var i = 0; i < json.length; i++) {

             id++;

             if (i == 0) { getProductByID2(pid); }

             if (json.length == 2) {
                 productUnite += "<li class='winzh_kj_lidiv03'><img src='http://www.519.com/519images/jf_03.gif' /></li>";
                 productUnite += "<li><div class='winzh_kj_lidiv01'><img src='http://www.519.com/519ErpImages/" + json[i].ImgSmall2 + "' width='74' height='79' /></div><div class='winzh_kj_lidiv02'><input  id=chb" + json[i].ProductID + " value=" + json[i].VipPrice + " name='chickbuy' onclick='javascript:void(0);checkclick(" + pid + ",this);'   name='' type='radio' value='' /><span>" + json[i].ChineseName + "</span></div></li>";
                 buygroupline = json[i].ProductID + ",";

             }
             else {
                 productUnite += "<li class='winzh_kj_lidiv03'><img src='http://www.519.com/519images/img_177.gif' /></li>";

                 groupprice += Math.round(json[i].VipPrice);
                 productUnite += "<li><div class='winzh_kj_lidiv01'><img src='http://www.519.com/519ErpImages/" + json[i].ImgSmall2 + "' width='74' height='79' /></div><div class='winzh_kj_lidiv02'><input  id=chb" + json[i].ProductID + " value=" + json[i].VipPrice + " name='chickbuy' onclick='javascript:void(0);checkclick(" + pid + ",this);'  checked='checked' name='' type='checkbox' value='' /><span>" + json[i].ChineseName + "</span></div></li>";
                 buygroupline += json[i].ProductID + ",";
             }
         }
         if (id != 0) {
             $("#P_Unite").show();
             if (id == 2)
                 $("#buyline").attr("href", "javascript:buy('" + pid + "','1')");
             else
                 $("#buyline").attr("href", "javascript:buy('" + pid + "," + buygroupline.substring(0, buygroupline.length - 1) + "','1,1,1,1')");

             $("#productUnite").append(productUnite);
             $("#pprice").text("￥" + Math.round(groupprice + primaryprice));

         }
     })
}

var primaryprice = 0;
var price = 0;

function getProductByID(pid) {

    $.getJSON("http://service.519.com/product/productUnite.aspx?action=getProductByID&callback=?&PID=" + pid,
     function(json) {


         $("#productChineseName").html(json.ChineseName);
         $("#imgone").attr("src", "http://www.519.com/519ErpImages/" + json.ImgSmall2);
         $("#line").attr("href", json.FilePath);
         primaryprice = json.VipPrice;

         $("#pprice").text("￥" + Math.round(groupprice + primaryprice));
     })

}

function getProductByID2(pid) {

    $.getJSON("http://service.519.com/product/productUnite.aspx?action=getProductByID&callback=?&PID=" + pid,
     function(json) {


         $("#productChineseName").html(json.ChineseName);
         $("#imgone").attr("src", "http://www.519.com/519ErpImages/" + json.ImgSmall2);
         $("#line").attr("href", json.FilePath);
         primaryprice = json.MemberPrice;
         $("#pprice").text("￥" + Math.round(groupprice + primaryprice));
     })

}
function checkclick(pid, src) {

    var j = 0;
    var gprice = 0;
    var buygroupline = "";
    var checkid = "";
    var checknames = document.getElementsByName('chickbuy');
    var groupnum = "";
    checkid = checknames[0].id;
    for (var i = 0; i < checknames.length; i++) {
        if (checknames[i].checked == true) {
            j++;
            gprice += Math.round(checknames[i].value);
            buygroupline += checknames[i].id.substring(3) + ",";

        }

    }

    $("#pprice").text("￥" + Math.round(gprice + primaryprice));

    switch (j) {
        case 1: groupnum = "1,1";
            break;
        case 2: groupnum = "1,1,1";
            break
        case 3: groupnum = "1,1,1,1";
            break;
    }

    $("#buyline").attr("href", "javascript:buy('" + pid + "," + buygroupline.substring(0, buygroupline.length - 1) + "','" + groupnum + "')");

    if (j == 0) {

        $("#" + src.id).attr("checked", true);
        $("#buyline").attr("href", "javascript:buy('" + pid + "," + checkid.substring(3) + "','1,1')");
        alert("请确认选中至少一款");

        j = 1;
        var checknames = document.getElementsByName('chickbuy');
        for (var i = 0; i < checknames.length; i++) {
            if (checknames[i].checked == true) {
                j++;
                gprice += Math.round(checknames[i].value);

            }

        }
        $("#pprice").text("￥" + Math.round(gprice + primaryprice));

    }
    $("#count").html(j);
}


function kaixin() {
    var u = 'http://www.kaixin001.com/repaste/share.php?rtitle=' + encodeURIComponent("易酒") + '&rurl=' +
encodeURIComponent(location.href) + '&rcontent=' + encodeURIComponent("易酒");
    if (!window.open(u, 'kaixin')) {
        location.href = u;
    }
}
function xiaonei() {
    var u = 'http://share.xiaonei.com/share/buttonshare.do?link=' + encodeURIComponent(location.href) + '& title=' + encodeURIComponent("易酒");
    if (!window.open(u, 'xiaonei')) {
        location.href = u;
    }
}
function douban() {
    var u = 'http://www.douban.com/recommend/?url=' + encodeURIComponent(location.href) + '& title=' + encodeURIComponent("易酒");
    if (!window.open(u, 'douban')) {
        location.href = u;
    }
}
function facebook() {
    var u = 'http://www.facebook.com/share.php?u=' + encodeURIComponent(location.href) + '& title=' + encodeURIComponent("易酒");
    if (!window.open(u, 'facebook')) {
        location.href = u;
    }
}
function twitter() {

    var u = 'http://twitter.com/home?status=' + encodeURIComponent("易酒");
    if (!window.open(u, 'twitter')) {
        location.href = u;
    }
}
function choose(pid) {
    $.getJSON(
            "http://service.519.com/product/wine.aspx?action=getProductByID&productID=" + pid + "&callback=?",
            function(json) {
                var text = json.ChineseName + "&nbsp;￥<span>" + json.MemberPrice + "</span>";
                $("#park_choose").html(text);
                $("#wine_park").attr("value", json.ProductID);
                tb_remove();
            });
}

function showIndex(pid) {
    $.getJSON(
            "http://service.519.com/product/Review.aspx?action=loadIndex&productID=" + pid + "&callback=?",
            function(json) {
                $("#AllIndex").html(showAllStar(json.AllIndex));
                $("#AllIndex2").html(showAllStar(json.AllIndex));
                $("#AllIndexNum").html(json.AllIndex);
                $("#PriceIndex").html(showStar(json.PriceIndex));
                $("#RecommendedIndex").html(showStar(json.RecommendedIndex));
                $("#TextureIndex").html(showStar(json.TextureIndex));
            });
}
//读去评论
function showReview(pid) {
    $.getJSON(
            "http://service.519.com/product/Review.aspx?action=reviewListTop&productID=" + pid + "&callback=?",
            function(json) {
                var output = "";
                for (var i = 0; i < json.ReviewList.length; i++) {
                    output += "<tr";
                    if (i % 2 == 0) output += " class='light'";
                    output += "><td width='16%'>" + json.ReviewList[i].NickName + "</td><td width='84%'>" + showStar(json.ReviewList[i].pMark) + "</td></tr>";
                }
                $("#reviewListTop").html(output);
            });
}

function showStar(num) {
    var str = "";
    for (var i = 0; i < num; i++) {
        str += "<img src='http://www.519.com/519images/r_05.gif' />";
    }
    for (var i = 0; i < 5 - num; i++) {
        str += "<img src='http://www.519.com/519images/r_06.gif' />";
    }
    return str;
}
function showAllStar(num) {
    var str = "";
    for (var i = 0; i < num; i++) {
        str += "<img src='http://www.519.com/519images/wopf_07.gif' />";
    }
    for (var i = 0; i < 5 - num; i++) {
        str += "<img src='http://www.519.com/519images/wopf_08.gif' />";
    }
    return str;
}

function buyProduct(type, productID, isbook) {

    if ($("#product_qut").attr("value") == "")
        $("#product_qut").attr("value", 1);

    Getbuy(productID, ((isNaN($("#product_qut").attr("value"))) ? 1 : ($("#product_qut").attr("value"))), isbook);

    //   if (type == 1)
    //       buy(productID, ((isNaN($("#product_qut").attr("value"))) ? 1 : "6"));
    //   else {
    //       buy(productID, ((isNaN($("#product_qut").attr("value"))) ? 1 : ($("#product_qut").attr("value"))));
    //        var winepark = 0;
    //        winepark=$("#wine_park").attr("value");
    //        if (winepark == 0) {
    //            buy(productID, ((isNaN($("#product_qut").attr("value"))) ? 1 : ($("#product_qut").attr("value"))));
    //        }
    //        else { 
    //          //包括了包装功能
    //         buy("" + productID + "," + $("#wine_park").attr("value") + "", ((isNaN($("#product_qut").attr("value"))) ? 1 : ($("#product_qut").attr("value"))) + ",1");

    //        }
    //      
    //    }

    //包括了包装功能
    // buy("" + productID + "," + $("#wine_park").attr("value") + "", ((isNaN($("#product_qut").attr("value"))) ? 1 : ($("#product_qut").attr("value"))) + ",1");

}


function buySeckillProduct(productID) {
    if ($("#product_qut_" + productID + "").attr("value") == "")
        $("#product_qut_" + productID + "").attr("value", 1);

    GetSeckillbuy(productID, ((isNaN($("#product_qut_" + productID + "").attr("value"))) ? 1 : ($("#product_qut_" + productID + "").attr("value"))));

}
var buyids = "";
var buycount = 0;
function GetSeckillbuy(pid, num) {  //公共AddShoppingCart @TS

    if (pid < 1)
        return;
    $.getJSON(
        "http://service.519.com/shoppingcart.aspx?action=add&callback=?&id=" + pid + "&isbook=false&num=" + num + "&Seckill=" + pid,
        function(json) {
            if (json.ProductID == -4)
                alert("只有注册用户才能参加本次活动！");

            else if (json.ProductID == 0) //购买失败 @TS
                window.location.href = "http://passport.519.com/login.html?refferUrl=" + window.location.href;
            else    //购买成功，直接进入订单页面 http://service.519.com/OrderInfo.aspx?tp=1&SPID=&SeckillPID=
            {
                //购买成功
                buyids += pid + ",";
                buycount++;
                $("#a_img_timespan_" + pid + "").hide();
                $("#a_img_" + pid + "").show();
                LoadMiniShoppingCartForSec();
                LoadShoppingCartCount();
                alert("您已成功秒杀！请查看右侧购物车提示");
          

            }

        }
   );


}

function EngetProductUnite(pid) {

    groupprice = 0;
    var id = 0;
    var productUnite = "";
    var productTable = "";
    var buygroupline = "";

    $.getJSON("http://service.519.com/product/productUnite.aspx?action=getProductUnite&callback=?&ProductID=" + pid,
     function(json) {
         for (var i = 0; i < json.length; i++) {

             id++;

             if (i == 0) { getProductByID(pid); }
             groupprice += Math.round(json[i].MemberPrice);
             productUnite += "<li class='winzh_kj_lidiv03'><img src='http://www.519.com/images/img_177.gif' /></li>";
             productUnite += "<li><div class='winzh_kj_lidiv01'><img src='http://www.519.com/519ErpImages/" + json[i].ImgSmall2 + "' width='74' height='79' /></div><div class='winzh_kj_lidiv02'><input  id=chb" + json[i].ProductID + " value=" + json[i].MemberPrice + " name='chickbuy' onclick='javascript:void(0);checkclick(" + pid + ",this);'  checked='checked' name='' type='checkbox' value='' /><span>" + json[i].EnglishName + "</span></div></li>";
             buygroupline += json[i].ProductID + ",";
         }
         if (id != 0) {
             $("#P_Unite").show();
             $("#buyline").attr("href", "javascript:buy('" + pid + "," + buygroupline.substring(0, buygroupline.length - 1) + "','1,1,1,1')");
             $("#productUnite").append(productUnite);
             $("#pprice").text("￥" + Math.round(groupprice + primaryprice));

         }
     })
}

function EngetProductUnite2(pid) {

    groupprice = 0;
    var id = 0;
    var productUnite = "";
    var productTable = "";
    var buygroupline = "";

    $.getJSON("http://service.519.com/product/productUnite.aspx?action=getProductUnite&callback=?&ProductID=" + pid,
     function(json) {
         for (var i = 0; i < json.length; i++) {

             id++;

             if (i == 0) { getProductByID2(pid); }
             groupprice += Math.round(json[i].VipPrice);

             productUnite += "<li class='winzh_kj_lidiv03'><img src='http://www.519.com/519images/img_177.gif' /></li>";
             productUnite += "<li><div class='winzh_kj_lidiv01'><img src='http://www.519.com/519ErpImages/" + json[i].ImgSmall2 + "' width='74' height='79' /></div><div class='winzh_kj_lidiv02'><input  id=chb" + json[i].ProductID + " value=" + json[i].VipPrice + " name='chickbuy' onclick='javascript:void(0);checkclick(" + pid + ",this);'  checked='checked' name='' type='checkbox' value='' /><span>" + json[i].EnglishName + "</span></div></li>";
             buygroupline += json[i].ProductID + ",";
         }
         if (id != 0) {
             $("#P_Unite").show();
             $("#buyline").attr("href", "javascript:buy('" + pid + "," + buygroupline.substring(0, buygroupline.length - 1) + "','1,1,1,1')"); $("#productUnite").append(productUnite);

             $("#pprice").text("￥" + Math.round(groupprice + primaryprice));

         }
     })
}


function showReview_V2(pid) {
    $.getJSON("http://service.519.com/product/Review.aspx?action=LoadList&productID=" + pid + "&callback=?", {}, function(Result) {
        var output = "";
        for (var i = 0; i < Result.ReviewList.length; i++) {
            output += "<tr><td >" + Result.ReviewList[i].tContent + "<br /><span class='date'>[" + Result.ReviewList[i].mDate + "]</span></td>"
            output += " <td class='ratee'>买家：<a class=''>" + Result.ReviewList[i].NickName + "</a><br />"
            var len = Result.ReviewList[i].pMark;
            for (t = 0; t < len; t++) {
                output += "<img src='http://www.519.com/common/img/b_red_1.gif' alt='' width='16' height='16' />"
            }
            output += "</td></tr>"
        }
        $("#comments_body1").html(output);
    });
}

function getInquiries_V2(pid) {
    $.getJSON("http://service.519.com/product/inquiries.aspx?action=InquiriesList&callback=?&productID=" + pid + "&Language=ch", {}, function(Result) {
        var output = "";
        for (i = 0; i < Result.InquiriesList.length; i++) {
            output += "<tr><td><img src='http://www.519.com/common/img/title_ask.gif' alt='' align='absbottom' />&nbsp;咨询内容:</td><td>" + Result.InquiriesList[i].tContent + "</td>"
            output += "<td>" + Result.InquiriesList[i].NickName + "[<span class='date'>" + Result.InquiriesList[i].mDate + "</span> ]</td></tr>"
            output += "<tr class='orange'><td><img src='http://www.519.com/common/img/title_answer.gif' alt='' align='absbottom' />&nbsp;519回复:</td><td>" + Result.InquiriesList[i].rContent + "</td>"
            output += "<td>519 Service[<span class='date'>" + Result.InquiriesList[i].rDate + "</span> ]<td></tr>";
        }
        $("#inquiriesBody").html(output);
    })
}
