//sets elements with same class name to equal height
function equalHeight(className) {
	var els = document.getElementsByTagName('*');
	var height = 0;
	var elr = new Array();
	for(var i = 0; i < els.length; i++) {
		if(els[i].className.match(className)) {
			if(els[i].offsetHeight > height) height = els[i].offsetHeight;
			elr.push(els[i]);
		}
	}
	for(var i = 0; i < elr.length; i++)
		elr[i].style.height = new String(height+'px');
}

// toggles divs on and off
function toggleLayer( whichLayer )
{
  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)?'inline':'none';
  vis.display = (vis.display==''||vis.display=='inline')?'none':'inline';
}

function toggleonLayer( whichLayer )
{
  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
  vis.display = 'inline';
}

function toggleoffLayer( whichLayer )
{
  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;
  vis.display = 'none';
}

function toggleLayers( els )
{
    for(var i = 0; i < els.length; i++) {
        toggleLayer(els[i]);
    }
}

function toggleoffLayers( els )
{
    for(var i = 0; i < els.length; i++) {
        toggleoffLayer(els[i]);
    }
}

function toggleonLayers( els )
{
    for(var i = 0; i < els.length; i++) {
        toggleonLayer(els[i]);
    }
}
