arrowOn		= new Image;	arrowOn.src	= "/images/nav/arrowOn.gif";
arrowOff	= new Image;	arrowOff.src	= "/images/nav/arrowOff.gif";
arrowDown	= new Image;	arrowDown.src	= "/images/nav/arrowDown.gif";

// main nav styles
var mainNavBgColor = '000000';
var mainNavColor = 'ffffff';
var mainNavRollover = 'cc6600';

var mainFontSize = '11px';
var subFontSize = '11';

// rollover
var subNavColor = '000000';
var subNavBgColor = 'ededee';
var subNavBgRollover = 'd5d3bf';

// Main Navigation
mainNavs = new Array();
	mainNavs[0] = new menuItem('HOME','/index.asp');
	mainNavs[1] = new menuItem('|&nbsp;&nbsp;SOLUTIONS','/solutions/');
	mainNavs[2] = new menuItem('|&nbsp;&nbsp;BENEFITS','/benefits/');
	mainNavs[3] = new menuItem('|&nbsp;&nbsp;TESTIMONIALS','/testimonials/');
	mainNavs[4] = new menuItem('|&nbsp;&nbsp;ABOUT','/about/');
	mainNavs[5] = new menuItem('|&nbsp;&nbsp;SUPPORT','/support/');
	mainNavs[6] = new menuItem('|&nbsp;&nbsp;SIGN UP','/register/');

//HOME
sub0 = new Array();

// SOLUTIONS MENU
sub1 = new Array();
	sub1[0] = new menuItem('Home &amp; Home Office','/home/index.asp');
	sub1[1] = new menuItem('Digital Photographers','/home/digitalphotographer.asp');
	sub1[2] = new menuItem('Music Enthusiasts','/home/musiclovers.asp');
	//sub1[3] = new menuItem('Small Business','/smallbusiness/index.asp');

// BENEFITS MENU
sub2 = new Array();

// TESTIMONIALS CENTER
sub3 = new Array();

// ABOUT
sub4 = new Array();
	sub4[0] = new menuItem('About Iron Mountain Digital','/about/company.asp');
	sub4[1] = new menuItem('Connected&reg; Backup for PC and Mac','/about/backup.asp');
	sub4[2] = new menuItem('How It Works','/about/howitworks.asp');

// SUPPORT
sub5 = new Array();
	sub5[0] = new menuItem('Manage Your Account','/manage/index.asp');
	sub5[1] = new menuItem('Online User\'s Guide','/support/guide.asp');
	sub5[2] = new menuItem('Frequently Asked Questions','/support/faqs.asp');
	sub5[3] = new menuItem('System Requirements','/support/reqs.asp');
	sub5[4] = new menuItem('Submit a Billing Question','/billing/form.asp');
	sub5[5] = new menuItem('Contact Support','/support/contact.asp');

// REGISTER
sub6 = new Array();
	sub6[0] = new menuItem('Plans for 1-4 PCs / Macs','/plans/soho.asp');
	sub6[1] = new menuItem('Plans for 5-100 PCs / Macs','/plans/smb.asp');
	sub6[2] = new menuItem('30-Day Free Trial','/trial/index.asp');

// total number of subsub menus
totalSubSubs = 0;
totalSubSubSubs = 0;


ns = (document.layers)? true:false
ie = (document.all)? true:false
ns6 = (navigator.appName == "Netscape" && document.getElementById)? true:false
winIE5 = false;
macIE = false;
macNS = false;
var browserString = navigator.appVersion;
if (navigator.userAgent.indexOf("Win") > -1 && navigator.appName == "Microsoft Internet Explorer"){
	if (parseInt(browserString.charAt(22)) < 6){
		winIE5 = true;
	}
}
if (navigator.userAgent.indexOf("Mac") > -1 && navigator.appName == "Microsoft Internet Explorer"){
	macIE = true;
}else if(navigator.userAgent.indexOf("Mac") > -1 && navigator.appName != "Microsoft Internet Explorer"){
	macNS = true;
}

