// JavaScript Document

/*-- showSectionHeader : generates the correct colored header for the current section --*/
function showSectionHeader() {
	document.write('<a href="'+sectionName+'.htm"><img src="images/header_'+sectionName+'.gif" alt="'+sectionName+' header" width="668" height="96" border="0"/></a><br />');
	var transition = sectionName.slice(0,4) + curLocation;
	document.write('<img src="images/transition_'+transition+'.gif" width="668" height="13" />');
}

// the names of each subsection of the site
var sectionNavData = new Object();
sectionNavData.projects = new Array("Churches","Biotechnology & Pharmaceutical","Auto Dealerships","Corporate Offices","Special Projects");
sectionNavData.services = new Array("General Contracting","Design-Build","Construction Management");
sectionNavData.aboutus = new Array("Core Values","Our Philosophy","Profiles","Press");
sectionNavData.contact = new Array();
sectionNavData.links = new Array();

// the ids of each subsection of the site
var sectionLinkData = new Object();
sectionLinkData.projects = new Array("churches","biotech","auto","corporate","special");
sectionLinkData.services = new Array("general","designbuild","construction");
sectionLinkData.aboutus = new Array("values","philosophy","profiles","press");
sectionLinkData.contact = new Array();
sectionLinkData.links = new Array();

// the names of each sub-subsection of the site
var subSectionNavData = new Object();
subSectionNavData.general = new Array("Project Management & Supervision","Self-Perform Work","Process & Document Control","Value Engineering");
subSectionNavData.designbuild = new Array("What is Design-Build?","Benefits of Design-Build","The Design-Build Process","Assembling the Construction Team");
subSectionNavData.construction = new Array("Project Management","Project Budgeting","Scheduling Accountability","Obtaining & Expediting Permits");
subSectionNavData.values = new Array();
subSectionNavData.philosophy = new Array();
subSectionNavData.profiles = new Array();
subSectionNavData.press = new Array();

// the ids of each sub-subsection of the site
var subSectionLinkData = new Object();
subSectionLinkData.churches = new Array();
subSectionLinkData.biotech = new Array();
subSectionLinkData.auto = new Array();
subSectionLinkData.corporate = new Array();
subSectionLinkData.health = new Array();
subSectionLinkData.special = new Array();
subSectionLinkData.general = new Array("projman","selfperf","procdoc","valeng");
subSectionLinkData.designbuild = new Array("whatis","benefits","process","team");
subSectionLinkData.construction = new Array("projman","budget","schedule","permits");
subSectionLinkData.values = new Array();
subSectionLinkData.philosophy = new Array();
subSectionLinkData.profiles = new Array();
subSectionLinkData.press = new Array();
						
/*-- showSectionNav : generates the white subnav for each section --*/
function showSectionNav() {
	var theData = sectionNavData[sectionName];
	for (var i=0; i<theData.length; i++) {
		var subSectionName = sectionLinkData[sectionName][i];
		var theCode = '<a href="'+sectionName+'_'+sectionLinkData[sectionName][i];
		if (subSectionLinkData[subSectionName].length > 0) {
			theCode += '_'+subSectionLinkData[subSectionName][0];
		}
		theCode += '.htm">'+theData[i]+'</a>';
		document.write(theCode);
		//document.write('<a href="'+sectionName+'_'+sectionLinkData[sectionName][i]+'_'+subSectionLinkData[subSectionName][0]+'.htm">'+theData[i]+'</a>');
		if (i < (theData.length - 1)) {
			document.write(' | ');
		}
	}
}

/*-- showSubSectionTitle : displays the title of the current subsection --*/
function showSubSectionTitle() {
	document.write(sectionNavData[sectionName][subSectionNum]);
}

/*-- showSubSectionNav : generates the subnav for each subsection --*/
function showSubSectionNav() {
	var subSectionName = sectionLinkData[sectionName][subSectionNum];
	var theData = subSectionNavData[subSectionName];
	if (theData != undefined) {
		for (var i=0; i<theData.length; i++) {
			document.write('<a href="'+sectionName+'_'+sectionLinkData[sectionName][subSectionNum]+'_'+subSectionLinkData[subSectionName][i]+'.htm">'+theData[i]+'</a>');
			if (i < (theData.length - 1)) {
				document.write(' | ');
			}
		}
	}
}

/*-- showSubSubSectionTitle : displays the title of the current sub-subsection --*/
function showSubSubSectionTitle() {
	var subSectionName = sectionLinkData[sectionName][subSectionNum];
	if (subSectionNavData[subSectionName].length > 0) {
		document.write('<h1>'+subSectionNavData[subSectionName][subSubSectionNum]+'</h1>');
	}
}
