function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

// Find header in second column and give them 0 margin

addLoadEvent(function() {
	if(document.getElementById("section2")) {
		var h = document.getElementById("section2").getElementsByTagName("h2");
		h[0].className+="first-header";
	}
	if (document.getElementById("feature")) {
		var ft = document.getElementById("feature").getElementsByTagName("h2");
		ft[0].className+="first-header";
	}
	if (!document.getElementById("section2") && !document.getElementById("feature")) {
			return;
	}
})

addLoadEvent(function() {
	l=window.location.toString(); s=l.split("/");
	// ********* CHANGE ME  ****************************************************************
	f=s[4]; // Change this number to the number of slashes in the URL before the home page
	
	if (f == "index.html" || f == "") {
		return;
	}
	else {
		cn = "n-" + f;
		var nli = document.getElementById(cn);
		nli.className+="location";
		var si = document.getElementById("sub-anthro");
		si.className=si.className.replace(new RegExp("si-default\\b"), "");
		switch(f) {
			case "research":
				si.className+="si-research";
				break
			case "about.html":
				si.className+="si-about";
				break
			case "grad":
				si.className+="si-grad";
				break
			case "undergrad":
				si.className+="si-undergrad";
				break				
			case "faculty":
				si.className+="si-faculty";
				break
			case "news":
				si.className+="si-news";
				break
			case "contact.html":
				si.className+="si-contact";
				break				
			default:
				si.className+="si-default";
		}
	}
})