var timer;

var menuImages = Array(3);
menuImages[2] = Array('AIM_Compliance.gif', 'advisors.gif', 'directors2.gif', 'corporate-governance.gif');
menuImages[3] = Array('finance_5year.gif', 'finance_shareprice.gif', 'finance_reports.gif', 'finance_seannounce.gif');
menuImages[6] = Array('whoWeAre.gif', 'history.gif');

var menuLinks = Array(3);
menuLinks[2] = Array('corporate.html', 'advisors.html', 'directors.html', 'corporate_governance.html');
menuLinks[3] = Array('5yearsummary.html', 'shareprice.html', 'reports.cfm', 'SE2009.html');
menuLinks[6] = Array('whoWeAre.html', 'history.html');

var menuWindows = Array(3);
menuWindows[2] = Array('_self','_self','_self','_self');
menuWindows[3] = Array('_self','_blank','_self','_self');
menuWindows[6] = Array('_self','_self');

function showmenu(menu, obj)
{
	position = findPos(obj);
	menuObj = document.getElementById("menulayer");
	menuObj.style.top = position[1] + 30;
	menuObj.style.left = position[0];
	
	newHTML = '';
	for(i=0; i<menuImages[menu].length; i++)
	{
		newHTML += '<a href="' + menuLinks[menu][i] + '" class="menu" onmouseover="cancelMenuOff()" onmouseout="menuOff()" target="' + menuWindows[menu][i] + '">';
		newHTML += '<img src="images/' + menuImages[menu][i] + '" alt="' + menuLinks[menu][i] + '"/>';
		newHTML += '</a>';
	}
	menuObj.innerHTML = newHTML;
	menuObj.style.display = 'block';
}

function menuOff()
{
	timer = setTimeout('hideMenu()', 1000);
}

function hideMenu()
{
	menuObj = document.getElementById("menulayer");
	menuObj.style.display = 'none';
}

function cancelMenuOff()
{
	clearTimeout(timer);
}

function findPos(obj)
{
	var curleft = curtop = 0;
	if (obj.offsetParent)
	{
		do
		{
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
		while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
}

function popUp(url)
{
	seaPrint = window.open(url, 'seaPrint', 'width=800,height=600,scrollbars=yes,menubar=yes');
}

function MM_swapImgRestore()
{
	return true;
}
function MM_swapImage()
{
	return true;
}
function MM_preloadImages()
{
	return true;
}