
$(document).ready(function(){
  $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    && location.hostname == this.hostname) {
      var $target = $(this.hash);
      $target = $target.length && $target
      || $('[name=' + this.hash.slice(1) +']');
      if ($target.length) {
        var targetOffset = $target.offset().top;
        $('html,body')
        .animate({scrollTop: targetOffset}, 'fast');
       return false;
      }
    }
  });
});

$(document).ready(function() {
  $('#scrollbox a[href*=#]').click(function() {
    var divOffset = $('#scrollbox').offset().top;
	var $target = $(this.hash);
	$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
	if ($target.length) {
		var pOffset = $target.offset().top;
		var pScroll = pOffset - divOffset;
		$('#scrollbox').animate({scrollTop: '+=' + pScroll + 'px'}, 'fast');
		return false;
	}
  });
});

$(function(){
	if (document.URL.match(/\?print$/)) {
		$('link[media="print"]').attr({media: "all"});
	}
});

$(function() {
	rollover();
});

$(function(){
	$('dl.recordsbar:eq(0)> dd').hide();
	$('dl.recordsbar:eq(0)> dt').click(function() {
		$(this).toggleClass('toggleopen');
		$(this).next().slideToggle('fast');
	});
});

$(function(){
	$('dl.recordsbar > dd > dl > dt:first').addClass('first');
	$('dl.recordsbar > dd > dl > dd:first').addClass('first');
});


$(function(){
	$("a.openmap").click(function() {
		window.open(this.href, '', 'width=385, height=450, directories=0, location=0, menubar=0, scrollbars=0, status=0, toolbar=0, resizable=1');
		return false;
	});
});


function rollover() {
	var image_cache = new Object();
	$('[src*=_roll.]').not("[src*='_on.']").each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function() { this.src = imgsrc_on; },
			function() { this.src = imgsrc; }
		);
	});
}
