//Global Variables	
	//var shortMenu = Array("People","Research","Education","Speech Corpora","Outreach","Announcements","Industry","Workshops","Contacts","Download","Publications");

	var linkPath = "http://ics.colorado.edu/";
	var mainMenu = Array("ICS Home","About the Institute","People","Graduate Programs","Undergraduate Program","Research and Centers","Technical Reports", "Colloquium Schedule","ICS Research Grants","Career/Job Opportunities","Funding/Scholarships","What's new...","Contact");
	var linkMenu = Array("index.html","about/index.html","people/index.html","grad/index.html","undergrad/index.html","research/index.html","techpubs/index.html","colloquium/index.html","grants/index.html","job/index.html","funding/fundingandscholarships.html","whatsnew/index.html","contact/index.html");

	//ICS Home
	var sub0 = Array();
	var link0 = Array();

	//About the Institute
	var sub1 = Array();
	var link1 = Array();
	//var sub1 = Array("Participating Academic Units","Grant Administration");
	//var link1 = Array("about/participating_units.html","about/grant_admin.html");
	
	//People
	var sub2 = Array("Institute Administration","Faculty Fellows","Associate members","Graduate Students","Research Staff","Staff");
	var link2 = Array("people/institute_admin.html","people/fellows.html","people/associates.html","people/grad_students.html","people/researchstaff.html","people/staff.html");
	
	//Graduate Programs
	var sub3 = Array("Admission","Graduate Certificate Program","Joint PhD with Cognitive Science","ICS Student Members","Program Enhancement Activities","Graduate Program Administration");
	var link3 = Array("grad/admission.html","grad/certificate.html","grad/joint_phd.html","grad/stu_members.html","grad/activities.html","grad/grad_admin.html");

	//Undergraduate Program
	var sub4 = Array("Admission","Requirements","Courses","Undergraduate Certificate","Undergraduate Program Administration","Cognitive Science Club");
	var link4 = Array("undergrad/admission_u.html","undergrad/requirements_u.html","undergrad/courses_u.html","undergrad/certificate_u.html","undergrad/undergrad_admin.html","http://www.colorado.edu/StudentGroups/cogsci/");

	//Research and Centers
	//var sub5 = Array("Center for Lifelong Learning and Design (L3D)","Center for Spoken Language Research (CSLR)","Center for Research on Training (CRT)");
	var sub5 = Array("L3D","CSLR","CRT");
	var link5 = Array("research/centers.html#L3D","research/centers.html#CSLR","research/centers.html#CRT");

	//Technical Reports
	var sub6 = Array();
	var link6 = Array();

	//Colloquium Schedule
	var sub7 = Array();
	var link7 = Array();

	//ICS Research Grants
	var sub8 = Array();
	var link8 = Array();

	//Job Opportunities
	var sub9 = Array();
	var link9 = Array();
	//var sub9 = Array("Faculty","Student");
	//var link9 = Array("job/facultyjob.html","job/studentjob.html");

	//Funding and Scholarships
	var sub10 = Array();
	var link10 = Array();

	//What's new....
	var sub11 = Array();
	var link11 = Array();

	//Contacts
	var sub12 = Array();
	var link12 = Array();

	var subMenu = Array(sub0,sub1,sub2,sub3,sub4,sub5,sub6,sub7,sub8,sub9,sub10,sub11,sub12);
	var subLink = Array(link0,link1,link2,link3,link4,link5,link6,link7,link8,link9,link10,link11,link12);

	var isAdvanceBrowser = false;
	if(document.getElementById) {
		isAdvanceBrowser = true;
	} 

//====================================================================================//

function changeColor(obj,color,index,colorIndex)
{
	obj.style.background = color;
	if(document.getElementById) {
		obj = document.getElementById('title_' + index);
		obj.style.color = colorIndex;
	}	
}

function changeBorder(obj,isInset)
{
	if(isInset)
		obj.style.border = '0.1mm inset';
	else
		obj.style.border = '0.1mm outset';
}

