
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";

ns = (document.layers)? true:false
ie = (document.all)? true:false
ns6 = (navigator.appName == "Netscape" && document.getElementById)? true:false
winIE5 = false;
var browserString = navigator.appVersion;
if (navigator.userAgent.indexOf("Win") > -1 && navigator.appName == "Microsoft Internet Explorer"){
	if (parseInt(browserString.charAt(22)) < 6){
		winIE5 = true;
	}
}
macIE = false;
macNS = false;
var browserString = navigator.appVersion;
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"
}
function findPosX(obj){
	var curleft = 0;
	if (document.getElementById || document.all){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
		//alert(curleft);
		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 proceedToCheckout(){
	totalForms = document.forms.length;
	for( x = 0; x < totalForms; x ++ ){
		for(y = 0; y < document.forms[x].elements.length; y ++){
			curELE = document.forms[x].elements[y];
			if( curELE.type == "select-one" && curELE.selectedIndex == 0 ){
				theName = curELE.name;
				if( theName.substring(0,9) == "OrderType" ){
					displayName = "Order Type";
				}
				if( theName.substring(0,6) == "Format" ){
					displayName = "Format";
				}
				if( theName.substring(0,8) == "Language" ){
					displayName = "Language";
				}
				alert("Please select:\n" + displayName);
				curELE.focus();
				return false;
			}
			theName = curELE.name;
			//alert(theName);
			if( theName.substring(0,8) == "quantity" ){
				quantity = curELE.value;
				if( isNaN(quantity) || isStringWhitespace(quantity) ){
					alert("Please enter valid numerals only for Quantity");
					curELE.select();
					return false;
				}/*else if( quantity == 0 ){
					location 	
				}*/
			}
		}
	}
	document.questionForm.submit();
	//location = "../order/checkout.asp";
}

function checkProceedToCheckout(f){
	//alert("hello");
	for(i = 0; i < f.elements.length; i ++){
		//curELE = document.forms[x].elements[y];
		curELE = f.elements[i];
		theName = curELE.name;
		if( curELE.type == "select-one" && curELE.selectedIndex == 0 ){
			//theName = curELE.name;
			if( theName.substring(0,9) == "OrderType" ){
				displayName = "Order Type";
			}
			if( theName.substring(0,6) == "Format" ){
				displayName = "Format";
			}
			if( theName.substring(0,8) == "Language" ){
				displayName = "Language";
			}
			alert("Please select:\n" + displayName);
			curELE.focus();
			return false;
		}
		if( theName.substring(0,8) == "quantity" ){
			quantity = curELE.value;
			if( isNaN(quantity) || isStringWhitespace(quantity) ){
				alert("Please enter valid numerals only for Quantity");
				curELE.select();
				return false;
			}/*else if( quantity == 0 ){
				location 	
			}*/
		}
	}
}

function submitCartContinueBrowsing(){
	document.theShoppingCartForm.doOtherThing.value = "ContinueBrowsing";
	document.theShoppingCartForm.submit();
}

function doLoc(page,action,theValue,id, docForm){
	/*if( theValue == "nogo" ){
		location = "shoppingcart.asp";
	}else{
		quantity = document.forms[docForm].quantity.value;
		if( isNaN(quantity) || isStringWhitespace(quantity) ){
			alert(quantity);
			alert("Please enter numerals only for Quantity");
			location = "shoppingcart.asp";
		}else{
			location = page + "?action=" + action + "&theValue=" + theValue + "&id=" + id + "&quantity=" + quantity;
		}
	}*/
}

function deleteFromCart(id,page){
	decide = confirm("Are you sure to delete?");
	if( decide ){
		//location = page + "?action=deleteFromCart&shoppingID=" + id;
		document.theShoppingCartForm.doOtherThing.value = "deleting";
		document.theShoppingCartForm.deleteID.value = id;
		document.theShoppingCartForm.submit();
	}
}

function checkFinal(bool){
	if(bool == "True"){
		alert("Sorry, your cart is empty");
		return false;
	}
	//alert("submit");
	//return true;
	document.theShoppingCartForm.doOtherThing.value = "SubmitOrder";
	document.theShoppingCartForm.submit();
}

function swap(theName,theImg){
	eval("document." + theName + ".src=" + theImg + ".src");
}

var whitespace = " \t\n\r";
function isEmpty(s){   
	return ((s == null) || (s.length == 0));
}
function isStringWhitespace(s){   
	var i;
	if (isEmpty(s)) return true;
	for (i = 0; i < s.length; i++){
		var c = s.charAt(i);
		if (whitespace.indexOf(c) == -1) return false;
	}
	return true;
}

function checkSearch(f){
	//alert(f.name);
	if( isStringWhitespace(f.searchKeyword.value) ){
		alert("Please enter search criteria");
		f.searchKeyword.focus();
		return false;
	}
	return true;
}

function doMainNav(theIndex,whichRoll){
	for(i = 1; i <= (mainNavs.length - 1); i ++){
		if(i == theIndex){
			swap("arrow" + i,"arrow" + whichRoll);
			if(ns6){
				var obj = eval("document.getElementById('butID" + i + "')")
				obj.style.backgroundImage = "url('../images/nav/bgO.gif')";
				//obj.style.color = '98C0FD';
			}else if(ie){
				if(!macIE){
					document.all["butID" + i].style.backgroundImage = "url('../images/nav/bgO.gif')";
				}
				//document.all["navID" + i].style.color = '98C0FD';
			}
			show("menu" + i);
			show("bigHide");
			show("bigHide2");
			for(m = 1; m <= totalSubSubs; m ++){
				hide("menuSub" + m);
			}
		}else{
			swap("arrow" + i,"arrowOff");
			if(ns6){
				var obj = eval("document.getElementById('butID" + i + "')")
				obj.style.backgroundImage = "url('../images/nav/bg.gif')";
				//obj.style.color = '98C0FD';
			}else if(ie){
				if(!macIE){
					document.all["butID" + i].style.backgroundImage = "url('../images/nav/bg.gif')";
				}
				//document.all["navID" + i].style.color = '98C0FD';
			}
			hide("menu" + i);
		}
	}
	//swap("arrow" + theIndex,"arrow" + whichRoll);
	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;
}

masterTop = 96;

mainNavs = new Array();
	mainNavs[1] = new mainNavOBJ(128, "Home", "On", "../home");
	mainNavs[2] = new mainNavOBJ(129, "Programs/Services", "Down", "../programs");
	mainNavs[3] = new mainNavOBJ(128, "Order Info", "Down", "../order");
	mainNavs[4] = new mainNavOBJ(131, "About Us", "Down", "../about");
	mainNavs[5] = new mainNavOBJ(131, "Contact", "Down", "../contact");

function writeMainNav(){
	outMainHTML = "";
	outMainHTML += "<table cellpadding=0 cellspacing=0 border=0 width=768 background=\"../images/nav/bg.gif\"><tr>";//background=\"../images/nav/bgO.gif\"   bgcolor='778998'
	for(i = 1; i <= (mainNavs.length - 1); i ++){
		outMainHTML += "<td width=24 id=\"navID" + i + "\"><img src=\"../images/nav/arrowOff.gif\" width=24 height=21 border=0 name=\"arrow" + i + "\"></td>";
		outMainHTML += "<td width=" + mainNavs[i].theWidth + " class=\"topNav\" onMouseOver=\"doMainNav(" + i + ",'" + mainNavs[i].whichType + "');\" id=\"butID" + i + "\" onClick=\"location='" + mainNavs[i].theLink + "';\"> &nbsp; " + mainNavs[i].displayText + "</td>";
	}
	outMainHTML += "<td width=1 bgcolor=\"#172F45\"><img src=\"../images/spacer.gif\" width=1 height=1></td></tr></table>";
	//alert(outMainHTML);
	document.write(outMainHTML);
}

function doSubNav(ele, state, subIndex, rowIndex){
	if(state > 0){
		//alert(ele.id);
		//ele.style.backgroundColor = '778998';
		//ele.style.color = '000000';
		for(m = 1; m < rowCount; m ++){
			if(m == rowIndex){
				if(ns6){
					var obj = eval("document.getElementById('row" + m + "')")
					obj.style.backgroundColor = '4D7D9D';
					obj.style.color = '000000';
				}else if(ie){
					if(!macIE){
						document.all["row" + m].style.backgroundColor = '4D7D9D';
					}
					document.all["row" + m].style.color = '000000';
				}
			}else{
				if(ns6){
					var obj = eval("document.getElementById('row" + m + "')")
					obj.style.backgroundColor = '134D7B';
					obj.style.color = 'ffffff';
				}else if(ie){
					if(!macIE){
						document.all["row" + m].style.backgroundColor = '134D7B';
					}
					document.all["row" + m].style.color = 'ffffff';
				}
			}
		}
		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);
		}
	}/*else{
		ele.style.backgroundColor = '19344C';
		ele.style.color = 'ffffff';
	}*/
}
function doSubSubNav(ele, state, subIndex, rowIndex){
	if(state > 0){
		//ele.style.backgroundColor = '2E6FAF';
		//ele.style.color = 'ffffff';
		//alert(rowIndex);
		for(b = 1; b < rowSubCount; b ++){
			if(b == rowIndex){
				if(ns6){
					var obj = eval("document.getElementById('rowSub" + b + "')")
					obj.style.backgroundColor = '77A1B7';
					obj.style.color = 'ffffff';
				}else if(ie){
					if(!macIE){
						document.all["rowSub" + b].style.backgroundColor = '77A1B7';
					}
					document.all["rowSub" + b].style.color = 'ffffff';
				}
			}else{
				if(ns6){
					var obj = eval("document.getElementById('rowSub" + b + "')")
					obj.style.backgroundColor = '4D7D9D';
					obj.style.color = '000000';
				}else if(ie){
					if(!macIE){
						document.all["rowSub" + b].style.backgroundColor = '4D7D9D';
					}
					document.all["rowSub" + b].style.color = '000000';
				}
			}
		}
		for(k = 1; k <= totalSubSubSubs; k ++){
			if(k == subIndex){
				show("menuSubSub" + k);
			}else{
				hide("menuSubSub" + k);
			}
		}
	}/*else{
		ele.style.backgroundColor = '778998';
		ele.style.color = '000000';
	}*/
}
function doLastNav(ele, state){
	if(state > 0){
		ele.style.backgroundColor = 'A4C3D3';//'2E6FAF';
		ele.style.color = '000000';//'ffffff';
	}else{
		ele.style.backgroundColor = '77A1B7';//'778998';
		ele.style.color = 'ffffff';//'000000';
	}
}

