function pBar()
{
	 $("#ProgBar").show("normal");
}
function pBarIn()
{
	$("#ProgBar").hide("normal");
}
function add_comment()
{
	message = $("#message").val();
	subject = $("#subject").val();
	onlyEmp = $("#onlyEmp").val();
	listing_id = $("#listing_id").val();
	if(message == '')
	{
		alert('Message empty!'); 
		return false;
	}
	else 
	{
		pBar();
    	xajax_add_comment(message,subject,listing_id,id_form, onlyEmp);
    	$("#message").val(" ");
    	$("#subject").val(" ");
    	return false;
	}
}

function edit_comment(subject, message, listing_id, comment_id) 
{
	$("#message").val(message);
	$("#subject").val(subject);
	$("#subject").focus;
	$("#titleAdd").css('display', 'none'); 
	$("#titleEdit").css('display', 'block'); 
	$("#addComment").css('display', 'none'); 
	$("#editComment").css('display', 'block'); 
	$("#comment_id").val(comment_id);
}

function cancelEditComment()
{
	$("#message").val('');
	$("#subject").val('');
	$("#coment_id").val('');
	$("#title").html('Edit');
	$("#titleAdd").css('display', 'block'); 
	$("#titleEdit").css('display', 'none'); 
	$("#addComment").css('display', 'block'); 
	$("#editComment").css('display', 'none'); 
}

function editComment()
{
	message = $("#message").val();
	subject = $("#subject").val();
	comment_id = $("#comment_id").val();
	listing_id = $("#listing_id").val();
	onlyEmp = $("#onlyEmp").val();
	if(message == '')
	{
		alert('Message empty!'); 
		return false;
	}
	else 
	{
		pBar();
    	xajax_edit_comment(comment_id, message,subject,listing_id,id_form, onlyEmp);
    	$("#message").val(" ");
    	$("#subject").val(" ");
    	$("#comment_id").val('');
    	return false;
	}
}

function delete_comment(comment_id)
{
	pBar();
    xajax_delete_comment(comment_id);
    return false
}

