// JavaScript Document

var dirList = new Array();
var textList = new Array();

//level 1
dirList[0] = 'contactus';
dirList[1] = 'test';
dirList[2] = 'bookletsmanuals';
dirList[3] = 'casestudies';
dirList[4] = 'pressroom';
dirList[5] = 'incidentmgmt';
dirList[6] = 'preventionprogram';
dirList[7] = 'tos';


//level 1
textList[0] = 'contact us';
textList[1] = 'take the test';
textList[2] = 'booklets + manuals';
textList[3] = 'case studies';
textList[4] = 'press room';
textList[5] = 'incident management';
textList[6] = 'prevention programs';
textList[7] = 'terms of use';


function breadcrumbs() {
	var sDelimiter = '&gt;';
	var sURL = (location.pathname.indexOf('?') != -1) ? location.pathname.substring(0, location.pathname.indexOf('?')) : location.pathname;
	sURL = (location.pathname.charAt(0) == '/') ? location.pathname.substring(1) : location.pathname;

	//remove download folder location
	//var tempIndex = sURL.indexOf("/download/");
	//if(tempIndex != -1) {
	//	sURL = sURL.slice(0, tempIndex+1);
	//}
		
	var aURL = sURL.split('/');
	//alert(aURL);
		
	if(aURL) {
		var sOutput = '<a href="/">home</a>  ' + sDelimiter + '  ';
		var sPath = '/';
		for(var i = 0; i < aURL.length-2; i++) {
			if(aURL[i].indexOf('.html')!=-1) {
				continue;
			}
			sPath += aURL[i] + '/';
			for(var s = 0; s < dirList.length; s++) {
				if(aURL[i]==dirList[s]) {
					aURL[i]=textList[s];
				}
			}
			//alert(sPath);        
			sOutput += '<a href="' + sPath + '"';
			sOutput += ' >' + aURL[i] + '</a>';
			//alert(sOutput);
			if (i < aURL.length-2) {
				sOutput += '  ' + sDelimiter + '  ';
			}
			else {
				sOutput += '';	
			}
      }
		
      for(var i = aURL.length-2; i < aURL.length-1; i++) {
			if(aURL[i].indexOf('.html')!=-1) {
				continue;
			}
			sPath += aURL[i] + '/';
			for(var s = 0; s < dirList.length; s++) {
				if(aURL[i]==dirList[s]) {
					aURL[i]=textList[s];
				}
			}
			//alert(sPath);
			sOutput += '<b><a href="' + sPath + '"';
			sOutput += ' >' + aURL[i] + '</a></b>';
			//alert(sOutput);
			if (i < aURL.length-2) {
				sOutput += '&nbsp;' + sDelimiter + '&nbsp;';
			}
			else {
        		sOutput += '';		
			}
      }	

      document.write(sOutput);
    }
}




