
var globalPath = 'http://utahstatecapitol.utah.gov/' 
//  this is the path to root that we can use for building common elements
//  !!! the ieStyle.css file might have a hard-coded domain. Check it if the globalPath changes !!!


/* ------------------------------------------------   Menu Arrays   ------------------------------------------------ */
//in the arrays below, the first set of quotes is the url, the second is the optional graphical button, the third is the alt attribute and title value and is also used as the link itself for text links.

//Top Navigation
var topNavArray = new Array();
	topNavArray[0] = new Array('hill/index.html',      'imageHere', 'Capitol Hill');
	topNavArray[1] = new Array('visitors/index.html',  'imageHere', 'Visitors');
	/*topNavArray[2] = new Array('educators/index.html', 'imageHere', 'Educators');*/
	topNavArray[2] = new Array('kids/index.html',      'imageHere', 'Kids');
	topNavArray[3] = new Array('store/index.html',     'imageHere', 'Store');
	topNavArray[4] = new Array('board/index.html',     'imageHere', 'Board');
	topNavArray[5] = new Array('news/index.html',      'imageHere', 'News');
	topNavArray[6] = new Array('visitors/schedule/index.html',  'imageHere', 'Scheduling');
	topNavArray[7] = new Array('links/index.html',     'imageHere', 'Links');

//Hill Section Navigation
var hillNavArray = new Array();
	hillNavArray[0] = new Array('hill/thecapitol/index.html', 'imageHere', 'The Capitol');
	hillNavArray[1] = new Array('hill/artarchitecture/index.html', 'imageHere', 'Art & Architecture');
	hillNavArray[2] = new Array('hill/grounds/index.html', 'imageHere', 'Grounds');
	hillNavArray[3] = new Array('hill/daughters/index.html', 'imageHere', 'Daughters of Utah Pioneers');
	hillNavArray[4] = new Array('hill/travelcouncilbuilding/index.html', 'imageHere', 'Travel Council Building');
	hillNavArray[5] = new Array('hill/whitechapel/index.html', 'imageHere', 'White Chapel');
	hillNavArray[6] = new Array('hill/stateofficebuilding/index.html', 'imageHere', 'State Office Building');
	hillNavArray[7] = new Array('visitors/virtualtours/index.html', 'imageHere', 'Virtual Tour');
	hillNavArray[8] = new Array('hill/timeline/index.html', 'imageHere', 'Interactive Time Line');
	hillNavArray[9] = new Array('hill/2008rededication/dedication.html', 'imageHere', '2008 Formal Re-Dedication of the People\'s House');
	hillNavArray[10] = new Array('hill/historicalstructuresreport/index.html', 'imageHere', 'Historic Structure\'s Report');
	hillNavArray[11] = new Array('hill/suggestedreadings.html', 'imageHere', 'Suggested Readings');
	hillNavArray[12] = new Array('index.html', 'imageHere', 'Home');
	
//Visitors Section Navigation
var visitorsNavArray = new Array();
	visitorsNavArray[0] = new Array('visitors/tourdates/index.html', 'imageHere', 'Schedule a Group Tour');
	visitorsNavArray[1] = new Array('visitors/volunteering.html', 'imageHere', 'Volunteer to be a Capitol Docent');
	visitorsNavArray[2] = new Array('visitors/statedining/index.html', 'imageHere', 'State Dining');
	visitorsNavArray[3] = new Array('visitors/schedule/index.html', 'imageHere', 'Capitol Hill Reservations');
	visitorsNavArray[4] = new Array('visitors/parking.html', 'imageHere', 'Parking/Transportation');
	visitorsNavArray[5] = new Array('visitors/virtualtours/index.html', 'imageHere', 'Virtual Tour');
	visitorsNavArray[6] = new Array('index.html', 'imageHere', 'Home');
	

//Educators Section Navigation
var educatorsNavArray = new Array();
	educatorsNavArray[0] = new Array('educators/planvisit.html', 'imageHere', 'Planning Your Visit');
	educatorsNavArray[1] = new Array('educators/lessonplans/index.html', 'imageHere', 'Lesson Plans');
	educatorsNavArray[2] = new Array('educators/resources/index.html', 'imageHere', 'Resources');
	educatorsNavArray[3] = new Array('#', 'imageHere', 'eMuseum');
	educatorsNavArray[4] = new Array('educators/parking.html', 'imageHere', 'Parking');
	educatorsNavArray[5] = new Array('index.html', 'imageHere', 'Home');

