var type_actions = 1;
	var json = '';
	var primero = false;
	var ultimo_id = 1;

	function templateActions(type, item){
		var iphone = '';
		if(item.iphone != '0'){
			iphone = '<img src="/images/telefono.png" title="Desde el IPhone" />';
		}
		if(item.wap != '0'){
			iphone = '<img src="/images/telefono.png" title="Desde WAP" />';
		}
		var str = '<p>'+iphone+' <span class="user_update">'+item.name+'</span> '+item.content+'</p><div class="clear"></div>'
		return str;
	}

	function searchActions(update){	
		clearTimeout(buscarAcciones);

		$.ajax({
			'url': '/acciones.1.json?uncache='+uncache(),
			'dataType': 'json', 
			'success': function(data){
				var content = '';
				var json_tmp = '';
				var n_id = true;

				$.each(data, function(i, item){
					switch(item.type) {
					case 1 :
						var clase = "type_vote"
						break;
					case 2 :
						var clase = "type_comment"
						break;
					case 3 :
						var clase = "type_poll"
						break;
						
					}
					var resto;
					var id='';
					resto = i % 2;
					if (resto != 0) id=' id="cebra"';
				
					content += '<li'+id+' class="'+clase+'">'+templateActions(type_actions, item)+'</li>';
					if(n_id) {
						ultimo_id = item.id;
					}
					n_id = false;
				});
					
				json_tmp = content;
		
				if(json_tmp != json){
					$('#updates_modulo').animate({'opacity': .5}, 600, function(){ $('#updates_modulo').html(content).animate({'opacity': 1}, 600);  });
					json = json_tmp;
				}
			}
		});
	
		if(!update){
		clearTimeout(buscarAcciones);
			buscarAcciones = setTimeout(function(){ primero=false;searchActions(); },12000);
		}else{
			clearTimeout(buscarAcciones);
			buscarAcciones = setTimeout(function(){ searchActions(); },8000);
		}
	}
			
	clearTimeout(buscarAcciones);
	buscarAcciones = setTimeout(function(){ searchActions(); },4500);