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;
}

masterPageWidth = 584;
pageMargin = 23;
highLightBG = "448de6"; //3975BE 4686D3
offBG = "2c5c9f"; //"3A6BAF";
overBG = "3779CA";
bgSubSubOff = "#448de6"; //"#4F7CBA";
bgSubSubOn = "#4C87CF";
navLastOff = "#448de6"; //"#72A0DE";
navLastOn = "#4C87CF";

function doMain(ele, state){
	if(state > 0){
		ele.style.backgroundColor = overBG; //'4583CF';
		ele.style.color = 'ffffff';
	}else{
		ele.style.backgroundColor = offBG; //'3A6BAF';
		ele.style.color = 'D5E0EE';
	}
}
function doSub(ele, state){
	if(state > 0){
		ele.style.backgroundColor = overBG //'4686D3';
		ele.style.color = 'ffffff';
	}else{
		ele.style.backgroundColor = offBG; //'2F63AB';
		ele.style.color = 'ffffff';
	}
}

function doSub2(ele, state){
	if(state > 0){
		ele.style.backgroundColor = bgSubSubOn //'4686D3';
		ele.style.color = 'ffffff';
	}else{
		ele.style.backgroundColor = bgSubSubOff; //'2F63AB';
		ele.style.color = 'ffffff';
	}
}

function doSub3(ele, state){
	if(state > 0){
		ele.style.backgroundColor = navLastOn;
		ele.style.color = '#ffffff';//'0E3368';
	}else{
		ele.style.backgroundColor = navLastOff;
		ele.style.color = '#ffffff';//'0E3368';
	}
}

function doPress(ele, state, color){
	if(state > 0){
		ele.style.backgroundColor = 'E5E5E5';
	}else{
		if( color > 0 ){
			color = 'EAEFF6';
		}else{
			color = 'ffffff';
		}
		ele.style.backgroundColor = color;
	}
}

function checkSearchField(searchValue){
	if( searchValue == "SEARCH" ){
		document.searchForm.theSearchField.value = "";
	}
}

function swap(theSRC, theNAME){
	eval("document." + theNAME + ".src=" + theSRC + ".src");
}

function homeSwap(imgNum, state){
	if( state > 0 ){
		sendImage = "2";
	}else{
		sendImage = "";
	}
	swap("b" + imgLookUp[imgNum] + sendImage, "pic" + imgNum);
}

function checkSearchForBlank(f){
	if( isStringWhitespace(f.theSearchField.value) ){
		alert("Please enter something to search for.");
		f.theSearchField.focus();
		return false;
	}else if( f.theSearchField.value == "SEARCH" ){
		f.theSearchField.value = "ThreeCore";
	}
	return true;
}

function mainNavOBJ(displayText, goLink, theWidth){
	this.displayText	= displayText;
	this.goLink			= goLink;
	this.theWidth		= theWidth;
}

mainNavs = new Array();
	mainNavs[1] = new mainNavOBJ("About Us", "../about/overview.asp", 71);
	mainNavs[2] = new mainNavOBJ("Services", "../services/supply_overview.asp", 67);
	mainNavs[3] = new mainNavOBJ("Suppliers", "../suppliers", 72);
	mainNavs[4] = new mainNavOBJ("Clients", "../customers", 78);
	mainNavs[5] = new mainNavOBJ("Newsroom", "../newsroom", 79);
	mainNavs[6] = new mainNavOBJ("Contact Us", "../contact", 78);

outMainHTML = "";

