t = 80;

needhide = new Array();
needhide['submenu1'] = 1;
needhide['submenu2'] = 1;
needhide['submenu3'] = 1;
needhide['submenu4'] = 1;
needhide['submenu5'] = 1;
needhide['submenu6'] = 1;
needhide['submenu7'] = 1;
needhide['submenu8'] = 1;

function f(id)
{
	document.getElementById(id).style.visibility = 'hidden';
}


function roll(id)
{
	document.getElementById(id).style.visibility = 'visible';
	needhide[id] = 0;
}


function mhide(id)
{
	needhide[id] = 1;
	setTimeout("if(needhide['" + id + "']){f('" + id + "')}", t);
}

function unroll(id)
{
	mhide(id);
}

function pipeline_archive_search(by_what, select) {
	if (select.selectedIndex == 0) {
		location = 'pubs_pipeline_archives';
	}
	else {
		location = 'pubs_pipeline_archives?' + by_what + '=' + select.options[select.selectedIndex].value;
	}
}

function qp_archive_search(by_what, select) {
	if (select.selectedIndex == 0) {
		location = 'pubs_quantitative';
	}
	else {
		location = 'pubs_quantitative?' + by_what + '=' + select.options[select.selectedIndex].value;
	}
}

function toggle_vis(id) {
  var e = document.getElementById(id);
  if (e.style.display == 'block')
    e.style.display = 'none';
  else
    e.style.display = 'block';
  return false;
}

function logout(a) {
  var f = document.createElement('form');
  f.style.display = 'none';
  a.parentNode.appendChild(f);
  f.method = 'POST';
  f.action = a.href;
  var m = document.createElement('input');
  m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method');
  m.setAttribute('value', 'delete');
  f.appendChild(m);
  f.submit();
  return false;
}

