var sources = new Object();
var srcp='v:sources';
var toggled = 0; var displayed = 0;

function getElt(id) {
  return document.getElementById ? document.getElementById(id) :
           (document.all ? document.all[id] : 0);
}

function toggle(id, show) {
  var elt = getElt(id);
  if (! elt) return;
  if (show > 0 || (! show && elt.style.display == 'none')) {
    elt.style.display = '';
    toggled = displayed = id;
  } else {
    elt.style.display = 'none';
    toggled = displayed = 0;
  }
}

function oc(){}
function display(id, show) {
  var elt = getElt(id);
  if (toggled && (toggled != id)) {
    toggle(toggled);
  }
  if (! elt) return;
  if (show) {
    elt.style.display = '';
    displayed = id;
  } else if (! toggled) {
    elt.style.display = 'none';
    displayed = 0;
  }
}
function ttoggle(id) {
  var elt = getElt(id);
  if (toggled && (toggled != id)) {
    toggle(toggled);
  }
  if (! elt) return;
  if (toggled) {
    elt.style.display = 'none';
    toggled = displayed = 0;
  } else {
    status = id;
    elt.style.display = '';
    toggled = displayed = id;
  }
}

  
function pviewall(show) {  
  toggle('pv-all', - show);  
  toggle('pvc-all', show);  
  var as = document.body.getElementsByTagName("a");  
  for (i = 0; i < as.length; i++) {  
    if (as[i].id &&   
        ((show > 0 && as[i].id.search(/^po-/) >= 0) ||   
         (show < 0 && as[i].id.search(/^pc-/) >= 0))) {  
      as[i].onclick();  
    }  
  }  
}  
  
function pview(id, show, post) {  
  var lk = getElt('po-' + id);  
  var fr = getElt('pf-' + id);  
  if (! lk || ! fr) return false;  
  toggle('pf-' + id, show);  
  toggle('po-' + id, - show);  
  toggle('pc-' + id, show);  
  if (! show) return;  
  if (fr.src) ;  
  else if (post) postlink(lk, 'pf-'+id);  
  else fr.src = lk.href;  
  return false;  
}  
  
function setts(link) {  
  var qs = link.search;  
  var tf = parent.frames['tree'];  
  if (! tf) return;  
  var state = tf.state;  
  qs = qs.replace(/v%3astate=[^&]*/i, "");  
  if (state) qs += "&v%3astate="+state;  
  link.search = qs;  
}  
  

function toggleLayer(whichLayer) {
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}

function hideLayer(whichLayer) {
        
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = "";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = "";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = "";
	}
}
