/********A little hack to keep things from becoming visible before we are ready *************/
document.write("<style type='text/css'>#TwoHalves tr td#LeftHalf div.visible {display: none !important;}</style>");

/*********************************************************************************
 * Cycling of #Features
 *********************************************************************************/
 
var arrayOfFeatures = new Array();

function assembleArrayOfFeatures() {
	if( arrayOfFeatures.length > 0 ) return; // already assembled
	var featureContainer = document.getElementById('Feature');
	if( !featureContainer )  {
		return; // could not find feature container
	}

	// Find all features within container
	var featureIdx = 0;
	for(var i = 0; i < featureContainer.childNodes.length; i++) {
		var feature = featureContainer.childNodes[i];
		var featureClassNames = ("" + feature.className).split(" ");
		for(var j = 0; j < featureClassNames.length; j++)
			if( featureClassNames[j] == 'feature' ) break;
		if( j == featureClassNames.length ) continue; // not a feature
		arrayOfFeatures[featureIdx++] = feature;
	}
};

function indexOfVisibleFeature() {
	if( arrayOfFeatures.length == 0 ) return null; // cannot find in an empty array
	for(var i = 0; i < arrayOfFeatures.length; i++) {
		var feature = arrayOfFeatures[i];
		if( feature.className.indexOf('hidden') == -1 ) return i;
	}
	return 0; // default to first one if one could not be determined.
};

function hideFeatureNavigationIfAppropriate() {
	var nav = document.getElementById('FeatureNavigation');
	if( !nav ) return;
	var navAnchors = getImmediateChildrenByTagName(nav, 'A');
	if( !navAnchors.length ) return;
	if( navAnchors[0].href.substring(0,11) != 'javascript:' ) return; // not default setup
	if( arrayOfFeatures.length < 2 ) nav.style.display = 'none';
};

function prepareImagePlacement() {
	if( getMosaicLevel() != 2 ) return; // only works on level 2
	var featureContainer = document.getElementById('Feature');
	for( var idx = 0; idx < arrayOfFeatures.length; idx++ ) {
		var imgs = getImmediateChildrenByTagName(arrayOfFeatures[idx], 'IMG');
	
		if( imgs.length != 1 ) continue;
		imgs[0].style.display = 'none';

		var ps = getImmediateChildrenByTagName(arrayOfFeatures[idx], 'P');
		for( var j = 0; j < ps.length; j++ )
			ps[j].style.paddingRight = (imgs[0].width == 0 ? 350 : imgs[0].width) + 'px';
	}
}

function hideFeature(idx) {
	arrayOfFeatures[idx].className = 'feature hidden';
	if( getMosaicLevel() != 2 ) return; // only works on level 2
	var imgs = getImmediateChildrenByTagName(arrayOfFeatures[idx], 'IMG');
	if( imgs.length == 1 ) {
		var featureContainer = document.getElementById('Feature');
		featureContainer.style.backgroundImage = '';
		featureContainer.style.minHeight = '';
	}	
};

function showFeature(idx) {
	arrayOfFeatures[idx].className = 'feature';
	if( getMosaicLevel() != 2 ) return; // only works on level 2
	var imgs = getImmediateChildrenByTagName(arrayOfFeatures[idx], 'IMG');
	if( imgs.length == 1 ) {
		var featureContainer = document.getElementById('Feature');
		featureContainer.style.backgroundImage = 'url(' + imgs[0].src + ')';
		featureContainer.style.minHeight = imgs[0].height + 'px';
	}
};

function nextFeature() {
	var idx = indexOfVisibleFeature();
	hideFeature(idx);
	showFeature((idx+1)%arrayOfFeatures.length);
};

function previousFeature() {
	var idx = indexOfVisibleFeature();
	hideFeature(idx);
	showFeature((idx + arrayOfFeatures.length - 1) % arrayOfFeatures.length);
};

function getRandom(low, high) { 
	return Math.floor(Math.random() * (1 + high - low) + low); 
};

function showRandomFeature() {
	var idx = indexOfVisibleFeature();
	hideFeature(idx);
	showFeature(getRandom(0,arrayOfFeatures.length-1));
};

function featureInitialize() {
	assembleArrayOfFeatures();
	hideFeatureNavigationIfAppropriate();
	prepareImagePlacement();
	showRandomFeature();
};

