// JavaScript Document
// This function has to be called in the onload statement of the body tag
// variable array mkeys (mainnav)
// mkeys works via the location property (subfolder)
// define the array in the Macromedia JavaScript code:
// mkeys = new Array('keyword1',...,'keyword#');
// slices should be named l2-keyword
// 6/14/2001 RJ

function eval_location() {
// ascertain the document location and image path
var here=new String(document.location),path=new String(document.images[0].src);

// get the path to the graphics folder
path = path.substring(0,path.lastIndexOf("/")+1);

// work through the keywords and test one is in the location
for (i=0;i<mkeys.length;i++){

// set the image to the down state
if (here.indexOf(mkeys[i])>-1) {

MM_nbGroup('down','navbar1','l2'+mkeys[i],path+'l2-'+mkeys[i]+'-d.gif',1);
break; }
}

/* if it is the about page with the subnav */
if (mkeys[i] == "about") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("dean") > -1) skey = "dean";
	if (str_title.indexOf("accreditation") > -1) skey = "accreditation";
	//alert(path);
	if (skey != "") MM_nbGroup('down','navbar2','l2about'+skey,path+"l2-about-"+skey+'-d.gif',1);
}	

/* if it is the ask met page with the subnav */
if (mkeys[i] == "ask") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("faqs") > -1) skey = "faqs";
	if (str_title.indexOf("graduate") > -1) skey = "graduate";
	if (str_title.indexOf("undergraduate") > -1) skey = "undergraduate";
	if (str_title.indexOf("international") > -1) skey = "international";
	if (str_title.indexOf("subscribe") > -1) skey = "subscribe";
	if (str_title.indexOf("request") > -1) skey = "request";
	//alert(path);
	//alert(skey);
	if (skey != "") MM_nbGroup('down','navbar2','l2ask'+skey,path+"l2-ask-"+skey+'-d.gif',1);
}	

/* if it is the courses page with the subnav */
if (mkeys[i] == "courses") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("graduate") > -1) skey = "graduate";
	if (str_title.indexOf("undergraduate") > -1) skey = "undergraduate";
	if (str_title.indexOf("explorations") > -1) skey = "explorations";
	if (str_title.indexOf("military") > -1) skey = "military";
	if (str_title.indexOf("non credit") > -1) skey = "noncredit";
	if (str_title.indexOf("online") > -1) skey = "online";
	//alert(path);
	//alert(skey);
	if (skey != "") MM_nbGroup('down','navbar2','l2courses'+skey,path+"l2-courses-"+skey+'-d.gif',1);
}	

/* if it is the departments page with the subnav */
if (mkeys[i] == "departments") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("actuarial") > -1) skey = "actuarial";
	if (str_title.indexOf("advertising") > -1) skey = "advertising";
	if (str_title.indexOf("administrative") > -1) skey = "administrative";
	if (str_title.indexOf("arts") > -1) skey = "arts";
	if (str_title.indexOf("brussels") > -1) skey = "brussels";
	if (str_title.indexOf("liberal") > -1) skey = "liberal";
	if (str_title.indexOf("gastronomy") > -1) skey = "gastronomy";
	if (str_title.indexOf("computer") > -1) skey = "computer";
	if (str_title.indexOf("criminal") > -1) skey = "applied";
	if (str_title.indexOf("engineering") > -1) skey = "engineering";
	if (str_title.indexOf("explorations") > -1) skey = "explorations";
	if (str_title.indexOf("lifelong") > -1) skey = "lifelong";
	if (str_title.indexOf("military") > -1) skey = "military";
	
	//alert(path);
	//alert(skey);
	if (skey != "") MM_nbGroup('down','navbar2','l2departments'+skey,path+"l2-departments-"+skey+'-d.gif',1);
}	
/* if it is the express enrollment page with the subnav */
if (mkeys[i] == "express") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("register") > -1) skey = "register";
	if (str_title.indexOf("current") > -1) skey = "current";
	if (str_title.indexOf("new") > -1) skey = "new";
	if (str_title.indexOf("apply") > -1) skey = "apply";
	if (str_title.indexOf("graduate") > -1) skey = "graduate";
	if (str_title.indexOf("undergraduate") > -1) skey = "undergraduate";	
	if (str_title.indexOf("international") > -1) skey = "international";
	if (str_title.indexOf("certificate") > -1) skey = "certificate";
	if (str_title.indexOf("tuition") > -1) skey = "tuition";	
	if (str_title.indexOf("add") > -1) skey = "add";
	if (str_title.indexOf("dates") > -1) skey = "dates";
	//alert(path);
	//alert(skey);
	if (skey != "") MM_nbGroup('down','navbar2','l2express'+skey,path+"l2-express-"+skey+'-d.gif',1);
}	

