var initialized = 0;

if (document.images) {
	/////////////////// Main Menu ///////////////////

	// Default
	_0_stat = new String(); _0_stat.src = "";

	// Home
	_1_menu = new Image();	_1_menu.src = "http://lasp.colorado.edu/images/menubar/1-menu.GIF";
	_1_high = new Image();	_1_high.src = "http://lasp.colorado.edu/images/menubar/1-high.GIF";
	_1_stat = new String(); _1_stat.src = "Home";
	
	/////////////////////////// Contents /////////////////////////	
	
	// Science Research
	_10_menu = new Image();	_10_menu.src = "http://lasp.colorado.edu/images/about_lasp/1-menu.GIF";
	_10_high = new Image();	_10_high.src = "http://lasp.colorado.edu/images/about_lasp/1-high.GIF";
	_10_stat = new String(); _10_stat.src = "Science Research";
	
	// Missions Ops
	_11_menu = new Image();	_11_menu.src = "http://lasp.colorado.edu/images/about_lasp/2-menu.GIF";
	_11_high = new Image();	_11_high.src = "http://lasp.colorado.edu/images/about_lasp/2-high.GIF";
	_11_stat = new String(); _11_stat.src = "Mission Ops";
	
	// Engineering
	_12_menu = new Image();	_12_menu.src = "http://lasp.colorado.edu/images/about_lasp/3-menu.GIF";
	_12_high = new Image();	_12_high.src = "http://lasp.colorado.edu/images/about_lasp/3-high.GIF";
	_12_stat = new String(); _12_stat.src = "Engineering";
	
	// Back
	_13_menu = new Image();	_13_menu.src = "http://lasp.colorado.edu/images/about_lasp/4-menu.GIF";
	_13_high = new Image();	_13_high.src = "http://lasp.colorado.edu/images/about_lasp/4-high.GIF";
	_13_stat = new String(); _13_stat.src = "Back";
	
	// Images are now initialized
	initialized = 1;
}

// Set the status bar to correspond with the current highlighted menu item
function stat (s) {
    	if (document.images) {
		window.status = eval ("_" + s + "_stat.src");
	}
    	return true;
}

// Set the menu item to be highlighted or not based on the state
function menu (what, state) {
	if (document.images) {
		if (what != '0') {
	    		if (state == '1') {
	        		document ["_" + what + "_menu"].src = eval("_" + what + "_high.src");
            		}
            		else {
                		document ["_" + what + "_menu"].src = eval ("_" + what + "_menu.src");
            		}
        	}
    	}

    	return true
}

// Change an item to a new state
function change (what, state) {
	// Set the menu item state
	menu (what, state);

	if (state == 1) {
		stat (what);
	}
	else {
	        stat (0);
	}

	return true;
}

function Is () {   
    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase()

    // *** BROWSER VERSION ***
    this.major = parseInt(navigator.appVersion)
    this.minor = parseFloat(navigator.appVersion)

    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))

    this.ie   = (agt.indexOf("msie") != -1)
    this.ie3  = (this.ie && (this.major == 2))
    this.ie4  = (this.ie && (this.major == 4))
    this.ie4up  = this.ie  && (this.major >= 4)

    this.opera = (agt.indexOf("opera") != -1)
}

var is;
var isIE3Mac = false;
if ((navigator.appVersion.indexOf("Mac")!=-1) && (navigator.appVersion.indexOf("MSIE"!=-1)) && (parseInt(navigator.appVersion) == 3))
   isIE3Mac = true;
else
   is = new Is();