/*********************************************************************************
 * Layering of the #MenuTabs.
 *********************************************************************************/
function changeTabContent(tabAnchor, layerId, showNews) {
	var newsLayer = document.getElementById('RightHalf');
	if (showNews) {
		newsLayer.style.display = 'block';
	} else {
		newsLayer.style.display = 'none';
	}
	swapLeftSide(tabAnchor, layerId);
}

function swapLeftSide(tabAnchor, layerId) {
	var leftHalf = document.getElementById('LeftHalf');
	var tabs = document.getElementById('Tabs');
	var clickedTab = tabAnchor.parentNode;
	
	// unselect all tabs, and select the appropriate one.
	var eachTab = getImmediateChildrenByTagName(tabs, 'LI');
	for( var i = 0; i < eachTab.length; i++ ) {
		var tab = eachTab[i];
		tab.className = (tab == clickedTab) ? 'current' : null;
	}
	
	// first hide all layers
	for( var i = 0; i < leftHalf.childNodes.length; i++ ) {
		var layer = leftHalf.childNodes[i];
		if( layer.id == layerId && layer.className != 'visible' ) continue; // avoid flicker by not hiding the one we want to show
		
		if( layer.style ) layer.style.display = 'none';
		if( layer.className == 'toVisible' || layer.className == 'visible' )
			layer.className = '';
	}
	
	// show just the one layer
	var layer = document.getElementById(layerId);
	if( !layer ) return; // layer id is probably wrong.
	layer.style.display = 'block';
	if( layer.className.length == 0 )
		layer.className = 'toVisible';

	// Look for input boxes on new tab, and select the first one if found
	var inputFields = layer.getElementsByTagName("input");	//is this the problem with the RY form not submitting on the "enter" key on IE?
	for( var i = 0; i < inputFields.length; i++ ) {						//maybe it just contributes to IE's bugginess
		if( inputFields[i].type != 'hidden' ) {
			inputFields[i].focus();
			break;
		}
	}
};

/* Finds the "selected" (class=curent) tab and simulates a click on it.
	This was important in crushing the "menu flicker" bug */
function initializeMenus() {
	var tabs = document.getElementById('Tabs');
	var eachTab = getImmediateChildrenByTagName(tabs, 'LI');
	for( var i = 0; i < eachTab.length; i++ ) {
		var tab = eachTab[i];
		if (tab.className == 'current') {
			var eachAnchor = tab.getElementsByTagName('A');
			var selectedTab = eachAnchor[0];
			selectedTab.onclick();
			tab.className = 'current'; //don't know why this has to be here, but IE was unselecting the tab
			break;
		}
	}
};

/*********************************************************************************
 * Convert the pretty outline bulleted list of menus into the ugly HTML of yonder-year
 *********************************************************************************/

var subMenuCount = 0; // this is a static counter, since menu 1.5 is "fifth", and 2.1 is "sixth"
var tabIndexCount = 50; // this is a static counter, since no anchor tag should share a tabindex with another
var menuSystemPrefix = 'menusystem';

