<!--
// IDR.browser_check.v07.js
// Below is the code to perform basic browser checking
// Previously this was done as part of the IDR.loop.vxx.js
// v6 2006-12-22 jxl added isUnsupported
// v6 2006-11-01 jxl dropped support for NN6 browsers
// v6 2006-10-02 jxl splits off browser checking code into IDR.browser_check.v06.js
// v7 2008-12-12 kzt support two digit for browser version IDR.browser_check.v07.js
// reason for change: browser needs to be checked before the page header loads

// Microsoft vs. Netscape.  See below for safer definitions.
// If either of these are true, then the mouse-distances (cursor) shows.
// If both false, then we get simple loops, but no mouse.

isMS  = false;
isMSold  = false;
isOpera = false;
isOperaOld  = false;
isNN4 = false;
isGecko = false;
isNetscape = false;
isKonqueror = false;
isLikeGecko = false;
isNN6 = false;
isMac = false;
isSafari = false;
isUnsupported = false;
upgradeMsg = false;
debug = false;

browser_version = parseFloat(navigator.appVersion)


if (!browser_version) browser_version = 0.
   //browser_version = 0.  // only do this during testing.


// Currently all Internet Explorer browser contain MS as part of the app name
if (navigator.appName.indexOf("Microsoft") != -1)
{
   //IE does not accurately report version numbers
   realVindex = navigator.userAgent.indexOf("MSIE") + 5;
   //support 1 digit browser version
   //realV = parseInt(navigator.userAgent.substring(realVindex, realVindex+1));
   //support 2 digit browser version
   realV = parseInt(navigator.userAgent.substring(realVindex));
   
   if ( browser_version >= 4. && realV >= 5)
      isMS = true;
   if ( browser_version >= 4. && realV < 5)
   {
      isMSold = true;
   }
   
   // IE on Mac has different Mouse calculations.
   if ( navigator.appVersion.indexOf("Mac") != -1)
      isMac = true;
}

if (navigator.appName.indexOf("Netscape") != -1)
{
   // Netscape 6 reports v5 !!!
   if  ( (browser_version >= 4) && (browser_version < 5) )
      isNN4 = true;
   if  ( navigator.userAgent.toLowerCase().indexOf("netscape6") != -1 )
      isNN6 = true;
   if  ( navigator.userAgent.toLowerCase().indexOf("gecko") != -1 )
      isGecko = true;
   if  ( navigator.userAgent.toLowerCase().indexOf("netscape") != -1 )
      isNetscape = true;
}

if (navigator.userAgent.indexOf("Safari") >= 0)
   isSafari = true;

if (navigator.userAgent.toLowerCase().indexOf("konqueror") != -1)
{
   isKonqueror = true;
}

if (navigator.appVersion.toLowerCase().indexOf("like gecko") != -1)
{
   isLikeGecko = true;
}

//Opera does not accurately report version numbers
if (navigator.userAgent.toLowerCase().indexOf("opera") != -1)
{
   isOpera = true;
   realVindex = navigator.userAgent.indexOf("Opera") + 6;
   //support 1 digit browser version
   //realV = parseInt(navigator.userAgent.substring(realVindex, realVindex+1));
   //support 2 digit browser version
   realV = parseInt(navigator.userAgent.substring(realVindex));
   
   if(realV < 7)
      isOperaOld = true;
}


if (debug)
{
   document.writeln ("<br> Browser = " + navigator.appName );
   document.writeln ("<br> Version = " + navigator.appVersion);
   document.writeln ("<br> extracted Browser version = " + browser_version );
   document.writeln ("<br> isMS = "  + isMS  + ", isMac=" + isMac)
   document.writeln ("<br> isMSold = "  + isMSold  + ", isMac=" + isMac)
   document.writeln ("<br> isSafari = "  + isSafari)
   document.writeln ("<br> isOpera = "  + isOpera)
   document.writeln ("<br> isOperaOld = "  + isOperaOld)
   document.writeln ("<br> isNN4 = " + isNN4 + ", isNN6=" + isNN6)
   document.writeln ("<br> isNetscape = "  + isNetscape)
   document.writeln ("<br> isGecko = "  + isGecko)
   document.writeln ("<br> isKonqueror = "  + isKonqueror)
   document.writeln ("<br>")
}

function msg()
{
   location.replace("/products/browser.shtml");
}

//If a user is using a browser that will not run the IDR.loop.v06.js code, alert them
if (isMSold && !isMS || isMac && isMS || isNN4 || isNN6 || isOperaOld)
{
   isUnsupported = true;
   msg();
}
