<!--
//Set up variable for use with dynamic link selection
	// option selected in link options frame - with default
	// This variable also keeps a tab on which image(s) to display
	// in this frame
	// efb 01/99
	var optionSelected = 0;

	// An array of links
	var linkArr = new Array(5);
	var visPagesArr = new Array(5);
	var visFeaturedArr = new Array(5);
	var newWind;
	
	self.name = 'homePage';
	
	// Get the state from a cookie lhat only lasts for this session.
	function getOptionVal()
	{
		var optionString = new String();
	
		optionString = document.cookie;
		splitString = optionString.split(':');
		optionSelected = splitString[1];
		
		if (optionSelected != 1)
		{
			optionSelected = 0;
		}
	}
	
	function initArrs()
	{
		// Get information from Cookie
		getOptionVal();
		
		// The URL's of the different groups viz pages
		// Tsunami
		visPagesArr[0] = 'http://www.pmel.noaa.gov/tsunami/research.html';
		// VRML
		visPagesArr[1] = 'http://www.pmel.noaa.gov/vrml/3DViz.html';
		// FOCI
		visPagesArr[2] = 'http://www.pmel.noaa.gov/foci/visualizations/visual.html';
		// TAO group
		visPagesArr[3] = 'http://www.pmel.noaa.gov/toga-tao/vis/tao-vis.html';
		// Vents group
		visPagesArr[4] = 'http://www.pmel.noaa.gov/vents/nemo/index.html';
		
		// The URL's of the different groups 'featured' visualization
		// Tsunami
		visFeaturedArr[0] = 'http://www.pmel.noaa.gov/tsunami/Mov/andr1.mov';
		// VRML
		visFeaturedArr[1] = 'http://www.pmel.noaa.gov/vrml/tao/start_tao.html';
		// FOCI
		visFeaturedArr[2] = 'http://www.pmel.noaa.gov/~hermann/review/WorkStationPage.html';
		// TAO group
		visFeaturedArr[3] = 'http://www.pmel.noaa.gov/toga-tao/vis/explorer/t-dyn-med.html';
		// Vents group
		visFeaturedArr[4] = 'http://www.pmel.noaa.gov/vents/nemo/explorer.html';
		
		// Set the list of links
		if (optionSelected == 0)
		{
			for (i = 0; i < 5; i++)
			{
				linkArr[i] = visPagesArr[i];
			}
			
			// images in layers are referenced differently
			if (navigator.appName == 'Netscape')
			{
				window.document.layers['linkoptsel'].document.linkoptone.src="images/but_on.gif";
				window.document.layers['linkoptsel'].document.linkopttwo.src="images/but_off.gif";
			}
			if (navigator.appName.indexOf('Microsoft') != -1)
			{
				document.linkoptone.src="images/but_on.gif";
				document.linkopttwo.src="images/but_off.gif";
			}
		}
		if (optionSelected == 1)
		{
		 	for (i = 0; i < 5; i++)
			{
				linkArr[i] = visFeaturedArr[i];
			}
			// images are referenced differently in NS and IE
			if (navigator.appName == 'Netscape')
			{
				window.document.layers['linkoptsel'].document.linkoptone.src="images/but_off.gif";
				window.document.layers['linkoptsel'].document.linkopttwo.src="images/but_on.gif";
			}
			if (navigator.appName.indexOf('Microsoft') != -1)
			{
				document.linkoptone.src="images/but_off.gif";
				document.linkopttwo.src="images/but_on.gif";
			}
		 }
	} // end initarrs()
	
function MM_preloadImages() { //v2.0
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}

function MM_swapImgRestore() { //v2.0
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

function MM_swapImage() { //v2.0
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}

function MM_showHideLayers() { //v2.0
  var i, visStr, args, theObj;
  args = MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) { //with arg triples (objNS,objIE,visStr)
    visStr   = args[i+2];
    if (navigator.appName == 'Netscape' && document.layers != null) {
      theObj = eval(args[i]);
      if (theObj) theObj.visibility = visStr;
    } else if (document.all != null) { //IE
      if (visStr == 'show') visStr = 'visible'; //convert vals
      if (visStr == 'hide') visStr = 'hidden';
      theObj = eval(args[i+1]);
      if (theObj) theObj.style.visibility = visStr;
  } }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  newWind = window.open(theURL,winName,features);
  if (newWind.opener == null) {
  	newWind.opener = self;
	}
 }

function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v2.0
  var newURL = '', version = parseFloat(navigator.appVersion);
  if (navigator.appName.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL = (NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL = (NSnoPass==1)?URL:altURL;}
  } else if (navigator.appName.indexOf('Microsoft') != -1) {
    if (version >= IEvers) {if (IEpass>0) newURL = (IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL = (IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL = (OBpass==1)?URL:altURL;
  if (newURL) {
    window.location = unescape(newURL);
    document.MM_returnValue = false;
  }
}

function changeOptions(theObject, choice)
{
	var i = 0;
	
	if (choice == 0)
	{
		// link to the featured page of each group
		// set the array of links
		optionSelected = 0;
		theObject.linkoptone.src="images/but_on.gif";
		theObject.linkopttwo.src="images/but_off.gif";
		for (i = 0; i < 5; i++)
		{
			linkArr[i] = visPagesArr[i];
		}
	}
	else
	{
		// link to the visualization page of each group
		optionSelected = 1;
		theObject.linkoptone.src="images/but_off.gif";
		theObject.linkopttwo.src="images/but_on.gif";
		for (i = 0; i < 5; i++)
		{
			linkArr[i] = visFeaturedArr[i];
		}
	}
	
	// delay the clearing of the link options layer
	setTimeout("clearLinkLayer();",1000);
	//MM_showHideLayers('document.layers[\'linkoptsel\']','document.all[\'linkoptsel\']','hide');
	
	// set cookie
	cookieVal = "username=vizPage:"+optionSelected;
	document.cookie = cookieVal;
}

// Clear the linkoptions layer - will only work this way from setTimeout()
function clearLinkLayer()
{
	MM_showHideLayers('document.layers[\'linkoptsel\']','document.all[\'linkoptsel\']','hide');
}

// Takes the user to the selected page
function goTo(ID)
{
	top.location.href=linkArr[ID];
}
//-->