// Constructs a MenuSystem object
function MenuSystem(ul, index) {
	var maxLevels = 3; // this isn't as variable as it looks
	// This is some of the skeletal HTML required to make the menus work.
	var cellInternals = ['', 
		'<div id="secpd" style="visibility: hidden;">'+
			'<table cellpadding="0" cellspacing="0" align="left">'+
				'<tr>'+
					'<td><span style="background-position: bottom" class="popupMenusHorizLine"/></td>'+
				'</tr>'+
				'<tr>'+
					'<td id="secct" valign="top" class="mb" height="200"></td>'+
				'</tr>'+
				'<tr>'+
					'<td><span style="background-position: top" class="popupMenusHorizLine"/></td>'+
				'</tr>'+
			'</table>'+
		'</div>',
		'<div id="thrpd" style="visibility: hidden;">'+
			'<table cellpadding="0" cellspacing="0" align="left">'+
				'<tr>'+
					'<td><span style="background-position: bottom" class="popupMenusHorizLine"/></td>'+
				'</tr>'+
				'<tr>'+
					'<td id="thrct" valign="top" class="mb" height="200"></td>'+
				'</tr>'+
				'<tr>'+
					'<td><span style="background-position: top" class="popupMenusHorizLine"/></td>'+
				'</tr>'+
			'</table>'+
		'</div>'];
	var firstMenuSetArea; // first level menus get placed in created table
	var subMenuSetArea; // the rest of the menus get placed after the table
	// These class names and ids have significance in popMenu.js and the stylesheet.
	var cellClasses = new Array("bm", "htd", "htd"); // each of 3 cells gets a class name
	var cellIds = new Array("", "second", "third"); // each cell gets a unique id
	var classNamesForLinksToPopUpMenus = new Array("ll", "l2");
	var sd, td, sc, tc, m1, m2, u1, u2, s, t;

	this.ul = ul; // the original bulleted list
	this.index = index; // the index of this system in relation to all menu systems on the page
	this.html = null; // this will be the transformed html
	this.prefix = function() { return menuSystemPrefix + this.index + '_'; };
	this.install = install;
	this.toggleMenu = toggleMenu;
	this.transformHtml = transformHtml;
	this.getUniqueSubmenuName = getUniqueSubmenuName;
	this.getCookieName = getCookieName;
	this.preloadmenus = preloadmenus;
	this.showMenu = showMenu;
	this.isMenuUp = isMenuUp;
	this.hideMenus = hideMenus;
	this.hideThirdLevelMenu = hideThirdLevelMenu;

	// generate html
	this.html = document.createElement('div');
	this.html.className = 'popupMenus';
	this.html.appendChild( buildMenuTable() ); // build the skeletal table
	var subMenuSetArea = this.html; // the hidden menus appear below the table

	this.transformHtml(this.ul, 0, new Array()); // transform html
	
	return this;

	// Builds the skeletal table to store the popup menus in
	function buildMenuTable()
	{
		var tbl, tbody, tr, td;
		tbl = document.createElement('table');
		tbody = tbl.getElementsByTagName("tbody")[0];
		tbl.cellPadding = 0;
		tbl.cellSpacing = 0;
		tr = tbl.insertRow(0);
		for( var i = 0; i < cellClasses.length; i++ )
		{
			tr.appendChild( td = document.createElement('td') );
			td.className = cellClasses[i];
			if( cellIds[i] ) td.id = cellIds[i];
			td.innerHTML = cellInternals[i];
			if( i == 0 ) firstMenuSetArea = td;
		}
		return tbl;
	};

	function getUniqueSubmenuName(index) {
		return this.prefix() + 'submenu' + index;
	};
	
	// Performs the grunge work of actually reading the bulleted list
	// and producing the ugly html.
	function transformHtml(ul, depth, path)
	{
		// This could be the top-level of the bulleted list,
		// or an inner UL tag that signifies a hidden menu.  
		// The "ul" parameter reference the current UL tag being parsed.
		// The "depth" parameter tells us how deep we are in recursion.
		// The "path" parameter is an array of indexes in the menuing system
		// that tells us how we got to this hidden menu (if applicable).
		var targetArea;
		switch( depth )
		{
			case 0:
				targetArea = firstMenuSetArea;
				break;
			case 1:
				subMenuSetArea.appendChild( targetArea = document.createElement('div') );
				targetArea.className = 'hd';
				targetArea.id = this.getUniqueSubmenuName(path[0]) + '_menu';
				break;
			case 2:
				subMenuSetArea.appendChild( targetArea = document.createElement('div') );
				targetArea.className = 'hd';
				targetArea.id = this.getUniqueSubmenuName(subMenuCount++) + '_submenu';
				break;
		}
		// Get all the immediate members of this particular menu
		var liList = getImmediateChildrenByTagName(ul, 'LI');
		var firstLinkEncountered = false;
		for( var i = 0; i < liList.length; i++ )
		{
			var li = liList[i];
			// Prepare to add this LI element's children to the appropriate
			// table cell or div area.
			var div = document.createElement('div');
			targetArea.appendChild( div );
			// Look for sub-menus of this menu item.  If one is found, mark it for
			// recursion later, and meanwhile copy all other nodes into the new location.
			var ulSub = null;
			for( var j = 0; j < li.childNodes.length; j++ )
			{
				var liChild = li.childNodes[j];
				if( liChild.nodeName == "UL" ) 
				{
					ulSub = liChild;
					continue; // skip this
				}
				div.appendChild( liChild.cloneNode(true) );
			}
			div.className = ulSub ? classNamesForLinksToPopUpMenus[depth] : 'lt';
			var anchors = div.getElementsByTagName('A');
	
			// Make sure an anchor tag exists.  Create it if it doesn't.
			// Unless it doesn't have any child nodes, and is therefore just text.
			var primaryAnchor;
			if( anchors.length == 0 && ulSub )
			{
				primaryAnchor = document.createElement('a');
				primaryAnchor.href = "#";
				while( div.childNodes.length )
					primaryAnchor.appendChild( div.childNodes[0] );
				div.appendChild( primaryAnchor );
			} 
			else if( anchors.length > 0 )
				primaryAnchor = anchors[0];
			
			if( primaryAnchor ) {
				primaryAnchor.className = ulSub ? 'navBranch' : 'navLink';
				if( !ulSub && !firstLinkEncountered )
				{
					firstLinkEncountered = true;
					// Only add extra space if there were navBranch's above us
					if( i > 0 ) div.className += ' firstNavLink';
				}
			}
			if( primaryAnchor ) primaryAnchor.tabIndex = tabIndexCount++;
			// If this LI element had a child UL element, recurse into that
			if( ulSub ) 
			{
				if( depth == 0 )
					div.id = 'u' + this.getUniqueSubmenuName(i) + '_menu';
				else {
					// assert debug == 1
					div.id = 'u' + this.getUniqueSubmenuName(path[0]) + '_menu.' + this.getUniqueSubmenuName(subMenuCount) + '_submenu';
				}
	
				var param = div.id.substr(1);
	
				// Just setting the onclick attribute or the click event
				// seems to cause problems in various browsers.
				// This works every time.
				primaryAnchor.href = "javascript:document.toggleMenu('" + param + "');";
				
				path[depth] = i;
				this.transformHtml(ulSub, depth+1, path);
			}
		}
	};
	
	function install() {
		// Swap the bulleted list for the newly generated HTML.
		this.ul.parentNode.replaceChild(this.html, this.ul);
		this.preloadmenus();
	};

	/*********************************************************************************
	 * Popup menu navigation system
	 *********************************************************************************/
	
	function getCookieName() { return this.prefix() + 'mid'; };
	
	function preloadmenus() {
		// find all elements once
		sd = MM_findObj('secpd'); td = MM_findObj('thrpd'); 
		sc = MM_findObj('secct'); tc = MM_findObj('thrct');
		s = MM_findObj('second');  t = MM_findObj('third');
		// now erase their ids so that another menu system can temporarily use them
		sd.id = td.id = sc.id = tc.id = s.id = t.id = null;
		
		m1 = m2 = u1 = u2 = null;
		var menuId = getCookie(this.getCookieName());
		if (menuId != null && menuId != '')
			this.showMenu(menuId);
		else
			this.showMenu(this.getUniqueSubmenuName(0)+'_menu');
	};
	
	function isMenuUp(menu_id) {
		var lastMenu = getCookie(this.getCookieName());
		var menus = lastMenu.split('.');
		if( menu_id.indexOf('.') >= 0 )
			return lastMenu == menu_id;
		else
			return menus[0] == menu_id;
	};
	
	// This method must not return anything, as is required for being called from a 
	// "javascript:" anchor link, in order to stay on the same page.
	function toggleMenu(menu_id) {
		var menus = menu_id.split('.');
		if (menus.length == 1) {
			if( this.isMenuUp(menus[0]) ) {
				this.hideMenus();
				return;
			}
			this.hideMenus();
		} else {
			if( this.isMenuUp(menu_id) ) {
				this.hideThirdLevelMenu(menu_id);
				return;
			}
			this.hideThirdLevelMenu(menu_id);
		}
		this.showMenu(menu_id);
		keepMenuItemFocused(menu_id);
	};
	
	function keepMenuItemFocused(menu_id) {
		// For IE, ensure that the clicked menu item remains focused
		// for those keyboard enthusiasts and for accessibility requirements.
		var menuItem = document.getElementById('u' + menu_id);
		getImmediateChildrenByTagName(menuItem, 'A')[0].focus();
	};
	
	function showMenu(menu_id) {
		menus = menu_id.split('.');
		if ((m1 = MM_findObj(menus[0])) != null) {
			// 2nd level
			s.className = 'std';
			sd.style.visibility = 'visible';
			if( sc.innerHTML != m1.innerHTML ) sc.innerHTML = m1.innerHTML;
			u1 = MM_findObj('u' + menus[0]);
			if (u1 != null) u1.className = 'ls'; 
		}
		if (menus.length == 2 && (m2 = MM_findObj(menus[1])) != null) {
			// 3rd level
			t.className = 'ttd';
			td.style.visibility = 'visible';
			tc.innerHTML = m2.innerHTML;
			u2 = findNode('u' + menu_id, sc);
			if (u2 != null) u2.className = 'ls';
		}
		setCookie(menu_id, this.getCookieName());
		return false;
	};
	
	function hideThirdLevelMenu(menu_id) {
		menus = menu_id.split('.');
		if( menus.length < 2 ) return;
		tc.innerHTML = ''; // hides text of third level
		td.style.visibility = 'hidden'; // hides vertical bar at left of third level
		t.className = 'htd'; // allows What's New box to resize
		
		if( u2 != null ) {
			var u2c = findNode(u2.id, sc);
			if( u2c ) u2c.className = 'l2';
		}
		m2 = null;
	
		setCookie(menus[0], this.getCookieName());
	};
	
	function hideMenus() {
		sc.innerHTML = ''; tc.innerHTML = '';
		sd.style.visibility = 'hidden'; td.style.visibility = 'hidden';
		m1 = null; m2 = null;
		s.className = 'htd';
		t.className = 'htd';
		if (u1 != null) 
			u1.className = 'll';
		if (u2 != null) 
			u2.className = 'l2';
		unsetCookie(this.getCookieName());
	};
	
	function findNode(id, parent) {
		if( parent.id == id ) return parent;
		for( var i = 0; i < parent.childNodes.length; i++ )
			if( parent.childNodes[i].id == id )
				return parent.childNodes[i];
			else {
				var found = findNode(id, parent.childNodes[i]);
				if( found ) return found;
			}
		return null;
	};
	
	function MM_findObj(n, d) { //v4.01
		var p,i,x;  
		if (!d) 
			d = document; 
		if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
			d = parent.frames[n.substring(p+1)].document; 
			n = n.substring(0,p);
		}
		if (!(x = d[n]) && d.all) 
			x = d.all[n]; 
		for (i = 0; !x && i < d.forms.length; i++) 
			x = d.forms[i][n];
		for (i = 0; !x && d.layers && i < d.layers.length; i++) 
			x = MM_findObj(n, d.layers[i].document);
		if(!x && d.getElementById) 
			x = d.getElementById(n); 
		return x;
	};
};

