﻿// JavaScript Document
// 加载xml文档 
function loadXML(xmlFile)
{ 
    var xmlDoc; 
    if(window.ActiveXObject) 
    { 
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); 
        xmlDoc.async = false; 
        xmlDoc.load(xmlFile); 
    } 
    else if (document.implementation && document.implementation.createDocument) 
    { 
        xmlDoc = document.implementation.createDocument("", "", null); 
        xmlDoc.load(xmlFile); 
    } 
    else 
    { 
        return null; 
    } 
    return xmlDoc; 
} 
// 首先对xml对象进行判断 
function checkXMLDocObj(xmlFile) 
{ 
    var xmlDoc = loadXML(xmlFile); 
    if(xmlDoc==null) 
    { 
        alert("您的浏览器不支持xml文件读取,于是本页面禁止您的操作,推荐使用IE5.0以上可以解决此问题!"); 
        window.location.href="/"; 
    } 
    return xmlDoc; 
} 

function GetUrl(){
var url,theUrl
url = window.location.href;
if(url.indexOf("/") != -1){
	theUrl=url.slice(url.lastIndexOf("/")+1);
	if(theUrl!=""){
		theUrl=theUrl.substring(0,theUrl.indexOf("."))+".html";
	}
	else
	{
		theUrl="index.html";
		}
	}
if(theUrl=="")theUrl="index.html";
return theUrl;
}

function GoUrl(xurl){
	location.href=xurl;
	}
	