// Email me here: http://www.paulhirsch.com/contact_me.php//// Copyright 2006, Paul Hirsch. All rights specified herein and within GPL// documentation: http://www.gnu.org/licenses/gpl.txt//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Change the following variables as instructed                             ////////////////////////////////////////////////////////////////////////////////// Enter your domain name here, //var url = "http://www.juicyapple.com.au/ryancarlislethomas";//var url = "http://localhost";var url = "www.rct-law.com.au";// Enter the word you want to use to describe the home page of your sitevar home = "home";// Enter the character(s) you want to use to separate your breadbrumbsvar divide = "|";// Enter text you'd like to see.  You can make this blank as well - "";var pre = "";// Enter the character that replaces spaces in your URL (i.e. - or _ or %20)var sp = "_";// Enter the extension you use for your pagesvar ext = ".html";// Enter the default file name you use for the root file of your foldersvar root = "index";// Want to replace any folder names with custom names of your own?  Create// replacement pairs in the following format: swap[i] = 'Old Words|New Words';swap = new Array(); // Don't touch this line!// Remove comments from swap array variables below to put them into use.// Create additional replacement items by increasing the array number [i] as// you add more lines.swap[0] = 'Replace Me|Different Text';// swap[1] = 'Replace Me|My Replacement';// etc.swap[1] = 'publicacc|accidents in public places';swap[2] = 'tac|traffic accidents';swap[3] = 'comcare|comcare seacare and military compensation';//swap[3] = 'crimescomp|crimes compensation';swap[4] = 'divorceseparations|family law';swap[5] = 'employmentandindustrial|employment and industrial law';swap[6] = 'crime|criminal charges';swap[7] = 'personalinjury|personal injury';swap[8] = 'willsandprobate|wills and probate';swap[9] = 'property|property and conveyancing';swap[10] = 'super|superannuation';swap[11] = 'coaldust|coal dust claims';swap[12] = 'sexualandinstit|sexual and institutional abuse';swap[13] = 'contact|contact us';swap[14] = 'feepolicies|fee policies';swap[15] = 'offices|our offices';swap[16] = 'ourteam|our team of experts';swap[17] = 'privacypolicy|privacy policy';swap[18] = 'termsandcond|terms and conditions';swap[19] = 'principalsandpartners|partners, consultants and senior legal executives';swap[20] = 'professionalstaff|professional staff';swap[21] = 'solicitorsandlegal|solicitors and legal executives';//////////////////////////////////////////////////////////////////////////////// DO NOT TOUCH ANYTHING BELOW THIS LINE                                    //// unless you know damned well what you're doing!                           ////////////////////////////////////////////////////////////////////////////////divide = ' ' + divide + ' '; // Adds some space around the breadcrumb divider.var a = '' + window.location; // Adds some space around the breadcrumb divider.var b, code, left, x, y = ''; // Declaring these for later.var foo = root + ext; // Creates a variable we can use to call the root file of a given folder at a later time.var bar = divide + root; // Creates a variable to allow us to easily remove some unwanted breadcrumb stuff later.a = a.replace(ext,''); // [A] Strips off the file extension from the name of the page.left = a.lastIndexOf("/"); // Identifies the last forward slash in the page URL.// If the last character within the URL is a forward slash, this bit of code adds the root folder word to the end of it, so other parts of this script will be able to process things properly.if (a.substring(a.lastIndexOf('/')) == '/') {	a = a + root;}b = a.substring(left+1); // Makes the variable "b" equal to everything on the right side of the last forward slash in the URL: the page name, minus the file extension (removed in line [A])b = b.replace(new RegExp(sp, 'g'),' '); // Replaces all word separators (underscore, hyphen, etc.) with spaces. Separator in use is a user-declared variable.b = b.replace(/#/g,divide); // Replaces the octothorpe commonly used for jump links with the user-specified divider.code = divide + b; // [B] Makes the variable "code" equal to the name of the page, as stored in variable "b", plus a breadcrumb divider is added in front.b = '/' + b; // The slash is added back to the beginning of variable "b".  It was discarded in line [B].b = b.replace(divide,'#'); // The octothorpe is put back into the file name.b = b.replace(/ /g,sp); // The user-specified word separators are put back into the file name.a = a.replace(b,''); // Removes the segment that was just used from the variable holding the URL.// This loop will continue the breadcrumb creation process, so long as the last forward slash is not preceded by another forward slash (which signifies the beginning of the URL)if (a.substring(left-1) != '/') {	do  {		left = a.lastIndexOf('/'); // Identifies the last forward slash in the remaining URL.		b = a.substring(left+1); // Makes the variable "b" equal to everything on the right side of the last forward slash in the URL: a folder in which a page or deeper folder is being stored.		b = b.replace(new RegExp(sp, 'g'),' '); // Replaces all user-specified word separators with spaces.		code = divide + '<a href="' + foo + '" rel="nofollow">' + b + '</a>' + code; // Updates the variable code to include the name of the folder and the URL necessary to reach the folder root.
		foo = '../' + foo; // Adds an additional level to the variable that determines the path to the folder that will be assigned in the breadcrumb loop.		b = '/' + b; // The slash is added back to the beginning of variable "b".		b = b.replace(/ /g,sp); // The user-specified word separators are put back into the file name.		a = a.replace(b,''); // Removes the segment that was just used from the variable holding the URL.	} while (a.substring(left-1) != '/'); // Checks to make sure there's still more string to parse.}code = code.replace(url,home); // The remaining URL is replaced with whatever word was specified for the home page of the site.code = code.replace(bar,''); // If the URL is pointing to a folder root file, the root file name is stripped out, along with the bullet between it and the folder name.code = (code.substring(code.indexOf('<'))); // The "code" string contains an unwanted bullet at the beginning.  This snippet causes it to be removed/ignored.code = pre + code; // Any verbiage specified by the author to precede the breadcrumbs is inserted here.// This loop looks for folder names the user wants to replace with custom text, as specified in the user variables section of this script.  It will run one loop for every replacement item specified.for (i=0 ; i<swap.length ; i++) {	x = swap[i].substr(0,swap[i].lastIndexOf('|')); // Extracts the words that are to be replaced and sets them to variable x.	y = swap[i].substr(swap[i].lastIndexOf('|')+1); // Extracts the words that will be used in place of x, and sets them to y.	code = code.replace(new RegExp(x, "g"),y); // This line does the actual words replacement.}document.getElementById('breadcrumbs').innerHTML = code; // The final code string is inserted into the Web page at the point where it sees an object with the ID "breadcrumbs".