var menuSystems = new Array(); // stores all the variables required to manage the popup menu(s) on the page

// Performs the transformation of the nice bulleted list
// into the ugly HTML tables that work the pop-up menus.
function popmenuInitialize()
{
	var popupMenuList = getElementsByClassName('popupMenus', document, 'UL');
	for(var iMenu = 0; iMenu < popupMenuList.length; iMenu++ ) {
		menuSystems[iMenu] = new MenuSystem(popupMenuList[iMenu], iMenu);
		menuSystems[iMenu].install();
	}
};

document.toggleMenu = function(menu_id) {
	var re = new RegExp(menuSystemPrefix+'(\\d+)');
	var idx = re.exec(menu_id)[1];
	menuSystems[idx].toggleMenu(menu_id);
};

/*********************************************************************************
 * Automatic index generation
 *********************************************************************************/

function initializePopupIndex() {
	var layerMenus = document.getElementById('LayerMenus');
	var layerIndex = document.getElementById('LayerIndex');
	var bl = getImmediateChildrenByTagName(layerMenus, 'UL')[0];
	if( !bl || !layerIndex || !layerMenus || layerIndex.childNodes.length > 0 )
		return;
	
	var targetArea = layerIndex;
	var arrayIndex = new Array();
	generateIndex(bl, arrayIndex);
	arrayIndex.sort();
	indexToHtml(targetArea, arrayIndex);
};

