/* Js for , Version=1775193950 */
 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","confirmReviewed":"\u786e\u8ba4\u6807\u8bb0\u4e3a\u5ba1\u6838\u901a\u8fc7?","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","hide":"\u9690\u85cf"};;if(location.href.includes('needEditNickname'))
{
    $('#editName').modal({
        show: true,
        backdrop: 'static',
        keyboard: false
    });
    $.setAjaxForm('#nicknameForm');
};v.answersText = "\u6536\u8d77\u56de\u7b54";;v.expandText = "\u9605\u8bfb\u5168\u6587";;v.collect = "\u6536\u85cf";;v.collected = "\u5df2\u6536\u85cf";;v.copySuccess = "\u590d\u5236\u6210\u529f";;v.copyFailed = "\u590d\u5236\u5931\u8d25";;v.deleteConfirm = "\u5220\u9664\u540e\u8be5\u95ee\u9898\u6240\u6709\u56de\u7b54\u5185\u5bb9\u5c06\u4e00\u5e76\u6e05\u9664\uff0c\u60a8\u786e\u5b9a\u8981\u6267\u884c\u5220\u9664\u64cd\u4f5c\u5417\uff1f";;v.noAnswerTip = "\u8fd8\u6ca1\u6709\u4eba\u56de\u7b54\u8fc7\u8fd9\u4e2a\u95ee\u9898\uff0c\u53d1\u5e03\u7b2c\u4e00\u4e2a\u56de\u7b54\u5427\uff01";;v.saveSuccess = "\u4fdd\u5b58\u6210\u529f";;v.loginUrl = "\/user-login-L2Fzay8xMTAuaHRtbA==.html";;$(function(){
   $('.join').click(function(e) {
        e.stopPropagation();
        $(this).find('.code-wrap').toggle()
    })
    $(document).click(function(){
        $('.join .code-wrap').hide();
    })
    $('.code-wrap').click(function(e) {
        e.stopPropagation();
    })
    
    if($('#copyright').find('.footer-link').length === 0) {
        $('#copyright').after('<a href="http://www.easycorp.cn" target="_blank" class="footer-link">禅道软件（青岛）有限公司</a>')
    } 
})

