//elementary script for highlighting navigation - JCC

 
 function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

page=window.location
base="http://www.law.duke.edu/journals/lcp/"

addLoadEvent(function() {
  if (page == base+"index.html" || page == base || page == base+"index" ) {
  document.getElementById('home').className = "on";
  } 
  if (page == base+"issues.html" || page == base+"issues") {
  document.getElementById('issues').className = "on";
  }
   if (page == base+"archive" || page == base+"archive.html") {
  document.getElementById('issues').className = "on";
  document.getElementById('archive').className = "subnavon";
  }
  if (page == base+"order.html" || page == base+"order") {
  document.getElementById('subscriptions').className = "on";
  document.getElementById('order').className = "subnavon";
  }
  if (page == "http://www.law.duke.edu/journals/journal_order?ordItem=Subscription&journalTitle=Law+and+Contemporary+Problems") {
  document.getElementById('issues').className = "off";
  document.getElementById('subscriptions').className = "on";
  document.getElementById('subscription').className = "subnavon";
  }  
  if (page == base+"submit.html" || page == base+"submit") {
  document.getElementById('submissions').className = "on";
  }
  if (page == base+"about.html" || page == base+"about") {
  document.getElementById('aboutus').className = "on";
  document.getElementById('about').className = "subnavon";
  }
  if (page == base+"history.html" || page == base+"history") {
  document.getElementById('aboutus').className = "on";
  document.getElementById('history').className = "subnavon";
  }
  if (page == base+"staff.html" || page == base+"staff") {
  document.getElementById('aboutus').className = "on";
  document.getElementById('staff').className = "subnavon";
  }
  if (page == base+"masthead.html" || page == base+"masthead") {
  document.getElementById('aboutus').className = "on";
  document.getElementById('masthead').className = "subnavon";
  }
  if (page == base+"staffselect.html" || page == base+"staffselect") {
  document.getElementById('aboutus').className = "on";
  document.getElementById('staffselect').className = "subnavon";
  }
  if (page == base+"contact.html" || page == base+"contact") {
  document.getElementById('aboutus').className = "on";
  document.getElementById('contact').className = "subnavon";
  }
  if (page == base+"search.html" || page == base+"search") {
  document.getElementById('search').className = "on";
  }
  if (location.pathname.search(/lcptoc/) == "14") {
  document.getElementById('issues').className = "on";
  document.getElementById('archive').className = "subnavon";
  }
})