document.LN = new Object();
document.LN.menu = new Object();
document.LN.menu.dropdown = new Array();

function LN_initializeMenu(){
    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.LN.menu.dropdown[document.LN.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.LN.menu.dropdown[document.LN.menu.dropdown.length] = contained[i];
	      }
	    }
    }
}

function LN_collapse(item){
  if(document.LN.menu.dropdown.length){
	if (document.LN.menu.dropdown[item + 1].style.display == 'none'){
	    document.LN.menu.dropdown[item + 1].style.display = '';
	    document.images[document.LN.menu.dropdown[item].id + 'Img'].src = '';
	}
	else {
	    document.LN.menu.dropdown[item + 1].style.display = 'none';
	}
  } 
  else {
		document.images[document.LN.menu.dropdown[item].id + 'Img'].src = '';
  }
}

function LN_imageSwap(daImage, daSrc){
  var objStr,obj;
  /*
    LN_imageSwap()
    Changes the source of an image.
    Source: Webmonkey Code Library
    (http://www.hotwired.com/webmonkey/javascript/code_library/)

    Author: Shvatz
    Author Email: shvatz@wired.com
    */

  // 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;
    }
  }
}
