
window.onerror = erro;
function erro(msg, url, line){
    jQuery.post("admin/error.php", {
        msg: msg,
        url: url,
        line: line
    });
};
$(window).error(function(){
    erro;
});

$(document).ready(function(){
    $.fn.createDialog.defaults = {
        progress: true,
        center: true,
        opacity: 0.7,
        bg: '#000'
    }
    $("#clipPlay").createDialog({
        addr: 'clip/dialog.php?clip=clip_Fusopar',
        opacity: 0.9
    });
	$("#satisf").createDialog({
        addr: 'satisf/dialog.php',
        opacity: 0.9
    });
    $('#atalhoCompet,#atalhoCatalog,#atalhoFusoNet,#atalhoVideo,#containerLeft #news_wrap').show('fold', 1000);
    $('#bannerHome').animate({
        opacity: 1
    }, 2000);
    $('#menu a').css({
        backgroundPosition: "0 0"
    }).mouseover(function(){
        $(this).stop().animate({
            backgroundPosition: "-160px 0",
            color: "#000"
        }, {
            duration: 200
        });
    }).mouseout(function(){
        $(this).stop().animate({
            backgroundPosition: "-300px 0",
            color: "#DAD8E4"
        }, {
            duration: 200,
            complete: function(){
                $(this).css({
                    backgroundPosition: "0 0"
                })
            }
        })
    });
    /*function atualiza(){
        var conteudoNews = '';
        var textNews = '';
        $.ajax({
            type: "GET",
            url: "blog/?feed=rss2",
            cache: false,
            dataType: "xml",
            success: function(xml){
                var cont = 0;
                $(xml).find('item').each(function(){
                    var title = $(this).find('title').text();
                    var date = $(this).find('pubDate').text();
                    var localDate = new Date(date);
                    localDate = localDate.toLocaleString();
                    var links = $(this).find('link').text();
                    var description = $(this).find('description').text();
                    textNews += title;
                    conteudoNews += '<div class="news_title"><a  href="' + links + '" target="_blank">' + title + '</a></div>';
                    cont++;
                    //número de notícias que serão exibidas
                    if (cont == 7) 
                        return false;
                });
                if (textNews != $('#news_wrap').text()) {
					//o elemento #news_wrap recebe a variável conteudoNews
                    $('#news_wrap').html(conteudoNews);
                };
                            }
        });
    };
    atualiza();*/
    $("#atalhoCompet, #atalhoCatalog, #atalhoFusoNet, #atalhoVideo").hover(function(){
        $(this).find('.imagesAtHome').each(function(){
            $(this).stop().animate({
                width: '10px'
            }, 500)
        });
    }, function(){
        $(this).find('.imagesAtHome').each(function(){
            $(this).stop().animate({
                width: '130px'
            }, 500)
        });
    });
});

