var LMIPrefx = "EasyLinkMail";
var suboptions = new Array;
suboptions[1] = new Array;
suboptions[1][0] = "Company";
suboptions[1][1] = "Home|index.htm";
suboptions[1][2] = "About Us|About_Us.htm";
suboptions[2] = new Array;
suboptions[2][0] = "Products";
suboptions[2][1] = "EasyCombineMail|index_EasyCombineMail.htm";
suboptions[2][2] = "EasyLinkMail|index_EasyLinkMail.htm";
suboptions[2][3] = "EasyExportMail|index_EasyExportMail.htm";
suboptions[2][4] = "EasyMailTrimmer|index_EasyMailTrimmer.htm";
suboptions[2][5] = "CooWire|http://www.coowire.com";
suboptions[2][6] = "EasyTaskLink|http://www.easytasklink.com";
suboptions[3] = new Array;
suboptions[3][0] = "Buy Now";
suboptions[3][1] = "Price List|ELM_PriceList.asp";
suboptions[3][2] = "Buy Now|http://www.kmsciences.com/purchase.asp";
suboptions[3][3] = "Payment Info|ELM_Payment_Info.htm";
suboptions[4] = new Array;
suboptions[4][0] = "Help";
suboptions[4][1] = "Help|ELM_How_To.htm";
suboptions[4][2] = "FAQ|ELM_FAQ.htm";
suboptions[5] = new Array;
suboptions[5][0] = "Site Map";
suboptions[5][1] = "Site Map|ELM_SiteMap.htm";

var nowDate = new Date();
var nowYear = nowDate.getYear();
var inclick = false;
var currentAddress = document.location + "";
function stopError() {  return true; }
var copydate = new Date();
var copyyear = copydate.getYear();
var menuett = false;
var RowColor = "";

//window.onerror = stopError;

var noth = "";
var char34 = String.fromCharCode(34);
var movmou;
var updstr = "";
var menuheadcolor  = "white";
var menuheadover = "white";
var menuheadoverbg = "#49589E";
var menubackground = "orange";
var menubodyborder = "white";
var menubodylink = "white";
var menuhighlight = "white";
var menubodylinkbg = menuheadoverbg;
var topnavover = "white";
var topnavoverbg = menuheadoverbg;

//var brow = navigator.appVersion + "";
var brow = navigator.userAgent.toLowerCase() + "";
var is_ie = false; var is_ie5 = false; var is_ie6 = false;
if (brow.indexOf("msie ") != -1) {
    is_ie = true; 
    if (brow.indexOf("msie 5") != -1) is_ie5 = true;
    if (brow.indexOf("msie 6") != -1) is_ie6 = true
    if (brow.indexOf("opera ") != -1) {is_ie = false; is_ie5 = false; is_ie6 = false};
}

// if (brow.indexOf("applewebkit") != -1) {
//    menuheadover = "white";
//    menuheadoverbg = "#316AC5";
//    menuhighlight = "white";
//    menubodylinkbg = menuheadoverbg;
//    topnavover = "white";
//    topnavoverbg = "#316AC5";
//}

w("<style>");
w(".navlink {font-family: tahoma; font-size: 8pt; font-weight: bold; padding-left: 8px; padding-right: 8px; vertical-align: middle}");
w("td.navlink a {text-decoration: none; font-weight: bold}");
w("td.navlink a:hover {text-decoration: underline}");
w(".menuhead {color: " + menuheadcolor + "; cursor: default; padding-left: 8px; padding-right: 8px; font-family: tahoma; font-size: 8pt; font-weight: bold}");
w(".topmenucsik {height: 1px; background-color: " + menubodyborder + "; border-left: 3px solid " + menubackground + "; border-right: 3px solid " + menubackground + "; border-top: 2px solid " + menubackground + "; border-bottom: 2px solid " + menubackground + "}");
w(".menubody {background-color: " + menubackground + "}");
w(".menubody {padding-top: 2px; padding-bottom: 2px; font-size: 85%; white-space: nowrap; border: 1px solid " + menubodyborder + "}");
w(".menubodyb {font-size: 9pt; font-weight: bold;}")
w(".menubodyb a{color: " + menubodylink + "; text-decoration: none}")
w(".menubodyb a:link{color: " + menubodylink + "; text-decoration: none}")
w(".menubodyb a:visited{color: " + menubodylink + "; text-decoration: none}")
w(".menubodylink {display: block; padding-left: 12px; padding-right: 12px; padding-top: 2px; padding-bottom: 3px; border-left: 1px solid " + menubackground + "; border-right: 1px solid " + menubackground + "}");
if (is_ie) {w(".menubodylink {width: 100%}");}
w(".NN {	z-index: 9; visibility: hidden; position: absolute; left: 0px; top: 0px; border: none}");
w(".siderow {padding-top: 2px; padding-bottom: 2px; vertical-align: top; width: 99%} .bullet1 {font-size: 8px; padding-top: 4px; width: 1%; vertical-align: top}");
w(".leftnavlink {font-size: 8pt; padding-top: 3px; padding-bottom: 3px; padding-left: 8px; padding-right: 8px; text-align: right}");
w(".leftnavhighed {background-color: "+menubodylinkbg+"; color: "+menuhighlight+"}");
w(".leftnavdivider {font-size: 1px; border-top: 4px solid white; border-bottom: 1px solid white; padding: 0px; padding-left: 10px; padding-right: 10px; text-align: right; background-color: #C9C9C9}");
w("</style>");

