$(document).ready(function(){

$("a[id^='domain_id_']").toggle
(
	function()
	{
		$('p#' + $(this).attr('id') + '_hint').slideDown('fast');
	},
	function()
	{
		$('p#' + $(this).attr('id') + '_hint').slideUp('fast');
	}
);

$('#domain_trust').click(function(event)
{
	$.getJSON
	(
		'/default-domain/create/',
		{
			domain: $('#domain_val').val(),
			// user_id: $('#user_id_val').val()
		},
		function(json)
		{
			if (json.errors)
			{
				$('#domain_trust').attr('checked', false);
				
				event_delay.hold(event);

				$('#dialog_auth').dialog
				(
					{
						modal: true
					}				
				);
			}
		}
	);	
});

});
