$(document).ready(function() {
	loadComments();
	$('#comment_submit').hover(function() {
		$('#js_val').val('kk');
	});
	$('#comment_form').ajaxForm( {
		dataType : 'xml',
		beforeSubmit : function() {
			$('#comment_form').fadeTo('slow', 0);
		},
		success : commentXml
	});
});
function commentXml(responseXML) {
	var status = $('status', responseXML).text();
	var body = $('body', responseXML).text();
	if (status == 'ok') {
		loadComments();
		$('#comment_form').clearForm();
		$('#comment_form').fadeTo('slow', 1);
	}
}
function loadComments() {
	$('#comments').text('');
	$('#comments').toggleClass('loading');
	$('#comments').load('/comment/show/'+entryId, '',
			function() {
				$('#comments').toggleClass('loading');
			});

}
