$('html').addClass('js'); // fixes the flash of unstyled content in header

$(document).ready(function() {

  $("#content-wrapper-landing-ets .intro-section .photo-block img#changeout-image").hide();
  $("#content-wrapper-homepage .intro-section .photo-block img#changeout-image").hide();
  
  $("table.stripey").each(
  function (stripey) {
  if ($(this).is(".plain")) {
    }
  else {
    $(this).find('tr:nth-child(odd)').addClass('odd');
    $(this).find('tr:nth-child(even)').addClass('even');
    }
  })
  
  $(".description-text").hide();
  $("p.description-link").click(function(){
		$(this).next(".description-text").slideToggle("slow");
		return false;
	});
  $("p.description-link-show").click(function(){
		$(this).next(".description-text").slideToggle("slow");
		return false;
	});

  $(".description-showall").click(function(){
		$(".description-text").show("slow");
		return false;
	});

  $(".description-hideall").click(function(){
		$(".description-text").hide("slow");
		return false;
	});
// fix up left-hand menu
  var url = $(location).attr('pathname');	//get the pathname
  var url2 = url.replace('index.html','');	//pathname with index.html removed
  var urlParts = url.split('/');			//put pathname into an array
  var filename = urlParts.pop();			//get filename from array
  if (filename == ''){						//add index.html if not there
	  filename = 'index.html';
	  url = url + 'index.html';
	  }
  $("#subnav-col a[href="+url+"]").parent().addClass("current");
  $("#subnav-col a[href="+url2+"]").parent().addClass("current");
  $("#subnav-col a[href="+filename+"]").parent().addClass("current");
  $("#subnav-col ul li ul").parent().addClass("parent");
  $("#subnav-col ul li ul li ul").parent().addClass("parent");
// end fix up left-hand menu  
  $("#content-col .highlight-box ul li:first").addClass("first");
  $("#content-wrapper-landing-ets .main-content-section .users-news-block .news-block ul li:first").addClass("first");
  $("#content-wrapper-homepage .main-content-section .users-news-block .news-block ul li:first").addClass("first");
  $("#content-wrapper-homepage .main-content-section .users-news-block .users-block ul li:first").addClass("first");
  

});

