
	/*
	
	FILE:			education.js
	
	DESCRIPTION:	An external script for the ICONS Project's public education website.
	
	AUTHOR:		Alex Jonas
	
	Last Modified:		9/23/2009
	
	
	*/


	function initPage() {
	
		if (document.forms.length > 0) {
		
			initForm();
		
		}
	
		var elem = document.getElementById('sub_menu_list');
		
		var arrSideMenuItems = elem.getElementsByTagName('li');
		
		for (var i = 0; i < arrSideMenuItems.length; i++) {
		
			arrSideMenuItems[i].onmouseover = function() { 
													if ( this.firstChild.className.indexOf('_selected') == -1 ) {	//I.e., they are _not_  a selected menu item
													
														if ( this.parentNode.id.toLowerCase() == 'sub_menu_list' ) {
															//this.firstChild.className = 'sub_menu_item_highlight';	//"DOM Level 0" -- works with all browsers
															this.firstChild.setAttribute('class', 'sub_menu_item_highlight');
															this.firstChild.setAttribute('className', 'sub_menu_item_highlight');  //For IE
														} else if ( this.parentNode.id.toLowerCase() == 'sub_menu_level2_list' ) {
															this.firstChild.setAttribute('class', 'sub_menu_level2_item_highlight');
															this.firstChild.setAttribute('className', 'sub_menu_level2_item_highlight');  //For IE
														}
														
													}
													
													this.firstChild.onfocus = function() { this.blur(); };  //Removes dashed or dotted lines around selected link.
													
												};
		
			arrSideMenuItems[i].onmouseout = function() {
													if ( this.firstChild.className.indexOf('_selected') == -1 ) {	//I.e., they are _not_  a selected menu item
													
														if ( this.parentNode.id.toLowerCase() == 'sub_menu_list' ) {
															//this.firstChild.className = 'sub_menu_item_unselected';	//"DOM Level 0" -- works with all browsers
															this.firstChild.setAttribute('class', 'sub_menu_item_unselected');
															this.firstChild.setAttribute('className', 'sub_menu_item_unselected');  //For IE
														} else if ( this.parentNode.id.toLowerCase() == 'sub_menu_level2_list' ) {
															this.firstChild.setAttribute('class', 'sub_menu_level2_item_unselected');
															this.firstChild.setAttribute('className', 'sub_menu_level2_item_unselected');  //For IE
														}
													}
													
												};
		
		}		
	
	}
	
	var arrTable = document.getElementsByTagName('table');
	
	for (var i = 0; i < arrTable.length; i++) {
	
		if ( arrTable[i].className.toLowerCase() == 'data' ) {
		
			arrRow = arrTable[i].getElementsByTagName('tr');
			
			for (var j = 1; j < arrRow.length; j++) {	//Start with 1 to exclude first row, assumed to be a row of table header (th) elements.
			
				arrRow[j].onmouseover = function() {
												dataRowColor = this.style.backgroundColor;
												this.style.backgroundColor = '#DEDEDE';
												this.style.color = '#14499D';
												//this.style.fontWeight = 'bold';
												
											};
												
				arrRow[j].onmouseout = function() {
												this.style.backgroundColor = dataRowColor;
												this.style.color = '#000000'; 
												//this.style.fontWeight = 'normal';
												
											};
			
				arrRow[j].onclick = function() {
												this.style.backgroundColor = dataRowColor;
												this.style.color = '#000000'; 
												//this.style.fontWeight = 'normal';
												
											};
			
			}
			
		}
	
	}
	
	var dataRowColor;
	
	window.onload = initPage;

	
