var comments_focus = "comments";

function private_comment(id)
{
	if(confirm('Are you sure that you want to make this comment private?\nThis cannot be undone!'))
	{
		document.location = '/private_comment.php?type=review&id=' + id;
	}
}

function set_focus(focus)
{
	comments_focus = focus;
}

function review_panel(panel)
{
	$('div.review_panel').hide();
	$('div#panel_' + panel).show();	
}

function get_review_comments(user, review_id, private)
{
	$.get("/xmlhttp/profile.php", { action: "get_review_comments", user: user, review_id: review_id, private: private }, review_comments_callback, "html");
	comm_tab(private);
}

function review_comments_callback(data, status)
{
	$("div#review_comment_list_1").html(data);
}

function show_contact_form(id, show)
{
	if(show)
	{
		document.getElementById('contact_form' + id).style.display = '';
		document.location.hash = 'anchor' + id;
	}
	else document.getElementById('contact_form' + id).style.display = 'none';
}

function contact_user(id)
{
	var subject = eval('document.frm_contact' + id + '.subject.value');
	var message = eval('document.frm_contact' + id + '.message.value');
	var to_uid = eval('document.frm_contact' + id + '.to_uid.value');
	var to_user = eval('document.frm_contact' + id + '.to_user.value');
	xmlhttp_contact_user('contact_form' + id, subject, message, to_uid, to_user)
}

function show_review_body(id, show)
{
	if(show)
	{
		document.getElementById('review_body_short' + id).style.display = 'none';
		document.getElementById('review_body_full' + id).style.display = '';
	}
	else
	{
		document.getElementById('review_body_short' + id).style.display = '';
		document.getElementById('review_body_full' + id).style.display = 'none';
	}
}
