String.prototype.trim  =  function(){
	//  用正则表达式将前后空格
	//  用空字符串替代。
	var retStr=this.replace(/^\s*(.*?)[\s\n]*$/g,'$1');
	retStr.replace(' ','');
	return retStr;
}
String.prototype.LCase  =  function(){
	//  转换小写字母
	var retStr=this.toLowerCase();
	return retStr;
}
var __sto = setTimeout;
window.setTimeout = function(callback,timeout,param){ 
    var args = Array.prototype.slice.call(arguments,2);
    var _cb = function(){
        callback.apply(null,args);}
    __sto(_cb,timeout);
} 
///读取XML成功返回对象
function getXMLFile(url){
	//获得操作的XML文件的对象
	var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
	xmlDoc.async=false;
	xmlDoc.load(url);
	if(xmlDoc == null){
		window.location.href='/index.asp';
		return;
	}
	//解析xml文件，判断是否出错
	if(xmlDoc.parseError.errorCode != 0){
		return;///xmlDoc.parseError.reason; 错误信息
	}
	return xmlDoc;
}
var XmlMain=getXMLFile('xml/MainInfo.xml');
var XmlWebInfo=getXMLFile('xml/WebInfo.xml');
var XmlServices=getXMLFile('xml/Services.xml');

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function ChangeClassOver(obj,img){
	if(obj){
		//obj.className = 'menu1';
		obj.style.background='url('+img+')';
		var o = obj.getElementsByTagName("DIV");
		if(o){o[0].style.display = 'block';}
	}
}
function ChangeClassOut(obj,img){
	if(obj){
		obj.style.background='url('+img+')';
		var o = obj.getElementsByTagName("DIV");
		if(o){o[0].style.display = 'none';}
	}
}

function ChickMenu(id) 
{
	var strID;
    var obj = document.getElementById(id);
    if (obj!=null)
    {
        var k=id.substr(id.length-1,1);
        if (obj.style.display == 'none'){
          obj.style.display = obj.style.display == 'none' ? '' : 'none';
        } else {
          return;
        }
    }
    for (var i=1;i<8;i++){
      if (i!=k){
        strID=id.substring(0,id.length-1)+i;
        obj = document.getElementById(strID);
        if (obj!=null){obj.style.display='none';}
      }
    }
    strID='mMenu'+id.substr(id.length-1,1);
    var P = document.getElementById(strID);
    if (P!=null){
      var sText=P.innerText;
      var fnObj = document.getElementById('MainMenuDesc');
      if (fnObj!=null){fnObj.innerText=' >> '+sText.trim();}
      var subobj = document.getElementById('SubMenuDesc');
      if (subobj!=null){subobj.innerText=''}
    }
}
///子项点击后的效果
function ShowSubPath(P) {
	if (P!=null){
		var node;
		var sText=P.innerText;
		var fnObj = document.getElementById('SubMenuDesc');
		if (fnObj!=null){fnObj.innerText=' >> '+sText.trim();}
		LoaddingHTML('txtinfo');
		if (P.name=='News'){ ///新闻列表 最新动态
			node=getNodes(XmlWebInfo,'NewsList');
			window.setTimeout(loadNewsList,200,node);
			return;
		}
		if (P.name=='Summary'){///公司概要
			node=getNodes(XmlWebInfo,'ComSummary');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='Culture'){///公司文化
			node=getNodes(XmlWebInfo,'ComCulture');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='Target'){///公司目标
			node=getNodes(XmlWebInfo,'ComTarget');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='Team'){///公司团队
			node=getNodes(XmlWebInfo,'ComTeam');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='Client'){///公司客户群
			node=getNodes(XmlWebInfo,'ComClient');
			window.setTimeout(loadClientList,200,node);
			return;
		}
		if (P.name=='StockTake'){///点货系统
			node=getNodes(XmlWebInfo,'ComStockTake');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='OrderPlacingMeeting'){///订货会系统
			node=getNodes(XmlWebInfo,'ComOrderPlacingMeeting');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='ChainOfDistributionSystem'){///分销、连锁系统
			node=getNodes(XmlWebInfo,'ComChainOfDistributionSystem');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='SaleSystem'){///分销之友(单/多店)
			node=getNodes(XmlWebInfo,'ComSaleSystem');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='PDASystem'){///PDA零售系统
			node=getNodes(XmlWebInfo,'ComPDASystem');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='APMSystem'){///汽车配件管理系统
			node=getNodes(XmlWebInfo,'ComAPMSystem');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='MRPSystem'){///生产管理系统
			node=getNodes(XmlWebInfo,'ComMRPSystem');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='TFSystem'){///终端装修系统
			node=getNodes(XmlWebInfo,'ComTFSystem');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='AttendanceSystem'){///考勤系统
			node=getNodes(XmlWebInfo,'ComAttendanceSystem');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='WebPosSystem'){///网上连锁查询系统
			node=getNodes(XmlWebInfo,'ComWebPosSystem');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='ProDown'){///系统下载
			node=getNodes(XmlWebInfo,'DownloadList');
			window.setTimeout(loadClientList,200,node);
			return;
		}
		if (P.name=='SvrSystemIntegration'){///系统集成
			node=getNodes(XmlServices,'SvrSystemIntegration');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='SvrSoftwareDevelopment'){///软件开发
			node=getNodes(XmlServices,'SvrSoftwareDevelopment');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='SvrSystemSupport'){///系统支持
			node=getNodes(XmlServices,'SvrSystemSupport');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='SvrConsulting'){///咨询顾问服务
			node=getNodes(XmlServices,'SvrConsulting');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
		if (P.name=='SvrSoftwareImplementation'){///软件实施
			node=getNodes(XmlServices,'SvrSoftwareImplementation');
			window.setTimeout(loadCompanyList,200,node);
			return;
		}
	}
}