function writeMainNav(){
	if( mainHighLight < 0 ){
		masterPageWidth = 556;
	}
	outMainHTML += "<table cellpadding=0 cellspacing=0 border=0 width=" + masterPageWidth + ">";
	outMainHTML += "<tr bgcolor=\"" + offBG + "\"><form name=\"searchForm\" method=\"post\" action=\"../search/search.asp?action=search\" onSubmit=\"return checkSearchForBlank(this);\">";
	for(i = 1; i <= (mainNavs.length - 1); i ++){
		theLink = mainNavs[i].displayText;
		if( ns || winIE5 ){
			theLink = "<a href=\"" + mainNavs[i].goLink + "\">" + mainNavs[i].displayText + "</a>";
		}
		if(i == mainHighLight){
			tdStuff = "bgcolor='" + highLightBG + "' style=\"color:#ffffff;\"";
		}else{
			tdStuff = "onMouseOver=\"doMain(this,1);\" onMouseOut=\"doMain(this,0);\"";
		}
		outMainHTML += "<td width=" + mainNavs[i].theWidth + " align=\"center\" class=\"nav\" " + tdStuff + " onClick=\"location='" + mainNavs[i].goLink + "';\">" + theLink + "</td>";
	}
	outMainHTML += "<td width=138 align=\"center\"><input type=\"text\" class=\"form\" style=\"width: 72px;\" name=\"theSearchField\" value=\"SEARCH\" onFocus=\"checkSearchField(this.value);\"> ";
	outMainHTML += "<input type=\"submit\" value=\"GO!\" class=\"formbutton\"></td>";
	outMainHTML += "<td width=1><img src=\"../images/spacer.gif\" width=1 height=21></td>";
	outMainHTML += "</tr><tr><td bgcolor=\"#000000\" colspan=8><img src=\"../images/spacer.gif\" border=0 width=1 height=1></td></tr></form></table>";
	document.write(outMainHTML);
}
//About Us
sub1 = new Array();
	sub1[1] = new mainNavOBJ("Overview", "../about/overview.asp");
	sub1[2] = new mainNavOBJ("Management Team", "../about/management.asp");
	sub1[3] = new mainNavOBJ("Investors", "../about/investors.asp");
	sub1[4] = new mainNavOBJ("Careers", "../about/careers.asp");
	sub1[5] = new mainNavOBJ("FAQ", "../about/faq.asp");
		sub1Sub1 = new Array();
		sub1Sub2 = new Array();
		sub1Sub3 = new Array();
		sub1Sub4 = new Array();
		sub1Sub5 = new Array();
		//Services
sub2 = new Array();
	sub2[1] = new mainNavOBJ("Integrated Supply", "../services/supply_overview.asp");
	sub2[2] = new mainNavOBJ("Strategic Sourcing", "../services/sourcing.asp");
	sub2[3] = new mainNavOBJ("Outsourced Procurement", "../services/procurement.asp");
	sub2[4] = new mainNavOBJ("Operational Consulting", "../services/consulting.asp");

	//Integrated Supply
	sub2Sub1 = new Array();
		sub2Sub1[1] = new mainNavOBJ("Overview","../services/supply_overview.asp");
		sub2Sub1[2] = new mainNavOBJ("Getting Started","../services/gettingstarted.asp");
		//sub2Sub1[3] = new mainNavOBJ("How It Works","../services/howitworks.asp");
		sub2Sub1[3] = new mainNavOBJ("Keys to Success","../services/keys.asp");
		sub2Sub1[4] = new mainNavOBJ("FAQ","../services/FAQ.asp");

	//Strategic Sourcing
	sub2Sub2 = new Array();
		sub2Sub2[1] = new mainNavOBJ("Production Materials", "../services/productionMaterials.asp");
		sub2Sub2[2] = new mainNavOBJ("Energy, Technology, and Communications", "../services/communications.asp");

	//Outsourced Procurement
	sub2Sub3 = new Array();
		sub2Sub3[1] = new mainNavOBJ("Supply Chain Management", "../services/supplychain.asp");
		sub2Sub3[2] = new mainNavOBJ("Purchasing", "../services/purchasing.asp");
		sub2Sub3[3] = new mainNavOBJ("Engineering Procurement", "../services/engineering.asp");
		sub2Sub3[4] = new mainNavOBJ("China Supply Chain Management", "../services/china.asp");

	//Operational Consulting
	sub2Sub4 = new Array();
		sub2Sub4[1] = new mainNavOBJ("Overview", "../services/consulting.asp");
		sub2Sub4[2] = new mainNavOBJ("Typical Assignments", "../services/typicalAssignments.asp");
		sub2Sub4[3] = new mainNavOBJ("Results", "../services/results.asp");

//Suppliers
sub3 = new Array();
	sub3[1] = new mainNavOBJ("Overview", "../suppliers");
	sub3[2] = new mainNavOBJ("Type of Suppliers", "../suppliers/suppliers.asp");
	sub3[3] = new mainNavOBJ("Bidding Process", "../suppliers/biddingProcess.asp");
	sub3[4] = new mainNavOBJ("Qualification Process", "../suppliers/qualification.asp");
	sub3[5] = new mainNavOBJ("Application", "../suppliers/application.asp");
	sub3[6] = new mainNavOBJ("FAQs", "../suppliers/faq.asp#supplierfaq");
		sub3Sub1 = new Array();
		sub3Sub2 = new Array();
		sub3Sub3 = new Array();
		sub3Sub4 = new Array();
		sub3Sub5 = new Array();
		sub3Sub6 = new Array();

//Customers
sub4 = new Array();
	sub4[1] = new mainNavOBJ("Clients", "../customers/default.asp");
	//Sample Customers
	sub4Sub1 = new Array();
		sub4Sub1[1] = new mainNavOBJ("Client Description by Industry", "../customers/description.asp");

