﻿LoadXML = function(xmlFile) {
    var xmlDoc = null;
    if (getBrowseType() == "Firefox") {
        xmlDoc = document.implementation.createDocument("", "doc", null);
        xmlDoc.async = false;
        xmlDoc.load(xmlFile);

    } else if (getBrowseType() == "MSIE") {
        xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0");
        xmlDoc.async = false;
        xmlDoc.load(xmlFile);
    }
    else if ((getBrowseType() == "Chrome") || (getBrowseType() == "Safari")) {
        var xmlhttp = new window.XMLHttpRequest();
        xmlhttp.open("GET", xmlFile, false);
        xmlhttp.send(null);
        xmlDoc = xmlhttp.responseXML;
    }
    return xmlDoc;

}

getBrowseType = function() {
    var type = window.navigator.userAgent;
    if (type.indexOf("MSIE") >= 1) {
        return "MSIE";
    }
    else if (window.navigator.userAgent.indexOf("Firefox") >= 1) {
        return "Firefox";
    }
    else if (window.navigator.userAgent.indexOf("Chrome") >= 1) {
        return "Chrome";
    }
    else if (window.navigator.userAgent.indexOf("Safari") >= 1) {
        return "Safari";
    }
    else if (window.navigator.userAgent.indexOf("Camino") >= 1) {
        return "Camino";
    }
    else if (window.navigator.userAgent.indexOf("Gecko/") >= 1) {
        return "Gecko";
    }
    else
        return null;
}
getBrowseVersion = function() {
    var type = window.navigator.userAgent;
    if (type.indexOf("MSIE") >= 1) {
        browstype = type.substring(type.indexOf("MSIE") + 5);
        browsInfos = browstype.split(";");
        if (browsInfos.length <= 0) {
            return "";
        }
        return browsInfos[0];

    }
    else if (type.indexOf("Firefox") >= 1) {
        browstype = type.substring(type.indexOf("Firefox"));
        browsInfos = browstype.split("/");
        if (browsInfos.length <= 0) {
            return "";
        }
        return browsInfos[1];

    }
    else
        return "";
}

