/*****
Dynamic Javascript Breadcrumb Navigation by Adam DuVander
http://duvinci.com/projects/javascript/crumbs/

Released under Creative Commons License:
http://creativecommons.org/licenses/by/2.5/
*****/
var crumbsep = " > ";
var precrumb = "<span class=\"crumb\">";
var postcrumb = "</span>";
var sectionsep = "/";
var rootpath = "/"; // Use "/" for root of domain.
var rootname = "Home";

var ucfirst = 1; // if set to 1, makes "directory" default to "Directory"

var objurl = new Object;
objurl['chief'] = 'Chief\'s Message';
objurl['profileofthecity'] = 'Profile of the City';
objurl['aboutus'] = 'About Us';
  objurl['staffingandbudget'] = 'Staffing & Budget';
  objurl['organizationalchart'] = 'Organizational Chart';
  objurl['crimestatistics'] = 'Crime Statistics';
  objurl['commendations'] = 'Commendations';
  objurl['wallofhonor'] = 'Wall of Honor';
  objurl['inremembrance'] = 'In Remembrance';
    objurl['york'] = 'Shayne York';
    objurl['cate'] = 'Darrel “Bud” Cate';
    objurl['pinchot'] = 'Tyler Pinchot';
     objurl['pinchotbiography'] = 'Biography';
     objurl['pinchotphotos'] = 'Photographs';
     objurl['memorialservices'] = 'Memorial Services';
     objurl['pinchotremembrances'] = 'Remembrances';
     objurl['pinchotvideo'] = 'Memorial Video';
objurl['divisions'] = 'Divisions';
  objurl['operationsdivision'] = 'Operations Division';
    objurl['patrolbureau'] = 'Patrol Bureau';
      objurl['fieldtrainingofficers'] = 'Field Training Officers';
      objurl['policecanineunit'] = 'Police Canine Unit';
      objurl['schoolresourceofficers'] = 'School Resource Officers';
      objurl['chaplainprogram'] = 'Chaplain Program';
      objurl['problemorientedpolicingteam'] = 'Problem Oriented Policing Team';
      objurl['communicationsunit'] = 'Communications Unit';
      objurl['swat'] = 'SWAT';
      objurl['reservepoliceofficers'] = 'Reserve Police Officers';
      objurl['computerservices'] = 'Computer Services';
      objurl['technologytaskforce'] = 'Technology Task Force';
      objurl['communitypoliceserviceaides'] = 'Community/Police Service Aides';
      objurl['professionalstandards'] = 'Professional Standards';
      objurl['prisonerprocessing'] = 'Prisoner Processing';
    objurl['trafficbureau'] = 'Traffic Bureau';
      objurl['pocketmotorcycles'] = 'Pocket Motorcycles';
      objurl['gopeds'] = 'Go-Peds';
      objurl['dirtbikes'] = 'Dirtbikes & ATVs';
  objurl['supportservicesdivision'] = 'Support Services Division';
    objurl['investigativeservicesbureau'] = 'Investigative Services Bureau';
      objurl['crimespersonsunit'] = 'Crimes Persons Unit';
      objurl['crimespropertyunit'] = 'Crimes Property Unit';
      objurl['viceandnarcoticsunit'] = 'Vice and Narcotics Unit';
      objurl['forensicservicesunit'] = 'Forensic Services Unit';
    objurl['auxiliaryservicesbureau'] = 'Auxiliary Services Bureau';
      objurl['trainingunit'] = 'Training Unit';
      objurl['communitypoliceacademy'] = 'Community Police Academy';
      objurl['citizensassistingpoliceandracesvolunteers'] = 'Citizens Assisting Police & RACES Volunteers';
      objurl['crimepreventioncommunityrelations'] = 'Crime Prevention/Community Relations';
      objurl['explorerprogram'] = 'Explorer Program';
      objurl['pressinformationofficer'] = 'Press Information Officer';
      objurl['supportunit'] = 'Support Unit';
        objurl['records'] = 'Records';
        objurl['opticalimaging'] = 'Optical Imaging';
        objurl['reporttranscription'] = 'Report Transcription';
        objurl['courtliaison'] = 'Court Liaison';
        objurl['purchasing'] = 'Purchasing';
        objurl['propertyandevidence'] = 'Property and Evidence';
        objurl['custodialservicesandbuildingmaintenance'] = 'Custodial Services';
objurl['other'] = 'Other';
  objurl['neighborhoodsurvey'] = 'Neighborhood Survey';
  objurl['livescaninformation'] = 'Live Scan Information';
  objurl['pressreleases'] = 'Press Releases';
  objurl['faq'] = 'FAQ';
  objurl['otherinformation'] = 'Other Information';
    objurl['firearmssafety'] = 'Firearms Safety';
    objurl['homesecurity'] = 'Home Security';
    objurl['businesssecurity'] = 'Business Security';
    objurl['personalsecurity'] = 'Personal Security';
    objurl['sexualabuse'] = 'Sexual Abuse';
    objurl['meganslaw'] = 'Megan\'s Law';
    objurl['domesticviolence'] = 'Domestic Violence';
    objurl['crimevictim'] = 'Crime Victim';
    objurl['patchcollectors'] = 'Patch Collectors';
    objurl['crimewatch'] = 'Crime Watch';
    objurl['policepoems'] = 'Police Poems';
    objurl['otherpolicesites'] = 'Other Police Sites';
  objurl['specialevents'] = 'Special Events';
  objurl['contactus'] = 'Contact Us';
    objurl['directions'] = 'Directions';
    objurl['phonenumbers'] = 'Phone Numbers';
    objurl['guestbook'] = 'Guestbook';
  objurl['publiceducationinformation'] = 'Public Education Information';
  objurl['areacommanderprogram'] = 'Area Commander Program';

// Grab the page's url and break it up into directory pieces
var pageurl = (new String(document.location));
var protocol = pageurl.substring(0, pageurl.indexOf("//") + 2);
pageurl = pageurl.replace(protocol, ""); // remove protocol from pageurl
var rooturl = pageurl.substring(0, pageurl.indexOf(rootpath) + rootpath.length); // find rooturl
if (rooturl.charAt(rooturl.length - 1) == "/") //remove trailing slash
{
  rooturl = rooturl.substring(0, rooturl.length - 1);
}
pageurl = pageurl.replace(rooturl, ""); // remove rooturl fro pageurl
if (pageurl.charAt(0) == '/') // remove beginning slash
{
  pageurl = pageurl.substring(1, pageurl.length);
}

var page_ar = pageurl.split(sectionsep);
var currenturl = protocol + rooturl;
var allbread = precrumb + "<a href=\"" + currenturl + "\">" + rootname + "</a>" + postcrumb; // start with root

for (i=0; i < page_ar.length-1; i++)
{
  var displayname = "";
  currenturl += "/" + page_ar[i];
  if (objurl[page_ar[i]])
  {
    displayname = objurl[page_ar[i]];
  }
  else
  {
    if (ucfirst == 1)
    {
      displayname = page_ar[i].charAt(0).toUpperCase() + page_ar[i].substring(1);
    }
    else
    {
      displayname = page_ar[i];
    }
  }
  allbread += crumbsep + "<a href=\"" + currenturl + "\">" + displayname + "</a>";
}
document.write(allbread);
