function ConfigManger(configPath) {
    var m_configPath = "";
    var m_xmlDoc = null;

    if (configPath != null && configPath != "")
        m_configPath = configPath;
    else
        m_configPath = "config_local.xml";

    if (m_configPath == null || m_configPath == "")
        return null;
    var xmlHelper = new XmlHelper();
    var m_xmlDoc = xmlHelper.loadFileXml(m_configPath); //获取工具栏信息
    if (m_xmlDoc == null)
        return null;

    //获取配置信息
    this.GetConfigValue = function (keyName) {
        if (m_xmlDoc == null)
            return null;
        var data = m_xmlDoc.getElementsByTagName(keyName); //获得所有子节点
        //var value = data[0].text;
        var xmlHelper = new XmlHelper();
        var value = xmlHelper.getNodeValue(data[0]);
        return value;
    }
}

var xmlUtil;
var xmlDoc;
var configXML='<Configuration>' +
    '<defaultConfigName></defaultConfigName>' +
    '<map>'+
    '<maptype>2D</maptype>'+
    '<initialextent></initialextent>'+
    '<WebServiceURL>https://10.101.35.50/zhwjWebservice/Webservice/WebService.asmx</WebServiceURL>'+
    '<MYQueryLayer>http://10.101.35.46:6080/arcgis/rest/services/zhwj/MapServer</MYQueryLayer>'+
    '<basemaps3D>'+
    ' <Layer type="scene" label="建筑物" visible="true" >http://10.81.71.188/arcgis/rest/services/Hosted/buildingNoTextureRegion2/SceneServer</Layer>' +
    '        <Layer type="tiled" label="地面" visible="true" >http://10.81.71.162/arcgis/rest/services/city/QS_ZhuJian_NoRoad/MapServer</Layer>' +
    '        <Layer type="tiled" label="地面" visible="true" >http://10.81.71.162/arcgis/rest/services/city/QS_ZhuJian_Road/MapServer</Layer>' +
    '        <Layer type="dynamic" label="动态数据" visible="true" >http://10.101.35.46:6080/arcgis/rest/services/zhwj/MapServer</Layer>' +
    '        <Layer type="density" label="density_1" visible="true" > http://10.101.35.46:6080/arcgis/rest/services/zhwj/MapServer</Layer>'+
    '</basemaps3D>'+
    '<containExtraLayer>0</containExtraLayer>'+
    '<portalItemId>76eb30639aff4e70bbecfd74a93226c4</portalItemId>' +
    '        <fullextent>-10696.497436769,267.175033188,13967.733349092,9822.324974442</fullextent>' +
    '        <extent1>-17221.816,-5450.66,-15189.445,-4297.402</extent1>' +
    '        <extent2>-25930.782,-10527.042,-5599.259,647.995</extent2>' +
    '        <extent3>-89836.648,-56485.216,70797.201,31738.557</extent3>' +
    '        <viewxmax>160975</viewxmax>' +
    '        <viewxmin>-116460</viewxmin>' +
    '        <viewymax>91762.64627439517</viewymax>' +
    '        <viewymin>-86647.3105455185</viewymin>' +
    '        <basemaps>' +
    '            <Layer type="tiled" label="基础数据" visible="true" >http://10.101.35.46:6080/arcgis/rest/services/zhwjlm/MapServer</Layer>' +
    '            <Layer type="dynamic" label="动态数据" visible="true" >http://10.101.35.46:6080/arcgis/rest/services/zhwj/MapServer</Layer>' +
    '            <Layer type="density" label="density_1" visible="true" >http://10.101.35.46:6080/arcgis/rest/services/zhwj/MapServer</Layer>' +
    '        </basemaps>'+
    '</map>'+
    '</Configuration>';
function GetConfigData(){
    xmlUtil = new XMLUtil();
    //xmlDoc = xmlUtil.loadXmlFromFile("config/config_local.xml");
xmlDoc = xmlUtil.loadXML(configXML);
}

function GetConfigValueByTagName(tagName)
{
    if(isEmptyValue(xmlUtil))
        GetConfigData();
    var configNode = xmlDoc.getElementsByTagName(tagName);
    var stringUrl = xmlUtil.getNodeValue(configNode[0]);
    return stringUrl;
}

function getRootPath_web() {
    //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
    var curWwwPath = window.document.location.href;
    //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
    var pathName = window.document.location.pathname;
    var pos = curWwwPath.indexOf(pathName);
    //获取主机地址，如： http://localhost:8083
    var localhostPaht = curWwwPath.substring(0, pos);
    //获取带"/"的项目名，如：/uimcardprj
    var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
    return (localhostPaht + projectName);
}

function getRootPath_dc() {
    var pathName = window.location.pathname.substring(1);
    var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));
    if (webName == "") {
        return window.location.protocol + '//' + window.location.host;
    }
    else {
        return window.location.protocol + '//' + window.location.host + '/' + webName;
    }
}

function GetConfigDataByName(nodeName) {
    var nodeXml = xmlDoc.getElementsByTagName(nodeName);
    var nodeValue = xmlUtil.getNodeValue(nodeXml[0]);
    return nodeValue;
}