var isMSIE = false;
     function getInternetExplorerVersion() {
        var rv = -1; // Return value assumes failure.
        //alert(navigator.appName);
        if (navigator.appName == 'Microsoft Internet Explorer') {
            isMSIE = true; 
            //alert(navigator.userAgent);
            var ua = navigator.userAgent;
            var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
            if (re.exec(ua) != null) { rv = parseFloat(RegExp.$1); }
        }
        //alert(rv); 
        return rv;
    }
    var isIE8orGT = false;
    var isIE7 = false;
    var isIE6orLT = false; 
    function checkVersion() {
        //var msg = "You're not using Windows Internet Explorer.";    
        var ver = getInternetExplorerVersion();
        //alert("ver: " + ver);
        if (ver > -1) {
            if (ver >= 8)  { isIE8orGT = true; }
            else if (ver > 6)  { isIE7 = true; }
            else if (ver > 0)  { isIE6orLT = true; } 
        } 
        /* 
        if (ver > -1) {
            if (ver >= 7) {
                msg = "You're using a recent copy of Windows Internet Explorer.";
                return true;
            }
            else {
                msg = "You should upgrade your copy of Windows Internet Explorer.";
                return false
            }
         }
         */ 
    }
    //var isIE8 = false;
    //isIE8 = checkVersion();
    checkVersion();
    //alert("isMSIE ["+isMSIE+"] isIE8orGT ["+isIE8orGT+"] isIE7 ["+isIE7+"] isIE6orLT ["+isIE6orLT+"]"); 
    //if (isMSIE && !isIE8orGT) { document.write('<link href="Css/MSIEminor8.css" type="text/css" rel="stylesheet">'); }
    
    var engine = null;
    if (window.navigator.appName == "Microsoft Internet Explorer")
    {
       // This is an IE browser. What mode is the engine in?
       if (document.documentMode) // IE8
          engine = document.documentMode;
       else // IE 5-7
       {
          engine = 5; // Assume quirks mode unless proven otherwise
          if (document.compatMode)
          {
             if (document.compatMode == "CSS1Compat")
                engine = 7; // standards mode
          }
       }
       // the engine variable now contains the document compatibility mode.
    }
    //alert(engine); 
