/*****
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 = " &raquo; ";
var precrumb = "<span class=\"breadcrumb\">";
var postcrumb = "</span>";
var sectionsep = "/";
var rootpath = "/"; // Use "/" for root of domain.
var rootname = "UEN";

var ucfirst = 1; // if set to 1, makes "directory" default to "Directory"
var showpage = document.title; // this contains what to show as the current page in the crumb. Set to "" to show nothing

//
// objurl elements have values that are two-element arrays. The first
// element is a string which will become the text for the hyperlink.
// The second element is the server-relative link address.  Most entries
// have this second element equal to the index value. I.e., the entry
// whose index value is 'xyz' have a server-relative link address equal
// to '/xyz'.  There are a few exceptions to this rule. E.g.,
//
//    /Districts
//    /Services
//    /utahlink
//
// Also note below the note for 'utahlink'

var objurl = new Object;
objurl['3-6interactives'] = new Array('3-6 Student Interactives','/3-6interactives'); 
objurl['7-12interactives'] = new Array('7-12 Student Interactives','/7-12interactives'); 
objurl['activities'] = new Array('www.Activities','/activities'); 
objurl['adult_ed'] = new Array('Education for Adults','/adult_ed'); 
objurl['big6'] = new Array('Big 6 Resources','/big6'); 
objurl['cactus'] = new Array('CACTUS','/cactus');
objurl['ccgp'] = new Array('Comprehensive Guidance & Counseling','/ccgp'); 
objurl['citizenship'] = new Array('','');
objurl['clouds'] = new Array('Cloud Guide','/clouds');
objurl['cms'] = new Array('Course Management System','/cms');
objurl['core'] = new Array('Utah Core Curriculum','/core'); 
objurl['counties'] = new Array('Counties of Utah','/counties'); 
objurl['createpdf'] = new Array('Create Adobe PDF Online','/createpdf'); 
objurl['cte'] = new Array('Career & Technical Education','/cte'); 
objurl['collegemedia'] = new Array('collegEmedia','/collegemedia'); 
objurl['course_details'] = new Array('Course Details','/course_details'); 
objurl['currmapping'] = new Array('Curriculum Mapping','/currmapping');
objurl['currsearch'] = new Array('Curriculum Search','/currsearch');
objurl['curriculumsearch'] = new Array('Curriculum Search','/curriculumsearch');
objurl['daily'] = new Array('Daily Life','/daily'); 
objurl['development'] = new Array('Professional Development','/development'); 
objurl['distance_ed'] = new Array('Distance Education','/distance_ed'); 
objurl['districts'] = new Array('Utah Schools Information','/districts/index.shtml'); 
objurl['Districts'] = new Array('Utah Schools Information','/districts/index.shtml'); 
objurl['decatalog'] = new Array('Distance Education Catalog','/decatalog'); 
objurl['dms'] = new Array('Digital Media Service','/dms'); 
objurl['docs'] = new Array('','');
objurl['dtv'] = new Array('DTV','/dtv'); 
objurl['ednetcontacts'] = new Array('IVC Site Directory','/ednetcontacts'); 
objurl['edtech'] = new Array('Educational Technology','/edtech'); 
objurl['educator'] = new Array('Educator Search','/educator'); 
objurl['elections'] = new Array('','');
objurl['email'] = new Array('Mailing List','/email'); 
objurl['englishlanguage'] = new Array('English Language Proficiency','/englishlanguage'); 
objurl['etep'] = new Array('Educational Technology Endorsement Program (ETEP)','/etep'); 
objurl['e-rate'] = new Array('E-Rate','/e-rate'); 
objurl['feeds'] = new Array('RSS News Feeds','/feeds'); 
objurl['financial'] = new Array('Financial Literacy','/financial'); 
objurl['foreignlanguage'] = new Array('World Language','/foreignlanguage'); 
objurl['forms'] = new Array('','');
objurl['general_learner'] = new Array('General Learners','/general_learner'); 
objurl['government'] = new Array('','');
objurl['help'] = new Array('Help Center','/help'); 
objurl['highered'] = new Array('Higher Education Center','/highered'); 
objurl['index'] = new Array('Site Index','/index'); 
objurl['infotech'] = new Array('Information Technology','/infotech'); 
objurl['integrated'] = new Array('Integrating Curriculum','/integrated'); 
objurl['iss'] = new Array('Instructional Services Subcommittee','/iss'); 
objurl['itc'] = new Array('Integrated Technology and Curriculum','/itc'); 
objurl['ivc_search'] = new Array('Interactive Video Conferencing Search','/ivc_search'); 
objurl['k12educator'] = new Array('K-12 Educator Center','/k12educator'); 
objurl['k12student'] = new Array('K-12 Student Center','/k12student'); 
objurl['k-2'] = new Array('K, 1, 2 Core','/k-2'); 
objurl['k-2educator'] = new Array('K-2 Educator Center','/k-2educator'); 
objurl['k-2interactives'] = new Array('K-2 Student Interactives','/k-2interactives'); 
objurl['languagearts'] = new Array('Language Arts','/languagearts'); 
objurl['learning_centers'] = new Array('Learning Centers','/learning_centers'); 
objurl['lessonplan'] = new Array('Lesson Plan','/lessonplan'); 
objurl['Lessonplan'] = new Array('Lesson Plan','/Lessonplan'); 
objurl['LPAdmin'] = new Array('Lesson Plan Admin','/LPAdmin'); 
objurl['librarymedia'] = new Array('Library Media','/librarymedia'); 
objurl['listowner'] = new Array('Mailing List Owner','/listowner');
objurl['my.uen'] = new Array('my.uen','/my.uen'); 
objurl['New_myuen'] = new Array('my.uen','/New_myuen'); 
objurl['ourworld'] = new Array('Our World','/ourworld'); 
objurl['parents'] = new Array('Parent and Caregiver Resources','/parents'); 
objurl['pdms'] = new Array('Professional Development Catalog','/pdms'); 
objurl['pe'] = new Array('Physical Education','/pe'); 
objurl['Pmt'] = new Array('PMT','/pmt'); 
objurl['polarpalooza'] = new Array('Polar Palooza','/polarpalooza'); 
objurl['prek'] = new Array('Early Childhood','/prek'); 
objurl['proposal'] = new Array('Course Scheduling Process','/proposal'); 
objurl['register'] = new Array('Courses','/register'); 
objurl['rubric'] = new Array('Rubric Tool','/rubric'); 
objurl['sacredimages'] = new Array('Sacred Images','/sacredimages'); 
objurl['service_catalog'] = new Array('Service Catalog','/service_catalog');
objurl['services'] = new Array('About UEN','/services');
objurl['Services'] = new Array('About UEN','/services');
objurl['shared_vision'] = new Array('Shared Vision','/shared_vision');
objurl['sitecode'] = new Array('my.uen','/sitecode');
objurl['socialstudies'] = new Array('Social Studies','/socialstudies'); 
objurl['steering'] = new Array('Steering Committee','/steering'); 
objurl['teacherpreview'] = new Array('Teacher\'s Preview Night','/teacherpreview'); 
objurl['tech'] = new Array('Network','/tech'); 
objurl['technical'] = new Array('Network','/technical'); 
objurl['techservices'] = new Array('Technical Services Subcommittee','/techservices'); 
objurl['textsections'] = new Array('Text Sections','/textsections'); 
objurl['trade'] = new Array('CTE/Skilled & Technical Sciences Education','/trade'); 
objurl['tours'] = new Array('Virtual Field Trips','/tours'); 
objurl['tutorial'] = new Array('Tutorials','/tutorial');
objurl['tv'] = new Array('UEN-TV','/tv'); 
objurl['ucet'] = new Array('UEN @ UCET','/ucet'); 
objurl['ucme'] = new Array('UCME','/ucme'); 
objurl['ueninfo'] = new Array('About UEN','/ueninfo'); 
objurl['uentv'] = new Array('UEN-TV','/uentv'); 
objurl['uimc'] = new Array('UIMC','/uimc'); 
objurl['usoeci'] = new Array('USOE Core Interface Tutorial','/usoeci'); 
objurl['usoecrt'] = new Array('USOE COGNOS End of Level CRT Data','/usoecrt'); 
objurl['utah'] = new Array('This Must Be Utah!','/utah'); 
objurl['utahkids'] = new Array('Utah Kids','/utahkids');
objurl['utahlink'] = new Array('','');
objurl['utahnationalparks'] = new Array('Utah National Parks','/utahnationalparks');
objurl['veterans'] = new Array('Veterans\' Oral History Resources','/veterans'); 
objurl['visualarts'] = new Array('Visual Arts','/visualarts');
objurl['wcs'] = new Array('Web Collaboration Services','/wcs');
objurl['weather'] = new Array('Weather Resources','/weather');
objurl['webctvista'] = new Array('WebCT Vista','/cms');
objurl['whatson'] = new Array('What\'s On','/whatson');
//
// If you don't want the directory to be represented in the breadcrumb, define
// it's entry as shown here for the utahlink directory
// 






// 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 = "";
  var displayTheLink = false;
  if (objurl[page_ar[i]])
  {
    displayname = objurl[page_ar[i]][0];
    if (objurl[page_ar[i]][1] != '') {
      currenturl += objurl[page_ar[i]][1];
      displayTheLink = true;
    }
  }
  else
  {
    displayTheLink = true;
    currenturl += "/" + page_ar[i];
    if (ucfirst == 1)
    {
      displayname = page_ar[i].charAt(0).toUpperCase() + page_ar[i].substring(1);
    }
    else
    {
      displayname = page_ar[i];
    }
  }

  if (displayTheLink == true) {
    allbread += crumbsep + precrumb + "<a href=\"" + currenturl + "\">" + displayname + "</a>" + postcrumb;
  }
}

if (showpage != "")
{
  allbread += crumbsep + precrumb + showpage + postcrumb;
}
document.write(allbread);
