$(document).ready(
	function () {

	  // Open links with rel="external" in new window - like ye ole' target="_blank"
	  $('a[rel="external"]').click(function () { window.open($(this).attr('href')); return false; });


	  // Zebra-stripe data tables
	  $("#content table tr:even").addClass("even");
	  $("#content table tr").mouseover(function () {
	    $(this).addClass("over");
	  }).mouseout(function () {
	    $(this).removeClass("over");
	  });
	  $("td:last-child").css({ border: "none" });


	  // Wrap internal-page images with a caption block if they start with "caption:"
	  $("#content img").each(function () {
	    var imgalt = $(this).attr('alt');
	    var imgwidth = $(this).width();
	    var captionsplit = imgalt.split(":");
	    if (jQuery.trim(captionsplit[0].toLowerCase()) == "caption") {
	      $(this).after('<p class="caption">' + jQuery.trim(captionsplit[1]) + '</p>');
	    }
	  });
	  
	

	  // Placeholder.js
	  InitPlaceHolder();

	  // County Map highlights
	  $('#mapCountyControl .map').maphilight({
	    fillColor: '9e1526',
	    fillOpacity: '1',
	    strokeColor: '9e1526',
	    strokeWidth: '2'
	  });


	}
);

function scrollToTop() {
	window.scrollTo(0, 0);

}

function InitPlaceHolder() {
  Placeholder.init({
    normal: "#000000",
    placeholder: "#979c9c"
  });
}

function BuildUrl(url, params) {
  var paramCount = 0;
  url = "/" + url.replace(/\"/gi, "\\\"");

  for (var param in params) {
    if (params[param] != "") {
      if (paramCount == 0) {
        url += "?";
      }
      else {
        url += "&";
      }
      url += param + "=" + params[param];
      ++paramCount;
    }
  }
  return url;
}

// make sure referrer gets set in IE
function goTo(url) {

  window.location = url;
  return;
  /*
  var a = document.createElement("a");
  if (!a.click) { //only IE has this (at the moment);
    window.location = url;
    return;
  }
  a.setAttribute("href", url);
  a.style.display = "none";
  $("body").append(a); //prototype shortcut
  a.click();
  */
}
