function getInnerText(inputHtml)
{
	var outputHtml = "";
	var findClose = false;
	
	inputHtml = stripWhitespace(inputHtml);
	
	for (var i = 0; i < inputHtml.length; i++)
	{
		if (findClose == true)
		{
			if ( inputHtml.substr(i, 1) == ">" )
				findClose = false;
		}

		else if ( inputHtml.substr(i, 1) == "<" )
		{
			findClose = true;
		}

		else if ( isAlphanumeric(inputHtml.substr(i, 1)) )
			outputHtml = outputHtml + inputHtml.substr(i, 1);
	}
	
	return outputHtml;
};

function generateIndex(bl, arrayIndex, prefixText) {
	var origPrefix = prefixText;
	var liTags = getImmediateChildrenByTagName(bl, 'LI');
	for( var i = 0; i < liTags.length; i++ ) {
		prefixText = origPrefix;
		if( getImmediateChildrenByTagName(liTags[i], 'UL').length ) {
			// recurse deeper into tree
			if( prefixText && prefixText.length > 0 ) 
				prefixText += ', ';
			else
				prefixText = '';
			if( liTags[i].attributes['indexText'] ) {
				if( liTags[i].attributes['indexText'].value.length )
					prefixText += liTags[i].attributes['indexText'].value;
				else
					prefixText = prefixText.substr(0, prefixText.length-2); // trim comma
			} else {
				for( var j = 0; j < liTags[i].childNodes.length; j++ )
					if( liTags[i].childNodes[j].nodeName != 'UL' && liTags[i].childNodes[j].nodeValue )
						prefixText += liTags[i].childNodes[j].nodeValue.replace(/^\s*|\s*$/g,"");
			}
			generateIndex(getImmediateChildrenByTagName(liTags[i], 'UL')[0], arrayIndex, prefixText);
		} else { // leaf node
			var indexElement = newIndexElement();
			indexElement.text = getInnerText(liTags[i].innerHTML);
			indexElement.html = liTags[i].innerHTML;
			if( prefixText ) indexElement.html += "<span class='navLink'> (" + prefixText + ")</span>";
			arrayIndex[arrayIndex.length] = indexElement;
		}
	}
};

