/* 	GLOBALS
 *
 *	SubCat:	possibilities for sub category
 */
var SubCat = 
{	
	"BUILDING_RESOURCES" 	: 0, 
	"BUILDING_MATERIALS" 	: 1, 
	"BUILDING_CONTRACTORS" 	: 2
};

/*	FUNCTION: 	makeUnhighlightedSubHeading
 *
 *	INPUT:	  	href: 	web address that link goes to
 *				text: 	text to display for the subcategory
 *
 *	OUTPUT:		the div that contains the sub category
 *
 *	PURPOSE: 	used for making a sub category div that is unhighlighted (user is not viewing content from that sub category)
 */
function makeUnhighlightedSubHeading(href, text) 
{
	return "<div onmouseout='navLinkMouseout(this)' onmouseover='navLinkMouseover(this)' class='subnav_link'\
	style='overflow:hidden; background-color:rgb(158, 158, 158);'>\
	<a target='_self' href='"+href+"' class='subnav_link' style='color:White; text-decoration:none;'>"+text+"</a>\
		</div>"
}

/*	FUNCTION:	makeHighlightedSubHeading
 *
 *	INPUT:		text:	text to display for the subcategory
 *
 *	OUTPUT:		the div that contains the sub category
 *
 *	PURPOSE: 	used for making a sub category div that is highlighted (user is viewing content from that sub category)
 */
function makeHighlightedSubHeading(text) 
{
	return "<div class='subnav_link subnav_link_sel'>\
				<span>"+text+"</span>\
			</div>"
}

/*	FUNCTION:	loadCONSTRUCTIONTemplate
 *
 *	INPUT:		subCat:	picked from the SubCat variable above, gives information on the subcategory to highlight
 *
 *	OUTPUT:		the CONSTRUCTION sub template html
 *
 *	LOCALS:		subCatNav_head:	text right above sub template navigation div
 *				subCatNav:	the sub template navigation div
 *
 *	PURPOSE:	creates the content for the CONSTRUCTION sub template
 */
function loadconstructiontemplate(subCat) 
{
	var subCatNav_head = "\
		<a name='top'></a>\
		<div style='font-weight:bold; margin-bottom:0.4em'> Building and Construction Pages:</div>"
	
	var subCatNav = "<div id='construction_head_nav'>"
	
	if (subCat == SubCat.BUILDING_RESOURCES)
			subCatNav += makeHighlightedSubHeading("Building Resources")
	else	subCatNav += makeUnhighlightedSubHeading("cinformation.html", "Building Resources")

	if (subCat == SubCat.BUILDING_MATERIALS)
			subCatNav += makeHighlightedSubHeading("Building Materials")
	else	subCatNav += makeUnhighlightedSubHeading("cmaterials.html", "Building Materials")

	if (subCat == SubCat.BUILDING_CONTRACTORS)
			subCatNav += makeHighlightedSubHeading("Building Contractors")
	else	subCatNav += makeUnhighlightedSubHeading("contractors.html", "Building Contractors")

	subCatNav += "</div><div class='div_clear'></div><br /><br />"
		
	document.getElementById('subtemplate_div_top').innerHTML = subCatNav_head + subCatNav
	document.getElementById('subtemplate_div_bot').innerHTML = subCatNav
}