function doBar1(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '888888';
		//ele.style.color = '000000';
	}else{
		ele.style.backgroundColor = '41586C';
		//ele.style.color = 'ffffff';
	}
}

function doBar2(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '666666';
		//ele.style.color = '000000';
	}else{
		ele.style.backgroundColor = '788896';
		//ele.style.color = 'ffffff';
	}
}

function doBar2Mid(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '888888';
		//ele.style.color = '000000';
	}else{
		ele.style.backgroundColor = '788896';
		//ele.style.color = 'ffffff';
	}
}

function doBar3(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '888888';
		//ele.style.color = '000000';
	}else{
		ele.style.backgroundColor = 'A8B3BC';
		//ele.style.color = 'ffffff';
	}
}

function doBar4(ele, state){
	if(state > 0){
		ele.style.backgroundColor = 'd3d3d3';
		ele.style.color = '000000';
	}else{
		ele.style.backgroundColor = 'EAEDEE';
		ele.style.color = '#3A5166';
	}
}

function doBar5(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '#d3d3d3';
		ele.style.color = '#000000';
	}else{
		ele.style.backgroundColor = '#000000';
		ele.style.color = '#FFFFFF';
	}
}

function doBar6(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '#20394F';
		ele.style.color = '#000000';
	}else{
		ele.style.backgroundColor = '';
		ele.style.color = '#FFFFFF';
	}
}

