  jQuery('body').ready(function($){
      $('.addcomparar').click(function(){
                var id = jQuery(this).attr('ident');
                var este = this;
		$.ajax( {
                            type: "GET", url: "index.php?option=com_properties&format=json&view=compare&task=addProduct&product_id="+id,
                            dataType: "json",
                            error: function(XMLHttpRequest, textStatus, errorThrown){
                                alert(XMLHttpRequest);
                                alert(textStatus);
                                alert(errorThrown);
                            },
                            success: function(datos){
                                $.jGrowl(datos.mensaje, { life: 20000, sticky: false, theme: datos.estado});
                                if(datos.estado == 'ok'){
                                    jQuery(este).attr('class','jomres_button_property_compare desmarcado');
                                    jQuery(este)[0].innerHTML = '<span class="enMiLista">'+jQuery('.ejemploDesmarcado')[0].innerHTML+'</span>';
                                    jQuery(este).unbind('click');
                                    jQuery('.contadorcomparar').children('a')[0].innerHTML = jQuery('.ejemploMilista')[0].innerHTML+ ' ('+datos.cantidad+')';
                                }
                            }
                });
	  });
    });
