
/* GLOBAL FOOTPRINT NETWORKS */
/* 14/Mar/2004 16:31 EVERETT CAMPBELL::everett_campbell@hotmail.com */

<!-- start hiding

/* ----------------------------------------- */

document.GFN = new Object();
document.GFN.hirelist = new Object();
document.GFN.hirelist.expandos = new Array();
document.GFN.hirelist.heights = new Array();
document.GFN.hirelist.names = new Array();

/* ----------------------------------------- */

function open_popup(page) {
msgbox (page);
	window.open("http://www.footprintnetwork.org/gfn_sub.php?content=" & page ,'','scrollbars=no, menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
}


function GFN_checkIn(id) {
    if (document.layers){
	return document.layers[id];
    } else {
	return document.getElementById(id);
    }

  if (document.all) {
      alert("id:" + document.getElementById(id).id);
//    return document.all[id]
return document.getElementById(id);
  } else if(document.layers) {
    return document.layers[id];
  } else {
      return document.getElementById(id);
  }	
}

/* ----------------------------------------- */

function GFN_align() {
    var i,j,stupid_netscape_array_infinate_loop_error;
    stupid_netscape_array_infinate_loop_error =
	document.GFN.hirelist.expandos.length;
    for(i=0; i<stupid_netscape_array_infinate_loop_error; i++) {
	j = i + 1;
	if(document.GFN.hirelist.expandos[j]){
	    if(document.layers) {
		document.GFN.hirelist.expandos[j].top =
		    document.GFN.hirelist.expandos[i].top
		    +
		    document.GFN.hirelist.expandos[i].clip.bottom;
	    }
	}
    }
}

/* ----------------------------------------- */

function GFN_toggle(id) {
  if (document.all){
    if(document.all[id].style.display == 'none'){
      document.all[id].style.display = '';
    } else {
      document.all[id].style.display = 'none';
    }
  } else if (document.getElementById){
    if(document.getElementById(id).style.display == 'none'){
      document.getElementById(id).style.display = 'block';
    } else {
      document.getElementById(id).style.display = 'none';
    }
  } else if(document.layers) {
      if(parseInt(id + 1)){
	  ditem = id + 1;
      } else {
	  ditem = document.GFN.hirelist.names[id];
      }
      if(document.GFN.hirelist.expandos[ditem].clip.bottom == 0) {
	     document.GFN.hirelist.expandos[ditem].clip.bottom = 
		 document.GFN.hirelist.heights[ditem];
      } else {
	  document.GFN.hirelist.expandos[ditem].clip.bottom = 0;
      }
      GFN_align();
  }
}

/* ----------------------------------------- */

function GFN_imageToggle(daImage, src1, src2, netscape_container){
    var objStr,obj;
    // Check to make sure that images are supported in the DOM.
    if(document.layers){
	//document.layers['container'].
	myImage = document.layers[netscape_container].document.images[daImage];
    } else if(document.images){ 
	myImage = document.images[daImage];
    } else if (!document.all && !document.layers){
	myImage = document.getElementByID(daImage);
    }

    // Check to see whether you are using a name, number, or object
	if(myImage.src == src1){
	    myImage.src = src2;
	} else {
	    myImage.src = src1;
	}
}

/* ----------------------------------------- */

function GFN_initialize_toolbar(){
    if(document.layers) {
		for(i=0; i<document.layers['container'].document.layers.length; i++){
	    	document.GFN.hirelist.expandos[i] = document.layers['container'].document.layers[i];
	    	document.GFN.hirelist.names[document.layers['container'].document.layers[i].name] = i;
	    	document.GFN.hirelist.heights[i] = document.GFN.hirelist.expandos[i].clip.bottom;
		}
		for (p=0;p<document.GFN.hirelist.expandos.length;p=p+2){
	    	GFN_toggle(p);
		}
		document.layers['container'].visibility = 'visible';
    } else if (document.all){
		for(i = 0; i < document.all('container').all.length; i++){
		    document.all('container').all[i].style.position = 'relative';
		    if(document.all('container').all[i].className == 'menu'){
			document.all('container').all[i].style.display = 'none';
		    }
		}
		document.all('container').style.visibility = 'visible';
    } else if (document.getElementsByTagName && document.getElementById){
		var contained = document.getElementById('container').getElementsByTagName('div');
		for(i = 0; i < contained.length; i++){
		    contained[i].style.position = 'relative';
		    if(contained[i].getAttribute('class') == 'menu'){
			contained[i].style.display = 'none';
		    }
		}
		document.getElementById('container').style.visibility = 'visible';
    }
}

/* ----------------------------------------- */

var hidden="";
var visible="";
var toggle = "toggle";
if (document.layers) {
    hidden = "hide";
    visible = "show";
} else {
    hidden = "hidden";
    visible = "visible";
}


/* ----------------------------------------- */
// Used on the homepage only
function GFN_changeVisibility(menuNum,action) {
    var ns= (document.layers) ? true : false;

    // get a good object reference
    var daObj = GFN_checkIn(menuNum);
    if (action == 'hidden') {
	if (ns) {daObj.hidden=true;}
	daObj.style.visibility = hidden;
    } else if (action == 'visible') {
	if (ns) {daObj.hidden=false;}
	daObj.style.visibility = visible;
alert("state:" +	daObj.style.visibility);
    } else if (action == 'toggle') {
	if (ns) {
	    if (daObj.hidden){daObj.hidden=false;
	    } else {	      daObj.hidden=true;
	    }
	} else {
	    if (daObj.style.visibility == visible){
		daObj.style.visibility = hidden;
	    } else if (daObj.style.visibility == hidden) {
		daObj.style.visibility = visible;
	    }
	}
    }
    return false;
}


// stop hiding -->

/* GLOBAL FOOTPRINT NETWORK */
