vMenuCfg["debate_post"]={"img":"./img/debate1/d_large_add"};
fidJones={
	"url":"debate.handler1.php"
,	"mode":0
,	"sec":0
,	"sec_timer":0
,	"sec_cache":{}
,	"akn":0
,	"akn_cache":{}
,	"OnPost":function(e,vPolId)
	{
		iclCancelEvent(e);
		HideVisMenu();
		var vSet = this.mode==0;
		this.SetMode(vSet?"post":0);
		if( vSet )
			AwfExec("post_form",{"pol_id":vPolId},{"url":this.url});
	}
,	"OnNote":function(e,pid)
	{
		iclCancelEvent(e);
		HideVisMenu();
		var vSet = this.mode==0;
		this.SetMode(vSet?"note":0);
		if( vSet )AwfExec("note_form",{"post_id":pid},{"url":this.url});
	}
,	"OnCancel":function(e)
	{
		iclCancelEvent(e);
		this.SetMode(0);
	}
,	"OnSecSel":function(vSel)
	{
		var vSec=vSel.value,vData;
		this.ClearSecTimer();
		this.sec=vSec;
		if( !this.sec || this.sec=="0" || this.sec.substr(0,1)=="c")
			this.ClearSecView(1);
		else
		if( vData = this.sec_cache[vSec] )
			this.SetSecView(vData.htm);
		else
		{
			this.ClearSecView(0);
			this.sec_timer=setTimeout("fidJones.OnSecTimer()",250);
		}
	}
,	"OnSecTimer":function()
	{
		this.sec_timer=0;
		if( this.sec )
		{
			this.SetSecView("<div style=\"font-size:11px;padding:20px;text-align:center\">Cargando...</div>");
			AwfExec("get_sec",{"sec":this.sec},{"url":this.url});
		}
	}
,	"OnSecData":function(vSec,vData)
	{
		this.sec_cache[vSec]=vData;
		if( vSec==this.sec )
			this.SetSecView(vData.htm);
		
	}
,	"ClearSecView":function(vSelMsg)
	{
		this.SetSecView(vSelMsg
			? "<div style=\"font-size:11px;padding:20px;text-align:center\">Por favor seleccione una autoridad</div>"
			: "&nbsp;");
	}
,	"SetSecView":function(vHtm)
	{
		iclSetEltHtm("id_debate_form_sec_view",vHtm);
	}
	
,	"ClearSecTimer":function()
	{
		if( this.sec_timer ){clearTimeout(this.sec_timer);this.sec_timer=0;}
	}
,	"SetMode":function(vMode)
	{
		this.ClearSecTimer();
		switch(vMode)
		{
		case "post":
		case "note":
			iclDisplayElt("id_debate_form_dock","block");
			iclSetEltHtm("id_debate_form_dock","<div style=\"font-size:14px;padding:20px\"><b>Un momento por favor...</b></div>");
			iclDisplayElt("id_debate_posts","none");
		//	iclDisplayElt("id_debate_add","none");
			break;
		default:
			vMode=0;
			iclDisplayElt("id_debate_form_dock","none");
			iclSetEltHtm("id_debate_form_dock","");
			iclDisplayElt("id_debate_posts","block");
		//	iclDisplayElt("id_debate_add","block");
			break;
		}
		this.mode=vMode;
	}
,	"OnPostSubmit":function(e,vForm)
	{
		iclCancelEvent(e);
		AwfExecForm(vForm,{"cmd":"post_submit","url":this.url});
	}
,	"OnNoteSubmit":function(e,vForm)
	{
		iclCancelEvent(e);
		AwfExecForm(vForm,{"cmd":"note_submit","url":this.url});
	}
,	"SetFormMsg":function(vMsg)
	{
		var vShow;
		if( !vMsg || vMsg=="0" )
			vShow="none";
		else
			vShow="block";
		iclSetEltHtm("id_debate_form_msg",vMsg);
		iclDisplayElt("id_debate_form_msg",vShow);
	}
,	"OnPostInfo":function(e,vPostId)
	{
		iclCancelEvent(e);
		HideVisMenu();
		if( e=iclElt("postinfo"+vPostId) )
		{
			var vShow=this.akn!=vPostId;
			e.style.display=vShow?"block":"none";
			if( vShow )
			{
				if( this.akn )iclDisplayElt("postinfo"+this.akn,"none");
				this.akn=vPostId;
				AwfExec("get_post_akn",{"post_id":vPostId},{"url":this.url});
			}
			else
			{
				this.akn=0;
			}
		}
	}
,	"OnRankPost":function(e,vPostId,vVal)
	{
		iclCancelEvent(e);
		HideVisMenu();
		AwfExec("rank_post",{"post_id":vPostId,"val":vVal},{"url":this.url});
	}	
,	"OnRankNote":function(e,vNoteId,vVal)
	{
		iclCancelEvent(e);
		HideVisMenu();
		AwfExec("rank_note",{"note_id":vNoteId,"val":vVal},{"url":this.url});
	}	
};