


function breadCrumbs(base, delStr, defp, cStyle, tStyle, dStyle, nl) {

	loc = window.location.toString();
    subs = loc.substr(loc.indexOf(base) + base.length + 1).split("/");

	document.write("<a href=\"" + getLoc(subs.length - 1) + defp + "\"><span class=\"" + cStyle + "\">Jones Drafting</span></a>  ");
    a = (loc.indexOf(defp) == -1) ? 1 : 2;
	firstRun	= true;
	b = 1;
		
//alert("loc  " + loc + "\n" + "subs  " + subs + "\n" + "defp  " + defp + "\n" + "a  " + a + "\n" + "subs.length  " + subs.length + "\n" + "subs.length - a  " + (subs.length - a))
    for (i = 0; i < (subs.length - b); i++) {
        subs[i] = makeCaps(unescape(subs[i]));
		subs[i] = replaceSubString(subs[i],"_"," ");
		separator = ((a == 2) ? "" : "<span class=\"" + dStyle + "\">" + delStr + "</span> ");
		
        document.write("<span class=\"" + dStyle + "\">" + delStr + "</span> " + "<a href=\"" + getLoc(subs.length - i - 2) + defp + "\"><span class=\"" + cStyle + "\">" + subs[i] + "</span></a>  " + separator);
		if (firstRun) {
			b = a;
			firstRun = false;
		}
    }
    if (nl == 1) {
        document.write("<br>");
    }
	if (a == 1) {
    	document.write("<span class=\"" + tStyle + "\">" + document.title + "</span>");
	}
}

function makeCaps(a) {
    g = a.split(" ");
    for (l = 0; l < g.length; l++) {
        g[l] = g[l].toUpperCase().slice(0, 1) + g[l].slice(1);
    }
    return g.join(" ");
}

function getLoc(c) {
    var d = "";
    if (c > 0) {
        for (k = 0; k < c; k++) {
            d = d + "../";
        }
    }
    return d;
}

function writePageTitle() {

	loc			= window.location.toString();
	folderName	= loc.substring(0,loc.lastIndexOf('/'));
	folderName	= folderName.substring(folderName.lastIndexOf('/')+1);
    pageName	= loc.substring(loc.lastIndexOf('/')+1,loc.lastIndexOf('.'));
    pageName	= ((pageName.indexOf("index") == -1) ? pageName : folderName);
	pageTitle	= replaceSubString(pageName,"_"," ");
	pageTitle	= makeCaps(pageTitle);
	document.title	= pageTitle;
}

function replaceSubString(string,oldVal,newVal) {
	while (string.indexOf(oldVal)>-1) {
		pos		= string.indexOf(oldVal);
		string	= string.substring(0, pos) + newVal + string.substring(pos + oldVal.length, string.length);
	}
	return string;
}


function openPopUp(url,winName,width,height,left,top,scr,rsz,status,menubar,location,toolbar) {

	width		= ((width == null)		? '300'		: width);
	height		= ((height == null)		? '300'		: height);
	left		= ((left == null)		? '100'		: left);
	top			= ((top == null)		? '100'		: top);
	scrollbars	= ((scr == null)		? 'yes'		: scr);
	resizable	= ((rsz == null)		? 'no'		: rsz);
	status		= ((status == null)		? 'no'		: status);
	menubar		= ((menubar == null)	? 'no'		: menubar);
	location	= ((location == null)	? 'no'		: location);
	toolbar		= ((toolbar == null)	? 'no'		: toolbar);

	windowProps	 = 'width='			+ width;
	windowProps	+= ',height='		+ height;
	windowProps	+= ',left='			+ left;
	windowProps	+= ',top='			+ top;
	windowProps	+= ',scrollbars='	+ scrollbars;
	windowProps	+= ',resizable='	+ resizable;
	windowProps	+= ',status='		+ status;
	windowProps	+= ',menubar='		+ menubar;
	windowProps	+= ',location='		+ location;
	windowProps	+= ',toolbar='		+ toolbar;

	eval(winName + ' = window.open("' + url + '","' + winName + '","' + windowProps + '")');
	eval(winName + '.focus()');
//	popUp		= window.open(url,winName,windowProps);
//	popUp.focus()
	return void(0);
}


