
//Script for random Image Changer in the banner
// Type the number of images you are rotating.

NumberOfImagesToRotate = 3;

// Specify the first and last part of the image tag. 

FirstPart = '<img src="/images/bannerImage';
LastPart = '.png" alt="Images of the people at CSSS" class="bannerImage" />';

function printImage() {
var r = Math.ceil(Math.random() * 6);
document.write(FirstPart + r + LastPart);
} 

function changeTitle(foo){
	var idToUse = foo;
 
	// The key to it all
	document.title = document.getElementById(idToUse).innerHTML;
}

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 + document.title);
}
