function toggleLayer( whichLayer, plusLayer, minusLayer ) {  
  var elem;
	var elemPlus;
	var elemMinus;
	var vis;
	var visPlus;
	var visMinus;
	
	//var PV = string(plusValue);
  
	if( document.getElementById ) { // this is the way the standards work
    elem = document.getElementById( whichLayer );
    elemPlus = document.getElementById( plusLayer );
    elemMinus = document.getElementById( minusLayer );
	}
  else if( document.all ) { // this is the way old msie versions work      
    elem = document.all[whichLayer];  
    elemPlus = document.all[plusLayer];
    elemMinus = document.all[minusLayer];
	}
  else if( document.layers ) { // this is the way nn4 works
    elem = document.layers[whichLayer];
    elemPlus = document.layers[plusLayer];
    elemMinus = document.layers[minusLayer];
	}

	vis = elem.style;
	if (elemPlus != null) visPlus = elemPlus.style;
	if (elemMinus != null) visMinus = elemMinus.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)?'block':'none';
  
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
	
	if (whichLayer == "calc1") {
		tab_hide_elem = document.getElementById("calc1_tab_hide");
		tab_hide_vis = tab_hide_elem.style;
		tab_show_elem = document.getElementById("calc1_tab_show");
		tab_show_vis = tab_show_elem.style;

		tab2_hide_elem = document.getElementById("calc2_tab_hide");
		tab2_hide_vis = tab2_hide_elem.style;
		tab2_show_elem = document.getElementById("calc2_tab_show");
		tab2_show_vis = tab2_show_elem.style;

		tab3_hide_elem = document.getElementById("calc3_tab_hide");
		tab3_hide_vis = tab3_hide_elem.style;
		tab3_show_elem = document.getElementById("calc3_tab_show");
		tab3_show_vis = tab3_show_elem.style;

		tab_hide_vis.display = (tab_hide_vis.display==''||tab_hide_vis.display=='block')?'none':'block';
		tab_show_vis.display = (tab_show_vis.display==''||tab_show_vis.display=='block')?'none':'block';
		tab2_hide_vis.display = 'block';
		tab2_show_vis.display = 'none';
		tab3_hide_vis.display = 'block';
		tab3_show_vis.display = 'none';
	}

	if (whichLayer == "calc2") {
		tab_hide_elem = document.getElementById("calc2_tab_hide");
		tab_hide_vis = tab_hide_elem.style;
		tab_show_elem = document.getElementById("calc2_tab_show");
		tab_show_vis = tab_show_elem.style;

		tab1_hide_elem = document.getElementById("calc1_tab_hide");
		tab1_hide_vis = tab1_hide_elem.style;
		tab1_show_elem = document.getElementById("calc1_tab_show");
		tab1_show_vis = tab1_show_elem.style;

		tab3_hide_elem = document.getElementById("calc3_tab_hide");
		tab3_hide_vis = tab3_hide_elem.style;
		tab3_show_elem = document.getElementById("calc3_tab_show");
		tab3_show_vis = tab3_show_elem.style;

		tab_hide_vis.display = (tab_hide_vis.display==''||tab_hide_vis.display=='block')?'none':'block';
		tab_show_vis.display = (tab_show_vis.display==''||tab_show_vis.display=='block')?'none':'block';
		tab1_hide_vis.display = 'block';
		tab1_show_vis.display = 'none';
		tab3_hide_vis.display = 'block';
		tab3_show_vis.display = 'none';
	}

	if (whichLayer == "calc3") {
		tab_hide_elem = document.getElementById("calc3_tab_hide");
		tab_hide_vis = tab_hide_elem.style;
		tab_show_elem = document.getElementById("calc3_tab_show");
		tab_show_vis = tab_show_elem.style;

		tab1_hide_elem = document.getElementById("calc1_tab_hide");
		tab1_hide_vis = tab1_hide_elem.style;
		tab1_show_elem = document.getElementById("calc1_tab_show");
		tab1_show_vis = tab1_show_elem.style;

		tab2_hide_elem = document.getElementById("calc2_tab_hide");
		tab2_hide_vis = tab2_hide_elem.style;
		tab2_show_elem = document.getElementById("calc2_tab_show");
		tab2_show_vis = tab2_show_elem.style;

		tab_hide_vis.display = (tab_hide_vis.display==''||tab_hide_vis.display=='block')?'none':'block';
		tab_show_vis.display = (tab_show_vis.display==''||tab_show_vis.display=='block')?'none':'block';

		tab1_hide_vis.display = 'block';
		tab1_show_vis.display = 'none';
		tab2_hide_vis.display = 'block';
		tab2_show_vis.display = 'none';
	}
  //if(visPlus.display==''&&elemPlus.offsetWidth!=undefined&&elemPlus.offsetHeight!=undefined)
  //  visPlus.display = (elemPlus.offsetWidth!=0&&elemPlus.offsetHeight!=0)?'block':'none';

  visPlus.display = 'none';

	//if(visMinus.display==''&&elemMinus.offsetWidth!=undefined&&elemMinus.offsetHeight!=undefined)
   // visMinus.display = (elemMinus.offsetWidth!=0&&elemMinus.offsetHeight!=0)?'block':'none';
  
  visMinus.display = 'none';
}
