var totalDropMenus = 1;
var totalSubDropMenus = 1;

function toggleSubMenu(obj, childID) {
 oSub = document.getElementById(childID);
 if (oSub.style.visibility == 'visible') {
  if (obj.className.indexOf('Active') != -1)
   obj.className = obj.className.substring(0, obj.className.length - 6);

  if (obj.className == 'menuItem')
   hideAllMenus();
  else
   hideAllSubMenus();
 } else {
  obj.className += 'Active';
  posArr = getPos(obj);
  newX = posArr[0] + obj.offsetWidth + 2;
  newY = posArr[1] - 2;
  if (navigator.appName.indexOf('Mozilla') != -1 && childID == 'subDropMenu0')
	alert('hi');//newY += 1;

  oSub.style.position = 'absolute';
  oSub.style.left = newX + 'px';
  oSub.style.top = newY + 'px';
  oSub.style.visibility = 'visible';
 }
 obj.blur();
}

function getPos(o) {
 newX = o.offsetLeft;
 newY = o.offsetTop;
 while (o.offsetParent) {
  o = o.offsetParent;
  newX += o.offsetLeft;
  newY += o.offsetTop;
 }

 retArr = new Array(newX, newY);
 return(retArr);
}

function hideAllMenus() {
 document.onclick = null;

 for (i=0;i<totalSubDropMenus;i++) {
  document.getElementById('subDropMenu' + i).style.visibility = 'hidden';
  document.getElementById('subDropLink' + i).className = 'menuDropItem';
 }

 for (i=0;i<totalDropMenus;i++) {
  document.getElementById('dropMenu' + i).style.visibility = 'hidden';
  document.getElementById('menuDropLink' + i).className = 'menuItem';
 }
}

function hideAllSubMenus() {
 for (i=0;i<totalSubDropMenus;i++) {
  document.getElementById('subDropMenu' + i).style.visibility = 'hidden';
  document.getElementById('subDropLink' + i).className = 'menuDropItem';
 }
}

function clearTextBox()
{
if (document.getElementById('searchBox').value == "Search Site:")
document.getElementById('searchBox').value = "";
} 