function genMenu(id)
{
	var str="";
	var tempStr;
	str += '<TABLE border="2" cellspacing="0" cellpadding="0" width="170" bordercolor="#626789"><TR><TD>';
	str += '<TABLE border="0" cellspacing="1" cellpadding="0" width="170" bgcolor="white">';
	index = 0;
	for(i=0; i<mainMenu.length; i++ , index++)
	{
		if(i==id)  bcolor = "#4E5AA8";  //selected items
		else bcolor = "#CCCCCC";  //unselected items
		
		if(isAdvanceBrowser) {
			//tempStr ='style="cursor:pointer; cursor:hand; border-width: 0.1mm;border-style:outset"';
			tempStr ='style="cursor:pointer; cursor:hand;"';
		} else {
			tempStr = '';
		}

		if(linkMenu[i].indexOf("http://")==0)  str += '<TR><TD height="25" bgcolor="'+bcolor+'" ' + tempStr + '><TABLE width="100%" height="100%" cellpadding="0" cellspacing="0"><TR onClick="window.location=\''+linkMenu[i]+'\';"><TD width="4">&nbsp;</TD><TD width="100%"><A href="'+linkMenu[i]+'"class="MenuLink" target="#"><B>';
		else  str += '<TR><TD height="25" bgcolor="'+bcolor+'" ' + tempStr + '><TABLE width="100%" height="100%" cellpadding="0" cellspacing="0"><TR onClick="window.location=\''+linkPath+linkMenu[i]+'\';"><TD width="4">&nbsp;</TD><TD width="100%"><A href="'+linkPath+linkMenu[i]+'"class="MenuLink"><B>';
		str += mainMenu[i];
		str += '</B></A></TD></TR></TABLE></TD></TR>';
		
		if(i==id) {
			str += '<TR><TD><TABLE border="0" cellspacing="1" cellpadding="0" width="170" bgcolor="#273B97">';
			for(j=0; j<subMenu[i].length; j++,index++)
			{
				if(isAdvanceBrowser) {
					tempStr = 'style="cursor:pointer; cursor:hand;"';
				} else {
					tempStr = '';
				}
				if(subLink[i][j].indexOf("http://")==0)  str += '<TR><TD height="25" bgcolor="#969FDF" valign="middle" ' + tempStr + '><TABLE width="100%" cellspacing="0" cellpadding="0" border="0" height="100%"><TR  onClick="window.location=\''+subLink[i][j]+'\';" onMouseOver="changeColor(this,\'#BDC4F7\',' + index +',\'#660000\');" onMouseOut="changeColor(this,\'#969FDF\',' + index +',\'black\');"><TD  align="right" width="100%"><A href="'+subLink[i][j]+'" class="MenuLink" target="#"><B><SPAN id="title_'   + index + '">';
				else  str += '<TR><TD height="25" bgcolor="#969FDF" valign="middle" ' + tempStr + '><TABLE width="100%" cellspacing="0" cellpadding="0" border="0" height="100%"><TR  onClick="window.location=\''+linkPath+subLink[i][j]+'\';" onMouseOver="changeColor(this,\'#BDC4F7\',' + index +',\'#660000\');" onMouseOut="changeColor(this,\'#969FDF\',' + index +',\'black\');"><TD  align="right" width="100%"><A href="'+linkPath+subLink[i][j]+'" class="MenuLink"><B><SPAN id="title_'   + index + '">';
				str += subMenu[i][j];
				str += '</SPAN></B></A></TD><TD width="4">&nbsp;</TD></TR></TABLE></TD></TR>';
			}
			str += '</TABLE></TD></TR>';
		} 
	} 
	str += '</TABLE>';
	str += '</TD></TR></TABLE>';

	str += addPicture(id);

	return str;
}

var imgArray = Array("CINC.jpg","CINC.jpg","scenic-5.jpg","poster.jpg","poster.jpg","scenic-2.jpg","scenic-3.jpg","scenic-2.jpg","scenic-3.jpg","biology_bldg.jpg","biology_bldg.jpg","biology_bldg.jpg");
function addPicture(id)
{
	var str='';
	if(id < imgArray.length)  str += '<p align="center"><img src="'+ linkPath +'images/' +imgArray[id]  +'" </p>';
	else  str += '<p align="center"><img src="'+ linkPath +'images/' + imgArray[0] +'" </p>';
	
	//for(i=0; i<imgArray.length; i++)
	//{
	//	str += '<p><img src="../images/'+imgArray[i]+'" </p>';
	//}
	
	return str;
}

function genTopMenu()
{
	var str='';
	str += '<img src="'+linkPath+'images/ucb_barB.gif" width="600" height="25" usemap="#Map" border="0">';
	return str;
}

function genBottomMenu()
{
	var str='';
	str += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	str += '<tr align="left" bgcolor="#000000">';
	str += '<td colspan="3" align="right"><img src="'+linkPath+'images/blk_pixel.gif" width="1" height="1"></td>';
	str += '</tr>';
	str += '<tr align="left">';
	str += '<td width="149" height="58" align="right"><a href="http://www.colorado.edu"><img src="'+linkPath+'images/clear.gif" width="1" height="1" border="0"></a><a href="http://www.colorado.edu"><img alt="University of Colorado at Boulder" src="'+linkPath+'images/wordmark_sm.gif" width="128" height="38" border="0"></a></td>';
	str += '<td width="31" height="58" valign="middle"><img alt="" src="'+linkPath+'images/blk_pixel.gif" width="1" height="1" vspace="10" hspace="15"></td>';
	str += '<td height="58" width="100%"><span class="smlink"><a href="'+linkPath+'">ICS Home</a> &nbsp;| &nbsp;';
	str += '<a href="'+linkPath+'people/index.html">Contact Us</a> &nbsp;| &nbsp;';
	str += '<a href="http://psych-swiki.colorado.edu:8080/ICS-Grant-Proposals">Wiki</a> &nbsp;| &nbsp;';
	str += '<a href="'+linkPath+'icsorgchart.html">Org Chart</a> &nbsp;| &nbsp;';
	str += '<a href="'+linkPath+'about/participating_units.html">Related Sites </a></span> &nbsp;| &nbsp;';
	str += '<span class="smlink"><a href="'+linkPath+'about/grant_admin.html">Grant Admin</a></span><br>';
	str += '<span class="caption">Copyright 2006 CU Regents. All rights reserved.<br>';
	str += '<!--The Institute of Cognitive Science, 344 UCB<br>Boulder, CO 80309-0344 &nbsp;Phone: 303.492.5063--></span>';
	str += '</td></tr></table>';
	return str;
}