/*
 *	 _   _  ____      _     __
 *	| \ | ||  _ \    | |   / _| _ __
 *	|  \| || |_) |_  | |  | |_ | '__|
 *	| |\  ||  _ <| |_| |_ |  _|| |
 *	|_| \_||_| \_\\___/(_)|_|  |_|
 *
 *
 *  SONDAGES TOOLS
 *  ------------------------------------
 *
 *  @author: NRJ Dev Team
 *  @date: 8 septembre 2009
 *  @revision: 10
 *  @version: 1.0
 *
 */

var Nrj_Sondage = {
		
	sondagePK:"",
	divId:"",
	responseId:"",
	module_index:"",
	
	constructor: function(divId, sondagePK, responseId, module_index)
	{
		Nrj_Library.Ajax(url_base + "/sondage/add/", divId, {reponse: responseId, module_index: module_index});
	},

	collapse: function(id, image_id, titre_id)
	{
		var image_closed = url_base + "/images/content/internal/sondage/picto.png";
		var image_open = url_base + "/images/content/internal/sondage/picto_select.png";

		if(document.getElementById(id).style.display != 'none')
		{
	    	document.getElementById(id).style.display = 'none';
	    	document.getElementById(image_id).src = image_closed;
			document.getElementById(titre_id).className = "strong";
		}
		else
		{
			document.getElementById(id).style.display = '';
	    	document.getElementById(image_id).src = image_open;
			document.getElementById(titre_id).className = "open";
		}
	}
	
}