<!--
// Current Page Reference
// copyright Stephen Chapman, 1st Jan 2005
// you may copy this function but please keep the copyright notice with it
function getURL(uri) {
uri.dir = location.href.substring(0, location.href.lastIndexOf('\/'));
uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);}
uri.pdir = ''; pos = uri.path.indexOf('\/'); if (pos > -1) {uri.pdir = uri.path.substr(pos+1); uri.path = uri.path.substr(0,pos);}
uri.cdir = ''; pos = uri.pdir.indexOf('\/'); if (pos > -1) {uri.cdir = uri.pdir.substr(pos+1); uri.pdir = uri.pdir.substr(0,pos);}
uri.page = location.href.substring(uri.dir.length+1, location.href.length+1);
pos = uri.page.indexOf('?');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
pos = uri.page.indexOf('#');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
uri.ext = ''; pos = uri.page.indexOf('.');if (pos > -1) {uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);}
uri.file = uri.page;
if (uri.ext != '') uri.file += '.' + uri.ext;
if (uri.file == '') uri.page = 'index';
uri.args = location.search.substr(1).split("?");
return uri;
}

var uri = new Object();
getURL(uri);

//Mid function
function Mid(str, start, len)
{
// Make sure start and len are within proper bounds
    if (start < 0 || len < 0) return "";
    var iEnd, iLen = String(str).length;
    if (start + len > iLen)
          iEnd = iLen;
    else
          iEnd = start + len;
    return String(str).substring(start,iEnd);
}

// Titlecase function (c)GPL, apv
String.noLC = new Object
  ({the:1, a:1, an:1, and:1, or:1, but:1, aboard:1,
    about:1, above:1, across:1, after:1, against:1,
    along:1, amid:1, among:1, around:1, as:1, at:1,
    before:1, behind:1, below:1, beneath:1, beside:1,
    besides:1, between:1, beyond:1, but:1, by:1, 'for':1,
    from:1, 'in':1, inside:1, into:1, like:1, minus:1,
    near:1, of:1, off:1, on:1, onto:1, opposite:1,
    outside:1, over:1, past:1, per:1, plus:1,
    regarding:1, since:1, than:1, through:1, to:1,
    toward:1, towards:1, under:1, underneath:1, unlike:1,
    until:1, up:1, upon:1, versus:1, via:1, 'with':1,
    within:1, without:1});
String.prototype.titleCase = function () {
  var parts = this.split(' ');
  if ( parts.length == 0 ) return '';
  var fixed = new Array();
  for ( var i in parts ) {
    var fix = '';
    if ( String.noLC[parts[i]] )
    {
      fix = parts[i].toLowerCase();
    }
    else if ( parts[i].match(/^([A-Z]\.)+$/i) )
    { // will mess up "i.e." and like
      fix = parts[i].toUpperCase();
    }
    else if ( parts[i].match(/^[^aeiouy]+$/i) )
    { // voweless words are almost always acronyms
      fix = parts[i].toUpperCase();
    }
    else
    {
      fix = parts[i].substr(0,1).toUpperCase() +
                 parts[i].substr(1,parts[i].length);
    }
    fixed.push(fix);
  }
  fixed[0] = fixed[0].substr(0,1).toUpperCase() +
                 fixed[0].substr(1,fixed[0].length);
  return fixed.join(' ');
}

	var ppath = uri.pdir;
	var cpath = uri.cdir;
	var ucat = "";
	var ocat = "";
	switch (ppath){
		case "cleanup": ucat = "Clean-up"; break;
		case "bio": ucat = "Biological Resources"; break;
		case "cultural": ucat = "Cultural Resources"; break;
		case "earthday": ucat = "Earth Day"; break;
		case "h2o": ucat = "Water"; break;
		case "risk": ucat = "Risk Reduction"; break;
		case "adep": ucat = "Associate Directorate for Environmental Programs, ADEP"; break;
		case "env": ucat = "Environmental Protection Division, ENV"; break;
		case "wdp": ucat = "Waste Disposition Project, WDP"; break;
		case "wes": ucat = "Waste and Environmental Services Division, WES"; break;
		default: ucat = ppath.titleCase();
	}
	switch (cpath){
		case "cap": ocat = "Corrective Actions Projects, CAP"; break;
		case "lwsp": ocat = "LANL Water Stewardship Project, LWSP"; break;
		case "rlw": ocat = "Radioactive Liquid Waste Projects, RLW"; break;
		case "ta21": ocat = "TA-21 Closure Project, TA21"; break;
		case "eaq": ocat = "Ecology and Air Quality, ENV-EAQ"; break;
		case "rcra": ocat = "Water Quality and RCRA, ENV-RCRA"; break;
		case "rro": ocat = "Risk Reduction Office, ENV-RRO"; break;
		case "hmwo": ocat = "Hazardous and Mixed Waste Operations, WDP-HMWO"; break;
		case "llwd": ocat = "Low-Level Waste Disposition, WDP-LLWD"; break;
		case "twps": ocat = "TRU Waste Project Support, WDP-TWPS"; break;
		case "eda": ocat = "Environmental Data and Analysis, WES-EDA"; break;
		case "ffs": ocat = "Facility and Field Services, WES-FFS"; break;
		case "rs": ocat = "Remedy Services, WES-RS"; break;
		case "wa": ocat = "Waste Acceptance, WES-WA"; break;
		default: ocat = "";
	}
	if (ocat!=""){document.title = document.title + ":" + "\u00a0" + ocat;}	
	if (ucat!="All"){document.title = document.title + ":" + "\u00a0" + ucat;}
	if (uri.path=="environment"){document.title = document.title + ": Environment";}
	document.title = document.title + ": LANL";
	if (uri.dom!="www.lanl.gov"){document.title = document.title + " Inside";}
	//document.write(document.title);
//-->

