/* 
Component:	mod_crumbs.js
Auth:		PHV 040225
Desc:		JavaScript Breadcrumb navigation generator
Editable:	NO
*/

var uTitle=document.title
function breadcrumbs(o,f,v,r,m) { 
	
	aClass="aClass";	// Define CSS class for live crumbs
	tClass="tClass";	// Define CSS class for title crumb
	dClass="dClass";	// Define CSS class for divider
	
	n=0;		// Place Current Page title on separate line
	q=4;		// sets initial value of i.  Must exist and be < 0 but value is unimportant
	
	d=document;l=window.location.toString();s=l.split("/");i=q;d1=" <span class='" + dClass + "'>"+m+"</span> "
	if (f!=-1) if (l.indexOf(f)!=-1) {sNew = new Array(); for (i=0;i<s.length-1;i++) {sNew[i] = s[i]}; 
	s = sNew;};h="<a href='"+jTrail(l,i)+f+"' class='" + aClass + "'>"+o+"</a>";
	t="<span class='" + tClass + "'>"+uTitle+"</span>";if (s.length==q) {h=t;d1=""}	w=(r==1)?h+d1:t;
	d.write(w);if (n&&!r) d.write("<br>");if (r==1) for (i=v;i<s.length;i++) {d.write("<a href='");
	d.write(jTrail(l,i)+f+"' class='" + aClass + "'>"+fName(s[i-1])+"</a> <span class='" + dClass + "'>"+m+"</span> ")
	l=window.location.toString();} else for (i=s.length;i>v;i--) {d.write(" <span class='" + dClass + "'>"+m)
	d.write("</span> <a href='"+jTrail(l,i-1)+f+"' class='" + aClass + "'>"+fName(s[i-2])+"</a>");
	l=window.location.toString();}if (n && r) d.write("<br>");w=(r==1)?t:d1+h;if (s.length!=q) d.write(w)

	}

function jTrail(l,i) {
	
	p=0;for (z=0;z<i;z++)p=l.indexOf("/",p)+1;return l.substring(0,p)
	
	}

function fName(a) {
	
	a=unescape(a); g=a.split(' '); for (l=0;l<g.length;l++)	
	g[l]=g[l].toUpperCase().slice(0,1)+g[l].slice(1);retVal=g.join(" "); 

	for (var x=0;x<nList.length;x=x+2) 	if (a==nList[x]) {retVal=nList[x+1];break;
	
	}
		
	return retVal;
	
	}