function doBarFeatured(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '#ACB6C0';
		//ele.style.color = '#2E475D';
	}else{
		ele.style.backgroundColor = '#C4CBD3';
		//ele.style.color = '#2E475D';
	}
}

function doLibHome(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '#5C6974';
	}else{
		ele.style.backgroundColor = 'transparent';
	}
}

function doLibProg(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '#919191';
	}else{
		ele.style.backgroundColor = 'transparent';
	}
}

function doLibProg2(ele, state){
	if(state > 0){
		ele.style.backgroundColor = '#919191';
	}else{
		ele.style.backgroundColor = '#8395A3';
	}
}

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;
}
sub1 = new Array();
sub2 = new Array();
	sub2[0] = new menuItem("Overview (start here)","../programs");
	sub2[1] = new menuItem("Find A Program","../programs/fourWays.asp",1,1);
	sub2[2] = new menuItem("Training Formats & Deployment Options","../programs/training.asp",1,2);
	sub2[3] = new menuItem("Custom Training Solutions","../programs/solutions.asp",1,3);
sub3 = new Array();
	sub3[0] = new menuItem("Overview (start here)","../order");
	sub3[1] = new menuItem("How To Order","../order/howTo.asp");
	sub3[2] = new menuItem("Free Preview/Demo Requests","../order/preview.asp");
	sub3[3] = new menuItem("Special Offers/Discounts","../order/offers.asp");
	sub3[4] = new menuItem("Licensing Options","../order/options.asp",1,5);
	sub3[5] = new menuItem("MY ORDER Form","../order/shoppingCart.asp");
	sub3[6] = new menuItem("International Orders","../order/international.asp");
	sub3[7] = new menuItem("Policies/Terms","../order/terms.asp",1,6);
