// JavaScript Document
function updateJSON(r)
{  alert('r:'+r+', data:'+data);
                  var data = r.evalJSON();
				  var numeroElementos = data.length;
				  
                  for (var i = 0; i < numeroElementos; i++) {
					//alert(i);
                    Element.update(data[i][0], data[i][1]);
                  }				  
}

function sendComment()
{
  if (this.comment.value == '') {
	alert('Debes ingresar un comentario');
	return false;
  }
  new Ajax.Updater( 'ctn_lst_comments',
				     this.action,
					 { asynchronous:true,
					   evalScripts:true,
					   onLoading:function(request, json)
					   { $('ctn_confirm_msg').update('<div align=\"center\"><img src=\"' + small_loader +'\" alt=\"Cargando\" /></div>')
					   },
					   parameters:Form.serialize(this)
					 });
  
  this.comment.value = '';
  this.comment.focus();
  return false;
}
function initSendComment()
{
  //alert('entro coment');
  var frm_ad_comment = $('frm_ad_comment');
  //alert (frm_ad_comment);
  if (frm_ad_comment != undefined) {
    frm_ad_comment.onsubmit = sendComment;
  }
  	
}

Event.observe(window, 'load', initSendComment, false);