function hide(id){
	if (ns) document.layers[id].visibility = "hide"
	if (ns6){
		var obj = eval("document.getElementById('" + id + "')")
		obj.style.visibility = "hidden"
	}
	else if (ie) document.all[id].style.visibility = "hidden"
}
function show(id){
	if (ns) document.layers[id].visibility = "show"
	if (ns6){
		var obj = eval("document.getElementById('" + id + "')")
		obj.style.visibility = "visible"
	}
	else if (ie) document.all[id].style.visibility = "visible"
}

loaded = false;
function findPosX(obj){
	var curleft = 0;
	if (document.getElementById || document.all){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
		return curleft;
	}
}

function findPosY(obj){
	var curtop = 0;
	if (document.getElementById || document.all){
		while (obj.offsetParent){
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
		return curtop;
	}else{
		curtop += obj.y;
		return curtop;
	}
}

function doMainNav(theIndex){
	for(i = 1; i <= (mainNavs.length - 1); i ++){
		if(i == theIndex){
			show("menu" + i);
			show("bigHide");
			show("bigHide2");
			for(m = 1; m <= totalSubSubs; m ++){
				hide("menuSub" + m);
			}

		var obj = eval("document.getElementById('butID" + i + "')")
		obj.style.backgroundColor='000000';

		//Main nav Font rollover color
		obj.style.color = mainNavRollover;
		obj.style.fontSize = mainFontSize;
		}else{
			hide("menu" + i);
			var obj = eval("document.getElementById('butID" + i + "')")
			obj.style.backgroundColor = mainNavBgColor;
			obj.style.fontSize = mainFontSize;

			//Main nav Font base color
			obj.style.color = mainNavColor;
		}
	}
	if(theIndex == 0){
		//home menu
		//Main nav Font rollover color
		var objHome = eval("document.getElementById('butID" + 0 + "')")
		objHome.style.backgroundColor='000000';
		objHome.style.color = mainNavRollover;
		objHome.style.fontSize = mainFontSize;
	}

	if(theIndex == -1){
		for(m = 1; m <= totalSubSubs; m ++){
			hide("menuSub" + m);
		}
		doSubNav(-1, 1, -1, -1);
		for(m = 1; m <= totalSubSubSubs; m ++){
			hide("menuSubSub" + m);
		}
		doSubSubNav(-1, 1, -1, -1);
		hide("bigHide");
		hide("bigHide2");
	}
}

function mainNavOBJ(theWidth, displayText, whichType, theLink){
	this.theWidth		= theWidth;
	this.displayText	= displayText;
	this.whichType		= whichType;
	this.theLink		= theLink;
}


function writeMainNav(){
	outMainHTML = "";
	outMainHTML += "<table cellpadding=0 cellspacing=0 border=0><tr>"; // width=\"240\"

	if( macIE ){
		//fontTag = "<font style=\"font-size:9px;\">";
		fontTag = "<font style=\"font-size:" + fontSize + ";\">";
		fontTagC = "</font>";
	}else{
		fontTag = "";
		fontTagC = "";
	}

//		outMainHTML += "<td align=\"left\" width=\"150\" class=\"Nav\" id=\"butID" + 0 + "\" nowrap onMouseOver=\"this.style.backgroundColor='#000000';doMainNav(" + 0 + ");;\" onMouseOut=\"this.style.backgroundColor=mainNavBgColor;this.style.color=mainNavColor;\" onClick=\"location='" +
		outMainHTML += "<td  class=\"Nav\" id=\"butID" + 0 + "\" nowrap onMouseOver=\"this.style.backgroundColor='#000000';doMainNav(" + 0 + ");;\" onMouseOut=\"this.style.backgroundColor=mainNavBgColor;this.style.color=mainNavColor;\" onClick=\"location='" +
		mainNavs[0].goLink + "';\">" + fontTag +  mainNavs[0].displayText.replace("_","/") + fontTagC + "</td>";

	for(i = 1; i <= (mainNavs.length - 1); i ++){
		outMainHTML +="<td bgcolor=\"#000000\" width=\"1\"><img src=\"/images/spacer.gif\" width=1 border=0 height=17 align=\"bottom\">";
		outMainHTML += "<td class=\"Nav\" id=\"butID" + i + "\" nowrap onMouseOver=\"this.style.backgroundColor='#000000';doMainNav(" + i + ");\" onClick=\"location='" +
		mainNavs[i].goLink + "';\">" + fontTag +  mainNavs[i].displayText.replace("_","/") + fontTagC + "</td>";
	}
	outMainHTML += "</tr></table>";
	document.write(outMainHTML);
}

function doSubNav(ele, state, subIndex, rowIndex){
	if(state > 0){

		for(m = 1; m < rowCount; m ++){
			if(m == rowIndex){
				if(ns6){
					var obj = eval("document.getElementById('row" + m + "')")
					//Drop down rollover background color for primary drop down
					obj.style.backgroundColor = subNavBgRollover;
					obj.style.color = '196499';
					obj.style.fontSize = subFontSize;
				}else if(ie){
					if(!macIE){
						//Drop down rollover background color for primary drop down
						document.all["row" + m].style.backgroundColor = subNavBgRollover;
						document.all["row" + m].style.fontSize = subFontSize;
					}
					document.all["row" + m].style.color = '196499';
					document.all["row" + m].style.fontSize = subFontSize;
				}
			}else{
				if(ns6){
					var obj = eval("document.getElementById('row" + m + "')")

					//firefox initial drop down background color
					obj.style.backgroundColor = 'ededee';
					obj.style.color = '000000';
					obj.style.fontSize = subFontSize;
				}else if(ie){
					if(!macIE){
						//main background for primary drop down
						document.all["row" + m].style.backgroundColor = subNavBgColor;
						document.all["row" + m].style.fontSize = subFontSize;
					}
					document.all["row" + m].style.color = subNavColor;
					document.all["row" + m].style.fontSize = subFontSize;
				}
			}
		}
		for(k = 1; k <= totalSubSubs; k ++){
			if(k == subIndex){
				show("menuSub" + k);
			}else{
				hide("menuSub" + k);
			}
		}
		for(k = 1; k <= totalSubSubSubs; k ++){
			hide("menuSubSub" + k);
		}
	}
}
function doSubSubNav(ele, state, subIndex, rowIndex){
	if(state > 0){
		for(b = 1; b < rowSubCount; b ++){
			if(b == rowIndex){
				if(ns6){
					var obj = eval("document.getElementById('rowSub" + b + "')")
					obj.style.backgroundColor = subNavBgColor;
					obj.style.color = '196499';
					obj.style.fontSize = subFontSize;
				}else if(ie){
					if(!macIE){
						//sub nav rollover background color
						document.all["rowSub" + b].style.backgroundColor = subNavBgRollover;
						document.all["rowSub" + b].style.fontSize = subFontSize;
					}
					document.all["rowSub" + b].style.color = '196499';
					document.all["rowSub" + b].style.fontSize = subFontSize;
				}
			}else{
				if(ns6){
					var obj = eval("document.getElementById('rowSub" + b + "')")
					obj.style.backgroundColor = 'ededee';
					obj.style.color = '000000';
					obj.style.fontSize = subFontSize;
				}else if(ie){
					if(!macIE){
						document.all["rowSub" + b].style.backgroundColor = '#ededee';
						document.all["rowSub" + b].style.fontSize = subFontSize;
					}
					document.all["rowSub" + b].style.color = '000000';
					document.all["rowSub" + b].style.fontSize = subFontSize;
				}
			}
		}
		for(k = 1; k <= totalSubSubSubs; k ++){
			if(k == subIndex){
				show("menuSubSub" + k);
			}else{
				hide("menuSubSub" + k);
			}
		}
	}
}

function menuItem(displayText,goLink,hasSub,subIndex,topPos,leftPos){
	this.displayText = displayText;
	this.goLink = goLink;
	this.hasSub = hasSub;
	this.subIndex = subIndex;
	this.topPos = topPos;
	this.leftPos = leftPos;
}

rowCount = 1;
rowSubCount = 1;
function writeLayers(){
	outHTML = "";
	findFirstLeftHandPoint=2000;
	menuWith = 250;//120;
	if(ns){
		outHTML += "<div id=\"mud\" style=\"position:absolute;left:0px;top:0px;visibility:hidden;z-index:0;\"></div>"
	}
	for(j = 1; j <= (mainNavs.length - 1); j ++){
		currentMenu = eval("sub" + j);
		theLength = currentMenu.length;
		n = j;
		if(ie){
			anchorX = findPosX(document.all("butID" + n));
			//alert(anchorX);
			anchorY = findPosY(document.all("butID" + n));
		}else if(ns6){
			anchorX = findPosX(document.getElementById("butID" + n));

		}else if(ns){
			anchorX = document.layers["butID" + n].pageX;
		}
		if (anchorX < findFirstLeftHandPoint)
		{
			findFirstLeftHandPoint=anchorX;
		}

		outHTML += "<div id=\"menu" + j + "\" style=\"position:absolute; top:" + masterTop + "px; left:" + anchorX + "px; visibility:hidden; z-index:100;\">";
		if(theLength > 0){
			outHTML += "<table cellpadding=0 cellspacing=0 border=0 width=160>";
			for(z = 0; z < theLength; z ++){
				if(ns){
					theLink = "<a href=\"" + currentMenu[z].goLink + "\">" + currentMenu[z].displayText + "</a>";
					theClass = "subNavNS";
				}else{
					theLink = currentMenu[z].displayText;
					theClass = "subNav";
				}
				if(currentMenu[z].hasSub != null){
					theArrow = "<img src=\"/images/nav/arrowNav2.gif\" width=5 height=5>";
				}else{
					theArrow = "<img src=\"/images/spacer.gif\" width=5 height=5>";
				}
				if(currentMenu[z].hasSub != null){
					sendSubIndex = currentMenu[z].subIndex;
				}else{
					sendSubIndex = -1;
				}
				outHTML += "<tr class=\"" + theClass + "\" onMouseOver=\"doSubNav(this,1," + sendSubIndex + "," + rowCount + ");\" onMouseOut=\"//doSubNav(this,0);\" id=\"row" + rowCount + "\"><td width=6><img src=\"/images/spacer.gif\" width=6 height=18></td><td onClick=\"parent.location='" + currentMenu[z].goLink + "';\">" + theLink + "</td><td width=7>" + theArrow + "</td></tr>";

				if(z < theLength-1){
					outHTML += "<tr><td width=160 bgcolor=\"#ffffff\" colspan=3><img src=\"/images/spacer.gif\" width=1 height=1></td></tr>";
				}

				rowCount ++;
			}
			outHTML += "<tr><td width=160 height=10 bgcolor=\"ededee\" colspan=3></td></tr></table>";
		}
		outHTML += "</div>";
	}
	outHTML += "<div id=\"bigHide\" style=\"position:absolute;left:0px;top:" + masterTop + "px;visibility:hidden;z-index:1;\"><a href=\"#\" onMouseOver=\"doMainNav(-1, 'Off')\"><img src=\"/images/spacer.gif\" width=766 height=300 border=0></a></div>";

	outHTML += "<div id=\"bigHide2\" style=\"position:absolute;left:0px;top:0px;visibility:hidden;z-index:1;\"><a href=\"#\" onMouseOver=\"doMainNav(-1, 'Off')\"><img src=\"/images/spacer.gif\" width=766 height=50 border=0></a></div>";
	writeSubLayers(findFirstLeftHandPoint);
}
function writeSubLayers(anchorX){
	anchorX+=160;

	var bNextRow = false;

	for(a = 1; a <= totalSubSubs; a ++){
		if (a > 5) {
			if (!bNextRow) {
				anchorX+=68;
				bNextRow = true;
			}
		}
		currentMenu = eval("subsub" + a);
		theLength = currentMenu.length;
		outHTML += "<div id=\"menuSub" + a + "\" style=\"position:absolute; top:" + currentMenu[0].topPos + "px; left:" + anchorX + "px; visibility:hidden; z-index:100;\">";
		outHTML += "<table cellpadding=0 cellspacing=0 border=0 width=160>";
		outHTML += "<tr><td width=160 bgcolor=\"#ffffff\" colspan=3><img src=\"/images/spacer.gif\" width=1 height=1></td></tr>";
			for(z = 0; z < theLength; z ++){
				if(ns){
					theLink = "<a href=\"" + currentMenu[z].goLink + "\">" + currentMenu[z].displayText + "</a>";
					theClass = "subsubNavNS";
				}else{
					theLink = currentMenu[z].displayText;
					theClass = "subsubNav";
				}
				if(currentMenu[z].hasSub != null){
					if(currentMenu[z].hasSub == 1){
						theArrow = "<img src=\"/images/nav/arrowNav2.gif\" width=5 height=8>";
					}else{
						theArrow = "<img src=\"/images/spacer.gif\" width=5 height=5>";
					}

				}else{
					theArrow = "<img src=\"/images/spacer.gif\" width=5 height=5>";
				}
				if(currentMenu[z].hasSub != null){
					sendSubIndex = currentMenu[z].subIndex;
				}else{
					sendSubIndex = -1;
				}
				if(currentMenu[z].goLink.indexOf("www.comac.com")>1){
					//open comac sub-menus in new window
					outHTML += "<tr class=\"" + theClass + "\" onMouseOver=\"doSubSubNav(this,1," + sendSubIndex + "," + rowSubCount + ");\" onMouseOut=\"//doSubSubNav(this,0);\" id=\"rowSub" + rowSubCount + "\"><td width=6 style=\"padding: 8px 2px; \"><!--img src=\"/images/spacer.gif\" width=6 height=6--></td><td onClick=\"javascript:window.open('" + currentMenu[z].goLink + "','','');\" width=122>" + theLink + "</td></tr>";
				}else{
					//open all other sub-menus in same window
					outHTML +=  "<tr class=\"" + theClass + "\" onMouseOver=\"doSubSubNav(this,1," + sendSubIndex + "," + rowSubCount + ");\" onMouseOut=\"//doSubSubNav(this,0);\" id=\"rowSub" + rowSubCount + "\"><td width=6 style=\"padding: 8px 2px; \"><!--img src=\"/images/spacer.gif\" width=6 height=6--></td><td onClick=\"parent.location='" + currentMenu[z].goLink + "';\" width=122>" + theLink + "</td></tr>";
				}
				//<td width=7>" + theArrow + "</td></tr>";

				if(z < theLength-1){
					outHTML += "<tr><td width=160 bgcolor=\"#ffffff\" colspan=3><img src=\"/images/spacer.gif\" width=1 height=1></td></tr>";
				}

				rowSubCount ++;
			}
			outHTML += "<tr><td width=160 height=10 bgcolor=\"ededee\" colspan=3></td></tr></table>";
		outHTML += "</div>";
	}
	writeSubSubLayers();
}
function writeSubSubLayers(){
	for(a = 1; a <= totalSubSubSubs; a ++){
		currentMenu = eval("subsubsub" + a);
		theLength = currentMenu.length;
		leftPosition = currentMenu[0].leftPos + 200;
		outHTML += "<div id=\"menuSubSub" + a + "\" style=\"position:absolute; top:" + currentMenu[0].topPos + "px; left:" + leftPosition + "px; visibility:hidden; z-index:100;\">";
		outHTML += "<table cellpadding=0 cellspacing=0 border=0 width=160>";
		outHTML += "<tr><td width=160 bgcolor=\"ededee\" colspan=2><img src=\"/images/spacer.gif\" width=1 height=1></td></tr>";
			for(z = 0; z < theLength; z ++){
				if(ns){
					theLink = "<a href=\"" + currentMenu[z].goLink + "\">" + currentMenu[z].displayText + "</a>";
					theClass = "subsubsubNavNS";
				}else{
					theLink = currentMenu[z].displayText;
					theClass = "subsubsubNav";
				}
				outHTML += "<tr class=\"" + theClass + "\" onMouseOver=\"doLastNav(this,1);\" onMouseOut=\"doLastNav(this,0);\"><td width=6><img src=\"/images/spacer.gif\" width=6 height=32></td><td onClick=\"parent.location='" + currentMenu[z].goLink + "';\" width=154>" + theLink + "</td></tr>";
				if(z < theLength-1){
					outHTML += "<tr><td width=160 bgcolor=\"#ffffff\" colspan=3><img src=\"/images/spacer.gif\" width=1 height=1></td></tr>";
				}
			}
			outHTML += "<tr><td width=160 height=10 bgcolor=\"ededee\" colspan=3></td></tr></table>";
		outHTML += "</div>";
	}
	document.write(outHTML);
	loaded = true;
}