sub4 = new Array();
	//sub4[0] = new menuItem("Overview","../about");
	sub4[0] = new menuItem("Who We Are (start here)","../about/whoweare.asp");
	sub4[1] = new menuItem("Why Buy A Commonwealth Program","../about/whyBuy.asp");
	sub4[2] = new menuItem("You're In Good Company","../about/goodCompany.asp");
	sub4[3] = new menuItem("What They're Saying...","../about/theyAreSaying.asp");
sub5 = new Array();
	sub5[0] = new menuItem("Contact Info (start here)","../contact");
	sub5[1] = new menuItem("Email Us Now","../contact/emailus.asp");
	sub5[2] = new menuItem("Your Feedback","../contact/feedback.asp");
	//sub5[3] = new menuItem("TBA Details????","../contact/details.asp");


totalSubSubs = 6;
subsub1 = new Array();
	subsub1[0] = new menuItem("Overview (start here)","../programs/fourWays.asp",0,0,128,305);
	//subsub1[1] = new menuItem("Legal Compliance/Business Ethics Program Library","../programs/showCategories.asp?library=1");
	//subsub1[2] = new menuItem("Information/Computer Security Program Library","../programs/showCategories.asp?library=2");
	//subsub1[3] = new menuItem("Business Continuity/Disaster Recovery Program Library","../programs/showCategories.asp?library=3");
	subsub1[1] = new menuItem("Legal Compliance/Business Ethics Program Library","../s/1_0_0.asp");
	subsub1[2] = new menuItem("Information/Computer Security Program Library","../s/2_0_0.asp");
	subsub1[3] = new menuItem("Business Continuity/Disaster Recovery Program Library","../s/3_0_0.asp");
	subsub1[4] = new menuItem("New & Best-Sellers List","../programs/bestSeller.asp");
	subsub1[5] = new menuItem("Subject/Title Index","../programs/subjectTitleIndex.asp");
	subsub1[6] = new menuItem("Program Finder","../programs/programFinder.asp");
