

/* ------------------------------------------------   Magic Vars   ------------------------------------------------ */
var globalPath = 'http://accessut.org/' //this is the path to root that we can use for building common elements
var uiiOverride = false; //false allows the uii banner to load. true turns it off. used with the loadUII() function below

var theDate = new Date();
var currentYear = theDate.getYear();
if (currentYear < 2000) {
	currentYear += 1900;
}
//alert('currentYear = ' + currentYear);


// daParams means include parameters or don't; parameter passed here should be 'y' for yes or 'n' for no
// You can use defaults for the parameters by leaving them between empty quote marks. Example: ('http:// url', '', '', '', '', 'y')
// You can specify the parameters you want to by adding numeric values. DO NOT, however, put the numeric values in quotes.

function popup(daURL, daHeight, daWidth, daTop, daLeft, daParams) {

	var h = ''; // New window height. Defined by daHeight, but has a default if daHeight is empty.
	var w = ''; // New window width. Defined by daWidth, but has a default if daWidth is empty.
	var t = ''; // New window location from screen top. Defined by daTop, but has a default if daTop is empty.
	var l = ''; // New window location from screen left. Defined by daLeft, but has a default if daLeft is empty.

		if(daHeight == 'null' || daHeight == '') {
		  h = screen.availHeight / 2; //height default
		} else {
		  h = daHeight;
		}

		if(daWidth == 'null' || daWidth == '') {
		  w = screen.availWidth / 2; //width default
		} else {
		  w = daWidth;
		}

		if(daTop == 'null' || daTop == '') {
		  t = 75; //top default
		} else {
		  t = daTop
		}

		if(daLeft == 'null' || daLeft == '') {
		  l = screen.availWidth / 2.5; //left default
		} else {
		  l = daLeft
		}

	var params = 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+ w +',height='+ h +',top='+ t +',left='+ l +'';
	var params2 = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+ w +',height='+ h +',top='+ t +',left='+ l +'';
	var newWindow = '';

		if (daParams == 'y') {
		  newWindow = window.open(daURL, 'daWindow', params);
		} else {
		  newWindow = window.open(daURL, 'daWindow', params2);
		}
		
	newWindow.focus();
}


