
var globalPath = 'http://dts.utah.gov/security/' //this is the path to root that we can use for building common elements

/* ------------------------------------------------   Menu Arrays   ------------------------------------------------ */
//in the arrays below, the first set of quotes is the url, the second is the graphical button, the third is the alt attribute and title value.
var mainNavArray = new Array();
	mainNavArray[0] = new Array('index.html', 'common/images/mainNav/00home.gif', 'Home');
	mainNavArray[1] = new Array('services/index.html', 'common/images/mainNav/01services.gif', 'Services');
	mainNavArray[2] = new Array('awareness/index.html', 'common/images/mainNav/02awareness.gif', 'Awareness');
	mainNavArray[3] = new Array('events/index.html', 'common/images/mainNav/03events.gif', 'Events');
	mainNavArray[4] = new Array('securityresources/index.html', 'common/images/mainNav/04resources.gif', 'Resources');
	mainNavArray[5] = new Array('incidents/index.html', 'common/images/mainNav/05reportIncident.gif', 'Report Incident');
	
var securityAuditsArray = new Array();
	securityAuditsArray[0] = new Array('#', 'imageHere', 'Audits00');
	securityAuditsArray[1] = new Array('#', 'imageHere', 'Audits01');
	securityAuditsArray[2] = new Array('#', 'imageHere', 'Audits02');
	
	
var securityAwarenessArray = new Array();
	securityAwarenessArray[0] = new Array('awareness/month', 'imageHere', 'Security Awareness Month');
	securityAwarenessArray[1] = new Array('awareness/newsletters', 'imageHere', 'Newsletters');
	securityAwarenessArray[2] = new Array('awareness/topics', 'imageHere', 'Topics');
	securityAwarenessArray[3] = new Array('awareness/training', 'imageHere', 'Employee Training');
	securityAwarenessArray[4] = new Array('awareness/media', 'imageHere', 'Media/Teaching Materials');
	securityAwarenessArray[5] = new Array('awareness/other', 'imageHere', 'Other Resouces');
	
	
var securityEventsArray = new Array();
	securityEventsArray[0] = new Array('#', 'imageHere', 'Events00');
	securityEventsArray[1] = new Array('#', 'imageHere', 'Events01');
	securityEventsArray[2] = new Array('#', 'imageHere', 'Events02');


var securityOfficeArray = new Array();
	securityOfficeArray[0] = new Array('#', 'imageHere', 'Security Office00');
	securityOfficeArray[1] = new Array('#', 'imageHere', 'Security Office01');
	securityOfficeArray[2] = new Array('#', 'imageHere', 'Security Office02');
	

var securityServicesArray = new Array();
	securityServicesArray[0] = new Array('#', 'imageHere', 'Sevice00');
	securityServicesArray[1] = new Array('#', 'imageHere', 'Sevice01');
	securityServicesArray[2] = new Array('#', 'imageHere', 'Sevice02');




var footerArray = new Array();
	footerArray[0] = new Array('http://www.utah.gov/privacypolicy.html', 'imageHere', 'Privacy Policy');
	footerArray[1] = new Array('http://www.utah.gov/disclaimer.html', 'imageHere', 'Terms of Use');
	footerArray[2] = new Array('index.html', 'imageHere', 'Home');
	footerArray[3] = new Array('services/index.html', 'imageHere', 'Services');
	footerArray[4] = new Array('awareness/index.html', 'imageHere', 'Awareness');
	footerArray[5] = new Array('events/index.html', 'imageHere', 'Events');	
	/*footerArray[6] = new Array('audits/index.html', 'imageHere', 'Audits');*/	
	footerArray[6] = new Array('EISO-ContactUs.html', 'imageHere', 'Security Office');	
	

	
/* ------------------------------------------------   Menu Functions   ------------------------------------------------ */
// !! this uses an array to build menu items. it relies on the global variable called globalPath (defined at top of page) to point to the current domain.
// Provide the array you want to build.
// Answer 'yes' to hardReturn if you want the menu organized as paragraphs
// Answer 'yes' to listItem if you want the menu organized as a list
function buildTextMenu(theArray, hardReturn, listItem) { 
	var htmlCode = '';
	
	var listOpen = '';
	var listClose = '';
	var listItemBegin = '';
	var listItemEnd = '';
	var hardReturnBegin = '';
	var hardReturnEnd = '';
	
	if (hardReturn == 'yes') {
		hardReturnBegin = '<p>';
		hardReturnEnd = '</p>';
	}
	
	if (listItem == 'yes') {
		listOpen = '<ul>';
		listClose = '</ul>';
		listItemBegin = '<li>';
		listItemEnd = '</li>';
	}
	
	htmlCode += listOpen;
	
	for(i=0; i<theArray.length; i++) {
		if( theArray[i][0].indexOf('http://') != -1 ){ //check for absolute url
			htmlCode += hardReturnBegin + listItemBegin + '<a href="' + theArray[i][0] + '" alt="' + theArray[i][2] + '" title="' + theArray[i][2] + '" />' + theArray[i][2] + '</a>' + listItemEnd + hardReturnEnd;
		} else { //if url is not absolute, then add the global path
			htmlCode += hardReturnBegin + listItemBegin + '<a href="' + globalPath + theArray[i][0] + '" alt="' + theArray[i][2] + '" title="' + theArray[i][2] + '">' + theArray[i][2] + '</a>' + listItemEnd + hardReturnEnd;
		}
	}
	
	htmlCode += listClose;
	//alert(htmlCode);
	
	document.write(htmlCode);
}


