/*in order to get the opening of attachments in new window you must
  modifty the start and finish point of the substring to find the 
  Attachments key word within the lotus address /xxxxx/xxxx/xxxx/Attachments
*/

var bgc = "#FFFFFF"; // background color of the item
var tc = "#666666"; // text color of the item

var over_bgc = "#FFA600";
var over_tc = "#FFA600";

function startup(nr) {
	la = Link[0].split("|");
	topsplit = la[0].split(".");
	topdepth = topsplit.length;
	if (nr != 0) {
		nrsplit = nr.split(".");
		openlevel = nrsplit[topdepth - 1];
	}
	toplevelnumber = 0;
	document.write("<table class='menu' cellpadding=2 cellspacing=0>");
	for(i=0;i<Link.length;i++) {
		la = Link[i].split("|");
		thissplit = la[0].split(".");
		if (thissplit.length == topdepth) {
			if (toplevelnumber != 0) {
				document.write("<tr height=2><TD colspan=2 class='navline'>&nbsp;</td></tr>");
			} else {
				document.write("<tr height=5><TD colspan=2></td></tr>");
			}
			toplevelnumber++;
			str = la[2];
	
	//addin	
			switch (str.substring(27,31))
			{
			case "Comp":
				over_bgc = "#FFA600"
				break
			case "Shar":
				over_bgc = "#81007E"
				break
			case "Inve":
				over_bgc = "#529419"
				break
			case "Medi":
				over_bgc = "#000080"
				break			
			default:
				if(str.substring(27,31) == "m/au"){
					over_bgc = "#81007E";
				}
				if(str.substring(27,31) == "m/cu"){
					over_bgc = "#81007E";
				}
			}
//end of adin
			if(str.substring(0,23) == "http://www.computershar") {
						document.write("<tr height=20><TD id='topbar"+toplevelnumber+"' bgcolor='"+over_bgc+"' width=3></TD><TD onmouseover='color(this.id, "+toplevelnumber+")' onmouseout='uncolor(this.id, "+toplevelnumber+")' id='navitem"+toplevelnumber+"'><b><a class='topmenu' href=javascript:launchRemote('" + la[2] + "','550','570','no');>"+ la[1] + "</a></b></TD></TR>");
			}
			else if(str.substring(19, 30) == "Attachments") {
				document.write("<tr height=20><TD id='topbar"+toplevelnumber+"' bgcolor='"+over_bgc+"' width=3></TD><TD onmouseover='color(this.id, "+toplevelnumber+")' onmouseout='uncolor(this.id, "+toplevelnumber+")'  id='navitem"+toplevelnumber+"'><b><a class='topmenu' href='" + la[2] + "' target='_blank'"+ la[1] + "</a></b></TD></TR>");
				}
			else {

			document.write("<tr height=20><td id='topbar"+toplevelnumber+"' bgcolor='"+over_bgc+"' width=3></td><td onmouseover='color(this.id, "+toplevelnumber+")' onmouseout='uncolor(this.id, "+toplevelnumber+")' id='navitem"+toplevelnumber+"'><b><a class='topmenu' href='" + la[2] + "'>"+ la[1] + "</a></b></td></tr>");
			}
			} else {
			if(toplevelnumber == openlevel || nr == 0) {
					str = la[2];
					if(str.substring(0,23) == "http://www.computershar") {
						document.write("<tr height=20><TD class='itemside' width=3></TD><TD onmouseover='colorsub(this.id, "+i+")' onmouseout='uncolorsub(this.id, "+i+")' class='item' id='navsubitem"+i+"'><a class='item' href=javascript:launchRemote('" + la[2] + "','550','570','no');>"+ la[1] + "</a></TD></TR>");
					}
					else if(str.substring(19, 30) == "Attachments") {
				document.write("<tr height=20><TD class='itemside' width=3></TD><TD onmouseover='colorsub(this.id, "+i+")' onmouseout='uncolorsub(this.id, "+i+")' class='item' id='navsubitem"+i+"'><a class='item' href='" + la[2] + "' target='_blank'>"+ la[1] + "</a></TD></TR>");
			}
					else {
				document.write("<tr height=20><TD class='itemside' width=3></TD><TD onmouseover='colorsub(this.id, "+i+")' onmouseout='uncolorsub(this.id, "+i+")' class='item' id='navsubitem"+i+"'><a class='item' href='" + la[2] + "'>"+ la[1] + "</a></TD></TR>");
				}
		}
			}
	}
	document.write("</table>");
}


//might need to chagne the variable which is passed through*************

function color(obj, iobj) {
	//document.getElementById("navitem"+iobj).text = over_tc;
	document.getElementById("navitem"+iobj).bgColor = over_bgc;
	document.getElementById("topbar"+iobj).bgColor = bgc;
}

function uncolor(obj, iobj) {
	//document.getElementById("navitem"+iobj).text = tc;
	document.getElementById("navitem"+iobj).bgColor = bgc;
	document.getElementById("topbar"+iobj).bgColor = over_bgc;
}

function colorsub(obj, iobj) {
	//document.getElementById("navsubitem"+iobj).text = over_tc;
	document.getElementById("navsubitem"+iobj).bgColor = over_bgc;
}

function uncolorsub(obj, iobj) {
	//document.getElementById("navsubitem"+iobj).text = tc;
	document.getElementById("navsubitem"+iobj).bgColor = bgc;
}