/* Js for , Version=1765695225 */
 v.lang = {"confirmDelete":"\u60a8\u786e\u5b9a\u8981\u6267\u884c\u5220\u9664\u64cd\u4f5c\u5417\uff1f","deleteing":"\u5220\u9664\u4e2d","doing":"\u5904\u7406\u4e2d","loading":"\u52a0\u8f7d\u4e2d","updating":"\u66f4\u65b0\u4e2d...","timeout":"\u7f51\u7edc\u8d85\u65f6,\u8bf7\u91cd\u8bd5","errorThrown":"\u6267\u884c\u51fa\u9519\uff1a","continueShopping":"\u7ee7\u7eed\u8d2d\u7269","required":"\u5fc5\u586b","back":"\u8fd4\u56de","continue":"\u7ee7\u7eed","bindWechatTip":"\u53d1\u5e16\u529f\u80fd\u8bbe\u7f6e\u4e86\u7ed1\u5b9a\u5fae\u4fe1\u7684\u9650\u5236\uff0c\u8bf7\u5148\u7ed1\u5b9a\u5fae\u4fe1\u4f1a\u5458\u3002","importTip":"\u53ea\u5bfc\u5165\u4e3b\u9898\u7684\u98ce\u683c\u548c\u6837\u5f0f","fullImportTip":"\u5c06\u4f1a\u5bfc\u5165\u6d4b\u8bd5\u6570\u636e\u4ee5\u53ca\u66ff\u6362\u7ad9\u70b9\u6587\u7ae0\u3001\u4ea7\u54c1\u7b49\u6570\u636e"};;v.jsRoot = "\/js\/";;v.webRoot = "\/";;v.editors = {"id":["comment","content"],"tools":"simple"};;v.editorLang = "zh_CN";;v.uid = "69d9eca3104cd";;

var simple =
[ 'formatblock', 'fontsize', '|', 'bold', 'italic','underline', '|',
'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|',
'emoticons', 'link', '|', 'removeformat','undo', 'redo', 'source' ];

var full =
[ 'formatblock', 'fontsize', 'lineheight', '|', 'forecolor', 'hilitecolor', '|', 'bold', 'italic','underline', 'strikethrough', '|',
'justifyleft', 'justifycenter', 'justifyright', '|',
'emoticons', 'image', '|', 'link', 'unlink', 'anchor', 'baidumap', '/',
'undo', 'redo', '|', 'cut', 'copy', '|', 'plainpaste', 'wordpaste', '|', 'removeformat', 'clearhtml','quickformat', '|',
'indent', 'outdent', 'subscript', 'superscript', 'insertorderedlist', 'insertunorderedlist', '|',
'table', 'code', 'hr', '|',
'fullscreen', 'source', 'about'];

