
function cycleFeature() {
	img_captions = new Array();


// captions: (link-url,image-path,title,text-block)
//	img_captions[n] = Array('#','http://history.nd.edu/images/affiliated/some.jpg','','');	

	img_captions[0] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#kellogg','http://history.nd.edu/images/affiliated/kellogg.jpg','Kellogg Institute for International Studies','The Kellogg Institute fosters interdisciplinary research on contemporary political, economic, social, and religious issues.');
	img_captions[1] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#cushwa','http://history.nd.edu/images/affiliated/cushwa.jpg','Cushwa Center for the Study of American Catholicism','The Cushwa Center for the Study of American Catholicism is widely recognized as the leading center for the historical study of Roman Catholicism in the United States.');
	img_captions[2] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#erasmus','http://history.nd.edu/images/affiliated/erasmus.jpg','Erasmus Institute','The Erasmus Institute is an international center at Notre Dame that helps scholars who are cultivating Catholic intellectual and cultural traditions, as well as those who will become such scholars.');	
	img_captions[3] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#reilly','http://history.nd.edu/images/affiliated/reilly.jpg','Reilly Center for Science, Technology, and Values','The Center is committed to advancing our knowledge of science and technology as human, knowledge-producing endeavors, and of the variety of ways these rapidly changing institutions affect and are, in turn, influenced by society at large.');	
	img_captions[4] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#nanovic','http://history.nd.edu/images/affiliated/nanovic.jpg','Nanovic Institute for European Studies','The Nanovic Institute is dedicated to broadening the learning experience at Notre Dame by supporting teaching and research in contemporary European affairs.');	
	img_captions[5] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#kroc','http://history.nd.edu/images/affiliated/kroc.jpg','Kroc Institute for International Peace Studies','The Kroc Institute for International Peace Studies at the University of Notre Dame conducts research, education, and outreach programs on the causes of violence and the conditions for sustainable peace.');	
	img_captions[6] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#medieval','http://history.nd.edu/images/affiliated/medieval.jpg','Medieval Institute','The Medieval Institute, founded in 1946, coordinates the teaching and research of the largest contingent of medievalists of any North American University.');	
	img_captions[7] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#keough_naughton','http://history.nd.edu/images/affiliated/keough.jpg','Keough-Naughton Institute for Irish Studies','The Keough- Naughton Institute for Irish Studies is an interdisciplinary project devoted to teaching and research in Irish culture in all its internal and external relations.');	
	img_captions[8] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#latino_studies','http://history.nd.edu/images/affiliated/latino.jpg','Institute for Latino Studies','The Institute for Latino Studies promotes understanding and appreciation of the social, cultural, and religious life of U.S. Latinos through advancing research, expanding knowledge, and strengthening community.');	
	img_captions[9] = Array('http://history.nd.edu/history-at-notre-dame/affiliated-institutes/#gender','http://history.nd.edu/images/affiliated/gender.jpg','Gender Studies','Gender Studies is an interdisciplinary academic program that analyzes the significance of gender—and the cognate subjects of sex, sexuality, race, ethnicity, and class—in all areas of human life around the globe.');	
// DO NOT CHANGE ANYTHING BELOW
var num = img_captions.length;
	img_number  = Math.floor(Math.random()*(num));
	img_output = 
		'<a href="' + img_captions[img_number][0] + '"><img src="' + img_captions[img_number][1] + '" alt="' + img_captions[img_number][2] + '" border="0" /></a>' +
		'<h4><a href="' + img_captions[img_number][0] + '">' + img_captions[img_number][2] + '</a></h4>' + 
		'<p>' + img_captions[img_number][3] + ' > <a href="' + img_captions[img_number][0] + '">Read More</a></p>';

	document.write(img_output);

}


