// Copyright © 2000 by Apple Computer, Inc., All Rights Reserved.
//
// You may incorporate this Apple sample code into your own code
// without restriction. This Apple sample code has been provided "AS IS"
// and the responsibility for its operation is yours. You may redistribute
// this code, but you are not permitted to redistribute it as
// "Apple sample code" after having made changes.
//
// 
//
var n = navigator;
// string comparisons are much easier if we lowercase everything now.
// to make indexOf() tests more compact/readable, we prepend a space 
// to the userAgent string (to get around '-1' indexOf() comparison)
var ua = ' ' + n.userAgent.toLowerCase();
var pl = n.platform.toLowerCase(); // not supported in NS3.0
var an = n.appName.toLowerCase();

// browser version
var version = n.appVersion;

var is_nn = ua.indexOf('mozilla') > 0;

 var is_nav  = ((ua.indexOf('mozilla')!=-1) && (ua.indexOf('spoofer')==-1)
                && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)
                && (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((ua.indexOf(";nav") != -1) ||
                          (ua.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (ua.indexOf('gecko') != -1);



// 'compatible' versions of "mozilla" aren't navigator
if(ua.indexOf('compatible') > 0) {
	is_nn = false;
}

var is_opera = ua.indexOf('opera') > 0;
var is_webtv = ua.indexOf('webtv') > 0;
var is_ie = ua.indexOf('msie') > 0;
var is_aol = ua.indexOf('aol') > 0;

var is_major = parseInt( version );
var is_minor = parseFloat( version );

// platform
var is_mac = ua.indexOf('mac') > 0;
var is_mac68k = (ua.indexOf('68k') > 0 || ua.indexOf('68000') > 0);
var is_macppc = (ua.indexOf('ppc') > 0 || ua.indexOf('powerpc') > 0);

var is_win = ua.indexOf('win') > 0;
var is_win16 = (ua.indexOf('16') > 0 && ua.indexOf('win') > 0);
var is_win31 = is_win16;
var is_win95 = (ua.indexOf('95') > 0 && ua.indexOf('win') > 0);
var is_win98 = (ua.indexOf('98') > 0 && ua.indexOf('win') > 0);
var is_winnt = (ua.indexOf('nt') > 0 && ua.indexOf('win') > 0);
var is_xp = ua.indexOf("windows nt 5.1")!=-1 ;
var is_os2 = ua.indexOf('os/2') > 0;

var is_sun = ua.indexOf('sunos') > 0;
var is_irix = ua.indexOf('irix') > 0;
var is_hpux = ua.indexOf('hpux') > 0;
var is_aix = ua.indexOf('aix') > 0;
var is_dec = (ua.indexOf('dec') > 0 || ua.indexOf('alpha') > 0 || ua.indexOf('osf1') > 0 || ua.indexOf('ultrix') > 0);
var is_sco = (ua.indexOf('sco') > 0 || ua.indexOf('unix_sv') > 0);
var is_vms = (ua.indexOf('vax') > 0 || ua.indexOf('openvms') > 0);
var is_linux = ua.indexOf('linux') > 0;
var is_sinix = ua.indexOf('sinix') > 0;
var is_reliant = ua.indexOf('reliantunix') > 0;
var is_freebsd = ua.indexOf('freebsd') > 0;
var is_openbsd = ua.indexOf('openbsd') > 0;
var is_netbsd = ua.indexOf('netbsd') > 0;
var is_bsd = ua.indexOf('bsd') > 0;
var is_unixware = ua.indexOf('unix_system_v') > 0;
var is_mpras = ua.indexOf('ncr') > 0;

var is_unix = ua.indexOf("x11") > 0;

// workarounds
// - IE5/Mac reports itself as version 4.0
if(is_ie && is_mac) {
	if(ua.indexOf("msie 5")) {
		is_major = 5;
		var actual_index = ua.indexOf("msie 5");
		var actual_major = ua.substring(actual_index + 5, actual_index + 8);
		is_minor = parseFloat(actual_major);
	}
}

function theText(x){

	newwindow=window.open('','',"width=400,height=300");
		newdocument=newwindow.document;
		newdocument.write("<html><title></title><head><head><body><font size=5>" + x + "</font></body></html>");
		newdocument.close();
}//end theText()

function check(){
        if (navigator.javaEnabled()< 1){
		//alert('no java');
		theText('Your machine is not currently Java Enabled. To view our presentations, you need the Java2 RunTime Environment.  Please click here to install this feature: '+"<a href=javascript:window.open('http://java.sun.com/j2se/1.4/download.html ','','width=640,height=480,scrollbars=1,resizable=1');window.close();>" + 'Download Java here.' +"</a>" + " Please select the JRE Edition.");
		//window.close();
		}else if (is_xp){
//		theText('we have detected that you are a Java-enabled XP user, but for optimal experience please make sure you have sun java installed: ' +"<a href=javascript:window.open('http://java.sun.com/j2se/1.3/jre/download-windows.html','','width=640,height=480,scrollbars=1,resizable=1');window.close()>" + 'Download Java here.' +"</a>" +"<p>" + 'We recommend rebooting your machine after the install');
		}//end if
}//end check()

 
 function bleep(){
alert ('test');

}//end bleep

function sniffMe(){
if(is_mac) {
if(!is_aol){
if(is_ie){
theText('SORRY, BUT YOU CANNOT ACCESS SYMPOSIUM PRESENTATIONS ON THE MACINTOSH WITH INTERNET EXPLORER. PLEASE VIEW WITH NETSCAPE 4.7 OR AOL');
}
}
}//end is iemac
if(is_winnt){
if(!is_xp){
//alert('nt');
}//end !is_xp
}//end if nt

if(is_xp){
//alert('xp');
}//end if xp

if(is_gecko){
//alert('nav6up');
theText('You are using a browser which is not equipped to handle our presentations. Please view presentations using an earlier version of Netscape, or Internet Explorer');
}//end if is_nav6up
}//end sniffMe()