function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function confirmDel() {
	if (confirm("Are you sure you want to delete this?")) return true;
	else return false;
}

var MSIE = (navigator.appName == "Microsoft Internet Explorer" &&  parseInt(navigator.appVersion) >= 4);
var hideToggle;

function showSubNav(i) {
	hideToggle = i;
	var pos = findPos(document.getElementById('parent_' + i));
	//var offset = parseInt(document.getElementById('parent_width_' + i).innerHTML);
	//offset = offset - parseInt(document.getElementById('child_width_' + i).innerHTML) - 10;

	if (MSIE) {
		document.getElementById('child_' + i).style.left = pos[0]  - 5 + 'px';
		document.getElementById('child_' + i).style.top = pos[1] + 24 + 'px';
	} else {
		document.getElementById('child_' + i).style.left = pos[0]  - 5 + 'px';
		document.getElementById('child_' + i).style.top = pos[1] + 16 + 'px';
	}
	//openSubNav(i, 0);
	document.getElementById('child_' + i).style.visibility = 'visible';
}
/*
function openSubNav(i, x) {
	var child = document.getElementById('child_' + i).getElementsByTagName('li');
	if (child[x]) {
		child[x].style.visibility = 'inherit';
		setTimeout('openSubNav(' + i + ',' + (x+1) +')', 100);
	} 
} */

function hideSubNav() {
	hideToggle = 'off'; 
	setTimeout('hideIt()', 500);
}
					 
function hideIt() {
	var i = 0;
	while (document.getElementById('child_' + i)) {
		if (hideToggle != i)
			document.getElementById('child_' + i).style.visibility = 'hidden';
			
		i++;
	}
}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft, curtop];
}
