/* Js for , Version=1778072481 */
 v.lang = {"confirmDelete":"Do you want to delete it?","deleteing":"Deleting","doing":"Doing","loading":"Loading","updating":"Updating","timeout":"Timeout. Please try it again.","errorThrown":"Error : ","continueShopping":"Continue shopping","required":"Required","back":"Back","continue":"Continue","bindWechatTip":"Posting sets the limit for binding WeChat. Please bind WeChat user first.","importTip":"Old layout data will be replaced","fullImportTip":"Old article, product, layout data will be replaced and import test data"};;$('#cartBox .label').insertBefore('.sidebar .cart i');
// $('#msgBox').insertBefore('.sidebar .msg');
$('#rightDocker').insertBefore('.sidebar .erweima em');
$('#go2top').insertBefore('.sidebar .top em');
$('#xuanxuanBtn').insertBefore('.sidebar .chat em');;v.path = ["272","275"];;v.objectType = "article";;v.objectID = 32;;v.categoryID = 275;;v.categoryPath = ["272","275"];;	// 百度地图API功能
	var mp = new BMap.Map("easycore_map");
	mp.centerAndZoom(new BMap.Point(114.33594,22.703665), 15);
	mp.enableScrollWheelZoom();
	// 复杂的自定义覆盖物
    function ComplexCustomOverlay(point, text, mouseoverText){
      this._point = point;
      this._text = text;
      this._overText = mouseoverText;
    }
    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function(map){
      this._map = map;
      var div = this._div = document.createElement("div");
      div.style.position = "relative ";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
      div.style.backgroundColor = "#EE5D5B";
      div.style.border = "1px solid #BC3B3A";
      div.style.color = "white";
      //div.style.height = "18px";
      //div.style.marginLeft = '100px';
      div.style.width = "180px";
      div.style.padding = "2px";
      div.style.lineHeight = "18px";
      div.style.whiteSpace = "normal";
      div.style.MozUserSelect = "none";
      div.style.fontSize = "15px";
      var span = this._span = document.createElement("span");
      div.appendChild(span);
      span.appendChild(document.createTextNode(this._text));
      var that = this;
      var arrow = this._arrow = document.createElement("div");
      arrow.style.background = "url(http://www.easy-core.com/sites/all/themes/easycore/images/mapmark.png) no-repeat";
      arrow.style.position = "absolute";
      arrow.style.width = "30px";
      arrow.style.height = "41px";
      arrow.style.top = "-6px";
      arrow.style.left = "-35px";
      arrow.style.overflow = "hidden";
      div.appendChild(arrow);
     
      div.onmouseover = function(){
        this.style.backgroundColor = "#6BADCA";
        this.style.borderColor = "#0000ff";
        this.getElementsByTagName("span")[0].innerHTML = that._overText;
        arrow.style.backgroundPosition = "0px 0px";
      }

      div.onmouseout = function(){
        this.style.backgroundColor = "#EE5D5B";
        this.style.borderColor = "#BC3B3A";
        this.getElementsByTagName("span")[0].innerHTML = that._text;
        arrow.style.backgroundPosition = "0px 0px";
      }

      mp.getPanes().labelPane.appendChild(div);
      
      return div;
    }
    ComplexCustomOverlay.prototype.draw = function(){
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
      this._div.style.top  = pixel.y - 30 + "px";
    }
    var mouseoverTxt = "凝聚优秀的团队，创造一流的解决方案，让市场摆脱科技的束缚。易芯科技，以家居生活为中心元素，致力为人类高品质生活 的实现做出杰出贡献。为全球家居电子产品制造企业提供全套强 有力的技术支撑。";
        
    var myCompOverlay = new ComplexCustomOverlay(new BMap.Point(114.33576,22.703744), "深圳市易芯科技有限公司",mouseoverTxt);

    mp.addOverlay(myCompOverlay);
  
  var scaleControl = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});
      scaleControl.setUnit(BMAP_UNIT_IMPERIAL);
      mp.addControl(scaleControl);
      var navControl = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_RIGHT,type:0});
      mp.addControl(navControl);
      var overviewControl = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:true});
      mp.addControl(overviewControl);
