/* Copyright (c) 1997-2004
   Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
   http://www.math.tu-berlin.de/polymake,  mailto:polymake@math.tu-berlin.de

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version: http://www.gnu.org/licenses/gpl.txt.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   $Project: polymake $$Id: recognize_browser.js,v 1.7 2004/08/24 15:28:43 gawrilow Exp $
*/

var isNS4=(document.layers) ? true : false;
var isDOM=(document.getElementById) ? true : false;
var isIE = (document.all) ? true : false;
var isOpera=isDOM && navigator.userAgent.indexOf("Opera")>=0;
var isMOZ=isDOM && navigator.userAgent.indexOf("Mozilla")>=0 && !isOpera;
var isIE5=isIE && isDOM && !isOpera;

function recognize_browser() {
   var Mac = navigator.userAgent.indexOf("Mac")>=0;
   //var isIE4=isIE && !isDOM;
   //var IE4Mac = isIE4 && Mac;
   var Konqueror = (navigator.userAgent.indexOf("Konqueror")>=0);

   return isNS4 || Konqueror || (isIE && Mac) ? null :
          isIE5 ? "DOM_IE" :
      //  isIE4 ? "IE4" :
          isOpera || isMOZ ? "DOM" : null;
}
