var flag = (navigator.userAgent.indexOf("MSIE") >=0 && parseInt( navigator.appVersion ) >= 4);
var oOpenMenu = null;

if (flag)	
{
	document.onmouseover = mouseover;
	document.onmouseout = mouseout;
}

function OpenMenu(oSrc, oMenu)
{
	var oParEl = idMenuBar;
	var iPosVert = 0;
	var iPosHorz = 0;

	while (oParEl != null)
	{
		iPosVert	+= oParEl.offsetTop;
		oParEl		= oParEl.offsetParent;
	}

	oMenu.style.top = idMenuBar.offsetHeight + iPosVert;

	oParEl = oSrc;
	while (oParEl != null)
	{
		iPosHorz	+= oParEl.offsetLeft;
		oParEl		= oParEl.offsetParent;
	}

	oMenu.style.left = iPosHorz;

	oMenu.style.visibility = "visible";
	oOpenMenu = oMenu;
}

function CloseMenu(oMenu)
{
	oMenu.style.visibility = "hidden";
	oOpenMenu = null;
}

function mouseover()
{
	if (flag)	
	{
		var oSrc = window.event.srcElement;

		if ( oSrc.className == "clsMenuBar" )
		{
			var oMenu = document.all[oSrc.id.replace("idMenuBarItem", "idMenu")];
			if (oOpenMenu && oOpenMenu != oMenu) 
			{
				CloseMenu(oOpenMenu);
			}

			if (oMenu)
			{ 
				OpenMenu(oSrc, oMenu);
			}

			oSrc.style.color="#ff0000";
		}
		else if (oOpenMenu && !oOpenMenu.contains(oSrc) && !idMenuBar.contains(oSrc))
		{ 
			CloseMenu(oOpenMenu);
		}      
	}
}

function mouseout()
{
	if (flag)	
	{
		var oSrc = window.event.srcElement;
		oSrc.style.color = "";
	}
}	

function drawmenus()
{
	var str='';

	if (flag)	
	{	
		str += '<div id="idMenuProducts" class="clsMenu" style="width:110; position:absolute; z-index:1; visibility:hidden;">';
		str += '<a href="bhunter.php">Berry Hunter</a><br>';
		str += '<hr width="100%" size="1" color="white">';
		str += '<a href="diskcat.php">DiskCat 2006</a><br>';
		str += '<a href="mailcheck.php">Mail Check 2000</a><br>';
		str += '</div>';

		str += '<div id="idMenuDownload" class="clsMenu" style="width:110; position:absolute; z-index:1; visibility:hidden;">';
		str += '<a href="/files/BerryHunter.sis">Berry Hunter</a><br>';
		str += '<hr width="100%" size="1" color="white">';
		str += '<a href="/files/DiskCat2006v301.exe">DiskCat 2006</a><br>';
		str += '<a href="/files/MailCheck21.exe">MailCheck 2000</a><br>';
    		str += '</div>';

		str += '<div id="idMenuOrder" class="clsMenu" style="width:100; position:absolute; z-index:1; visibility:hidden;">';
		str += '<a href="https://minibrand.handango.com/minibrand/basket.jsp?addItem=192207&siteId=1966&bNav=1&continueUrl=http://www.codewaves.com">Berry Hunter</a><br>';
		str += '<a href="http://shareit1.element5.com/programs.html?productid=134973">DiskCat 2006</a><br>';
		str += '<a href="http://shareit1.element5.com/programs.html?productid=154464">MailCheck 2000</a><br>';
		str += '</div>';

		str += '<div id="idMenuInfo" class="clsMenu" style="width:70; position:absolute; z-index:1; visibility:hidden;">';
		str += '<a href="contact.php">Support</a><br>';
		str += '<hr width="100%" size="1" color="white">';
		str += '<a href="contact.php">Contact</a><br>';
		str += '</div>';

		
		document.write(str)
	}
}
