/* 	GLOBALS
 *
 *	SubCat:	possibilities for sub category
 */
var SubCat = {"ARCHITECTURE" : 0, "CONSTRUCTION" : 1, "LANDSCAPE" : 3, "ARTPHOTO" : 4, "ACADEMIC" : 5};


/*	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:	loadCADTemplate
 *
 *	INPUT:		subCat:	picked from the SubCat variable above, gives information on the subcategory to highlight
 *
 *	OUTPUT:		the CAD 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 CAD sub template
 */
function loadcadprogramstemplate(subCat) {
	var subCatNav_head = "\
		<a name='top'></a>\
		<div style='font-weight:bold; margin-bottom:0.4em'> Software Library:</div>"
	
	var subCatNav = "<div id='construction_head_nav'>"
	if (subCat == SubCat.ARCHITECTURE) subCatNav += makeHighlightedSubHeading("Architecture")
	else							subCatNav += makeUnhighlightedSubHeading("cad.html", "Architecture")

	if (subCat == SubCat.CONSTRUCTION) subCatNav += makeHighlightedSubHeading("Construction")
	else							subCatNav += makeUnhighlightedSubHeading("cad_construction.html", "Construction")

	if (subCat == SubCat.LANDSCAPE)subCatNav += makeHighlightedSubHeading("Landscape")
	else							subCatNav += makeUnhighlightedSubHeading("cad_landscape.html", "Landscape")

	if (subCat == SubCat.ARTPHOTO) 	subCatNav += makeHighlightedSubHeading("ArtPhoto")
	else							subCatNav += makeUnhighlightedSubHeading("cad_art_photo.html", "ArtPhoto")

	if (subCat == SubCat.ACADEMIC) 	subCatNav += makeHighlightedSubHeading("Academic")
	else							subCatNav += makeUnhighlightedSubHeading("cad_academic.html", "Academic")
	
		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
}