$(function() {
	// Button
	$(".regular-button").button();

	// all hover logic for buttons
	$(".ripe-button:not(.ui-state-disabled)").hover(function() {
		$(this).addClass("ui-state-hover");
	}, function() {
		$(this).removeClass("ui-state-hover");
	});

	// all hover logic for link buttons
	$(".ripe-link-button:not(.ui-state-disabled)").hover(function() {
		$(this).addClass("ui-state-hover");
	}, function() {
		$(this).removeClass("ui-state-hover");
	});

	$(".radioset").buttonset();

	// hover states on the icons, not useful for the actual forms so ignore
	$('ul#icons li').hover(function() {
		$(this).addClass('ui-state-hover');
	}, function() {
		$(this).removeClass('ui-state-hover');
	});

	$("#tabs").tabs();

	$('#showfullresponse').click(function() {
		$('#fullresponse').toggle('slow');
	});

	$('#fullresponse').hide();

	$(".hover-link").twipsy({
		animate : false,
		placement : 'right',
		delayIn : 500
	});
	
	$(".hover-link-l").twipsy({
		animate : false,
		placement : 'left',
		delayIn : 500
	});

	$.jheartbeat.set({
		url : contextPath + "/heartbeat.html",
		delay : 1000 * 60 * 5,
		div_id : 'heartbeat'
	});
});