function showHideTR(what,doWhat) { // v6.0

	if (document.getElementById(what) != null ) 
		{ var el = document.getElementById(what); }
	else 
		{ var el = getElementsByClass(what); }
	
	
	//  this loops thru the array and sets the style you want
	for (var i=0; i < el.length; i++)
	{	
		obj = el[i] // .style.display = checked ? "block" : "none";

		if (obj.style) 
			{ 
				obj=obj.style; 
				if (obj.display == "" )
					{ v = "hide" }
				else if (obj.display == "inline" )
					{  v = "hide" }
				else if (obj.display == "block" )
					{  v = "hide" }
				else if (obj.display == "none" )
					{  v = "show" }
				
				// alert(doWhat+' '+typeof(doWhat))
				if ((doWhat != '') && (typeof(doWhat) != 'undefined')) v = doWhat
				if (v=="show") 
				{
				try { obj.display='';} 
				catch(e) { }
				
				}
			else if (v=="hide") 
				{
				try { obj.display='none';} 
				catch(e) { }
				}
			// alert(obj.display)
			}
	}
}


function MM_showHideLayersDecide(where) { // v6.0
	theDiv = MM_findObj(where)
// 	alert(theDiv.style.visibility)
	// alert(theDiv.style.display)
	
	if (theDiv.style.display == "" )
		{ showHideTR (where+"",'','hide'); // new_showHideLayers (where,'','hide') 
		}
	else if (theDiv.style.display == "table-row" )
		{  showHideTR (where+"",'','hide') ;//  new_showHideLayers (where,'','hide') 
		}
	else if (theDiv.style.display == "block" )
		{  showHideTR (where+"",'','hide') ;//  new_showHideLayers (where,'','hide') 
		}
	else if (theDiv.style.display == "none" )
		{  showHideTR (where+"",'','show') ; // new_showHideLayers (where,'','show') 
		}
	else {	alert(theDiv.style.display)}
// 	else 
// 		{alert ('show'); // MM_showHideLayers (theDiv,'','show') 
// 		}

}

function getElementsByClass(searchClass,node,tag) 
	{
		var classElements = new Array();
		if ( node == null ) node = document;
		if ( tag == null ) tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
		
		for (i = 0, j = 0; i < elsLen; i++) 
			{ 
				if (els[i].className !='')
				{
				// if (els[i].className!='arrow') {alert(els[i].className +': '+ pattern.test(els[i].className))}
				if (( pattern.test(els[i].className) ) || (contains(els[i].className,"-"+searchClass)> -1) || (contains(els[i].className,searchClass+"-")> -1))
					{
					
					// if (confirm(searchClass+';'+els[i].className+';'+els[i].className.indexOf (searchClass))) return false
					classElements[j] = els[i];
					j++;
					}
				}
			}
		return classElements;
	}


