function doRequest(form_id, url) {
	var params = $H({formid: form_id});
	new Ajax.Request(url, {
		parameters : params,
		onSuccess : function(transport) {
			var activeform = $(form_id);
			activeform.insert(new Element('input', {type: 'hidden', name: 'viewstate', value: transport.responseText}));
			activeform.insert(new Element('input', {type: 'hidden', name: 'formid', value: form_id}));
			activeform.submit();
		}
	});
}

function addComment(form_id) {
	var url = "/index.php?sid=wwwcomments&a=prepare";
	doRequest(form_id, url);
}

function reportMessage(form_id) {
	var url = "/index.php?sid=wwwcomments&a=prepare";
	doRequest(form_id, url);
}

function addMessage(form_id) {
	var url = "/index.php?sid=community_forum&a=prepare";
	doRequest(form_id, url);
	
}