/* ------------------------------------------------   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('disabilitylinks/disabilitylinks.html', 'common/images/mainNav/01disabilityLinks.gif', 'Disability Links');
	mainNavArray[2] = new Array('ada/index.html', 'common/images/mainNav/02adaResources.gif', 'ADA Resources');
	mainNavArray[3] = new Array('AccessibleCalendar.html', 'common/images/mainNav/03calendar.gif', 'Events Calendar');
	//mainNavArray[4] = new Array('http://itas25spr.utah.gov/referral', 'common/images/mainNav/04referrals.gif', 'Program Referrals');
	mainNavArray[4] = new Array('http://efs.utah.gov/efs', 'common/images/mainNav/05efs.gif', 'Equipment for Sale');
	mainNavArray[5] = new Array('multimedia/index.html', 'common/images/mainNav/06multimedia.gif', 'Multimedia');
	mainNavArray[6] = new Array('contact/index.html', 'common/images/mainNav/07contact.gif', 'Contact Us');
	


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');



var ustreamArray = new Array(); //this menu is created in reverse order so newest items go at the bottom, but display on the page at the top. 
	// ustreamArray[] = new Array('http://www.ustream.tv/flash/video/', '', '');
	ustreamArray[0] =  new Array('http://www.ustream.tv/flash/video/820471', 'October 28, 2008', 'Social Security Ticket to Work and You');
	ustreamArray[1] =  new Array('http://www.ustream.tv/flash/video/1038719', 'January 8, 2009', 'CPD - CREATE Program');
	ustreamArray[2] =  new Array('http://www.ustream.tv/flash/video/1058866', 'January 15, 2009', 'DRAC');
	ustreamArray[3] =  new Array('http://www.ustream.tv/flash/video/1104623', 'January 29, 2009', 'Gordon Swensen, USOR');
	ustreamArray[4] =  new Array('http://www.ustream.tv/flash/video/1147020', 'February 12, 2009', 'Salt Lake Advocacy and Community Training (Salt Lake ACT)');
	ustreamArray[5] =  new Array('http://www.ustream.tv/flash/video/1190551', 'February 24, 2009', 'Ruth Lubbers, Art Access');
	ustreamArray[6] =  new Array('http://www.ustream.tv/flash/video/1243979', 'March 12, 2009', 'Alan Ormsby, DSPD');
	ustreamArray[7] =  new Array('http://www.ustream.tv/flash/video/1300880', 'March 26, 2009', 'Sherry Repscher, UTA');
	ustreamArray[8] =  new Array('http://www.ustream.tv/flash/video/1362988', 'April 9, 2009', 'Mark Miller, DOC');
	ustreamArray[9] =  new Array('http://www.ustream.tv/flash/video/1422477', 'April 23, 2009', 'Ken Reid, UCAT');
	ustreamArray[10] = new Array('http://www.ustream.tv/flash/video/1505626', 'May 14, 2009', 'CSHCN Developmental Clinics');
	ustreamArray[11] = new Array('http://www.ustream.tv/flash/video/1572491', 'May 28, 2009', 'Martha Wunderli UIDAN');
	ustreamArray[12] = new Array('http://www.ustream.tv/flash/video/1640095', 'June 11, 2009', 'Marty Blair IOTI');
	ustreamArray[13] = new Array('http://www.ustream.tv/flash/video/1778394', 'July 9, 2009', 'Access Utah Now - Claire Mantonya, UDDC');
	ustreamArray[14] = new Array('http://www.ustream.tv/flash/video/1857250', 'July 23, 2009', 'Utah Assistive Technology Foundation with Dr.Marilyn Hammond and Sauchin Pavithran MS');
	ustreamArray[15] = new Array('http://www.ustream.tv/flash/video/1977576', 'August 13, 2009', 'Ron Roskos Executive Director, Brain Injury Association of Utah');
	ustreamArray[16] = new Array('http://www.ustream.tv/flash/video/2057357', 'August 27, 2009', 'Transition Team for the Utah Bureau of Children with Special Health Care Needs');
	ustreamArray[17] = new Array('http://www.ustream.tv/flash/video/2137433', 'September 10, 2009', 'Utah Food Bank');
	ustreamArray[18] = new Array('http://www.ustream.tv/flash/video/2220163', 'September 24, 2009', 'Roger Borgenicht - ASSIST, Inc.');
	ustreamArray[19] = new Array('http://www.ustream.tv/flash/video/2313183', 'October 10, 2009', 'Mr. Kerry Bate, Executive Director of Housing Authority of Salt Lake County');
	ustreamArray[20] = new Array('http://www.ustream.tv/flash/video/2402348', 'October 22, 2009', 'Marion Willey Exective Director of Utah Non-profit Housing Corporation');
	ustreamArray[21] = new Array('http://www.ustream.tv/flash/video/2593598', 'November 19, 2009', 'Ms. Helen Post, Executive Director Utah Parent Center');
	ustreamArray[22] = new Array('http://www.ustream.tv/flash/video/4278636', 'January 28, 2010', 'Leah Lobato, Employer Relation Specialist USOR');
	ustreamArray[23] = new Array('http://www.ustream.tv/flash/video/4644363', 'February 11, 2010', 'Education Enhancement Program - Julie Beckstead, Program Coordinator');
	ustreamArray[24] = new Array('http://www.ustream.tv/flash/video/5000153', 'February 25, 2010', 'Disability Determination Services - Gary Nakao and Paul Clingo');
	ustreamArray[25] = new Array('http://www.ustream.tv/flash/video/5363370', 'March 11, 2010', 'Yes We Can and Healthy Life Styles for Adolescents with Disabilities - Dr. Lauren Clark');
	ustreamArray[26] = new Array('http://www.ustream.tv/flash/video/5704441', 'March 25, 2010', 'Kristine Fawson, Co-Chair, The Legislative Coalition for People with Disabilities');
	ustreamArray[27] = new Array('http://www.ustream.tv/flash/video/6046215', 'April 8, 2010', 'Dr. Tracy Justesen, Managing Attorney, Disability Law Center');
	ustreamArray[28] = new Array('http://www.ustream.tv/flash/video/6362162', 'April 22, 2010', 'Amy Notewll, Director of Emergency Preparedness for People with Disabilities');
	ustreamArray[29] = new Array('http://www.ustream.tv/flash/video/6886240', 'May 13, 2010', 'Craig Boogaard, Utah Computer Center for Citizens with Disabilities');
	ustreamArray[30] = new Array('http://www.ustream.tv/flash/video/7250089', 'June 2, 2010', 'Leslee Hintze, Exec. Dir, Utah Governor\'s Committee on Employment for People with Disabilities');
	ustreamArray[31] = new Array('http://www.ustream.tv/flash/video/7567450', 'June 10, 2010', 'Splore: Talking with Dr. John LeBrett, Executive Director');
	ustreamArray[32] = new Array('http://www.ustream.tv/flash/video/7867817', 'June 24, 2010', '"Choose A Lane" with author, Ken Reid');
	ustreamArray[33] = new Array('http://www.ustream.tv/flash/video/8151234', 'July 8, 2010', 'Family to Family Interview with Deborah Bowman and Julia Pearce');
	ustreamArray[34] = new Array('http://www.ustream.tv/flash/video/8440005', 'July 22, 2010', 'Recreation: Interview with Gail Loveland, Executive Director, National Abilities Center');
	
	//ustreamArray[] = new Array('http://www.ustream.tv/flash/video/', '', '');

 
/* ------------------------------------------------   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 class="menuList">';
		listClose = '</ul>';
		listItemBegin = '<li>';
		listItemEnd = '</li>';
	}
	
	htmlCode += listOpen;
	
	for(i=0; i<theArray.length; i++) {
		if( theArray[i][0].indexOf('http://') != -1 || theArray[i][0].indexOf('https://') != -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);
}




function buildUstream(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=theArray.length-1; i>=0; i--) {
		if( theArray[i][0].indexOf('http://') != -1 || theArray[i][0].indexOf('https://') != -1){ //check for absolute url
			htmlCode += hardReturnBegin + listItemBegin + '<a href="' + theArray[i][0] + '" alt="' + theArray[i][1] + ' - ' +  theArray[i][2] + '" title="' + theArray[i][1] + ' - ' +  theArray[i][2] + '" onclick="return hs.htmlExpand(this, { objectType: \'swf\', width: 400, objectWidth: 400, objectHeight: 320, maincontentText: \'You need to upgrade your Flash player\', swfOptions: { version: \'7\' }  } )" class="highslide" />' + theArray[i][1] + '</a>' + ' - ' + theArray[i][2] + listItemEnd + hardReturnEnd;
			//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);
}


//<a href="http://www.ustream.tv/flash/video/1572491" onclick="return hs.htmlExpand(this, { objectType: \'swf\', width: 400, objectWidth: 400, objectHeight: 320, maincontentText: \'You need to upgrade your Flash player\', swfOptions: { version: '7' }  } )" class="highslide">May 28, 2009</a> - Martha Wunderli UIDAN



/* ------------------------------------------------   Content   ------------------------------------------------ */
function brandingContent() {
	var htmlCode = '';
	document.write(htmlCode);
}




function footer() {
	var htmlCode = '';
	htmlCode += currentYear + ' &copy; Access Utah Network<br />';
	document.write(htmlCode);
	buildTextMenu(mainNavArray, 'no', 'no');
	document.write('<br />');
	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]-->';
	htmlCode += '<!--[if IE 7]><link href="' + globalPath + 'common/css/ieStyle.css" rel="stylesheet" type="text/css"><![endif]-->';
	
	document.write(htmlCode);
}



/* ------------------------------------------------   UII Loader   ------------------------------------------------ */
function loadUII(pleaseLoad) {
	var htmlCode =  '';
	
	if(uiiOverride == true ) {
		document.getElementById('uiiBanner').innerHTML = '<img src="' + globalPath + 'common/images/uii/uiiLeft.gif">';
	}
}





