//Newsroom
sub5 = new Array();
	sub5[1] = new mainNavOBJ("In the News", "../newsroom/");
	sub5[2] = new mainNavOBJ("Press Releases", "../newsroom/press.asp");
	sub5[3] = new mainNavOBJ("White Papers", "../newsroom/whitePapers.asp");
	sub5[4] = new mainNavOBJ("Industry News", "../newsroom/industryNews.asp");
		sub5Sub1 = new Array();
		sub5Sub2 = new Array();
		sub5Sub3 = new Array();
		sub5Sub4 = new Array();

//Contact Us
sub6 = new Array();
	//sub6[1] = new mainNavOBJ("Directions", "../about/directions.asp");
	//sub6Sub1 = new Array();


//mainNavOBJ(displayText, goLink, theWidth)
//Look up table 
needsLastSub = new Array();
	//needsLastSub[0] = sub2Sub1;
	needsLastSub[0] = new mainNavOBJ(sub2Sub3[1], "supplychain");
	needsLastSub[1] = new mainNavOBJ(sub2Sub3[2], "purchasing");
	needsLastSub[2] = new mainNavOBJ(sub2Sub3[3], "engineering");
	needsLastSub[3] = new mainNavOBJ(sub2Sub3[4], "china");
	needsLastSub[4] = new mainNavOBJ(sub2Sub2[1], "productionMaterials");
	needsLastSub[5] = new mainNavOBJ(sub2Sub2[2], "communications");

theLinksArray = new Array();
	theLinksArray[0] = new mainNavOBJ("Overview", ""); //"Overview";
	theLinksArray[1] = new mainNavOBJ("Process", "_process"); //"Process";
	theLinksArray[2] = new mainNavOBJ("Results", "_results"); //"Results";
	theLinksArray[3] = new mainNavOBJ("Keys to Success", "_keys"); //"Keys to Success";

lineColor = "#DCD7D7"; // "#eeeeee"; //"#638AC0";

function writeSubNav(){
	theLine = "<tr><td width=180 bgcolor=\"" + lineColor + "\" colspan=3><img src=\"../images/spacer.gif\" width=180 height=1></td></tr>";
	theSub = eval("sub" + mainHighLight);
	if(theSub.length > 0){
		outSubHTML = "<table cellpadding=0 cellspacing=0 border=0 width=180 bgcolor=\"" + offBG + "\">";
		outSubHTML += "<tr><td  bgcolor=\"#123466\" colspan=3><img src=\"../images/spacer.gif\" width=1 height=22 border=0></td></tr>"
		outSubHTML += "<tr><td  bgcolor=\"" + lineColor + "\" colspan=3><img src=\"../images/spacer.gif\" width=1 height=1 border=0></td></tr>"
		for(j = 1; j <= (theSub.length - 1); j ++){
			if(j == subSubHighLight){
				bg = "bgcolor='" + highLightBG + "'";
				mouseEvents = "";
			}else{
				bg = "";
				mouseEvents = "onMouseOver=\"doSub(this,1);\" onMouseOut=\"doSub(this,0);\"";
			}
			if( ns || winIE5 ){
				theLink = "<a href=\"" + theSub[j].goLink + "\">" + theSub[j].displayText + "</a>";
			}else{
				theLink = theSub[j].displayText;
			}
			outSubHTML += "<tr " + bg + "><td class=\"subNav\" " + mouseEvents + " colspan=3 onClick=\"location='" + theSub[j].goLink + "';\"><img src=\"../images/spacer.gif\" width=8 height=27 border=0 align=\"absmiddle\">" + theLink + "</td></tr>";
			outSubHTML += theLine;
			if(j == subSubHighLight){
				theSubSub = eval("sub" + mainHighLight + "Sub" + subSubHighLight);
				if(theSubSub.length > 0){
					for(k = 1; k < (theSubSub.length); k ++){
						if( k == lastLevelHighLight ){
							tdStyle = "style=\"font-weight:bold; color:#FF7F00; font-size:12;\"";
							bullet = "<img src=\"../images/nav/liOrange.gif\" width=5 height=5>";
						}else{
							tdStyle = "";
							bullet = "";
						}
						outSubHTML += "<tr class=\"subSubNav\" onMouseOver=\"doSub2(this,1);\" onMouseOut=\"doSub2(this,0);\" onClick=\"location='" + theSubSub[k].goLink + "';\" bgcolor=\"" + bgSubSubOff + "\">";
						outSubHTML += "<td width=13><img src=\"../images/spacer.gif\" width=13 height=1 border=0></td>"; //height=27
						outSubHTML += "<td width=12 " + tdStyle + " valign=top><img src=\"../images/spacer.gif\" width=1 height=7><img src=\"../images/spacer.gif\" width=1 height=11 border=0><br>" + bullet + "</td>";
						outSubHTML += "<td width=155><img src=\"../images/spacer.gif\" width=1 height=7><br>" + theSubSub[k].displayText + "<br><img src=\"../images/spacer.gif\" width=1 height=7></td></tr>";
						if( k == lastLevelHighLight ){
							for( e = 0; e < needsLastSub.length; e ++ ){
								if( theSubSub[k] == needsLastSub[e].displayText ){
									for( f = 0; f < theLinksArray.length; f ++ ){
										//alert(finalNavHightlight);
										if( finalNavHightlight == f ){
											writeText = "<b>" + theLinksArray[f].displayText + "</b>";
										}else{
											writeText = theLinksArray[f].displayText;
										}
										outSubHTML += "<tr class=\"subSubNavWhite\" onMouseOver=\"doSub3(this,1);\" onMouseOut=\"doSub3(this,0);\" onClick=\"location='" + needsLastSub[e].goLink + theLinksArray[f].goLink + ".asp';\" bgcolor=\"" + navLastOff + "\"><td colspan=2>&nbsp;</td><td><img src=\"../images/spacer.gif\" width=8 height=20 align=absmiddle>" + writeText + "</td></tr>";
									}
									break;
								}
							}
						}
						//outSubHTML += "<tr><td colspan=3>HI</td></tr>";
						outSubHTML += theLine;
					}
				}
			}
		}
		outSubHTML += "</table>"
		//document.write(outSubHTML);
	}else{
		//alert("must be Contact Us");
		outSubHTML = "";
	}
	document.write(outSubHTML);
}
/*if( subSubHighLight > -1 ){
	layer2Array = eval("sub" + mainHighLight);
	layer2Write = layer2Array[subSubHighLight].displayText;
	layer2Link = layer2Array[subSubHighLight].goLink;
	if( lastLevelHighLight > -1 ){
		layer3Array = eval("sub" + mainHighLight + "Sub" + subSubHighLight);
		if( layer3Array.length > 0 ){
			layer3Write = layer3Array[lastLevelHighLight].displayText;
			layer3Link = layer3Array[lastLevelHighLight].goLink;
		}else{
			layer3Write = "";
			layer3Link = "";
		}
	}else{
		layer3Write = "";
		layer3Link = "";
	}
}*/


