$(function() {
	$('.tabs').livequery(function() {
		$('.tabs').tabs({ select: function(event, ui){ window.location = ui.tab.href; } });
	});

	$('.popupinfo').livequery('click', function(e) {
		e.preventDefault();

		$('#popupinfoheader').html($(this).attr('title'));

		$.get($(this).attr('href'), function(data) {
			$('#popupinfo .scrollingcontent').html(data);
			$('#popupinfo ul.tabs').tabs('select', 2);
			initPopup('#popupinfo'); 


		}); 

	});
	/*
	 * Image rollovers.  Any image with class "rollover" will have _on 
	appended to the filename (excluding extension) on over, and removed 
	on blur.
	 *
	 */

	$('img.rollover:not(.active), input.rollover:not(.active)').livequery(function() {
		$(this).hover(
			function () {
				$(this).attr('src', $(this).attr('src').replace(/\.([^\.]*)$/, '_on.$1'));
			},
			function() {
				$(this).attr('src', $(this).attr('src').replace(/_on\.([^\.]*)$/, '.$1'));
			}
			);
		});

	
	/*
	 * .fielddescriptionlink tooltips
	 *
	 */
	$('.tooltip').livequery(function() {
		$(this).tooltip({ showURL: false });
	})
});

			$(function() {
				$('.opennewwindow').livequery('click', function(e) {
					e.preventDefault();
					window.open($(this).attr('href'));
				});
			});

$(function() {
	$('a.viewmore').click(function(e) {
		e.preventDefault();
		$(this).prev('ul').find('li.hiddenfilter').slideDown();
		$(this).hide();
		$(this).next('.viewless').show();
		});
	$('a.viewless').click(function(e) {
		e.preventDefault();
		$(this).prev().prev('ul').find('li.hiddenfilter').slideUp();
		$(this).prev('.viewmore').show();
		$(this).hide();
	});
}); 	

