/**
 ** @project Epitech: techweb
 ** @authors Julien AMAR <amar_u@epitech.net>
 ** @authors Salah AZZOUG <azzoug@gmail.com>
 ** @authors Johanna BERDUGO <berdug_j@epitech.net>
 ** @authors Benoit CALVEZ <calvez_b@epitech.net>
 ** @authors Djamila MEHANNI <mehann_d@epitech.net>
 ** @authors John THIRIET <thirie_j@epitech.net>
 **/
 
function new_poll(page, methode, div)
{
	var	flag = 0;
	var request =	"id="+document.getElementById("id_forum").value+
					"&forum_message="+document.getElementById("forum_message").value+
					"&forum_unformated_message="+document.getElementById("forum_unformated_message").value+
					"&choice1_poll="+document.getElementById("choice1_poll").value+
					"&choice2_poll="+document.getElementById("choice2_poll").value+
					"&choice3_poll="+document.getElementById("choice3_poll").value+
					"&choice4_poll="+document.getElementById("choice4_poll").value+
					"&choice5_poll="+document.getElementById("choice5_poll").value;
	if	(document.getElementById("forum_message"))
		request = request + "&forum_message="+document.getElementById("forum_message").value;
	/* Verify values */
	flag |= IsEmpty('id_forum');
	flag |= IsEmpty('forum_message');
	flag |= IsEmpty('forum_unformated_message');
	flag |= IsEmpty('choice1_poll');
	flag |= IsEmpty('choice2_poll');
	if (!flag)
		ajax_get_div(page, methode, request, div);
}

function new_subject(page, methode, div)
{
	var	flag = 0;
	var request =	"id="+document.getElementById("id_forum").value+
					"&forum_message="+document.getElementById("forum_message").value+
					"&forum_unformated_message="+document.getElementById("forum_unformated_message").value;
	if	(document.getElementById("id_sujet"))
		request = request + "&id_sujet="+document.getElementById("id_sujet").value;
	/* Verify values */
	flag |= IsEmpty('id_forum');
	flag |= IsEmpty('forum_message');
	flag |= IsEmpty('forum_unformated_message');
	if (!flag)
		ajax_get_div(page, methode, request, div);
}