//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 * @package Starweb Webshop System
 * @version See version-file
 * @copyright Copyright (c) 2000 - 2008, Ehandelslogik i Lund AB
 * 
 * @author Ehandelslogik i Lund AB, org.no 556696-9019  (Starweb)
 *  Country: Sweden
 *  Homepage: www.starweb.se
 *  E-mail: support@starweb.se
 * 
 * License:
 * This program is not "free" software and restrictions apply!
 * This file as well as all other files containing the code to our software may ONLY be used and/or redistributed with written permission from us.
 * You'll find information regarding our conditions and pricing on our homepage. Contact us immediately if any of these conditions are not clear.
 */
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 * @name Function: Get Browser Name
 * @access public
 *
 * @desc Original script was found at:
 * http://parentnode.org/javascript/javascript-browser-detection-revisited/
 *
 * [if gte IE 7]
 * none => no value means only for the specified version: [if IE 7] will only work for IE 7
 * “lte” means “lower than or equal to”
 * “lt” means “lower than”
 * “gte” means “greater than or equal to”
 * “gt” means “greater than”
 * To target all IE versions, simply use <!–[if IE]>
 */
function GetBrowserName()
{
   var BO        = new Array();
   var bIsIe     = false /*@cc_on || true @*/;
   var bIsSafari = (document.childNodes) && (!document.all) && (!navigator.taintEnabled) && (!navigator.accentColorName);
   
   
   BO["Ie4"]       = bIsIe && (document.getElementById == null);
   BO["Ie5"]       = bIsIe && (document.namespaces == null) && (!BO["Ie4"]);
   BO["Ie6"]       = bIsIe && (document.implementation != null) && (document.implementation.hasFeature != null) && (window.XMLHttpRequest == null);
   /*@cc_on
   BO["Ie7"]       = @_jscript_version == '5.7';
   @*/
   BO["Ie55"]      = bIsIe && (document.namespaces != null) && (!BO["Ie6"]) && (!BO["Ie7"]);
   
   BO["Ns4"]       = !bIsIe &&  (document.layers != null) &&  (window.confirm != null) && (document.createElement == null);
   BO["Opera"]     = (self.opera != null);
   BO["Gecko"]     = (document.getBoxObjectFor != null); // Firefox
   BO["Khtml"]     = (navigator.vendor == "KDE");
   BO["Konq"]      = ((navigator.vendor == 'KDE') || (document.childNodes) && (!document.all) && (!navigator.taintEnabled));
   
   BO["Safari1.2"] = (parseInt(0).toFixed == null) && (bIsSafari && (window.XMLHttpRequest != null));
   BO["Safari2.0"] = (parseInt(0).toFixed != null) && bIsSafari && !BO["Safari1.2"];
   BO["Safari1.1"] = bIsSafari && !BO["Safari1.2"] && !BO["Safari2.0"];
   
   
   sBrowserName = false;
   for(sKey in BO)
   {
      if(BO[sKey] == true)
      {
         // Get: Browser name
         sBrowserName = sKey;
         
         // Break the loop
         break;
      }
   }
   
   
   return (sBrowserName != false) ? sBrowserName : (navigator.appName + navigator.appVersion); //parseInt(navigator.appVersion)
}
