// JavaScript Document
/*
Copyright Justin Whitford 2001.
  http://www.whitford.id.au/
Perpetual, non-exclusive license to use this code is granted
on the condition that this notice is left in tact.
*/
  function breadcrumbs(){
    sURL = new String;
    bits = new Object;
    var x = 0;
    var stop = 0;
    var output = "<A HREF=\"/\">Home</A> | ";

    sURL = location.href;
    sURL = sURL.slice(8,sURL.length);
    chunkStart = sURL.indexOf("/");
    sURL = sURL.slice(chunkStart+1,sURL.length)

    while(!stop){
      chunkStart = sURL.indexOf("/");
      if (chunkStart != -1){
        bits[x] = sURL.slice(0,chunkStart)
        sURL = sURL.slice(chunkStart+1,sURL.length);
      }else{
        stop = 1;
      }
      x++;
    }

    for(var i in bits){
      output += "<A HREF=\"";
      for(y=1;y<x-i;y++){
        output += "../";

      }
      output += bits[i] + "/\">" + bits[i] + "</A>  | ";	 
    }
    document.write(output);
 }

function breadcrumbs2(sClass, sDelimiter)
  {
    if(!sDelimiter) sDelimiter = '|';
    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;
    var aURL = sURL.split('/');
    if(aURL)
    {
      var sOutput = '<a href="/">Home</a> ' + sDelimiter + ' ';
      var sPath = '/';
      for(var i = 0; i < aURL.length; i++)
      {
        sPath += aURL[i] + '/';
        sOutput += '<a href="' + sPath + '"';
        if(sClass) sOutput += ' class="' + sClass +'"';
        sOutput += '>' + aURL[i] + '</a>';
        sOutput += ' ' + sDelimiter + ' ';
      }
      sOutput += document.title;
      document.write(sOutput);
    }
  }

function breadcrumbs3 () {
	var sURL   = window.location.href;
	var sURLen = sURL.length;
	var aURL   = new Array();
	var aURLoc = new Array();
	var aURLen = 0;
	var letter = '';
	var word   = '';
	var output = '<div class="navbreadcrumbs"> ';
	var theend = '';
	var begin  = 'hooppwebdev:81';
	var now    = (theend != '') ? 0 : 1;
	var sl     = '/';
	var home   = 'hooppwebdev:81';
	var idx    = 'index.asp';

	for (i=0; i < sURLen; i++) {
		justbeforeme = sURLen - i;
		fromme       = justbeforeme - 1;
		letter       = sURL.substring(fromme,justbeforeme);

		if (letter != sl) word = letter + word;
		if (((letter == sl) || (i == sURLen-1)) && (word != '')) {
			aURL[aURLen]   = word;
			aURLoc[aURLen] = sURL.substring(0,justbeforeme) + word;
			word = '';
			aURLen++;
		}
	}

	for (i=aURLen-1; i > 0; i--) {
		word = aURL[i];
		loc  = aURLoc[i];
		alert(" l > " + loc + "  w > " + word + " h > " + home  );
		if (word == theend) now = 0;
		if (now  == 1) {		
			if (word == home )
				output = output + '<a href="' + loc + '">home</a>' + ' &gt; ';
			else
				//output = output + '<a href="' + loc + '">' + word + '</a>' + ' &gt; ';
				output = output + '<a href="' + idx + '">' + word + '</a>' + ' &gt; ';
		}
		if (word == begin)  now = 1;
	}
	//document.write(output + 'here.</div>');
	document.write(output + document.title + '</div>');
}