function cycleSpotlight() {
	img_captions = new Array();

// captions: (link-url,image-path,title,text-block)
//	img_captions[n] = Array('#','http://history.nd.edu/images/affiliated/some.jpg','','');	

	img_captions[0] = Array('http://history.nd.edu/history-at-notre-dame/history-spotlight/#','http://history.nd.edu/images/spotlight-rodriguez.jpg','For Rodriguez Family Tree is a Teaching Tool','His mother was an Irish Catholic from Boston, his father a Mexican-American migrant worker. Fresh off his first job as a paperboy, Marc Rodriguez joined a Milwaukee grocer&rsquo;s union at age 16. If asked to predict the future profession of this blue-collar young man, few observers would have forecast the academy. Yet Rodriguez always knew he wanted to be an agent of social change, and he found that opportunity as an assistant professor of history at Notre Dame.');
	img_captions[1] = Array('http://history.nd.edu/history-at-notre-dame/history-spotlight/#sabine','http://history.nd.edu/images/wings_of_time_small.gif','Congratulations to Sabine MacCormack','Her recent "On the Wings of Time" from Princeton University Press has just been awarded not one but two American Historical Association book prizes. The first is the James A. Rawley prize in Atlantic history and the second is the John E. Fagg prize for the best book in Spanish, Portuguese or Latin American history.');
	img_captions[2] = Array( 'http://history.nd.edu/history-at-notre-dame/history-spotlight/#internship','http://history.nd.edu/history-at-notre-dame/history-spotlight/images/NationalArchives-CollegePark.jpg','History Majors Share Internship Stories','The History Department and Notre Dame Career Center recently hosted "History Career Night" Several history majors took this opportunity to share their recent internship experiences with their fellow students.');
	img_captions[3] = Array( 'http://history.nd.edu/history-at-notre-dame/history-spotlight/#sb08','http://history.nd.edu/history-at-notre-dame/history-spotlight/images/sb08.jpg','Spring Break 08','This course includes a travel program. It is these last six words in the course description of History 30408 that gave 27 Notre Dame students, Professor Kevin Spicer, C.S.C. and Maria Cuccharia (a third year European history graduate student) a unique opportunity to experience the history they had been learning. During Spring Break (February 29 – March 9) the group traveled to Poland (Warsaw, Lublin, Krakow), the Czech Republic (Prague) and Germany (Berlin) to visit sites related to Jewish religion, culture and life and the Holocaust.  <a href="http://history.nd.edu/history-at-notre-dame/history-spotlight/pdf/SpringBreak08.pdf">Download</a> this article with images or ');
	

// DO NOT CHANGE ANYTHING BELOW
var num = img_captions.length;
	img_output = "";
	img_number  = Math.floor(Math.random()*(num));
	if (img_captions[img_number][1] != "") {
		img_output = 
			'<a href="' + img_captions[img_number][0] + '"><img src="' + img_captions[img_number][1] + '" alt="' + img_captions[img_number][2] + '" border="0" /></a>';
	}
	img_output += 
		'<h4><a href="' + img_captions[img_number][0] + '">' + img_captions[img_number][2] + '</a></h4>' + 
		'<p class="spotlight-content">' + img_captions[img_number][3] + ' > <a href="' + img_captions[img_number][0] + '">Read full story</a></p>';

	document.write(img_output);

}



function currentNav() {
	strCurrPage = getCurrentPath();
	navdiv = document.getElementById("content-secondary")
	navli = navdiv.getElementsByTagName("li")
	
	if ((typeof(strCurrPage[0])=="undefined")||strCurrPage[0].length<2){
		currPage = new Array();
		currPage[0] = strCurrPage;
	}
	else
	{
	 	currPage = strCurrPage;	
	}

	for (var i = 0; i < currPage.length; i++) {
		for (var j = 0; j < navli.length; j++) {
			strTestPath = getPath(navli[j].firstChild.href);
			if ((typeof(strTestPath[0])=="undefined")||strTestPath[0].length<2){
				testPath = new Array();
				testPath[0] = strTestPath;
			}
			else
			{
				testPath = strTestPath;	
			}

			for (var k = 0; k < testPath.length; k++) {
				if (cleanLastSlash(currPage[i]) == cleanLastSlash(testPath[k])) {
					// alert(currPage[i] + ' == ' + testPath[k]);
					navli[j].className = 'nav-current';
				}
				else
				{
					// alert(currPage[i] + ' != ' + testPath[k]);
				}
			}
		}
	}
}


function getPath(someurl){
 d = document;
 csite = d.domain;
 sp = someurl.indexOf(csite) + csite.length;
 cpath = someurl.substring(sp);
 if (cpath.search(/index/)!=-1){
  re = "(.*?)€/index.shtml";
  myRe = new RegExp(re);
  cpath = cpath.match(myRe);
 }
return cpath;
}

function cleanLastSlash(someurl){
 lastchar = someurl.length-1;
  if (someurl!="") {
	if (someurl.charAt(lastchar)=="/"){someurl = someurl.substring(0,(someurl.length-1))}
  }
return someurl;

}

function getCurrentPath(){
 d = document;
 cpage = d.URL;
 csite = d.domain;
 sp = cpage.indexOf(csite) + csite.length;
 cpath = cpage.substring(sp);
 if (cpath.search(/index/)!=-1){
  re = "(.*?)€/index.shtml";
  myRe = new RegExp(re);
  cpath = cpath.match(myRe);
 }
return cpath;
}

window.onload = init;

function init(){
	currentNav();
}