;$(document).ready(function()
{
    $('a[href="/ask.html"]').parent().addClass('active');

    var isLogin = false;

    $.getJSON(createLink('user', 'ajaxCheckLogin', '', 'json'), function(response) {
        isLogin = response.result;
    });

    $('.nav-system-ask').addClass('active');
    $('.tree li').find("a[id='category" + v.category + "']").addClass('active');
    $('.has-list').addClass('open in');
    $('a[href="/index.php/ask.html"]').parent().addClass('active');

    $('.answer').click(function()
    {
        if($(this).hasClass('disabled')) return;
        var questionID = $(this).attr('id');
        var id         = questionID.substr(8);
        var textEle    = $(this).find('.answers-text');

        $(this).toggleClass('active');
        if(!$(this).parent().siblings('.btn-answer').hasClass('active'))
        {
            $(this).parent().siblings('.btn-answer').addClass('active');
            $(this).parents('.item').find('.answer-wrap').children('.answer-input').show();
            $(this).parents('.item').find('.answer-wrap').children('.answer-list').toggle();
            if($(this).hasClass('active'))
            {
                $('.no-answer-tip').remove();
                if(textEle.data('count') === 0)
                {
                    $('#replyContent' + id).after('<p class="no-answer-tip">' + v.noAnswerTip + '</p>');
                }
                else
                {
                    $(this).parent().siblings('.btn-answer').removeClass('active');
                    link = createLink('ask', 'loadanswers', 'id=' + id);
                    $('#answerList' + id).append('<div class="loading"><i class="icon icon-spin icon-spinner-indicator"></i></div>');
                    $('.answer').addClass('disabled');
                    $('#answerList' + id).load(link, function()
                    {
                        $('.loading').remove();
                        $('.answer').removeClass('disabled');
                        initReplyMarkdown();
                    });
                }
                textEle.text(v.answersText);
            }
            else
            {
                $(this).parents('.item').find('.answer-wrap').children('.answer-input').hide();
                $(this).parents('.item').find('.answer-wrap').children('.hide-answers').hide();
                $(this).parent().siblings('.btn-answer').removeClass('active');
                textEle.text(v.answersCount.replace('%s', textEle.attr('data-count')));
            }
        }
        else
        {
            $(this).parent().siblings('.btn-answer').removeClass('active');
            $(this).parents('.item').find('.answer-wrap').children('.answer-list').toggle();
            $(this).parents('.item').find('.answer-wrap').children('.hide-answers').hide();
            if($(this).hasClass('active'))
            {
                $(this).parents('.item').find('.answer-wrap').children('.answer-input').show();
                textEle.text(v.answersText);
            }
            else
            {
                if(!$(this).hasClass('active')) $(this).parents('.item').find('.answer-wrap').children('.answer-input').hide();
                textEle.text(v.answersCount.replace('%s', textEle.attr('data-count')));
            }
        }
    });

    $('.btn-answer').click(function()
    {
        if($(this).hasClass('active')) return;
        $(this).addClass('active');
        if(!$(this).siblings('.answer').hasClass('active'))
        {
            $(this).parents('.item').find('.answer-wrap').children('.answer-input').show();
            if($(this).hasClass('active'))
            {
                var answerListLink = createLink('ask', 'loadanswers', 'id=' + $(this).data('id'));
                $('#answerList' + $(this).data('id')).load(answerListLink, function()
                {
                    initReplyMarkdown();
                });
            }
            else
            {
                $('#answerList' + $(this).data('id')).children().remove();
            }
        }
        else
        {
            $(this).siblings('.answer').removeClass('active');
            $(this).siblings('.answer').find('.answers-text').text(v.answersCount.replace('%s', $(this).siblings('.answer').find('.answers-text').attr('data-count')));
        }
    });
    $('.cancel').click(function()
    {
        $(this).parents('.item').find('.btn-answer').removeClass('active');
        $(this).parent().hide();
    })

    $('.btn-answer-question').click(function()
    {
        if(isLogin == false)
        {
            location.href = v.loginUrl;
            return false;
        }

        var answerBtn  = $(this);
        var content    = answerBtn.siblings('.answer-content').attr('data-value');
        var questionID = answerBtn.siblings('.answer-content').attr('id');
        var id         = questionID.substr(12);
        if(!content) return;
        answerBtn.addClass('disabled');
        $.ajax({
            method: 'post',
            url: '/ask-answer-' + id + '.html',
            data: {
                'content': content,
            },
            success: function (response)
            {
                if(response.result == 'success')
                {
                    var link = createLink('ask', 'loadanswers', 'id=' + id);
                    $('#answerList' + id).load('/ask-loadanswers-' + id + '.html', function()
                    {
                        initReplyMarkdown();
                    });
                    window.markdownEditor[`${questionID}`].reset();
                    $('.no-answer-tip').remove();
                    answerBtn.removeClass('disabled');
                    var answers = answerBtn.parents('.item').find('.answers-text').attr('data-count');
                    answerBtn.parents('.item').find('.answers-text').attr('data-count', Number(answers) + 1);
                    answerBtn.parents('.item').find('.cancel').after("<div class='answer-success'><span class='success-text'>" + v.saveSuccess + "</span></div>");

                    setTimeout(function()
                    {
                        answerBtn.parents('.item').find('.answer-success').remove();
                        if(!answerBtn.parents('.item').find('.answer').hasClass('active'))
                        {
                            answerBtn.parents('.item').find('.btn-answer').removeClass('active');
                            answerBtn.parents('.item').find('.answer-input').hide();
                        }
                    }, 800);
                }
            }
        });
    });

    $(document).on('click', '.btn-reply-answer', function()
    {
        if(isLogin == false)
        {
            location.href = v.loginUrl;
            return false;
        }

        var replyBtn       = $(this);
        var contentValue   = replyBtn.siblings('.reply-answer-content').attr('data-value');
        var contentID      = replyBtn.siblings('.reply-answer-content').attr('id');
        var idStr          = contentID.substr(11);
        var idArr          = idStr.split('-');
        var answerID       = idArr[0];
        var questionID     = idArr[1];

        $.ajax({
            method: 'post',
            url: createLink('ask', 'replyAnswer', 'id=' + answerID),
            data: {
                'reply': contentValue,
            },
            success: function (res)
            {
                if(res.result == 'success')
                {
                    var link = createLink('ask', 'loadanswers', 'id=' + questionID);
                    $('#answerList' + questionID).load('/ask-loadanswers-' + questionID + '.html', function()
                    {
                        initReplyMarkdown();
                    });
                    window.markdownEditor[`${contentID}`].reset();
                }
            }
        });
    });

    $(document).on('click', '.description .expand', function()
    {
        $(this).parents('.item').find('.actions .fold').show();
        $(this).parents('.description').html($(this).parents('.description').data('content'));
    });

    $(document).on('click', '.reply-answer', function()
    {
        if($(this).parents('.actions').siblings('.reply-answer-content').find('.toastui-editor-toolbar').length < 1)
        {
            initMarkdownEdit({'id': [$(this).parents('.actions').siblings('.reply-answer-content').attr('id')]});
            $(this).parents('.actions').siblings('.reply-answer-content, .btn-reply-answer').show();
        }
    });

    $('.actions .fold').click(function()
    {
        var showContent = $(this).parents('.actions').siblings('.description-wrap').find('.description').data('content').substr(0, 100);
        $(this).parents('.actions').siblings('.description-wrap').find('.description').html(`${showContent}...<span class="expand">${v.expandText}<i class="icon icon-angle-down"></i></span>`);
        $(this).hide();
    });

    $('.actions .thumbs-up').click(function()
    {
        if(isLogin == false)
        {
            location.href = v.loginUrl;
            return false;
        }

        $(this).toggleClass('active');
        var currentCount = Number($(this).find('.likes-count').text());
        if($(this).hasClass('active'))
        {
            $(this).find('.likes-count').html(currentCount + 1);
        }
        else
        {
            if(currentCount - 1 > 0) { $(this).find('.likes-count').html(currentCount - 1);}
            else { $(this).find('.likes-count').html('');}
        }

        var idStr   = $(this).attr('id');
        var thumbID = idStr.substr(5);
        $.ajax({
            method: 'get',
            url: createLink('ask', 'like', 'type=question&id=' + thumbID),
        });
    });

    $(document).on('click', '.answer-thumb', function()
    {
        if(isLogin == false)
        {
            location.href = v.loginUrl;
            return false;
        }

        $(this).toggleClass('active');
        var currentCount = Number($(this).find('.answer-likes-count').text());
        if($(this).hasClass('active'))
        {
            $(this).find('.answer-likes-count').html(currentCount + 1);
        }
        else
        {
            if(currentCount - 1 > 0) { $(this).find('.answer-likes-count').html(currentCount - 1);}
            else { $(this).find('.answer-likes-count').html('');}
        }

        var idStr   = $(this).attr('id');
        var thumbID = idStr.substr(5);
        $.ajax({
            method: 'get',
            url: createLink('ask', 'like', 'type=answer&id=' + thumbID),
        });
    });

    $(document).on('click', '.reply-thumb', function()
    {
        if(isLogin == false)
        {
            location.href = v.loginUrl;
            return false;
        }

        $(this).toggleClass('active');
        var currentCount = Number($(this).find('.reply-likes-count').text());
        if($(this).hasClass('active'))
        {
            $(this).find('.reply-likes-count').html(currentCount + 1);
        }
        else
        {
            if(currentCount - 1 > 0) { $(this).find('.reply-likes-count').html(currentCount - 1);}
            else { $(this).find('.reply-likes-count').html('');}
        }

        var idStr   = $(this).attr('id');
        var thumbID = idStr.substr(5);
        $.ajax({
            method: 'get',
            url: createLink('ask', 'like', 'type=reply&id=' + thumbID),
        });
    });

    $('.actions .collect').click(function()
    {
        if(isLogin == false)
        {
            location.href = v.loginUrl;
            return false;
        }

        $(this).toggleClass('active');
        if($(this).hasClass('active')) { $(this).find('.collect-text').text(v.collected);}
        else { $(this).find('.collect-text').text(v.collect);}

        var idStr     = $(this).attr('id');
        var collectID = idStr.substr(7);
        $.ajax({
            method: 'get',
            url: createLink('ask', 'collect', 'type=question&id=' + collectID),
        });
    });

    $('.actions .share').click(function(e)
    {
        e.stopPropagation();
        var $shareConfig =
        {
            url  : location.origin + $(this).data('url'),
            sites: ['wechat', 'weibo', 'qzone', 'qq'],
        }
        socialShare('.question-share', $shareConfig);

        if($(this).find('.icon-link').length < 1)
        {
            $('.question-share').append('<a class="social-share-icon icon-link" data-clipboard-text="'+ location.origin + $(this).data('url') + '" style="font-family:ZenIcon !important"></a>');
        }

        $(this).toggleClass('active');
        $(this).find('.question-share').toggle();
        $(this).parents('.item').siblings('.item').find('.question-share').hide();
        $(this).parents('.item').siblings('.item').find('.share.active').removeClass('active');
    });

    $('.question-share').click(function(e)
    {
        e.stopPropagation();
    });

    $('.question-share').on('click', '.icon-link', function(e)
    {
        e.stopPropagation();
        var link = $(this);
        var clipboard = new ClipboardJS(e.target);
        clipboard.on('success', function(e)
        {
            link.popover({container : 'body', trigger : 'manual', content: v.copySuccess, placement:'right', tipClass : 'popover-success'}).popover('show');
            link.next('.popover').addClass('popover-success');
            setTimeout(function(){link.popover('hide');}, 2000);
            e.clearSelection();
        });

        clipboard.on('error', function(e)
        {
            alert(v.copyFailed);
        });
        this.click();
    });

    $(document).on('click', '.all-replies', function()
    {

        var idStr      = $(this).prev('.first-wrap').find('.reply-first').eq(-1).attr('id');
        var idStr      = idStr.substr(7);
        var idArr      = idStr.split('-');
        var questionID = idArr[0];
        var startID    = idArr[1];
        var link       = createLink('ask', 'appendanswers', 'id=' + questionID + '&startID=' + startID);
        $.get(link, function(data) {
            var start = data.indexOf('/>') + 2;
            $(this).prev('.first-wrap').append(data.substr(start));
            initReplyMarkdown();

            var answers    =  $(this).prev('.first-wrap').find('.reply-first').length;
            var answersStr = $(this).attr('id');
            var allAnswers = answersStr.substr(12);
            if(answers >= allAnswers)
            {
              $(this).hide()
              $('.hide-all-replies').show();
            };
        }.bind(this));
    });

    $(document).on('click', '.more-replies', function()
    {
        if($(this).parent().prev('.second-wrap').find('.reply-second').hasClass('hidden'))
        {
            $(this).parent().prev('.second-wrap').find('.reply-second').removeClass('hidden');
        }
        else
        {
            var idStr      = $(this).parent().prev('.second-wrap').find('.reply-second').eq(-1).attr('id');
            var idStr      = idStr.substr(6);
            var idArr      = idStr.split('-');
            var answerID   = idArr[0];
            var startID    = idArr[1];
            var link       = createLink('ask', 'appendreplies', 'id=' + answerID + '&startID=' + startID);
            $.get(link, function(data) {
                var start = data.indexOf('/>') + 2;
                $(this).parent().prev('.second-wrap').append(data.substr(start));

                var replies    = $(this).parent().prev('.second-wrap').find('.reply-second').length;
                var repliesStr = $(this).attr('id');
                var allReplies = repliesStr.substr(12);
                if(replies >= allReplies)
                {
                  $(this).hide();
                }
            }.bind(this));
        }
    });

    $(document).on('click', '.hide-replies', function()
    {
        var replyID = $(this).data('id');
        $(`.reply-second-${replyID}, .more-replies-${replyID}`).hide();
        $(`.see-replies-${replyID}`).css('display', 'inline-flex');
        $(this).hide();
    });

    $(document).on('click', '.see-replies', function()
    {
        var replyID = $(this).data('id');
        $(`.reply-second-${replyID}, .hide-replies-${replyID}, .more-replies-${replyID}`).show();
        $(this).hide();
    });

    document.addEventListener('scroll', function()
    {
        if($('.replies:visible').length && $('html').scrollTop() > $('.replies:visible').offset().top)
        {
            if($('.reply:visible').height() > 500)
            {
                $('.replies:visible').parents('.answer-wrap').children('.hide-answers').show();
            }
        }
        $('.contextmenu').remove();
    });

    $(document).on('click', '.hide-all-replies', function()
    {
        $(this).parents('.item').find('.answer-input').hide();
        $(this).parents('.item').find('.answer-list').hide();
        $(this).parents('.item').find('.hide-answers').hide();
        $(this).parents('.item').find('.btn-answer').removeClass('active');
        $(this).parents('.item').find('.answer').removeClass('active');
        $(this).parents('.item').find('.answers-text').text($(this).parents('.item').find('.answers-text').data('text'));
    });

    $(document).on('click', '.hide-answers', function()
    {
        $(this).hide();
        $(this).siblings('.answer-list').toggle();
        $(this).siblings('.answer-input').hide();
        $(this).parents('.item').find('.btn-answer').removeClass('active');
        $(this).addClass('hide');
        $(this).parents('.item').find('.answer').removeClass('active');
        $(this).parents('.item').find('.answers-text').text($(this).parents('.item').find('.answers-text').data('text'));
        $('html, body').animate({ scrollTop: $(this).parents('.item')[0].offsetTop + 20}, 300);
        var parentItem = $(this).parents('.item');
        parentItem.css('background', '#f8f8f8');
        setTimeout(function() { parentItem.css('background', 'unset')}, 800);
    });

    $(document).on('click', function()
    {
        $('.question-share').hide();
        $('.share.active').removeClass('active');
    });

    $(document).on('click', '.delete-answer a', function(e)
    {
        e.preventDefault();
        var delAnswerBtn = $(this);
        bootbox.confirm(v.deleteAnswerConfirm, function(result)
        {
            if(result)
            {
                $.ajax({
                    method: 'post',
                    url: delAnswerBtn.attr('href'),
                    success: function(response)
                    {
                        if(response.result == 'success')
                        {
                            var myMessager = new $.zui.Messager(v.answerDeleted,
                            {
                                type: 'primary',
                                time: 2500
                            }).show();

                            var answers        = delAnswerBtn.parents('.item').find('.answers-text').attr('data-count');
                            var deletedAnswers = answers === 0 ? 0 : answers - 1;

                            delAnswerBtn.parents('.item').find('.answers-text').attr('data-count', deletedAnswers);
                            if(deletedAnswers === 0)
                            {
                                delAnswerBtn.parents('.reply').remove();
                            }
                            else
                            {
                                delAnswerBtn.parents('.reply').find('.replies').html(v.answersCount.replace('%s', deletedAnswers));
                                delAnswerBtn.parents('.reply-first').next('.second-wrap').remove();
                                delAnswerBtn.parents('.reply-first').remove();
                            }
                            $('.contextmenu').remove();
                        }
                    }
                });
            };
            return true;
        });
        return false;
    });

    $(document).on('click', '.delete-reply a', function(e)
    {
        e.preventDefault();
        var delReplyBtn = $(this);
        bootbox.confirm(v.deleteReplyConfirm, function(result)
        {
            if(result)
            {
                $.ajax({
                    method: 'post',
                    url: delReplyBtn.attr('href'),
                    success: function (response)
                    {
                        if(response.result == 'success')
                        {
                            var myMessager = new $.zui.Messager(v.replyDeleted,
                            {
                                type: 'primary',
                                time: 2500
                            }).show();

                            delReplyBtn.parents('.reply-second').remove();
                            $('.contextmenu').remove();
                        }
                    }
                });
            };
            return true;
        });
        return false;
    });

    if(!$('.modal').is(':visible'))
    {
        $('.answer-content').each(function(index, item)
        {
            initMarkdownEdit({id: [$(item).attr('id')]});
        });
    }

    $('.description').each(function(index, item)
    {
        new toastuiview.Editor({
            language: 'zh-CN',
            el: $(item)[0],
            viewer: true,
            initialValue: $(item).data('content')
        });
    });

    function initReplyMarkdown()
    {
        $('.reply-content .content').each(function(index, item)
        {
            new toastuiview.Editor({
                language: 'zh-CN',
                el: $(item)[0],
                viewer: true,
                initialValue: $(item).data('content')
            });
        });
    }

    function initMarkdownEdit(config, afterInit)
    {
        config = config || markdownEditor;
        $.each(config.id, function (key, markdownEditorID) {
            var options =
            {
                el: document.querySelector('#' + markdownEditorID),
                previewStyle: 'vertical',
                height: '150px',
                initialEditType: 'wysiwyg',
                initialValue: '',
                language: 'zh-CN',
                hooks: {
                    addImageBlobHook: (blob, callback) => {
                        var formData = new FormData();
                        var link = createLink('file', 'ajaxUpload', 'uid=' + v.uid);
                        formData.append('imgFile', blob, blob.name);
                        fetch(link, {
                            method: 'POST',
                            body: formData
                        }).then(response => {
                            if (response.ok) return response.json();
                            throw new Error('Server or network error');
                        }).then(response => {
                            callback(response.url, 'image');
                        });
                    },
                },
            };

            var markdown = new toastui.Editor(options);

            markdown.on('change', function () {
                let elementId = $($(markdown.getEditorElements()).prop('mdEditor')).parent().parent().parent().parent().parent().prop('id');
                $('#' + elementId).css('height', $('#' + elementId).height() + markdown.getScrollTop() + 'px');
                $(`#${elementId}`).attr('data-value', markdown.getMarkdown());
            });

            if (!window.markdownEditor) window.markdownEditor = {};
            window.markdownEditor['#'] = window.markdownEditor[markdownEditorID] = markdown;

            $(':input[type=submit]').after("<input type='hidden' id='uid' name='uid' value=" + v.uid + ">");
        });
        if ($.isFunction(afterInit)) afterInit();
    }
})
$(function()
{
    $('.answer').click();

    new toastuiview.Editor({
        language: 'zh-CN',
        el: document.querySelector('.description'),
        viewer: true,
        initialValue: $('.description').data('content')
    });
});
$(function(){
    $(".siteNav a[href*='register']").remove();
    $(".siteNav a[href*='login']").text('登录/注册');
    
    $('.all-bottom').prependTo('#footer');

    var windowHeight = $(window).innerHeight();
    var minHeight = windowHeight - $('#header').height() - $('#footer').height() + 30;
    if($('html').hasClass('m-user-settings')) minHeight = minHeight - 30;
    if($('.page-wrapper').height() < minHeight) {
        $('.page-wrapper').css('minHeight', minHeight)
    }
    
    if($(window).innerWidth() < 768) {
        if($('html').hasClass('m-ask')) {
            $('.tree > li').removeClass('open');
        }
        
        if($('html').hasClass('m-claim')) {
            $('.clickable-claim').click(function() {
                $('.popover').remove();
            });
        }
    }
    
    if(location.href.includes('rrpl-search')) {
        $('a[href="/rrpl.html"]').parent().addClass('active');
    }
    
    if($('html').hasClass('m-ask-view')) {
        $('a[href="/ask.html"]').parent().addClass('active');
    }
    
    if(location.pathname == '/') $('a[href="/index.html"]').parent().addClass('active');
    
    $('.m-claim-browse .status-list a:last-child').addClass('hide');
    $('.m-claim-browse .type-wrap').css('display', 'none');
    $('.m-claim-browse #keyword').attr('placeholder', '请输入您要搜索的实践');
    if($('.related-zentao').length > 0) $('.details .origin').after($('.details .related-zentao'));
});
;
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?3f3a48b32f0477a6748d1771a83f99a1";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
;
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});
