/**
* Opens Report Broken Listing window
*
* @param int id listing id
*/
function reportBrokenLink(id)
{
	var w = 455;
	var h = 150;
	var left = (screen.width - w) / 2;
	var top = (screen.height - h) / 2;

	var win = window.open('report-link.php?id=' + id, 'report_broken', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=1,width=' + w + ',height=' + h + ',left=' + left + ',top=' + top);
	if (window.focus)
	{
		win.focus();
	}
}
function reportBrokenListing(id)
{
	$.get("report-listing.php", {id: id, report: 1}, function(data)
	{
		
		$("#tdlisting" + id).after(data);
	});
}

function actionFavorites(listing_id, account_id, action, refresh, remove_phrase, add_phrase)
{
	var msg = ('add' == action) ? add_phrase : remove_phrase;
	var conf = confirm(msg);
	
	if (conf)
	{
		$.post("favorites.php", {account_id: account_id, listing_id: listing_id, action: action, refresh: refresh}, function(data)
		{
			$("#af_" + listing_id).text();
			$("#af_" + listing_id).html(data);
		});
	}

	return false;
}
