
overColor = 'cccccc';
outColor = 'efefef'
timeoutFlag = 0;
numMenus = 3;


function ShowDetail(divid)
{

document.getElementById('displaydiv').innerHTML = document.getElementById(divid).innerHTML;
}

function HideDetail()
{
document.getElementById('displaydiv').innerHTML = '';
}


function navigate(rollOver,nav,state) {

	if (state == 'on') {
		for (i=1;i<=numMenus;i++) {
			divObj = buildDivObj('nav' + i);
			closeThisNav = 'nav' + i;
			if (closeThisNav != nav) {
				closeNav(divObj);
			}
		}
	}

	thisNav = nav;
	divObj = buildDivObj(thisNav);
	
	if (state == 'on') {
		timeoutFlag = 0;
		rollOver.style.backgroundColor=overColor;
		openNav(thisNav);
	} else {
		timeoutFlag = 1;
		rollOver.style.backgroundColor=outColor;
		setTimeout('closeNav(thisNav)',1000);
	}
}

function buildDivObj(nav) {
	if (document.all) {
		thisNav = eval('document.all.' + nav);
	} else {
		thisNav = eval('document.getElementById(\'' + nav + '\')');
	}
	return thisNav;
	
}

function openNav(divObj) {
	divObj.style.visibility = 'visible'
}

function closeNav(divObj) {
	if (timeoutFlag == 1) {
		divObj.style.visibility = 'hidden';
	}
}

function positionMenus() {
	for (i=1;i<=numMenus;i++) {
		xPos = 0;
		yPos = 0;
		if (document.all) {
			prefix = 'document.all.main' + i;
		} else {
			prefix = 'document.getElementById(\'main' + i + '\')';
		}
		offsetObj = eval(prefix);
		while (offsetObj) {
			xPos += offsetObj.offsetLeft;
			yPos += offsetObj.offsetTop;
			prefix += '.offsetParent';
			offsetObj = eval(prefix);
		}
		thisMenu = buildDivObj('nav' + i);
		thisMenu.style.left = xPos - 50;
		thisMenu.style.top = yPos + 28;
	}
}

function PopUpEmail(contactid)
{
	window.open('email.aspx?contactid=' + contactid ,'','height=450,width=400,resizable=yes');
	
	return;
}

