


function delete_branch(entity_id,a_id)
{
	if (confirm('Are you sure you want to deleted this location?'))
	{
		$.getJSON("/ajax/user/delete_branch.html", { entity_id: entity_id,a_id: a_id }, processJson);
		
	}
}



function delete_listing()
{
	if (confirm('Are you sure you want to deleted your entire directory listing?'))
	{
		
		$.getJSON("/ajax/user/delete_listing.html",  function(data){
			if (data.status)
			{
			     
			     set_changed(false);
				 $usermenu.tabs("select", 0);
			}
			else
			{
				$("#directory_info").fadeIn('fast');
				processJson(data);
			}
		});
		$("#directory_info").fadeOut('slow');
	}
}

function directory_check_box(entity_id)
{
	toggle_link('#location_1','use_default');
	if ($('#use_default:checked').length == 1)
	{
		
		$.getJSON("/ajax/user/directory_use_contact_details.html", { shared: true},processJson);
	}
	else
	{
		$.getJSON("/ajax/user/directory_use_contact_details.html", { shared: false},processJson);
	}
}