/* if it is the locations page with the subnav */
if (mkeys[i] == "locations") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("charles") > -1) skey = "boston";
	if (str_title.indexOf("braintree") > -1) skey = "braintree";
	if (str_title.indexOf("international") > -1) skey = "international";
	if (str_title.indexOf("corporate") > -1) skey = "corporate";
	if (str_title.indexOf("military") > -1) skey = "military";
	if (str_title.indexOf("tyngsboro") > -1) skey = "tyngsboro";
	if (str_title.indexOf("other") > -1) skey = "other";
	if (str_title.indexOf("online") > -1) skey = "online";	
	
	//alert(path);
	//alert(skey);
	if (skey != "") MM_nbGroup('down','navbar2','l2locations'+skey,path+"l2-locations-"+skey+'-d.gif',1);
}	
/* if it is the news page with the subnav */
if (mkeys[i] == "news") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("information") > -1) skey = "information";
	if (str_title.indexOf("archive") > -1) skey = "archive";
	
	//alert(path);
	//alert(skey);
	if (skey != "") MM_nbGroup('down','navbar2','l2news'+skey,path+"l2-news-"+skey+'-d.gif',1);
}	

/* if it is the news page with the subnav */
if (mkeys[i] == "people") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("employee") > -1) skey = "employee";
	if (str_title.indexOf("student") > -1) skey = "student";
	if (str_title.indexOf("faculty") > -1) skey = "faculty";
	if (str_title.indexOf("alumni") > -1) skey = "alumni";
	
	//alert(path);
	//alert(skey);
	if (skey != "") MM_nbGroup('down','navbar2','l2people'+skey,path+"l2-people-"+skey+'-d.gif',1);
}	
/* if it is the programs page with the subnav */
if (mkeys[i] == "programs") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("graduate certificate") > -1) skey = "advanced";
	if (str_title.indexOf("post graduate degree") > -1) skey = "masters";
	if (str_title.indexOf("graduate school program") > -1) skey = "graduate";
	if (str_title.indexOf("under") > -1) skey = "undergraduate";
	if (str_title.indexOf("undergraduate certificate") > -1) skey = "certificate";
	if (str_title.indexOf("undergraduate degree") > -1) skey = "bachelors";
	if (str_title.indexOf("corporate") > -1) skey = "corporate";
	if (str_title.indexOf("other") > -1) skey = "other";
	if (str_title.indexOf("online") > -1) skey = "online";
	if (str_title.indexOf("elive") > -1) skey = "elive";
	if (str_title.indexOf("international") > -1) skey = "international";
	//alert(path);
	//alert(skey);
	if (skey != "") MM_nbGroup('down','navbar2','l2programs'+skey,path+"l2-programs-"+skey+'-d.gif',1);
}
if (mkeys[i] == "graduation") {
	var str_title = document.title.toLowerCase();
	//alert(str_title);
	var skey = new String;
	if (str_title.indexOf("graduate") > -1) skey = "graduate";
	if (str_title.indexOf("online") > -1) skey = "online";
	if (str_title.indexOf("terms") > -1) skey = "terms";
	if (str_title.indexOf("undergraduate") > -1) skey = "undergraduate";
	if (str_title.indexOf("resources") > -1) skey = "resources";
	if (str_title.indexOf("questions") > -1) skey = "faq";
	if (str_title.indexOf("commencement") > -1) skey = "year";
	if (str_title.indexOf("guest") > -1) skey = "guest";
	if (str_title.indexOf("directory") > -1) skey = "directory";
	//if (str_title.indexOf("international") > -1) skey = "international";
	//alert(path);
	//alert(skey);
	if (skey != "") MM_nbGroup('down','navbar2','l2commencement'+skey,path+"l2-commencement-"+skey+'-d.gif',1);
}
return;
}