/**
 * $Id: comments.js 10087 2011-08-10 07:01:57Z vincent $
 **/

/**
 * CMS Comments library
 */

// Login function
function commentsLogin(sourceForm) {
	// Check form fields
	if (sourceForm == 'permanent'){
		// Show "wait" message
		$('#permanent-comment-login-status').html('Veuillez patientez...');
		xajax_commentsLogin($('#permanent_comment_email').attr('value'), $('#permanent_comment_password').attr('value'), sourceForm);
	}else{
		// Show "wait" message
		$('#comment-login-status').html('Veuillez patientez...');
		xajax_commentsLogin($('#comment_email').attr('value'), $('#comment_password').attr('value'), sourceForm);
	}
}

// Add comment to a CMS Page
function commentsSave(page_id) {
	// Disable "publish" button
	$('#comment-publish').attr('disabled', 'disabled');
	xajax_commentsSave(page_id, xajax.getFormValues('commentForm'));
}