;v.pageLayout = "global";;
$(document).ready(function()
{
    $('.tree .list-toggle').mousedown(function(){$(this).parents('.panel-block').height('auto');})
    $('.row.blocks .tree').resize(function(){$(this).parents('.row.blocks').tidy({force: true});})
})
;$().ready(function() { $('#execIcon').tooltip({title:$('#execInfoBar').html(), html:true, placement:'right'}); }); ;$(document).ready(function()
{
    $('#copyBox').hide().find(':input').attr('disabled', true);
    $('#source').change(function()
    {
        $('#copyBox').hide().find(':input').attr('disabled', true);
        if($(this).val() != 'original') $('#copyBox').show().find(':input').attr('disabled', false);
    });

    /* Set current active topNav. */
    var hasActive = false;
    if(v.categoryID > 0 && $('.nav-article-' + v.categoryID).length >= 1)
    {
        hasActive = true;
        $('.nav-article-' + v.categoryID).addClass('active');
    }

    if(v.categoryPath && v.categoryPath.length)
    {
        $.each(v.categoryPath, function(index, category)
        {
            if(!hasActive)
            {
                if($('.nav-article-' + category).length >= 1) hasActive = true;
                $('.nav-article-' + category).addClass('active');
            }
        });
    }
    else if(v.path && v.path.length)
    {
        $.each(v.path, function(index, category)
        {
            if(!hasActive)
            {
                if($('.nav-article-' + category).length >= 1) hasActive = true;
                $('.nav-article-' + category).addClass('active');
            }
        });
        if(!hasActive) $('.nav-article-0').addClass('active');
    }

    if(v.categoryID !== 0) $('#category' + v.categoryID).parent().addClass('active');
    $('#navbar li.active').parents('li').addClass('active');
});
$(document).ready(function()
{
    function basename(str)
    {
        var pos = str.lastIndexOf('/');
        return str.substring(pos + 1,str.length);
    }

    $('body').tooltip(
    {
        html: true,
        selector: "[data-toggle=tooltip]",
        container: "body"
    }); 

    $('.article-content img').click(function(){
        var itemSrc  = $(this).attr('src');
        var itemName = basename(itemSrc).split('&')[0];
        if(typeof(itemName) == 'string')
        {
            $('.article-files .' + itemName).click();
        }
    });

    if($('.previous > a > span').width() > $('.previous > a').width())
    {
        previousSpanWidth = $('.previous > a').width() - $('.previous .icon-arrow-left').width() - 10;
        $('.previous > a > span').css('width', previousSpanWidth);
    }

    if($('.next > a > span').width() > $('.next > a').width())
    {
        nextSpanWidth = $('.next > a').width() - $('.next .icon-arrow-right').width() - 10;
        $('.next > a > span').css('width', nextSpanWidth);
    }
});
$('#siteNav').insertAfter('#navbarWrapper');
$('#searchbar').insertBefore('#siteNav');
$('#foot').insertBefore('#footer');
$('#words').attr('placeholder','Search');

$(document).ready(function(){
    if(typeof headerList != 'undefined') return ;
    headerList = true;
    $('#siteNav').before('<div id="language"><a class="lang"><i class="icon icon-globe"></i><span>English</span><i class="icon icon-caret-down"></i></a><div class="globe"><a href="/">简体</a><a href="/tw/">繁体</a></div></div>');
});

if(screen.width > 767){
    $('#navbar .nav > li:nth-child(2) a').attr('onclick',"window.open('/en/solution/35.html','_self')");
    $('#navbar .nav > li:nth-child(3) a').attr('onclick',"window.open('/en/mall.html','_self')");
    $('#navbar .nav > li:nth-child(4) a').attr('onclick',"window.open('/en/faq.html','_self')");
    $('#navbar .nav > li:nth-child(5) a').attr('onclick',"window.open('/en/profile/31.html','_self')");
    
    $(".dropdown").mouseover(function(e){
       $(this).addClass('open');
    });
    $(".dropdown").mouseout(function(e) {
       $(this).removeClass('open');
    });
}
;
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});