function writeTitle(){
	/*if( subSubHighLight > -1 ){
		if( layer3Write.length > 0 ){
			thislayer3Write = layer3Write + " - ";
		}else{
			thislayer3Write = "";
		}
		outTitleHTML = "<title> " + thislayer3Write + layer2Write + " - " + mainNavs[mainHighLight].displayText + " | ThreeCore - Professional Procurement Services </title>";
		document.write(outTitleHTML);
	}else if( mainHighLight > -1 ){
		outTitleHTML = "<title> " + mainNavs[mainHighLight].displayText + " | ThreeCore - Professional Procurement Services </title>";
		document.write(outTitleHTML);
	}*/
}

function writePageIndNav(){
	/*if( subSubHighLight > -1 ){
		outPageNavHTML = "<table cellpadding=0 cellspacing=0 border=0 width=" + masterPageWidth + " bgcolor=\"#E5E5E5\">";
		outPageNavHTML += "<tr bgcolor=\"#F2F2F2\"><td colspan=2><img src=\"../images/spacer.gif\" width=1 height=1></td></tr><tr>";
		outPageNavHTML += "<td width=" + pageMargin + "><img src=\"../images/spacer.gif\" width=" + pageMargin + " height=1></td>";
		outPageNavHTML += "<td width=" + (masterPageWidth - pageMargin) + " class=\"pageNav\"><img src=\"../images/spacer.gif\" width=1 height=4><br>";
		if( layer3Write.length > 0 ){
			writeGT = "&gt;";
		}else{
			writeGT = "";
		}
		outPageNavHTML += "<b>" + layer2Write + "</b> " + writeGT + " " + layer3Write + "";
		outPageNavHTML += "<br><img src=\"../images/spacer.gif\" width=1 height=5></td></tr></table>";
		document.write(outPageNavHTML);
	}*/
}

function openWin(page,name,width,height,scroll,resize){
window.open(page,name,"toolbar=0,location=0,status=0,menubar=0,scrollbars=" + scroll + ",resizable=" + resize + ",top=0,left=0,width=" + width + ",height=" + height)
}
