﻿var IE6redirectURL = "/BrowserUpdate.html";

var browser_version_raw = navigator.appVersion;
var version = parseFloat(navigator.appVersion.split("MSIE")[1]);
var browser = DetectBrowser();

if (browser == "msie" && version <= 6) {
    window.location = IE6redirectURL;
}
else if (browser == "msie" && version == 7) {
    document.createStyleSheet("/Styles/IE7Fix.css");
}
function DetectBrowser() {

    var result = "other";

    try {
        var agent = navigator.userAgent.toLowerCase();

        if (agent.indexOf("msie") != -1) {

            result = "msie";
        }
        else if (agent.indexOf("firefox") != -1) {

            result = "firefox";
        }
        else if (agent.indexOf("opera") != -1) {

            result = "opera";
        }
        else if (agent.indexOf("safari") != -1) {

            result = "safari";
        }
    }
    catch (Exception) {
        alert('DetectBrowser() Exception: ' + Exception.description);
    }

    return result;
}
