var navList = new Array (
	"Home|index.html",
	"Business<br />Parks|projects.html?bsp",
	"Commercial<br />Development|projects.html?com",
	"Residential<br />Subdivisions|projects.html?sub",
	"Stormwater<br />Management|projects.html?swm",
	"Water & Pump Systems|projects.html?wps",
	"About Us<br />& Contact|about.html"
);

function outputNav () {
	pagid = getLocation()
	if (getQueryString()) {
		pagid += "?" + getQueryString();
	}
	document.write("<ul>");
	for (x=0; x<navList.length; x++) {
   		theParts = navList[x].split("|");
		if (pagid == theParts[1]) {
			document.write("<li><a class=\"current\" href=\""+theParts[1]+"\">"+theParts[0]+"</a></li>");			
   			} else {
				document.write("<li><a href=\""+theParts[1]+"\">"+theParts[0]+"</a></li>");			
			}
		}
	document.write("</ul>");
}

function getLocation() {
	pagid = document.location.pathname;
	pagid = pagid.substring(pagid.lastIndexOf('/') +1);

	// default if it's blank
	if (!pagid) {
		pagid = "index.html";
	}

	return pagid;
}

function getQueryString() {
	query = document.location.search;
	if (query.length > 1) {
		query = query.substring (1,query.length);
	} 
	return query;
}

function outputProjectList() {
	projid = getQueryString();
	if (projid == "bsp") {
		projList = projList_bsp;
	}
	if (projid == "sub") {
		projList = projList_sub;
	}
	if (projid == "com") {
		projList = projList_com;
	}
	if (projid == "wps") {
		projList = projList_wps;
	}
	if (projid == "swm") {
		projList = projList_swm;
	}
	
	for (x=0; x<projList.length; x++) {
	elements = projList[x].split("|");
	document.write ("<div class=\"show\">"+elements[0]+" </div><div class=\"box\"><img src=\"images/projects/"+elements[2]+"\" style=\"float:right;margin-left:25px;border: black solid 1px;margin-top:3px;\"><p class=\"proj_graph\">"+elements[1]+"</p><div style=\"clear:both;\"></div></div>");
	}
}

function getRandomCornerPic() {

	var totalAvailablePics = 6;
	theTempNum = Math.round((totalAvailablePics-1)*Math.random())+1;
	document.write("<img class=\"headerbox\" src=\"images/corner/corner" + theTempNum + ".jpg\" alt=\"header photo\">");

}


function outputNav_OLD() {
	document.write('<a style="margin-left:16px;" class="buttonlink" href="index.html">Home</a><a class="buttonlink" href="about.html">About Us</a><a class="buttonlink" href="projects.html">Projects</a><a class="buttonlink" href="contact.html">Contact Us</a>');
}

function outputNav_OLD2() {
	for (x=0; x<navList.length; x++) {
		theParts = navList[x].split("|")
		if (window.location.pathname.indexOf(theParts[1]) > 0) {
			document.write("<div class=\"currentloc\">" + theParts[0] + "</div>");
		} else {
			document.write("<a class=\"buttonlink\" href=\"" + theParts[1] + "\">" + theParts[0] + "</a>");
		}
	}
}

