$(document).ready(function(){
    try {
        //opacidade
        $("#destaques .destaques div p.btnMore a").fadeTo("fast", 0.8);
        $("#destaques .destaques div p.btnMore a").hover(function(){
            $(this).fadeTo("fast", 1.0);
        },function(){
            $(this).fadeTo("fast", 0.8);
        });

        //infoHorarios
        if($(".infoHorarios div").length > 1) {
            $('.infoHorarios').cycle({
                fx:      'fade',
                cleartype: true,
                cleartypeNoBg: true,
                timeout: 3000
            //pause:   1,
            //pager: '.pages'
            });
        }
 
        //mapa
        $("#mapsmag").fancybox({
            'width'				: '97%',
            'height'			: '97%',
            'autoScale'			: false,
            'transitionIn'		: 'none',
            'transitionOut'		: 'none',
            'titleShow'		: false,
            'type'				: 'iframe'
        });
        
        // twitter
        $.get(UrlSite + "/_shared/twitter.php?act=list", function(data) {
            $("#widgetTwitter ul").html(data);

            $("#widgetTwitter ul").cycle({
                fx: 'fade',
                cleartype: true,
                cleartypeNoBg: true,
                timeout: 5000
            });

        //ajax_loading_close(".rssTwitter");
        });

    } catch (e) { }
});


function ajax_loading(campo)
{
    $(campo).block({
        message: "<img src=\""+ UrlSite + "/_imgs/ajax-loader.gif\" alt=\"\" />",
        css : {
            margin: 0,
            padding: 0,
            border: 'none',
            background: 'none'
        },
        overlayCSS: {
            backgroundColor:'#495058',
            opacity: '0.9',
            padding: "0 5px 0 0"
        }
    });
}

function ajax_loading_close(campo) {
    $(campo).unblock();
}
