





var map = null;
var mymap = null;
var StoreLabel = null;
jQuery(function () {
    navMenu();
})

function navMenu() {
    var navabout = '<div rel="130" class="positionNav"><a href="'+url+'/html/1//2.html">公司简介</a><span></span><a href="'+url+'/html/1//3.html">公司理念</a><span></span><a href="'+url+'/html/1//4.html">公司图文</a></<div>';
    var navproduct = '<div rel="248" class="positionNav"><a href="'+url+'/html/6//7.html">陶瓷数字展厅</a><span></span><a href="'+url+'/html/6//8.html">Excel报表系统</a><span></span><a href="'+url+'/html/6//9.html">企业ERP</a><span></span><a href="'+url+'/html/6//10.html">媒体大管家</a><span></span><a href="'+url+'/html/6//11.html">物业管理系统</a><span></span><a href="'+url+'/html/6//12.html">网站建设</a></div>';
    var navcase = '<div rel="353" class="positionNav"><a href="'+url+'/list?tid=14">陶瓷数字展厅</a><span></span><a href="'+url+'/list?tid=15">企业ERP</a><span></span><a href="'+url+'/list?tid=16">媒体大管家</a><span></span><a href="'+url+'/list?tid=17">网站建设</a></div>';
    var navmaps = '<div rel="645" class="positionNav"><a href="../js/Home/LayerMaps">2D地图</a><span></span><a href="../js/Home/Maps">3D地图</a><span></span><a href="http://bus.mapcc.cn" target="_blank">交通查询</a></div>';
    $(".nav > ul > li:not(.navIndex)").hover(function () {
        $(".nav > ul > li:not(.navIndex)").removeClass("navSel");
        $(this).toggleClass("navSel");
        var offset = $(this).offset();
        var navRel = $(this).attr("rel");
        if (navRel == undefined || navRel == "") {
            $(".subnav").html("");
        } else {
            $(".subnav").html(eval(navRel));
            var left = eval($(".subnav > .positionNav").attr("rel"));
            $(".subnav > .positionNav").css({ "margin-left": left }, { "top": offset.top });
        }
    });
}


//弹出信息提示
function getTextCallBack(marker, strText) {
    return function () {
        var icon = marker.getIcon();
        var point = marker.getPoint();
        var size = marker.getSize();
        var anchor = icon.getAnchor();
        var w = (size[0] - anchor[0]);
        var h = (size[1] / 2 - anchor[1]);
        StoreLabel = new LTMapText(point, [w, h]);
        StoreLabel.setLabel("<span style=\"padding:4px;\">" + strText + "</span>");
        map.addOverLay(StoreLabel);
    }
}

//设置弹出窗口
function setWindow(wMarker, wTitle, wContent) {
    return function () {
        var win = wMarker.openInfoWinHtml(wContent);
        //设置窗口标题
        win.setTitle("<span class=\"fB fBlue f12\">" + wTitle + "</span>");
        //移动到合适的显示位置
        var p = map.getPixelCoord(this.getPoint());
        var l = p[0] + 50;
        var t = p[1] + 10;
        var m = map.getPointLatLng([l, t]);
        map.moveToCenter(m);
    }
}

//弹出窗口内容
function getPopWinContent(objPoint) {
    var pophtml = "";
    pophtml += '<div id="popinfo">';
    pophtml += 'test';
    pophtml += '</div>';

    return pophtml;
}

//截取固定长度子字符串
//Str为字符串
//Len为长度,
//超出的部分用padStr填齐
function strLeft(Str, Len, padStr) {
    if (Str.replace(/[^\x00-\xff]/g, "xx").length <= Len + 2) { return Str; }
    var str = "", l = 0, schar;
    for (var i = 0; schar = Str.charAt(i); i++) {
        str += schar;
        l += (schar.match(/[^\x00-\xff]/) != null ? 2 : 1);
        if (l >= Len) { break; }
    }
    return str + padStr;
}

//检测浏览器
function JudgeBrowser() {
    var win_ie_ver = 0;    //IE版本信息        
    if (navigator.userAgent.indexOf('Mac') >= 0) { //Mac
        win_ie_ver = -1;
    } else if (navigator.userAgent.indexOf('Windows CE') >= 0) { //Windows CE
        win_ie_ver = -1;
    } else if (navigator.userAgent.indexOf('Opera') >= 0) { //Opera
        win_ie_ver = -1;
    } else if (navigator.userAgent.indexOf('Firefox') >= 0) { //Firefox
        win_ie_ver = -1;
    } else if (navigator.userAgent.indexOf('MSIE') < 0) { //非IE
        win_ie_ver = -2;
    } else { //IE
        win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);    //IE版本信息
    }

    if (win_ie_ver < 7) { //非IE 或 IE版本低于6  
        alert('您的当前浏览器为:' + navigator.userAgent + '\n本系统要求使用IE浏览器7以上版本或者Firefox/3.5.3以上版本！');
    }
} 
