//----------------------------------------------------------------------------------------------
//	see PrefixDef_ReadMe.txt for procedure/function nomenclature guidelines.
//----------------------------------------------------------------------------------------------
/* DELETE NOTES PRIOR TO UPLOAD
ba_breadcrumbs01.1;   	
	.name == ba_breadcrmb();
	.purpose == returns a series of links from the home page to the current page being browsed
	.call origin == within the html file where you want the breadcrumbs to appear;
	.notes == be sure to include a 
<script language="javascript" src="/DIRECTORY OF JS FILE/breadcrumbs.js" type="text/javascript"></script>
tag in the <head> of your *.html document in which this function is invoked.
Place the following in the location of the html/php/etc. document that you want the breadcrumbs to appear:
<div id="breadcrumb_bar">
	<!--START BA Bread Crumb script-->
		<script language="javascript" type="text/javascript">
			<!--
			var breadURL=ba_breadcrmb(window.document.location.href);
			document.writeln(breadURL);
			//-->
		</script>
	<!--END BA Bread Crumb script-->
</div>
	
/*Bread crumb script - Kevin Lynn Brown; Duplicate directory names bug fix by JavaScriptKit.com, Visit JavaScript Kit (http://javascriptkit.com) for original script; -------->Stream lined and enhanced by Barr Allen, Bruce Stevenson,ABC */
function ba_breadcrmb(page_href){
	
	var i,cp="",thishref=page_href,thS=thishref.split("/"),thS1,x,actURL;
	var y="www./.com/.net/.biz/.org", z=y.split("/");
	var p=".html/.htm/.php", q=p.split("/"),b,m,n,r,t;
	var sEP=" | "; //seperator that will be used between each page's link in the breadcrumb result. i.e., home sEP page sEP page;
	var pFX='viewing\:'; //the prefix that comes prior to the breadcrumb links. i.e., viewing: home | dir | etc. 

	for (i=2;i<(thS.length-1);i++) {
		thS1=""
		for (a=0;a<z.length;a++){
			if(thS[i].indexOf(z[a])>-1){
				thS1=" home "
				break;
			}
		}
		if(thS1==" home "){
			cp+='<a href="'+thishref.substring(0,thishref.indexOf("/"+thS[i])+thS[i].length+1)+'">'+thS1+'</a>'+sEP;
			continue;
		}else if(thS[i].indexOf("_")>-1){
			//x=thS[i].indexOf("_");			
			//thS1=thS[i].substring(thS[i].length - (thS[i].length-(x+1)));
			m=thS[i].split("_");
			for(r=0;r<m.length;r++){
				if(parseInt(m[r])){
					continue;
				}else{
					thS1=thS1+m[r]+" ";
				}
			}
		}else{
			thS1=thS[i];
		}
		cp+='<a href=\"'+thishref.substring(0,thishref.indexOf("/"+thS[i])+thS[i].length+1)+'/\">'+thS1+'</a>'+sEP;
	}
	i=thS.length-1;
	for (b=0;b<q.length;b++){
		if(thS[i].indexOf(q[b])>-1){
			var thS2=thS[i].substring(0, (thS[i].length-q[b].length));
			if(thS2.indexOf("_")>-1){
				//x=thS2.indexOf("_");
				//thS1=thS2.substring(thS2.length - (thS2.length-(x+1)));
				thS1="";
				n=thS2.split("_");
				for(t=0;t<n.length;t++){
					if(parseInt(n[t])){
						continue;
					}else{
						thS1=thS1+n[t]+" ";
					}
				}
				break;
			}else{
				thS1=thS2
				break;
			}
		}
	}
	cp+='<a href=\"'+thishref.substring(0,thishref.indexOf(thS[i])+thS[i].length)+'\">'+thS1+'</a>';
	actURL =pFX+cp;
	//actURL = '<span class="breadcrumbs">viewing\:'+window.location.protocol+'//'+cp+'</span>';
	return(actURL);
}
