BreadCrumbClass = function(){
	this.init();
}

BreadCrumbClass.prototype.init = function(){
	this.deliminator;
	this.separator;
	this.pageURL;
	this.crumbTrail;
	this.crumbString;
	this.crumbArray = new Array();
}

BreadCrumbClass.prototype.getURL = function(){
	return(document.URL);
}

BreadCrumbClass.prototype.setCrumb = function(deliminator, separator){
	this.deliminator = deliminator;
	this.separator = separator;
	this.pageURL = this.getURL();
	this.crumbTrail = this.formatCrumb(this.pageURL, this.deliminator, this.separator);
	return(this.crumbTrail);
}

BreadCrumbClass.prototype.setModel = function(strings,links){
	var tempStringArray = strings;
	var tempLinkArray = Links;
	var tempSLArray;
	
}

BreadCrumbClass.prototype.formatCrumb = function(URL,deliminator,separator){
	var tempArray; //hold link text
	var tempArrayLink; //hold links
	var tempArrayLinkComb = new Array(); //combined links
	var tempDelim = new RegExp(deliminator, ["g"]); //create regular expression for search and replace
	var tempSepar = separator;
	var tempString = URL;
		tempString = tempString.toString();
		if(tempString.substr(0,5) == "https"){
		tempString = tempString.slice(8); //"https://"
		}else{
		tempString = tempString.slice(7); //"http://"
		}
	var tempStringLink = tempString;
		tempString = tempString.replace(tempDelim, " ");
		tempArray = tempString.split("/");
		tempArrayLink = tempStringLink.split("/");
		//alert(tempArrayLink);
		//loup through the link (folder structure) and recreate it to build the tree structure
		for(count2 = 1; count2 < tempArrayLink.length; count2++){
			if(count2 == 1){
				tempArrayLinkComb[count2] = tempArrayLink[count2];
				//alert(tempArrayLinkComb[count2]);
			}else{
				tempArrayLinkComb[count2] = tempArrayLinkComb[count2 - 1] + "/" + tempArrayLink[count2];
				//alert(tempArrayLinkComb[count2]);
			}
			//alert(tempArrayLinkComb);
		}
		tempString = ""; //clear for reuse
		for(count = 0; count < tempArray.length-1; count++){
			if(count == 0){
				tempString = "<a href='" + "http://" + tempArrayLink[count] + "'>Home</a>";
			}else{
				//make sure http:// is on the link
				tempString = tempString + (tempSepar + "<a href='" + "http://www.shellvalley.com/" + tempArrayLinkComb[count] + "'>" + tempArray[count] + "</a>");
			}
			//alert(tempString);
		}
		//alert(tempString);
		return(tempString);
		
}


nppdCrumb = new BreadCrumbClass();
//////////////call script//////////////////
/******************************************
<script language="JavaScript" type="text/JavaScript">document.write(nppdCrumb.setCrumb("_","  /  "));</script>
******************************************/