function cargar_efectos_anuncios()
{
	$('#anuncios').after('<table cellspacing="0" width="100%" style="margin-top: 5px;margin-bottom: 5px;"><tr><td class="paginador" id="paginador" style="padding-top: 5px;padding-bottom: 5px;"></td><td align="right"> <button class="pause" id="accion_anuncios" rel="pause">Pausar</button> <button onclick="recargar_anuncios();" title="Recargar el listado de anuncios" style="padding-right: 3px;" id="refresh">Recargar</button></td></tr></table>').cycle({
	fx: 'scrollDown',
	timeout: 5000,
	delay:  -2000,
	pager:  '#paginador',
	pause:   1,
	next: '#anuncios'
	,easing:  'backinout'
	});
}

function cargar_efectos_proyectos()
{
	//.after('<b>Listado de im&aacute;genes:</b><br /> <i class="small">Haga clic en el n&uacute;mero para visualizar</i><table cellspacing="0" width="100%" style="margin-top: 5px;margin-bottom: 5px;"><tr><td class="paginador" id="paginador_imagenes_proyecto" style="padding-top: 5px;padding-bottom: 5px;"></td></tr></table>')
	$("#cycle_imagenes_proyecto").cycle({
		fx: 'fade',
		timeout: 0,
		delay:  -2000,
		pager:  '#paginador_imagenes_proyecto',
		next: '#cycle_imagenes_proyecto'
	});
}

function recargar_anuncios()
{
	$("#anuncios").cycle('stop');
	enviar_vinculo("modulos/anuncios.php?modo=ajax","public_anuncios");
	$("#anuncios").cycle('resume');
}

$(document).ready(function(){
	$("#accion_anuncios").click(function(){
		if ($(this).attr("rel")=="pause")
		{
			$(this).button({label: "Continuar" });
			$(this).attr("id","play");
			$(this).attr("rel","resume");
			$("#anuncios").cycle('pause');
		}
		else
		{
			$(this).button({label: "Pausar" });
			$(this).attr("id","pause");
			$(this).attr("rel","pause")
			$("#anuncios").cycle('resume');
		}
		
		configure_buttons();
	});
	
	$(document).ajaxStart(function(){
	}).ajaxStop(function(){
		$("#accion_anuncios").click(function(){
		if ($(this).attr("rel")=="pause")
		{
			$(this).button({label: "Continuar" });
			$(this).attr("id","play");
			$(this).attr("rel","resume");
			$("#anuncios").cycle('pause');
		}
		else
		{
			$(this).button({label: "Pausar" });
			$(this).attr("id","pause");
			$(this).attr("rel","pause")
			$("#anuncios").cycle('resume');
		}
		
		configure_buttons();
	});
	});
});