//Kids Section Navigation
var kidsNavArray = new Array();
	kidsNavArray[0] = new Array('http://utahstatecapitol.utah.gov/justforkids/', 'imageHere', 'Quiz/Games');
	kidsNavArray[1] = new Array('kids/ispy/index.html', 'imageHere', 'I Spy');
	kidsNavArray[2] = new Array('kids/resources/CapitolCycloramaColoringBook.pdf', 'imageHere', 'Capitol Cyclorama Coloring Pages');
	kidsNavArray[3] = new Array('index.html', 'imageHere', 'Home');

//Store Section Navigation
var storeNavArray = new Array();
	storeNavArray[0] = new Array('index.html', 'imageHere', 'Home');

//Board Section Navigation
var boardNavArray = new Array();
	//boardNavArray[0] = new Array('board/index.html', 'imageHere', 'Information');
	//boardNavArray[1] = new Array('board/boardmembers/index.html', 'imageHere', 'Board Members');
	boardNavArray[0] = new Array('index.html', 'imageHere', 'Home');

//News Section Navigation
var newsNavArray = new Array();
	newsNavArray[0] = new Array('news/photoindex/index.html', 'imageHere', 'Photo Index');
	newsNavArray[1] = new Array('index.html', 'imageHere', 'Home');
	
//Scheduling Section Navigation
var schedulingNavArray = new Array();
	schedulingNavArray[0] = new Array('visitors/schedule/eventapplications.html', 'imageHere', 'Event Applications');
	schedulingNavArray[1] = new Array('visitors/schedule/resources/bridalhotoapp.pdf', 'imageHere', 'Bridal Photography Application');
	schedulingNavArray[2] = new Array('visitors/schedule/index.html', 'imageHere', 'Room Set-Up Diagrams');
	schedulingNavArray[3] = new Array('visitors/schedule/facilityuserules.html', 'imageHere', 'Facility Use Rules');
	schedulingNavArray[4] = new Array('visitors/schedule/cateringdocs.html', 'imageHere', 'Catering');
	schedulingNavArray[5] = new Array('visitors/schedule/feeschedule.html', 'imageHere', 'Fee Schedules');
	schedulingNavArray[6] = new Array('index.html', 'imageHere', 'Home');

//Links Section Navigation
var linksNavArray = new Array();
	linksNavArray[0] = new Array('http://www.utah.gov/governor/', 'imageHere', 'Governor\'s Web Site');
	linksNavArray[1] = new Array('http://le.utah.gov/', 'imageHere', 'Legislature\'s Web Site');
	linksNavArray[2] = new Array('http://www.utcourts.gov/courts/sup/', 'imageHere', 'Supreme Court');
	linksNavArray[3] = new Array('links/othercapitols.html', 'imageHere', 'Other Capitols');
	linksNavArray[4] = new Array('index.html', 'imageHere', 'Home');

