<!--
function CreateTrail() { //Paula Speller, Neil Martin, David Gillies. Jack Levy 2002,2003
var i;
 url=location.toString(); //Turns URL into a string
subdirs=url.substr(3+url.indexOf("au")).split("/"); //Removes extraneous characters from URL - the number of characters equals the http://
//subdirs=url.substr(url.indexOf("localhost")).split("/"); //Removes extraneous characters from URL - the number of characters equals the http://
                                    // the domain name and the end slash e.g. http://www.ucl.ac.uk/ = 21 characters
 divider=(" &#8250;&#8250; "); //Defines divider
 var number=subdirs.length;
 document.write('<a href="'+RelURL(subdirs.length-1)+'">Home</a>'); //Automatically writes UCL home page into breadcrumb
 if (number==2) 
 {
 document.write(divider+Dirname(unescape(subdirs[0]))); //If  number of directories is 2 inserts divider plus runs function Dirname below
 }
 if (number!=2) //If number is other than 2 makes second directory a link and subsequent directories if required
 {
 
 document.write(divider+'<a href="'+RelURL(subdirs.length-2)+'">'+Dirname(unescape(subdirs[0]))+'</a>');
 for (i=1;i<(subdirs.length-2);i++) { subdirs[i]=Dirname(unescape(subdirs[i]));
 if (subdirs[i].substr(0,1)!=1) document.write(divider+'<a href="'+RelURL(subdirs.length-i-2)+'">'+subdirs[i]+'</a>');};}
 if (i>0)
 {
 subdirs[i]=Dirname(unescape(subdirs[i]));
 document.write(divider+subdirs[i]);
}
}
function RelURL(x) { //makes link relative
  var address="";
  if (x>0) for (z=0;z<x;z++) address=address+"../"; 
  return address;
}
function Dirname(name) { //writes directory name
 
 //switch folder name
 
 switch(name) {
 
  //toplevel
  
  case "aboutus": Newname="About us";
  break;
  
  case "complaints": Newname="Complaints";
  break;
  
  case "guideorganisations": Newname="Guidelines for organisation";
  break;
  
  case "publications": Newname="Publications";
  break;
  
  case "trainingworkshops": Newname="Training workshops";
  break;
  
  case "whatsnew": Newname="Whats new";
  break;
  
  case "faq": Newname="FAQ";
  break;
  
  case "links": Newname="Links";
  break;
  
  default: // default if nothing to switch
  if (typeof namechange != "undefined"
      && typeof namechange[name] != "undefined") {
	 Newname = namechange[name];
	 break;
  }
  proper=name.split('-'); //splits file name and removes hyphen
  Newname=proper.join(" "); //joins them back together
  Newname=toUpper(Newname); //references upper case function below
  break;
  
}

return Newname;
}

function toUpper(word) {
    var pattern =/(\w)(\w*)/;
    var a = word.split(/\s+/g); // split the sentence into an array of words

    for (i = 0 ; i < a.length ; i ++ ) {
	var parts = a[i].match(pattern);

        var firstLetter = parts[1].toUpperCase();
        var restOfWord = parts[2].toLowerCase();

        a[i] = firstLetter + restOfWord; // re-assign it back to the array and move on
    }

    word = a.join(' ');
	return word; // joins it back together
}




//-->