function Nothing()   {return}

function w(text)      {
var textout = text.toString();
document.write(textout);
}

var normalColor, normalBgColor;
function mov(oobj)
{
	normalColor = oobj.style.color;  
	normalBgColor = oobj.style.backgroundColor;  
	oobj.style.color = topnavover;
 	oobj.style.backgroundColor = topnavoverbg;
}
function mou(oobj)
{
	oobj.style.color = normalColor;
	oobj.style.backgroundColor = normalBgColor;
}

function showmenu(mhead, mbody, trig)   {
	if (mbody)
	{
		if (trig)
			{
//			if (inclick) 
//			{
				mbody.style.left = mhead.offsetLeft;
				HideAllMenu();
				mbody.style.display = "";
				if (document.getElementById("Hfrm"))
				{
				document.getElementById("Hfrm").style.top = document.getElementById(mhead.id + "menu").offsetTop; 
				document.getElementById("Hfrm").style.left = mhead.offsetLeft;
				document.getElementById("Hfrm").style.width = document.getElementById(mhead.id + "menuin").offsetWidth; 
				document.getElementById("Hfrm").style.height = document.getElementById(mhead.id + "menuin").offsetHeight;
				document.getElementById("Hfrm").style.visibility = "visible";
				}
//			}
			mhead.style.backgroundColor = menuheadoverbg;
			mhead.style.color = menuheadover;
			menuett = true;
			}
		else 	{
			menuett = false;
			if (document.getElementById("Hfrm")) {document.getElementById("Hfrm").style.visibility = "hidden"};
			mbody.style.display = "none";
			mhead.style.backgroundColor = "";
			mhead.style.color = menuheadcolor;
			}
	}
}

function doClearM(obj)
{
	obj.style.backgroundColor = "";
	obj.style.color = menuheadcolor;
}

function HideAllMenu()
{
	for (i = 1; i < suboptions.length; i++)
	{
		showmenu(document.getElementById("topm" + i), document.getElementById("topm" + i + "menu"), false);
	}
}

function foo(evt) 
{
	var e = (window.event) ? window.event : evt;
	e.cancelBubble = true;
	if (e.stopPropagation) {e.stopPropagation()};
}

function topMenu1()
{
	if (is_ie5) 
	{ w("<span class=NN id=Hfrm src='javascript: false;' frameborder=0></span>")}
	else
	{
		if (is_ie) {w("<iframe class=NN id=Hfrm src='javascript: false;' frameborder=0></iframe>")}
	};
	w("<table cellpadding=0 cellspacing=0 height=25 onmouseover='foo(event)'><tr>");
	for (i = 1; i < suboptions.length; i++)
	{
		var st = suboptions[i][0];
//		w("<td style='cursor: default' nowrap onmouseover='foo(event); showmenu(document.getElementById(\"" + "topm" + i + "\"), document.getElementById(\"" + "topm" + i + "menu\"), true)' class=menuhead id='" + "topm" + i + "'><a href='/sitemap.asp?t="+i+"' style='color: white; text-decoration: none'>" + st + "</a></td>");
		w("<td style='cursor: default' nowrap onmouseover='foo(event); showmenu(document.getElementById(\"" + "topm" + i + "\"), document.getElementById(\"" + "topm" + i + "menu\"), true)' class=menuhead id='" + "topm" + i + "'>" + st + "</a></td>");
	}
	w("</tr>");
	w("</table>");
}

function topMenu2()   
{
	for (i = 1; i < suboptions.length; i++)
	{
		w("<table id='" + "topm" + i + "menu' cellspacing=0 cellpadding=0 border=0 style='position: absolute; top: 25px; left: 10px; display: none; z-index: 10'><tr><td nowrap>");
		w("<table cellpadding=0 cellspacing=0 id='" + "topm" + i + "menuin' onmouseover='foo(event)'><tr><td nowrap class=menubody>");
		w("<table cellspacing=0 cellpadding=0 class='menubodyb'>");
		for (j = 1; j < suboptions[i].length; j++)
		{
			if (suboptions[i][j] != "-")
			{
				var lnkstr = suboptions[i][j].substring(suboptions[i][j].indexOf("|") + 1, suboptions[i][j].length);
				var lnktxt = suboptions[i][j].substring(0, suboptions[i][j].indexOf("|"));
				spacecnt = 0;
				while (lnktxt.indexOf(" ") > -1) {spacecnt += 1; if (spacecnt/4 != parseInt(spacecnt/4)) {lnktxt = lnktxt.replace(" ", "&nbsp;")} else {lnktxt = lnktxt.replace(" ", "<br>")};}
				w("<tr><td nowrap><a href=" + char34 + lnkstr + char34 + " onmouseover='mov(this)' onmouseout='mou(this)' class='menubodylink'>" + lnktxt + "</a></td></tr>");
			}
			else
			{w("<tr><td class=topmenucsik><img src='/images/blank.gif' border=0 height=1></td></tr>");}
		}
		w("</table>");
		w("</td></tr></table>");
		w("</td></tr></table>");
	}
}
