document.WebEQ = new Object();
document.WebEQ.menu = new Object();
document.WebEQ.menu.dropdown = new Array();

function WebEQ_initializeToolbar(){
    var i;
    if (document.all){
	for(i = 0; i < document.all('container').all.length; i++){
	    if ((document.all('container').all[i].className == 'header') ||
(document.all('container').all[i].className == 'links')){
		document.WebEQ.menu.dropdown[document.WebEQ.menu.dropdown.length]
= document.all('container').all[i];
	    }
	}
    } else if (document.getElementsByTagName && document.getElementById){
	var contained =
document.getElementById('container').getElementsByTagName('div');
	for(i = 0; i < contained.length; i++){
	    if ((contained[i].getAttribute('class') == 'header') ||
(contained[i].getAttribute('class') == 'links')){
		document.WebEQ.menu.dropdown[document.WebEQ.menu.dropdown.length]
= contained[i];
	    }
	}
    }
}

function WebEQ_collapse(item){
    if(document.WebEQ.menu.dropdown.length){
	if (document.WebEQ.menu.dropdown[item + 1].style.display == 'none'){
	    document.WebEQ.menu.dropdown[item + 1].style.display = '';
	    if(document.WebEQ.menu.dropdown[item].id == 'gristle'){
		document.images[document.WebEQ.menu.dropdown[item].id +
'Img'].src = 'open_gray.gif';
	    } else {
		document.images[document.WebEQ.menu.dropdown[item].id +
'Img'].src = '../images/open.gif';
	    }
	} else {
	    document.WebEQ.menu.dropdown[item + 1].style.display = 'none';
	    if(document.WebEQ.menu.dropdown[item].id == 'gristle'){
		document.images[document.WebEQ.menu.dropdown[item].id +
'Img'].src = 'closed_gray.gif';
	    } else {
		document.images[document.WebEQ.menu.dropdown[item].id +
'Img'].src = '../images/closed.gif';
	    }
	}
    }
}

function WebEQ_imageSwap(daImage, daSrc){
  var objStr,obj;
  /*
    WebEQ_imageSwap()
    Changes the source of an image.
    */

  // Check to make sure that images are supported in the DOM.
  if(document.images){
    // Check to see whether you are using a name, number, or object
    if (typeof(daImage) == 'string') {
      // This whole objStr nonesense is here solely to gain compatability
      // with ie3 for the mac.
      objStr = 'document.' + daImage;
      obj = eval(objStr);
      obj.src = daSrc;
    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
      daImage.src = daSrc;
    }
  }
}