$(document).ready(initKindeditor);
function initKindeditor(afterInit)
{
    $(':input[type=submit]').after("<input type='hidden' id='uid' name='uid' value=" + v.uid + ">");
    var nextFormControl = 'input:not([type="hidden"]), textarea:not(.ke-edit-textarea), button[type="submit"], select';

    var editorsID = '';
    var $editorsID = $('.editors-id');
    if($editorsID.length) editorsID = ($editorsID.data('editors') || '').split(',');
    $.each(editorsID || v.editors.id, function(key, editorID)
    {
        if(typeof(v.editors.filterMode) == 'undefined') v.editors.filterMode = true;
        editorTool = eval(v.editors.tools);
        var K = KindEditor, $editor = $('#' + editorID);
        keEditor = K.create('#' + editorID,
        {
            width:'100%',
            items:editorTool,
            cssPath:[v.webRoot + 'zui/css/min.css'],
            bodyClass:'article-content',
            urlType:'absolute',
            uploadJson: createLink('file', 'ajaxUpload', 'uid=' + v.uid),
            imageTabIndex:1,
            filterMode:v.editors.filterMode,
            allowFileManager:false,
            langType:v.editorLang,
            htmlTags:{
            
            
            'p,span,h1,h2,h3,h4,h5,em,u,strong,br,ol,ul,li,img,a,b,font,hr,pre,embed,video,audio,':["class","id","style"],
            
            object: ["type", "data", "width", "height"], param: ["name", "value"],
            audio: ['id', 'class', 'width', 'src', 'height', 'loop', 'preload', 'autoplay', 'controls', 'crossorigin', 'currentTime', 'duration', 'muted'],
            video: ['id', 'class', 'width', 'src', 'height', 'loop', 'preload', 'autoplay', 'controls', 'crossorigin', 'currentTime', 'duration', 'muted', 'buffered', 'playsinline', 'played', 'poster'],
            source: ['src', 'type'],
            font:["id","class","color","size","face",".background-color"],span:["id","class",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".line-height"],div:["id","class","align",".border",".margin",".padding",".text-align",".color",".background-color",".font-size",".font-family",
            ".font-weight",".background",".font-style",".text-decoration",".vertical-align",".margin-left"],table:["id","class","border","cellspacing","cellpadding","width","height","align","bordercolor",".padding",".margin",".border","bgcolor",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".background",".width",".height",".border-collapse"],"td,th":["id","class","align","valign","width","height","colspan","rowspan","bgcolor",".text-align",
            ".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".vertical-align",".background",".border"],a:["id","class","href","target","name"],embed:["id","class","src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess","allowfullscreen"],img:["id","class","src","width","height","border","alt","title","align",".width",".height",".border"],"p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":["id","class","align",".text-align",".color",
            ".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".text-indent",".margin-left"],pre:["id","class"],hr:["id","class",".page-break-after"],"br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del":["id","class"],iframe:["id","class","src","frameborder","width","height",".width",".height"],style:[]},

            
            
            
showLocal:false, imageTabIndex:0,

            
            syncAfterBlur: true,
            spellcheck: false,
            placeholderStyle: {fontSize: '14px', color: '#999'},
            pasteImage: {postUrl: createLink('file', 'ajaxPasteImage', 'uid=' + v.uid), placeholder: true}
        });
        try
        {
            if(!window.editor) window.editor = {};
            window.editor['#'] = window.editor[editorID] = keEditor;
            $editor.data('keditor', keEditor);
        }
        catch(e){}
    });

    if($.isFunction(afterInit)) afterInit();
}

;v.category = 21;;v.displayAnswer = 0;;v.buttonHtml = " <input type='submit' id='submit' class='btn btn-sm btn-primary' value='\u4fdd\u5b58'  data-loading='\u7a0d\u5019...' \/> ";;v.replyHtml = "<textarea name='reply' id='reply' class='form-control' rows='1'><\/textarea>\n";;$().ready(function() { $('#execIcon').tooltip({title:$('#execInfoBar').html(), html:true, placement:'right'}); }); ;$(document).ready(function()
{
    $('.nav-system-ask').addClass('active');
    $('.tree li').find("a[id='category" + v.category + "']").addClass('active');
    $('.has-list').addClass('open in');
    $('#navbar li.active').parents('li').addClass('active');
})
function setAnswerByFAQ(id)
{
    if(id)
    {
        $.get(createLink('ask', 'ajaxGetFAQ', 'id=' + id), function(answer)
        {
            keEditor.html(answer);
        });
    }
    else
    {
        keEditor.html('');
    }
}

function toggleShowReply(id, obj)
{
  replyBoxClass = $('#replyBox' + id).attr('class');
  if(typeof(replyBoxClass) != 'undefined')
  {
      if(replyBoxClass.indexOf('hide') >= 0)
      {
          $('#replyBox' + id).removeClass('hide');
      }
      else
      {
          $('#replyBox' + id).addClass('hide');
      }
  }
}

function toggleReply(id)
{
  if($('#answer' + id).find('.replyform').size() == 0) return;
  if($('#ajaxReply').size() > 0)
  {
    replyID = $('#ajaxReply').parents('div.comment').attr('id');
    $('#ajaxReply').remove();
    if(replyID == 'answer' + id) return;
  }

  var url       = createLink('ask', 'replyAnswer', 'answerID=' + id);
  var replyForm = "<form method='post' id='ajaxReply' action='" + url + "'><table class='table table-form'><tr><td class='w-p90'>" + v.replyHtml + "</td><td>" + v.buttonHtml + '</td></tr></table></form>';

  $('#answer' + id).find('.replyform').html(replyForm);
}

function toggleAnswer(id)
{
  if($('#ajaxAnswer').size() > 0)
  {
    answerID = $('#ajaxAnswer').parents('div.comment').attr('id');
    $('#ajaxAnswer').remove();
    if(answerID == 'answer' + id) return;
  }

  var url = createLink('ask', 'editAnswer', 'answerID=' + id);
  var content = $('#answer' + id).find('.td-content .content').html();
  var answerForm = "<form method='post' id='ajaxAnswer' action='" + url + "'>";
  answerForm = answerForm + "<table class='table table-form'><tr><td class='w-p90'><textarea name='content' id='content' rows=3 class='form-control'>" + content + "</textarea><td>";
  answerForm = answerForm + "<td>" + v.buttonHtml + '</td></tr></table></form>';

  $('#answerform' + id).html(answerForm);
  initKindeditor();
}

$(function()
{
    $.setAjaxJSONER('.ajaxJSON');
    $.setAjaxForm('#ajaxComment');
    $.setAjaxForm('#ajaxReply');
    $.setAjaxForm('#ajaxAnswer');
    toggleReply(v.displayAnswer);
    toggleShowReply(v.displayAnswer);
})

;
function loadCartInfo(twinkle)
{
    $('#siteNav').load(createLink('misc', 'printTopBar'),
        function()
        {
            if(twinkle) 
            {
                bootbox.dialog(
                {  
                    message: v.addToCartSuccess,  
                    buttons:
                    {  
                        back:
                        {  
                            label:     v.lang.continueShopping,
                            className: 'btn-primary',  
                            callback:  function(){location.reload();}  
                        },
                        cart:
                        {  
                            label:     v.gotoCart,  
                            className: 'btn-primary',  
                            callback:  function(){location.href = createLink('cart', 'browse');}  
                        }  
                    }  
                });
            }
        }
    );
}
;
var hash = window.location.hash.substring(1);
var browserLanguage = navigator.language || navigator.userLanguage; 
var resolution      = screen.availWidth + ' X ' + screen.availHeight;
$.get(createLink('log', 'record', "hash=" + hash), {browserLanguage:browserLanguage, resolution:resolution});
