// Collage Breadcrumbs v1.0 by Timothy Russell

var aPathArray=splitpath.split("/"); 
	  var output = ""; 
	  var count = 0; 
 
	  
	  //Loop through the array that we created, starting at the last element since we 
	  //KNOW that this is where the file is. Once we get to the "" element we can //break the loop
	  for(i=aPathArray.length-1;i>0;i--){ 
	  		if(aPathArray[i] == "WebSite"){ 
	  			break; 
				}else{ 
				count++;  
			} 
		} 
		
		//Create our ouput array based on how my levels deep we went 
		var aText = new Array(count); 
		var j = 0;
		for(i=aPathArray.length-1;i>0;i--){ 
			if(aPathArray[i] == "WebSite"){  
				break; 
				}else if(aPathArray[i] == "cas") {
				aText[j] = "College of Arts &amp; Sciences"; j++;  
				} else if(aPathArray[i] == "sps") {
				aText[j] = "School of Professional Studies"; j++;  
				} else if(aPathArray[i] == "grad") {
				aText[j] = "Graduate"; j++; 
				} else if(aPathArray[i] == "undergrad") {
				aText[j] = "Undergraduate"; j++; 
				} else if(aPathArray[i] == "edu") {
				aText[j] = "School of Education"; j++; 
				} else if(aPathArray[i] == "admissions") {
				aText[j] = "Admissions"; j++; 
				} else if(aPathArray[i] == "profiles") {
				aText[j] = "Profiles"; j++; 
				} else {
				aText[j] = aPathArray[i]; j++; 
				} 
		} 
	//	aPathArray = reverse(aPathArray)
		var k = 4; 
		var m = -1;  
		var aURL = new Array(count); 
		for(i=aPathArray.length;i>0;i--){   
			if(aPathArray[i] == "WebSite"){   
				break; 
			} else { 
				k = 2; 
				aURL[m] = '/';  
				while (k<=i) {  
					
					aURL[m] = aURL[m] + aPathArray[k] + '/';   
					k++;  	
				} 
				m++;
			} 
		} 
		
		//Loop through the output array, building our ouputstring. The file that we are on 
		//is the last element added to the output 
		if (documentname == 'Admissions Home Page') {
			output = documentname;  
		} else {
			
			for(i=aText.length-1;i>0;i--){ 
				if (aText[i] != "programs" && aText[i] != "events" ) { 
					if (aText[i] == "Profiles") {
						output += aText[i] + ' &gt;&gt '; 
					} else {
						output += '<a href="' + aURL[i] + '">' +aText[i] + '</a> &gt;&gt '; 
					}
				} 
			} 
			output += documentname; 
		}
		document.write(output);