subsub2 = new Array();
	subsub2[0] = new menuItem("Overview (start here)","../programs/training.asp",0,0,161,305);
	subsub2[1] = new menuItem("Video-based Programs","../programs/VideoBasedPrograms.asp");
	subsub2[2] = new menuItem("Web-based E-Learning","../programs/eLearning_main.asp"); //,1,2
	subsub2[3] = new menuItem("Network Licenses/ Deployment Options","../programs/deployment.asp");
	subsub2[4] = new menuItem("Print Publications","../programs/print.asp");
subsub3 = new Array();
	subsub3[0] = new menuItem("Overview (start here)","../programs/solutions.asp",0,0,194,305);
	subsub3[1] = new menuItem("Content Customization Services","../programs/custom.asp");
	subsub3[2] = new menuItem("Custom Productions Division","../programs/productions.asp");
subsub4 = new Array();
	subsub4[0] = new menuItem("Overview (start here)","../order/options.asp",0,0,194,457);
	subsub4[1] = new menuItem("Special Offers/Promos","../order/specialOffers.asp");
	subsub4[2] = new menuItem("Quantity Discounts","../order/specialOffers.asp");
	subsub4[3] = new menuItem("Government Discounts","../order/specialOffers.asp");
subsub5 = new Array();
	subsub5[0] = new menuItem("Overview (start here)","../order/options.asp",0,0,227,457);
	subsub5[1] = new menuItem("Video-based Programs","../order/licenseVideo.asp");
	subsub5[2] = new menuItem("E-Learning Programs","../order/licenseELearning.asp");
	subsub5[3] = new menuItem("Print Publications","../order/licensePrint.asp");
subsub6 = new Array();
	subsub6[0] = new menuItem("Overview (start here)","../order/terms.asp",0,0,326,457);
	subsub6[1] = new menuItem("General Policies/Terms","../order/general.asp");
	subsub6[2] = new menuItem("Site Terms Of Use","../order/siteTerms.asp");
	subsub6[3] = new menuItem("Privacy Policy","../order/privacyPolicy.asp");

totalSubSubSubs = 2;
subsubsub1 = new Array();
	subsubsub1[0] = new menuItem("Legal Compliance/Business Ethics","../programs/showCategories.asp?library=1",0,0,128,440);
	subsubsub1[1] = new menuItem("Information/Computer Security","../programs/showCategories.asp?library=2");
	subsubsub1[2] = new menuItem("Business Continuity/Disaster Recovery","../programs/showCategories.asp?library=3");
subsubsub2 = new Array();
	subsubsub2[0] = new menuItem("E-Learn Detail page TBA???????[link to 2-4B2a]","../programs/detail1.asp",0,0,194,440);
	subsubsub2[1] = new menuItem("E-Learn Detail page TBA???????[link to 2-4B2b]","../programs/detail2.asp");
	subsubsub2[2] = new menuItem("E-Learn Detail page TBA???????[link to 2-4B2c]","../programs/detail3.asp");


function writeTitle(){
	outTitle = "<title>"
	if(iSubSubSuba[0] > -1){
		theSubSubSub = eval("subsubsub" + iSubSubSuba[0]);
		outTitle += theSubSubSub[iSubSubSuba[1]].displayText + " - ";
	}
	if(iSubSub[0] > -1){
		theSubSub = eval("subsub" + iSubSub[0]);
		outTitle += theSubSub[iSubSub[1]].displayText + " - ";
	}
	if(iSub[0] > -1){
		theSub = eval("sub" + iSub[0]);
		outTitle += theSub[iSub[1]].displayText + " - ";
	}
	if(iMainNav > -1){
		outTitle += mainNavs[iMainNav].displayText + " - ";
	}
	outTitle += " Commonwealth Films Inc. BOSTON - Experience Counts For Everything </title>"
	//document.write(outTitle);
}