function newIndexElement() {
	var indexElement = new Object();
	indexElement.firstLetter = function() { return this.text.substring(0,1).toUpperCase(); };
	indexElement.toString = function() { return this.text; };
	return indexElement;
};

function indexToHtml(targetArea, arrayIndex) {
	printFirstCharacters(targetArea, arrayIndex);
	var lastSubset, ul;
	for( var i = 0; i < arrayIndex.length; i++ ) {
		if( arrayIndex[i].firstLetter() != lastSubset || !ul ) {
			lastSubset = arrayIndex[i].firstLetter();
			ul = document.createElement('ul');
			targetArea.appendChild(ul);
		}
		var indexLI = document.createElement('li');
		indexLI.innerHTML = arrayIndex[i].html;
		if( getImmediateChildrenByTagName(indexLI, 'A').length )
			getImmediateChildrenByTagName(indexLI, 'A')[0].className = 'navLink';
		ul.appendChild(indexLI);
	}
};

function printFirstCharacters(targetArea, arrayIndex) {
	var div = document.createElement('p');
	targetArea.appendChild(div);

	var list = firstCharactersList(arrayIndex);
	for( var i = 0; i < list.length; i++ ) {
		if( i > 0 ) div.innerHTML += '&nbsp;';
		var a = document.createElement('a');
		div.appendChild(a);
		a.className = 'indexSubsetLinks';
		a.innerHTML = list[i];
		a.href = 'javascript:showIndexSet(' + i + ');';
	}

	div.innerHTML += ' | ';
	var showAll = document.createElement('a');
	div.appendChild(showAll);
	showAll.className = 'indexSubsetLinks';
	showAll.innerHTML = 'ALL';
	showAll.href = 'javascript:showIndexSet(-1);';
};

function showIndexSet(ordinalIndex) {
	var uls = document.getElementById('LayerIndex').getElementsByTagName('ul');
	for( var i = 0; i < uls.length; i++ )
		uls[i].style.display = (i == ordinalIndex || ordinalIndex == -1) ? '' : 'none';
};

function firstCharactersList(arrayIndex) {
	var list = new Array();
	var firstCharacter;
	for( var i = 0; i < arrayIndex.length; i++ )
		if( arrayIndex[i].firstLetter() != firstCharacter ) {
			firstCharacter = arrayIndex[i].firstLetter();
			list[list.length] = arrayIndex[i].firstLetter();
		}
	return list;
};

/*********************************************************************************
 * Register all methods that need onLoad event handling.
 *********************************************************************************/
 
registerOnLoadHandler(featureInitialize);
registerOnLoadHandler(initializePopupIndex); /* this one must appear above popmenuInitialize */
registerOnLoadHandler(popmenuInitialize);
registerOnLoadHandler(initializeMenus);
