/*************************************************************
* The womOn() function will set the window.onload function to
* be womGo() which will run all of your window.onload
* functions.
*************************************************************/
function womOn(){
  window.onload = womGo;
}
/*************************************************************
* The womGo() function loops through the woms array and
* runs each function in the array.
*************************************************************/
function womGo(){
  for(var i = 0;i < woms.length;i++)
    eval(woms[i]);
}
/*************************************************************
* The womAdd() function will add another function to the woms
* array to be run when the page loads.
*************************************************************/
function womAdd(func){
  woms[woms.length] = func;
}
/*************************************************************
* The woms array holds all of the functions you wish to run
* when the page loads.
*************************************************************/
var woms = new Array();








document.getElementsByClassName = function(name) {
	var elm = elm || document;
	var results = new Array();
	var elems = elm.getElementsByTagName("*");
	for (var i=0; i<elems.length; i++) {
		if (elems[i].className.indexOf(name) != -1) {
			results[results.length] = elems[i];
		}
	}
	return results;
};






function removePrevLevelMenuArrow(containerName,containerIndicator,activeElement,active){
	
	containerIndicator = containerIndicator || "ID";//default value for containerIndicator
	var containerList;
	var container;
	var listitemList;
	var listitem;
	var activeList = [];
	
	if( containerIndicator.toUpperCase() == "ID" )
		containerList = document.getElementById( containerName );
	else if( containerIndicator.toUpperCase() == "CLASS" )
		containerList = document.getElementsByClassName( containerName );
	else
		return;
	
	//Loop over all containers
	for( var i=0; i<containerList.length; i++ ){
		
		container = containerList[ i ];
		listitemList = document.getElementsByTagName( activeElement );
		//Loop over all listitems
		for(var j=0; j<listitemList.length; j++){
			listitem = listitemList[ j ];
			if( listitem.className.toUpperCase().indexOf( active.toUpperCase() ) != -1 )
				activeList[ activeList.length ] = listitem;
		}//end for
		
		//alert(activeList.length);
		//Loop over all active items, execpt the last one (=deepest level)
		for(var k=0; k<activeList.length - 1; k++)
			activeList[ k ].style.backgroundImage = "none";
		
	}//end for
	
	
	
}//end function





function mkEqualHeightCols(containerName,containerIndicator,ColName){
	
	containerIndicator = containerIndicator || "ID";//default value for containerIndicator
	var containerList;
	var container;
	var columnList = [];
	var column;
	var columnHeights = [];
	var maxHeight = 0;//startvalue, increases later
	var myHeight;
	
	

	if( containerIndicator.toUpperCase() == "ID" )
		containerList = document.getElementById( containerName );
	else if( containerIndicator.toUpperCase() == "CLASS" )
		containerList = document.getElementsByClassName( containerName );
	else
		return;
		
	
	//Loop over all containers
	for( var i=0; i<containerList.length; i++ ){
		
		container = containerList[ i ];
		columnList = document.getElementsByClassName( ColName , container );
		//Loop over all columns
		for(var j=0; j<columnList.length; j++){
			column = columnList[ j ];
			//Found one of the desired columns, save its height
			if( column.className.toUpperCase().indexOf( ColName.toUpperCase() ) != -1 ){
				myHeight = column.offsetHeight;
				//maxHeight hasn't been set yet
				if( maxHeight < 1 && myHeight >= 1 )
					maxHeight = myHeight;
				//When maxHeight has been set, but is less than myHeight
				else if( maxHeight > 1 && maxHeight < myHeight )
					maxHeight = myHeight;
			}//end if
		}//end for
		
		//Loop over all active items, execpt the last one (=deepest level)
		for(var k=0; k<columnList.length; k++){
			column = columnList[ k ];
			column.style.height = maxHeight + "px";
		}//end for
		
		
	}//end for
	
	
	
}//end function