function cycleImage() {
	img_captions = new Array();

// captions: (link-url,image-path,alt-text)

	img_captions[0] = Array('http://www.nd.edu/~NETID/','http://www.nd.edu/~NETID/assets/images/rotator/1.jpg','');
	img_captions[1] = Array('http://www.nd.edu/~NETID/','http://www.nd.edu/~NETID/assets/images/rotator/2.jpg','');
	img_captions[2] = Array('http://www.nd.edu/~NETID/','http://www.nd.edu/~NETID/assets/images/rotator/3.jpg','');	


var num = img_captions.length;
	img_number  = Math.floor(Math.random()*(num));
	document.write('<a href="../../../assets/scripts/' + img_captions[img_number][0] + '"><img src="../../../assets/scripts/' + img_captions[img_number][1] + '" alt="' + img_captions[img_number][2] + '" border="0" /></a>');
}


function currentNav() {
	currPage = getCurrentPath();
	navdiv = document.getElementById("nav-global")
	navli = navdiv.getElementsByTagName("li")
	if ((typeof(currPage[0])=="undefined")||currPage[0].length<2){
		for (var j = 0; j < navli.length; j++) {
			if (cleanLastSlash(currPage) == cleanLastSlash(getPath(navli[j].firstChild.href))) {
					navli[j].className = 'nav-current';
			}
		}
	}
	else {
		for (var i = 0; i < currPage.length; i++) {
			currPage[i];
			for (var j = 0; j < navli.length; j++) {
				if (currPage[i] == cleanLastSlash(getPath(navli[j].firstChild.href))) {
					navli[j].className = 'nav-current';
				}
			}
		}
	}
}


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.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();
}

function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}

function hideall()
{
HideContent('editor');
HideContent('shock');
HideContent('aristotelian');
HideContent('augustine');
HideContent('nemo');
HideContent('proliferation');
HideContent('equity');
HideContent('transnational');
HideContent('countess');
HideContent('japanese');
HideContent('monsignor');
HideContent('norman');
HideContent('underinvolvement');
HideContent('patriarchy');
HideContent('slaughter');
HideContent('mexico');
HideContent('ireland');
HideContent('riseofhistory');
HideContent('identity');
HideContent('woolf');
HideContent('coldwar');
HideContent('dancing');
HideContent('chineseness');
HideContent('enduring');
HideContent('poeticstoprada');
HideContent('chaos');
HideContent('dilemma');
HideContent('quaternary');
HideContent('oasis');
HideContent('clash');
HideContent('angel');
HideContent('autism');
HideContent('complex');
HideContent('crippled');
HideContent('vichy');
HideContent('sent');
}



