/*
//
//   Copyright © 2007 SolarWinds.Net, Inc. ipMonitor, the ipMonitor logo,
//   and Watching the Network are registered trademarks of SolarWinds.net, Inc.
//
*/

function Is()
{
    // convert user-agent string to lowercase to simplify testing
    var agt    = navigator.userAgent.toLowerCase();
    var appVer = navigator.appVersion.toLowerCase();

    this.major = parseInt( navigator.appVersion );
    this.full  = parseFloat( navigator.appVersion );

    var firebirdPos = agt.indexOf( 'firebird/' );
    var firefoxPos = agt.indexOf( 'firefox/' );

    if ( firebirdPos != -1 )
    {
      this.fbFull  = parseFloat( agt.substr( firebirdPos + 9, 3 ));
    }

    if ( firefoxPos != -1 )
    {
      this.ffFull  = parseFloat( agt.substr( firefoxPos + 8, 3 ));
    }

    // Netscape & Mozilla
    this.nav      = (( agt.indexOf( "mozilla" )!= -1 ) && (( agt.indexOf( "spoofer" ) == -1 ) && ( agt.indexOf( "compatible" ) == -1 )));
    this.nav2     = ( this.nav && ( this.major == 2 ));
    this.nav3     = ( this.nav && ( this.major == 3 ));
    this.nav4     = ( this.nav && ( this.major == 4 ));
    this.nav4up   = ( this.nav && ( this.major >= 4 ));
    this.navonly  = ( this.nav && (( agt.indexOf( ";nav" ) != -1 ) || ( agt.indexOf( "; nav" ) != -1 )));
    this.nav6     = ( this.nav && ( this.major == 5 ));
    this.nav6up   = ( this.nav && ( this.major >= 5 ));
    this.gecko    = ( agt.indexOf( "gecko" ) != -1 );
    this.firebird = ( agt.indexOf( "firebird" ) != -1 );
    this.fb06up   = ( this.firebird && this.fbFull >= 0.6 );
    this.firefox  = ( agt.indexOf( "firefox" ) != -1 );
    this.ff08up   = ( this.firefox && this.ffFull >= 0.8 );
    this.mozilla  = ( this.nav && ( this.major == 5 ) && this.gecko );

    if( this.nav6up )
    {
      var nsPos = agt.indexOf( "netscape/" );
      this.nsVer = parseFloat( agt.substr( nsPos + 9, 3 ));
    }

    this.ns71up = ( this.nav6up && this.gecko && this.nsVer >= 7.1 );

    if( this.mozilla && ! ( this.fb06up || this.ff08up ))
    {
      var rvPos = agt.indexOf( 'rv:' );
      this.mozillaVer = parseFloat( agt.substr( rvPos + 3, 3 ));
    }

    this.moz14up = ( this.mozilla && this.mozillaVer >= 1.4 );

    // Internet Explorer
    this.ie       = (( agt.indexOf( "msie" ) != -1 ) && ( agt.indexOf( "opera" ) == -1 ));
    this.ie3      = ( this.ie && ( this.major < 4 ));
    this.ie4      = ( this.ie && ( this.major == 4 ) && ( agt.indexOf("msie 4")!= -1 ));
    this.ie4up    = ( this.ie && ( this.major >= 4 ));
    this.ie5      = ( this.ie && ( this.major == 4 ) && ( agt.indexOf( "msie 5.0" ) != -1 ));
    this.ie5_5    = ( this.ie && ( this.major == 4 ) && ( agt.indexOf( "msie 5.5" ) != -1 ));
    this.ie5up    = ( this.ie && !this.ie3 && !this.ie4 );
    this.ie5_5up  = ( this.ie && !this.ie3 && !this.ie4 && !this.ie5 );
    this.ie6      = ( this.ie && ( this.major == 4 ) && ( agt.indexOf( "msie 6.0" )!= -1 ));
    this.ie6up    = ( this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5 );

    // Opera
    this.opera    = ( agt.indexOf( "opera" ) != -1 );
    this.opera2   = ( agt.indexOf( "opera 2" ) != -1 || agt.indexOf( "opera/2" ) != -1 );
    this.opera3   = ( agt.indexOf( "opera 3" ) != -1 || agt.indexOf( "opera/3" ) != -1 );
    this.opera4   = ( agt.indexOf( "opera 4" ) != -1 || agt.indexOf( "opera/4" ) != -1 );
    this.opera5   = ( agt.indexOf( "opera 5" ) != -1 || agt.indexOf( "opera/5" ) != -1 );
    this.opera6   = ( agt.indexOf( "opera 6" ) != -1 || agt.indexOf( "opera/6" ) != -1 );
    this.opera7   = ( agt.indexOf( "opera 7" ) != -1 || agt.indexOf( "opera/7" ) != -1 );
    this.opera6up = ( this.opera && !this.opera2 && !this.opera3 && !this.opera4 && !this.opera5 );
    this.opera7up = ( this.opera && !this.opera2 && !this.opera3 && !this.opera4 && !this.opera5 && !this.opera6 );

    if( this.opera7up )
    {
        var opPos  = agt.indexOf( "opera" );
        this.opVer = parseFloat( agt.substr( opPos + 6, 3 ));
    }

    this.opera72up = ( this.opera7up && this.opVer >= 7.2 );

    // Safari
    this.safari    = ( agt.indexOf( "safari" ) != -1 );
    this.safari2up = false;

    if( agt.match( /safari\/([0-9]+(\.[0-9]+)?)/ ) )
    {
      this.safari2up = parseFloat(RegExp.$1) > 417.7;
    }
}

var is = new Is();
if( !( is.ie5_5up || is.opera72up || is.nav71up || is.fb06up || is.ff08up || is.moz14up || is.safari2up ) ) window.location = "/browserwarn.htm";


