﻿/*
BROWSER DETECTION FUNCTIONS
    
(c) 2009, Helder Internet.
www.helderinternet.nl
*/
BrowserDetect = new function()
{
    var browserName = navigator.userAgent || navigator.vendor;
    
    this.Name = function()
    {
        return browserName;
    }

    this.Version = function()
    {
        return browserVersion;
    }

    this.isIE6 = function()
    {
        return ( browserName.indexOf("MSIE 6") > -1 ) ? true : false;
    }

    this.isIE7 = function()
    {
        return ( browserName.indexOf("MSIE 7") > -1 ) ? true : false;
    }

    this.isIE8 = function()
    {
        return ( browserName.indexOf("MSIE 8") > -1 ) ? true : false;
    }

    this.isFirefox1 = function()
    {
        return ( browserName.indexOf("Firefox/1") > -1 ) ? true : false;
    }

    this.isFirefox2 = function()
    {
        return ( browserName.indexOf("Firefox/2") > -1 ) ? true : false;
    }

    this.isFirefox3 = function()
    {
        return ( browserName.indexOf("Firefox/3") > -1 ) ? true : false;
    }

    this.isChrome1 = function()
    {
        return ( browserName.indexOf("Chrome/1") > -1 ) ? true : false;
    }

    this.isSafari3 = function()
    {
        return ( browserName.indexOf("Safari") > -1 && browserName.indexOf("Version/3") > -1 ) ? true : false;
    }

    this.toString = function()
    {
        var str = "";
        str += "browserName:" + this.Name() + "\n";
        str += "isIE6:" + this.isIE6() + "\n";
        str += "isIE7:" + this.isIE7() + "\n";
        str += "isIE8:" + this.isIE8() + "\n";
        str += "isFirefox1:" + this.isFirefox1() + "\n";
        str += "isFirefox2:" + this.isFirefox2() + "\n";
        str += "isFirefox3:" + this.isFirefox3() + "\n";
        str += "isChrome1:" + this.isChrome1() + "\n";
        str += "isSafari3:" + this.isSafari3() + "\n";
        return str;
    }
}
    
//alert(BrowserCheck.toString());


