﻿// Java Script for display and hide glossary with A - Z 

var gls_ids=new Array('Div_A', 'Div_B', 'Div_C', 'Div_D', 'Div_E', 'Div_F', 'Div_G', 'Div_H', 'Div_I', 'Div_J', 'Div_K', 'Div_L', 'Div_M', 'Div_N', 'Div_O', 'Div_P', 'Div_Q', 'Div_R', 'Div_S', 'Div_T', 'Div_U', 'Div_V', 'Div_W', 'Div_X', 'Div_Y', 'Div_Z');



function gls_hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<gls_ids.length;i++){
		gls_hidediv(gls_ids[i]);
	}		  
}

function gls_hidediv(id) {

if(document.getElementById(id) != null)
{
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
	//alert(document.getElementById(id).style.display);
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
 }
}

// JavaScript Document
function toggleGlossaryLayer(whichLayer) {
gls_hideallids();
var elem, vis;
if(document.getElementById) // this is the way the standards work
elem = document.getElementById(whichLayer);
else if(document.all) // this is the way old msie versions work
elem = document.all[whichLayer];
else if(document.layers) // this is the way nn4 works
elem = document.layers[whichLayer];
vis = elem.style;
 // if the style.display value is blank we try to figure it out here
if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}



///* this is for sub menu */

//var subMenuids = [];


//function subMenuHideallids()
//{
//	//loop through the array and hide each element by id
//	for (var i=0;i<subMenuids.length;i++)
//	{
//		document.getElementById(subMenuids[i]).className = 'none';
//	}		  
//}

////function dynamically add the values
//function addsubMenuidsToArray(newElement)
//{
//    subMenuids[subMenuids.length] = newElement;
//}

//function subMenuids_hideallids()
//{
//	for (var i=0;i<subMenuids.length;i++)
//	{
//	    gls_hidediv(subMenuids[i]);
//		//document.getElementById(ids[i]).className = 'none';
//	}	
//}


//// JavaScript Document
//function toggleSubMenuLayer(whichLayer) {
//subMenuids_hideallids();
//var elem, vis;
//if(document.getElementById) // this is the way the standards work
//elem = document.getElementById(whichLayer);
//else if(document.all) // this is the way old msie versions work
//elem = document.all[whichLayer];
//else if(document.layers) // this is the way nn4 works
//elem = document.layers[whichLayer];
//vis = elem.style; // if the style.display value is blank we try to figure it out here
//if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
//vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
//vis.display = (vis.display==''||vis.display=='block')?'none':'block';
//}