/* ------------------------------------------------   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(topNavArray);
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 brandingContent() {
	var htmlCode = '';
	
	//alert('brandingContent Fired');
	htmlCode += '<a href="' + globalPath + 'index.html"><img src="' + globalPath + 'common/images/logoDTS.gif" alt="Utah Department of Technology Services" title="Utah Department of Technology Services" /></a>';
	htmlCode += '<div id="searchBox">';
	htmlCode += '<form action="" enctype="multipart/form-data">';
	htmlCode += '<input type="text"/>';
	htmlCode += '<button id="search" type="submit" class="searchButton">Search</button>';
	htmlCode += '<a href="' + globalPath + 'index.html" class="spacer">Home</a>|<a href="' + globalPath + 'sitemap/index.html" class="spacer">Site Map</a>|<a href="' + globalPath + 'emp/index.html" class="spacer">Employees</a>'; 
	htmlCode += '</form>';
	htmlCode += '</div>';
	
	document.write(htmlCode);
}





// ------------------------------------------------   Banner Loader  ----------------------------------------------- //

	var home_array = new Array();
		home_array[0]  = new Array('common/images/randomBanners/home00.jpg', 'Pillars');
		home_array[1]  = new Array('common/images/randomBanners/home01.jpg', 'Interior Trim');
		home_array[2]  = new Array('common/images/randomBanners/home02.jpg', 'Scrollwork');
		
	var hill_array = new Array();
		hill_array[0]  = new Array('hill/images/banner_capitolhill00.jpg', 'Utah State Capitol');
		hill_array[1]  = new Array('hill/images/banner_capitolhill01.jpg', 'Utah State Capitol');
		hill_array[2]  = new Array('hill/images/banner_capitolhill02.jpg', 'Utah State Capitol');
		
	var visitors_array = new Array();
		visitors_array[0]  = new Array('visitors/images/banner_visitors00.jpg', 'Utah State Capitol');
		visitors_array[1]  = new Array('visitors/images/banner_visitors01.jpg', 'Utah State Capitol');
		visitors_array[2]  = new Array('visitors/images/banner_visitors02.jpg', 'Utah State Capitol');
		
	var educators_array = new Array();
		educators_array[0]  = new Array('educators/images/banner_educators00.jpg', 'Utah State Capitol');
		educators_array[1]  = new Array('educators/images/banner_educators01.jpg', 'Utah State Capitol');
		educators_array[2]  = new Array('educators/images/banner_educators02.jpg', 'Utah State Capitol');
		
	var kids_array = new Array();
		kids_array[0]  = new Array('kids/images/banner_kids00.jpg', 'Utah State Capitol');
		kids_array[1]  = new Array('kids/images/banner_kids01.jpg', 'Utah State Capitol');
		kids_array[2]  = new Array('kids/images/banner_kids02.jpg', 'Utah State Capitol');

	var store_array = new Array();
		store_array[0]  = new Array('store/images/banner_store00.jpg', 'Utah State Capitol');
		store_array[1]  = new Array('store/images/banner_store01.jpg', 'Utah State Capitol');
		store_array[2]  = new Array('store/images/banner_store02.jpg', 'Utah State Capitol');

	var board_array = new Array();
		board_array[0]  = new Array('board/images/banner_board00.jpg', 'Utah State Capitol');
		board_array[1]  = new Array('board/images/banner_board01.jpg', 'Utah State Capitol');
		board_array[2]  = new Array('board/images/banner_board02.jpg', 'Utah State Capitol');

	var news_array = new Array();
		news_array[0]  = new Array('news/images/banner_news00.jpg', 'Utah State Capitol');
		news_array[1]  = new Array('news/images/banner_news01.jpg', 'Utah State Capitol');
		news_array[2]  = new Array('news/images/banner_news02.jpg', 'Utah State Capitol');

	var links_array = new Array();
		links_array[0]  = new Array('links/images/banner_links00.jpg', 'Utah State Capitol');
		links_array[1]  = new Array('links/images/banner_links01.jpg', 'Utah State Capitol');
		links_array[2]  = new Array('links/images/banner_links02.jpg', 'Utah State Capitol');

			
function topBanner(theArray) {	
	//the code below is for when you want more'n one image on your banner, like uddc which uses 4 banner images
	/*for (i=0; i<4; i++) {
		var randomNumber = Math.floor( Math.random()*theArray.length );
		htmlCode += '<img src="../2007/common/' + globalPath + 'bannerImages/' + theArray[randomNumber][0] + '"alt="' + bannerArray[randomNumber][1] + '" title="' + bannerArray[randomNumber][1] + '" />';
		bannerArray.splice(randomNumber, 1);
	}*/
	var htmlCode = '';
	var randomNumber = Math.floor( Math.random()*theArray.length );
		htmlCode += '<a href="' + globalPath + 'index.html"><img src="' + globalPath + theArray[randomNumber][0] + '"alt="' + theArray[randomNumber][1] + '" title="' + theArray[randomNumber][1] + '" /></a>';
		
	document.write(htmlCode);
}

function citation() {
	var htmlCode = '';
	htmlCode += '<center>';
	htmlCode += '<p>To cite information from this page using APA style:</p>';
	htmlCode += '<p>Inside your text:<br>';
	htmlCode += '(Utah State Capitol Preservation Board, 2008)</p>';
	htmlCode += '<p>Inside your bibliography:<br>';
	htmlCode += 'Utah State Capitol Preservation Board. (2008). Utah State Capitol Website. Retrieved [insert date here: month, day, year], from (insert this page\'s URL here)</p>';
	
	document.write(htmlCode);
}


function footer() {
	var htmlCode = '';
	htmlCode += '<p><center> ';
	htmlCode += '<a href="http://www.utah.gov/">Utah.gov Home</a>';
	htmlCode += '<a href="http://www.utah.gov/disclaimer.html"> | Utah.gov Terms of Use</a>';
	htmlCode += '<a href="http://www.utah.gov/privacypolicy.html"> | Utah.gov Privacy Policy</a>';
	htmlCode += '<a href="http://www.utah.gov/accessibility.html"> | Utah.gov Accessibility Policy</a>';
	htmlCode += '<br>Copyright &#169; 2008 State of Utah - All rights reserved.</p>';
	
	document.write(htmlCode);
}

// ------------------------------------------------    ----------------------------------------------- //





/* ------------------------------------------------   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);
}