//buildGraphicMenu(mainNavArray);
function buildGraphicMenu(theArray) { // !! this uses an array to build menu items. it relies on the global variable called globalPath (defined at top of page) to point to the current domain. 
	var htmlCode = '';

	for(i=0; i<theArray.length; i++) {
		if( theArray[i][0].indexOf('http://') != -1 ){ //check for absolute url
			htmlCode += '<a href="' + theArray[i][0] + '"><img src="' + globalPath + theArray[i][1] + '" alt="' + theArray[i][2] + '" title="' + theArray[i][2] + '" /></a>';
		} else { //if url is not absolute, then add the global path
			htmlCode += '<a href="' + globalPath + theArray[i][0] + '"><img src="' + globalPath + theArray[i][1] + '" alt="' + theArray[i][2] + '" title="' + theArray[i][2] + '" /></a>';
		}
	}
	
	document.write(htmlCode);
}


/* ------------------------------------------------   Content   ------------------------------------------------ */
function uiiCustom() {
	var htmlCode = '';
	htmlCode += '<a href="http://utah.gov"><img src="' + globalPath + 'common/images/uii/00Logo.gif" alt="Utah.gov" title="Utah.gov" width="70" height="31" /></a>';
	//htmlCode += '<a href="http://www.utah.gov/services/index.html"><img src="' + globalPath + 'common/images/uii/01OnlineServices.gif" alt="Online Services" title="Online Services" width="140" height="31" /></a>';
	//htmlCode += '<a href="http://www.utah.gov/government/agencylist.html"><img src="' + globalPath + 'common/images/uii/02AgencyList.gif" alt="Agency List" title="Agency List" width="122" height="31" /></a>';
	//htmlCode += '<a href="http://business.utah.gov/business/"><img src="' + globalPath + 'common/images/uii/03Business.gif" alt="Business" title="Business" width="92" height="31" /></a>';
	
	document.write(htmlCode);
}



function brandingContent() {
	var htmlCode = '';
	
	htmlCode += '<a href="' + globalPath + '"index.html"><img src="' + globalPath + 'common/images/logos/logoSecurity.gif" alt="Security.utah.gov" title="Security.utah.gov" /></a>';
	//htmlCode += '<div id="brandingGraphic">';
	//htmlCode += '<img src="' + globalPath + 'common/images/branding/worker01.jpg" alt="DTS Technician" title="DTS Technician" />';
	//htmlCode += '</div>';
	htmlCode += '<div id="uii">';
	//htmlCode += '<a href="http://utah.gov"><img src="' + globalPath + 'common/images/logos/utahGov.gif" alt="Utah.gov" title="Utah.gov" /></a>';
	htmlCode += '</div>';        
	htmlCode += '<div id="searchBox">';

	htmlCode += '<!-- Google CSE Search Box Begins  -->';
	htmlCode += '<form action="http://dts.utah.gov/security/searchresults.html" id="searchbox_007813638107221317044:sfotluvwzkq">';
	htmlCode += '<input type="hidden" name="cx" value="007813638107221317044:sfotluvwzkq" />';
	htmlCode += '<input type="hidden" name="cof" value="FORID:11" />';
	htmlCode += '<input type="text" name="q" size="20" />';
	//htmlCode += '<input type="submit" name="sa" class="searchButton" />';
	htmlCode += '<button id="sa" name="sa" type="submit" class="searchButton">Search</button>';
	
	htmlCode += '<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_007813638107221317044%3Asfotluvwzkq&lang=en"></script>';
	htmlCode += '<!-- Google CSE Search Box Ends -->';

	htmlCode += '<a href="http://dts.utah.gov">DTS Home</a> | <a href="' + globalPath + 'sitemap.html">Site Map</a> | <a href="http://dts.utah.gov/emp">Employees</a>'; 
	htmlCode += '</form>';
	htmlCode += '</div>';
	htmlCode += '<div class="clear"></div>';
	
	document.write(htmlCode);
}

var theDate = new Date();
var currentYear = theDate.getYear();
if (currentYear < 2000) {
	currentYear += 1900;
}
//alert('currentYear = ' + currentYear);



function footer() {
	var htmlCode = '';
	htmlCode += currentYear + ' &copy; Department of Technology Services (DTS)<br />';
	document.write(htmlCode);
	buildTextMenu(footerArray, 'no', 'no');
}




/* ------------------------------------------------   IE Style   ------------------------------------------------ */

function ieStyle() {
	//alert('ieStyle() fired');
	var htmlCode = '';
	htmlCode += '<!--[if IE 5]><link href="' + globalPath + 'common/css/ieStyle.css" rel="stylesheet" type="text/css"><![endif]-->';
	htmlCode += '<!--[if IE 6]><link href="' + globalPath + 'common/css/ieStyle.css" rel="stylesheet" type="text/css"><![endif]-->';
	
	document.write(htmlCode);
}


