rowCount = 1;
rowSubCount = 1;
function writeLayers(){
	outHTML = "";
	menuWith = 150;//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;
		//alert(n);
		if(ie){
			anchorX = findPosX(document.all("navID" + n));
			//theClass = "navSub";
		}else if(ns6){
			anchorX = findPosX(document.getElementById("navID" + n));
			//theClass = "navSub";
		}else if(ns){
			anchorX = document.layers["navID" + n].pageX;
			//theClass = "navSubNS4";
		}
		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=" + (mainNavs[j].theWidth + 24) + ">";
			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/spacer.gif\" width=" + currentMenu[z].arrowWidth + " height=1 align='absmiddle'><img src=\"../images/nav/arrowSub.gif\" width=3 height=5>";
					theArrow = "<img src=\"../images/nav/arrowNav.gif\" width=5 height=8>";
				}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=32></td><td onClick=\"parent.location='" + currentMenu[z].goLink + "';\">" + theLink + "</td><td width=7>" + theArrow + "</td></tr>";
				outHTML += "<tr><td width=" + mainNavs[j].theWidth + " bgcolor=\"ffffff\" colspan=3><img src=\"../images/spacer.gif\" width=1 height=1></td></tr>";
				rowCount ++;
			}
			outHTML += "</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=70 border=0></a></div>";

	//document.write(outHTML);
	//loaded = true;
	writeSubLayers();
}
function writeSubLayers(){
	for(a = 1; a <= totalSubSubs; a ++){
		currentMenu = eval("subsub" + a);
		theLength = currentMenu.length;
		outHTML += "<div id=\"menuSub" + a + "\" style=\"position:absolute; top:" + currentMenu[0].topPos + "px; left:" + currentMenu[0].leftPos + "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/arrowNav.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;
				}
				outHTML += "<tr class=\"" + theClass + "\" onMouseOver=\"doSubSubNav(this,1," + sendSubIndex + "," + rowSubCount + ");\" onMouseOut=\"//doSubSubNav(this,0);\" id=\"rowSub" + rowSubCount + "\"><td width=6><img src=\"../images/spacer.gif\" width=6 height=32></td><td onClick=\"parent.location='" + currentMenu[z].goLink + "';\" width=154>" + theLink + "</td><td width=7>" + theArrow + "</td></tr>";
				outHTML += "<tr><td width=160 bgcolor=\"ffffff\" colspan=3><img src=\"../images/spacer.gif\" width=1 height=1></td></tr>";
				rowSubCount ++;
			}
			outHTML += "</table>";
		outHTML += "</div>";
	}
	//document.write(outHTML);
	//loaded = true;
	writeSubSubLayers();
}
function writeSubSubLayers(){
	for(a = 1; a <= totalSubSubSubs; a ++){
		currentMenu = eval("subsubsub" + a);
		theLength = currentMenu.length;
		outHTML += "<div id=\"menuSubSub" + a + "\" style=\"position:absolute; top:" + currentMenu[0].topPos + "px; left:" + currentMenu[0].leftPos + "px; visibility:hidden; z-index:100;\">";
		outHTML += "<table cellpadding=0 cellspacing=0 border=0 width=160>";
		outHTML += "<tr><td width=160 bgcolor=\"ffffff\" 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>";
				outHTML += "<tr><td width=160 bgcolor=\"ffffff\" colspan=2><img src=\"../images/spacer.gif\" width=1 height=1></td></tr>";
			}
			outHTML += "</table>";
		outHTML += "</div>";
	}
	document.write(outHTML);
	loaded = true;
}