$(document).ready(function() {
    $globalUsuarioId = "";

    $(".boxLoginAjax").each(function() {
        $.ajax({
            type: 'GET',
            dataType: 'html',
            url: '/site/login/boxLogado.ashx',
            async: false,
            success: function(data) {

                $(".boxLoginAjax").html(data).show();

                $gaTipo = $(".boxLoginAjax .gaTipo").text();
                $gaIdade = $(".boxLoginAjax .gaIdade").text();
                $gaSexo = $(".boxLoginAjax .gaSexo").text();
                $gaCategoria = $(".boxLoginAjax .gaCategoria").text();
                $gaUsuarioRetorno = $(".boxLoginAjax .gaUsuarioRetorno").text();
                $gaUsuarioId = $(".boxLoginAjax .gaUsuarioId").text();
                if ($gaUsuarioId != undefined) {
                    $globalUsuarioId = $gaUsuarioId;
                } else {
                    $globalUsuarioId = "";
                    $gaUsuarioId = "";
                }

                $gaTracker = $(".boxLoginAjax .gaTracker").text();
                $gaCampanha = $(".boxLoginAjax .gaCampanha").text();

                var pageTracker = _gat._getTracker("UA-11582663-1");
                pageTracker._setCampSourceKey("source");

                pageTracker._setCustomVar(1, "tipo", $gaTipo, 1);
                pageTracker._setCustomVar(2, "Idade", $gaIdade, 1);
                pageTracker._setCustomVar(3, "Sexo", $gaSexo, 1);
                pageTracker._setCustomVar(4, "Categoria", $gaCategoria, 1);

                if ($gaTracker != "") {
                    pageTracker._trackPageview($gaTracker);
                }
                if ($gaCampanha != "") {
                    pageTracker._trackPageview($gaCampanha);
                }

                if ($("body").attr("rel")) {
                    $val = $("body").attr("rel");
                    pageTracker._trackPageview($val);
                }
                else {
                    pageTracker._trackPageview();
                }

                if ($gaUsuarioRetorno != "")
                    pageTracker._trackPageview("/skol/login/auto");

                formLoginPOG();


                if ($gaUsuarioId != "") {
                    $(".boxRight").show();
                    $("#boxFavoritos").each(function() {
                        $urlfavoritos = '/site/Favoritos/boxLogado.ashx?chave=' + $gaUsuarioId;
                        $.ajax({
                            type: 'GET',
                            dataType: 'html',
                            url: $urlfavoritos,
                            success: function(data) {
                                $("#boxFavoritos").html(data).show();
                                formFavoritosPOG();
                            }
                        });
                    });

                    $("#boxNovidades").each(function() {
                        $urlnovidades = '/site/Novidades/boxLogado.ashx?chave=' + $gaUsuarioId;
                        $.ajax({
                            type: 'GET',
                            dataType: 'html',
                            url: $urlnovidades,
                            success: function(data) {
                                $("#boxNovidades").html(data).show();
                                formNovidadesPOG();
                            }
                        });
                    });
                } else {
                    $("#boxFavoritos").hide();
                    $("#boxNovidades").hide();
                    $(".boxRight").hide();
                }
            }
        });
    });

    $("#navHeader").each(function() {
        if ($(this).attr("rel")) {
            $tracker = $(this).attr("rel").split("|")[0];
            $campanha = $(this).attr("rel").split("|")[1];
            pageTracker._trackPageview($tracker);
            if ($campanha != "") {
                pageTracker._trackPageview($campanha);
            }
        }
    })


    if ($.browser.msie && ($.browser.version < 7)) {
        $("body").addClass("ie");
        $scrollTop = $(window).scrollTop();
        $top = $(window).height() - 25 + $scrollTop + "px";
        $("#footerBot").css({ top: $top });
        $("#mainNav").css({ top: $scrollTop + "px" });
        $(window).scroll(function() {
            $scrollTop = $(window).scrollTop();
            $top = $(window).height() - 25 + $scrollTop + "px";
            $("#footerBot").css({ top: $top });
            $("#mainNav").css({ top: $scrollTop + "px" });
        });
        $(window).resize(function() {
            $scrollTop = $(window).scrollTop();
            $top = $(window).height() - 25 + $scrollTop + "px";
            $("#footerBot").css({ top: $top });
        });
    } else if ($.browser.msie && ($.browser.version < 8)) {
        $("body").addClass("ie7");
    } else if ($.browser.msie) {
        $("body").addClass("ie8");
    }

    $(".player").each(function() {
        $(this).flash({ src: '/swf/player.swf', quality: 'autohigh', AllowFullScreen: 'true', width: 557, height: 350, AllowFullScreen: 'true', wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
            videoID: $(this).attr("rel"),
            logo: '',
            logoX: '',
            logoY: '',
            bg: '',
            bgX: '',
            bgY: '',
            label: '',
            title: '',
            text: '',
            angle: 0,
            side: 'left',
            link: '',
            audio_list: '',
            novidades: '',
            novidadesUrl: '',
            pontuacaoMedia: '',
            pontuado: '',
            pontuadoUrl: '',
            favoritado: '',
            favoritoUrl: '',
            compartilhe: '',
            compartilheId: '',
            compartilharUrl: '',
            fraseTwitter: '',
            compartilharTitle: '',
            cemailcomplete: '',
            cfavoritos: '',
            cfacebook: '',
            ctwitter: '',
            cdelicious: '',
            cmyspace: '',
            cgoogle: '',
            clive: ''
        }
        }, { version: 9 });
    })

    //$("#mainNav .content").prepend('<img src="/img/bg-subNavSkolMusica.png" width="829" height="127" alt="" class="bgMenu hide png" />');
    $("ul#navHeader").superfish({ animation: { height: 'show' }, delay: 500, speed: 'fast' });

    // Como é pesado as animações, a qualidade deve ser autolow ou autohigh
    // ver mais info em: http://kb2.adobe.com/cps/127/tn_12701.html
    $("#hotsiteFutebol").each(function() {
        if ($(window).height() <= 981) {
            $height = 981;
        } else {
            $height = $(window).height();
            $height = $height - 25;
        }
        if ($(window).width() <= 1000) {
            $("#hotsiteFutebol").parent().width("1000px");
        }
        $ASPSESSID = $(this).attr("rel").split("|")[0];
        $serverTime = $(this).attr("rel").split("|")[1];
        $rnd = $(this).attr("rel").split("|")[2];
        $userAgent = navigator.userAgent.toLowerCase();
        swfobject.embedSWF("/swf/futebol/copa/main.swf", "hotsiteFutebol", "100%", $height, "9", "", { ASPSESSID: $ASPSESSID, rnd: $rnd, userAgent: $userAgent, serverTime: $serverTime, configXML: '/swf/futebol/copa/xml/config.xml' }, { wmode: 'transparent', scale: 'noscale', allowFullScreen: 'true', quality: 'autolow' }, {});
    });

    $(".flashHome").flash({ src: '/swf/vitrine.swf', quality: 'autohigh', width: 1000, height: 470, wmode: 'transparent', flashvars: { urlXml: ['/swf/data/vitrineHome.xml'].join(' ')} }, { version: 9 });
    $(".flashSomNaLata").flash({ src: '/swf/vitrines/vitrine_som_na_caixa_2.swf', quality: 'autohigh', width: 1000, height: 470, wmode: 'transparent', flashvars: { urlXml: ['/swf/data/vitrineSomnalata.xml'].join(' ')} }, { version: 9 });
    $(".flashRodaAmigos").flash({ src: '/swf/loader.swf', quality: 'autohigh', width: 1000, height: 400, wmode: 'transparent', flashvars: { swfLoad: ['/swf/header_amigos.swf'].join(' ')} }, { version: 9 });
    $(".flashNasAreias").flash({ src: '/swf/loader.swf', quality: 'autohigh', width: 1000, height: 400, wmode: 'transparent', flashvars: { swfLoad: ['/swf/header_areias.swf'].join(' ')} }, { version: 9 });
    $("#navProdutos").flash({ src: '/swf/menu_produtos.swf', quality: 'autohigh', width: 892, height: 220, wmode: 'transparent' }, { version: 9 });
    $("#flashFotosFolia").flash({ src: '/swf/folia_jaRolou.swf', quality: 'autohigh', width: 446, height: 623, wmode: 'transparent', flashvars: { xml: $("#flashFotosFolia").attr("rel")} }, { version: 9 });
    $("#flashEventosFolia").flash({ src: '/swf/folia_vaiRolar.swf', quality: 'autohigh', width: 418, height: 619, wmode: 'transparent', flashvars: { xml: $("#flashEventosFolia").attr("rel")} }, { version: 9 });

    $(".garotaSkol244x319").flash({ src: '/swf/skolsurf_widget_garota.swf', quality: 'autohigh', width: 237, height: 348, wmode: 'transparent', flashvars: { regionCode: geoip_region()} }, { version: 9 });

    $(".flashRepublica1002x343").flash({ src: '/swf/republica_header_video.swf', quality: 'autohigh', width: 1072, height: 386, wmode: 'transparent', flashvars: { videoURL: "/swf/flv/Skol_teaser_final.flv", loop: false, xOffset: 0, yOffset: 0} }, { version: 9 });

    $("#flashVideosFolia").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashVideosFolia .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $text = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            videoID: $videoID,
            videoThumb: $videoThumb,
            title: $title,
            text: $text,
            todasLink: $link,
            todasWindow: '_blank',
            videosXML: $videoRSS,
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId
        }
        }, { version: 9 });
    });

    $("#flashCarnaval500x724").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashCarnaval500x724 .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $text = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            videoID: $videoID,
            videoThumb: $videoThumb,
            title: $title,
            text: $text,
            todasLink: $link,
            todasWindow: '_blank',
            videosXML: $videoRSS,
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId
        }
        }, { version: 9 });
    });


    $("#flashCoralNatal500x759").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashCoralNatal500x759 .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $text = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            videoID: $videoID,
            videoThumb: $videoThumb,
            title: $title,
            text: $text,
            todasLink: $link,
            todasWindow: '_blank',
            videosXML: $videoRSS,
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId
        }
        }, { version: 9 });
    });


    $("#flashPreHome").each(function() {
        $swf = $(this).attr("rel");
        $urlSim = $(this).find("a:eq(0)").attr("href");
        $urlNao = $(this).find("a:eq(1)").attr("href");
        $(this).flash({ src: $swf, quality: 'autohigh', width: 1000, height: 590, wmode: 'transparent', flashvars: { urlSim: [$urlSim].join(' '), urlNao: [$urlNao].join(' ')} }, { version: 9 });
    });

    $(".flashProdutos").flash({ src: '/swf/produtos.swf', quality: 'autohigh', width: 1000, height: 1959, wmode: 'transparent', flashvars: { url: ['/institucional/produto.aspx?produto='].join(' ')} }, { version: 9 });

    $("#flashBarraUrlGarota .inner").flash({ src: '/swf/barra_url_garota.swf', quality: 'autohigh', width: 309, height: 28, wmode: 'transparent', flashvars: { garotaUrl: "http://www.skol.com.br/garota"} }, { version: 9 });

    $("#playerVerao").flash({ src: '/swf/playerSkolVerao.swf', quality: 'autohigh', width: 450, height: 320, wmode: 'transparent', flashvars: { video: "http://static.skol.com.br/portal/verao/ocamarao.f4v", thumb: "http://static.skol.com.br/portal/verao/ocamarao.jpg"} }, { version: 9 });

    $("#flashEnquete").flash({ src: '/swf/enquete.swf', quality: 'autohigh', width: 380, height: 280, wmode: 'transparent' }, { version: 9 });

    $("#flashGarotaTempo").flash({ src: 'http://static.skol.com.br/garota/swf/main_garotaSkol.swf', quality: 'autohigh', width: 720, height: 527, allowscriptaccess: 'always', base: 'http://static.skol.com.br/garota/', wmode: 'transparent' }, { version: 9 });


    $("#navegueSkol div:eq(0)").css("width", "110px");
    $("#navegueSkol div:eq(1)").css("width", "175px");
    $("#navegueSkol div:eq(2)").css("width", "143px");
    $("#navegueSkol div:eq(3)").css("width", "130px");
    $("#navegueSkol div:eq(4)").css("width", "115px");
    $("#navegueSkol div:eq(5)").css("width", "105px");
    //$("#navegueSkol div:eq(6)").css("width", "100px");
    $("#navegueSkol div:eq(6)").css("width", "105px");
    $("#scrollWallLatinha ul li").addClass("png");

    /*$(".flashEmoticonsCopa").each(function() {
    $xml = $(this).attr("rel").split("|")[0];
    $idCanal = $(this).attr("rel").split("|")[1];
    $(".flashEmoticonsCopa").flash({ src: '/swf/skol_futebol_emo.swf', width: 605, height: 561, wmode: 'transparent', flashvars: { xml: [$xml], idChannel: [$idCanal] } }, { version: 9 });
    });*/

    $(".boxTwitterRadio ul.jcarousel li:odd").addClass("color");

    $(".rightEventos .containnerInfo .contentInfoEvento, .scrollCincaoRegulamento").jScrollPane({ scrollbarWidth: 16, scrollbarMargin: 0, showArrows: false });

    $("#paginationFolia .pagination, #paginacaoGaleriaVideos .pagination, #paginacaoGaleriaFotos .pagination, .resultadoBuscaCincao .pagination").each(function() {
        //alert('Blá');
        $widthPagination = 0;
        $(this).find("span, a").each(function() {
            $widthPagination += $(this).outerWidth(true);
        });
        if ($('body').hasClass('ie')) {
            $(this).width($widthPagination + 3);
        }
        else {
            $(this).width($widthPagination);
        }
    });


    // Selectbox
    $(".itemSelect").each(function() {
        $selectOption = $(this).find("option[selected=true]").html();
        $itens = "";
        $width = $(this).find("select").width() + "px";
        $flagClick = new Array("true", "true", "true", "true");
        $posItemSelect = 0;

        $(this).find("select option").each(function() {
            $itens += '<li><div class="inner">' + $(this).text() + '</div></li>';
        });
        $htmlAppend = '<div class="contSelect"><a href="#">' + $selectOption + '</a>';
        $htmlAppend += '<div class="scrollItemSelectContainer fix"><div class="scrollItemSelect"><ul>' + $itens + '</ul></div></div></div>';
        $(this).append($htmlAppend);
        $(this).css({ 'visibility': 'visible' }).find(".scrollItemSelect").jScrollPane({ scrollbarWidth: 16, scrollbarMargin: 0, showArrows: false });
        $(this).find(".jScrollPaneContainer").append('<span class="bgTop"></span><span class="bgBot"></span>')
    });

    $(".itemSelect a").click(function() {
        $posItemSelect = $(".itemSelect").index($(this).parents(".itemSelect"));
        if ($(this).hasClass("hover")) {
            $flagClick[$posItemSelect] = false;
            $(this).parent().find(".scrollItemSelectContainer").slideUp("fast", function() {
                $(this).parent().find("a").removeClass("hover");
            });
        }
        else {
            $flagClick[$posItemSelect] = true;
            $(this).addClass("hover");
            $(this).parent().find(".scrollItemSelectContainer").addClass("show").hide().slideDown("normal");
        };
        return false;
    });

    $(".scrollItemSelect ul li").live("click", function() {
        $item = $(this);
        $flagClick[$posItemSelect] = false;
        $(this).parents(".itemSelect").find("a").html($(this).html());
        $(this).parents(".itemSelect").find("select option").each(function() {
            if ($(this).text() == $item.text()) {
                $(this).attr("selected", true);
            }
        });
        $(this).parents(".scrollItemSelectContainer").slideUp("fast", function() {
            $(this).parent().find("a").removeClass("hover");
        });
        setTimeout('$("#formSelectFolia").submit()', 500);
    }).hover(function() {
        $(this).addClass("hover");
    }, function() {
        $(this).removeClass("hover");
    });
    $(".contSelect").mouseenter(function() {
        $posItemSelect = $(".itemSelect").index($(this).parents(".itemSelect"));
        if ($(this).find("a").hasClass("hover")) {
            $flagClick[$posItemSelect] = true;
        };
        $(this).find(".scrollItemSelectContainer").stop("animate");
    }).mouseleave(function() {
        $posItemSelect = $(".itemSelect").index($(this).parents(".itemSelect"));
        if ($flagClick[$posItemSelect]) {
            $flagClick[$posItemSelect] = false;
            $(this).find(".scrollItemSelectContainer").animate({ 'width': $(this).find(".scrollItemSelectContainer").width() }, 2000).slideUp("fast", function() {
                $(this).parent().find("a").removeClass("hover");
            });
        };
    });
    // Selectbox

    $(".flashCompartilhe").each(function() {
        var regex = "/&amp;/g";
        $location = $(".flashCompartilhe .infosVideoDetalheInto");
        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

        $id = $.trim($location.find('li[rel="id"]').html()).replace(eval(regex), "&");
        $titulo = $.trim($location.find('li[rel="Titulo"]').html()).replace(eval(regex), "&");
        $tipoMidia = $.trim($location.find('li[rel="tipoMidia"]').html()).replace(eval(regex), "&");
        $usuarioNome = $.trim($location.find('li[rel="UsuarioNome"]').html()).replace(eval(regex), "&");
        $usuarioEmail = $.trim($location.find('li[rel="UsuarioEmail"]').html()).replace(eval(regex), "&");
        $descricao = $.trim($location.find('li[rel="Descricao"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $tagCanal = $.trim($location.find('li[rel="tagCanal"]').html()).replace(eval(regex), "&");
        $tagDetalheConteudo = $.trim($location.find('li[rel="tagDetalheConteudo"]').html()).replace(eval(regex), "&");
        $parametro = $.trim($location.find('li[rel="parametro"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: '/swf/compartilhe_lightbox.swf', quality: 'autohigh', width: 213, height: 211, wmode: 'transparent', flashvars: {
            id: [$id].join(' '),
            nome: [$usuarioNome].join(' '),
            email: [$usuarioEmail].join(' '),
            compartilharUrl: [$compartilharUrl].join(' '),
            fraseTwitter: [$fraseTwitter].join(' '),
            compartilharTitle: [$compartilharTitle].join(' '),
            tipoMidia: [$tipoMidia].join(' '),
            tagCanal: [$tagCanal].join(' '),
            tagDetalheConteudo: [$tagDetalheConteudo].join(' '),
            parametro: [$parametro].join(' ')
        }
        }, { version: 9 });
    });

    $(".destHome").each(function() {
        $media = $(this).attr("rel").split("|")[0];
        $w = $(this).attr("rel").split("|")[1];
        $h = $(this).attr("rel").split("|")[2];
        $url = $(this).attr("rel").split("|")[3];
        if ($media.match(/(.swf)/)) {
            $(this).flash({ src: $media, quality: 'autohigh', width: $w, height: $h, wmode: 'transparent', flashvars: { url: [$url].join(' ')} }, { version: 9 });
        } else {
            $(this).append('<a href="' + $url + '"><img src="' + $media + '" width="' + $w + '" height="' + $h + '" class="fix" /></a>');
        }
    });

    $(".flashScrollProdutos").each(function() {
        $swf = $(this).attr("rel").split("|")[0];
        $w = $(this).attr("rel").split("|")[1];
        $h = $(this).attr("rel").split("|")[2];
        $produto = $(this).attr("rel").split("|")[3];
        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, wmode: 'transparent', flashvars: { produto: [$produto].join(' ')} }, { version: 9 });
    });

    $(".flashWidgets, .flashEmoticonsCopa, .flashEmoticonsV2").each(function() {
        $swf = $(this).attr("rel").split("|")[0];
        $w = $(this).attr("rel").split("|")[1];
        $h = $(this).attr("rel").split("|")[2];
        $xml = $(this).attr("rel").split("|")[3];
        $idCanal = $(this).attr("rel").split("|")[4];
        $idConteudo = $(this).attr("rel").split("|")[5];
        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, wmode: 'transparent', flashvars: { xml: [$xml].join(' '), idChannel: [$idCanal].join(' '), idConteudo: [$idConteudo].join(' ')} }, { version: 9 });
    });

    $("input.tooltip").hoverIntent(function() {
        $(this).parent().find(".boxTooltip").fadeIn();
    }, function() {
        $(this).parent().find(".boxTooltip").fadeOut();
    });

    $(".mostrarFavoritos .btnMinimizar").click(function() {
        $(this).toggleClass("hover");
        $("ul.listCategoria").slideToggle();
        return false;
    });

    $("div.itemTermos").hoverIntent(function() {
        $(".toolTipTermosErro").fadeIn();
    }, function() {
        $(".toolTipTermosErro").fadeOut();
    });

    $(".noticia .img210x159").prepend('<div class="imgLupa"><img class="png" src="/img/img-lupa.png" width="15" height="16" alt="" /></div>');
    $(".imgLupa").click(function() {
        $(this).parent().find("a").click();
    });

    $(".Descolados").append('<div class="Descolados"><img src="/img/thumb-descolados.png" width="88" height="71" alt="Descolados" class="png" /></div>');
    $(".RepublicaSkol").append('<div class="RepublicaSkol"><img src="/img/thumb-republicaRedonda.png" width="93" height="50" alt="República redonda" class="png" /></div>');
    $(".RedondoRirDaVida").append('<div class="RedondoRirDaVida"><img src="/img/thumb-rirDaVida.png" width="94" height="39" alt="Redondo é rir da vida" class="png" /></div>');
    $(".SkolBeats").append('<div class="SkolBeats"><img src="/img/thumb-skolBeats.png" width="85" height="35" alt="Skol beats" class="png" /></div>');
    $(".SkolFolia").append('<div class="SkolFolia"><img src="/img/thumb-skolFolia.png" width="73" height="68" alt="Skol folia" class="png" /></div>');
    $(".SurfRedondo").append('<div class="SurfRedondo"><img src="/img/thumb-surfRedondo.png" width="85" height="73" alt="Surf redondo" class="png" /></div>');

    $(".thumbSkolFolia").append('<div class="thumbSkolFolia fix"></div>');

    $("#contentSkolWeb .item329x95 .img").prepend('<span class="fix"></span>');

    $("#scrollNews, #scrollTwitter, .scrollTwitter").removeClass("hide").jcarousel({ vertical: true, scroll: 2 });
    $("#scrollNews2, #scrollTwitter2, ul.wallpapper").removeClass("hide").jcarousel({ vertical: true, scroll: 1 });
    $("ul.wallpapper").removeClass("hide").jcarousel({ vertical: false, scroll: 1 });
    $("ul.ListVideosSurf").removeClass("hideSurf").jcarousel({ vertical: false, scroll: 1 });

    $("ul.ListVideosSurf li a ").click(function() {
        regex = "/&amp;/g";
        $location = $(this).parent().find(".infosVideoBocao");

        $novidades = $.trim($location.find("li:eq(0)").html());
        $novidadesUrl = $.trim($location.find("li:eq(1)").html());
        $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
        $pontuado = $.trim($location.find("li:eq(3)").html());
        $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
        $favoritado = $.trim($location.find("li:eq(5)").html());
        $favoritoUrl = $.trim($location.find("li:eq(6)").html());
        $compartilhe = $.trim($location.find("li:eq(7)").html());
        $compartilheId = $.trim($location.find("li:eq(8)").html());
        $videoID = $.trim($location.find("li:eq(9)").html());
        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");
        $ga = $.trim($location.find("li:eq(22)").html());
        $titulo = $.trim($location.find('li[rel="titulo"]').html());

        $(".centerContTop h3.titVideo").html($titulo);
        $(".videoContainerSurf.bocao").flash({ src: '/swf/playerSkolSurf.swf', quality: 'autohigh', AllowFullScreen: 'true', width: 640, height: 490, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
            videoID: $videoID, logo: '', logoX: '', logoY: '', bg: '', bgX: '', bgY: '', label: '', title: '', text: '', angle: 0, side: 'left', link: '', audio_list: '',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,
            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive,
            ga: $ga
        }
        }, { version: 9 });

        $topTitle = parseInt($("h2#coberturaAsp").offset().top) - 30;
        $('html, body').animate({ scrollTop: $topTitle }, 'slow');

        return false;
    });

    $mycarousel_itemFirstInCallback = function(carousel, item, idx, state) {
        $midiaId = $(item).attr("rel").split("|")[0];
        //$userId = $(item).attr("rel").split("|")[1];
        $userId = $globalUsuarioId;
        $mediaPontuacao = $(item).attr("rel").split("|")[2];
        $favoritado = $(item).attr("rel").split("|")[3];
        $userName = $(item).attr("rel").split("|")[4];
        $userLogin = $(item).attr("rel").split("|")[5];
        $midiaTipo = $(item).attr("rel").split("|")[6];
        $(".flashOqueAchou").flash({ src: "/swf/controles_v7.swf", quality: 'autohigh', width: 361, height: 30, wmode: 'transparent',
            flashvars: {
                midiaId: [$midiaId].join(' '),
                userId: [$userId].join(' '),
                mediaPontuacao: [$mediaPontuacao].join(' '),
                favoritado: [$favoritado].join(' '),
                userName: [$userName].join(' '),
                userLogin: [$userLogin].join(' '),
                midiaTipo: [$midiaTipo].join(' ')
            }
        }, { version: 9 });
    };
    $(".scrollFotosSurf").removeClass("hide").jcarousel({ vertical: false, scroll: 1, itemFirstInCallback: $mycarousel_itemFirstInCallback });



    if ($("body").hasClass("imprensa")) {
        //$htmlAlvo = $(".boxFotosGarotaTempo .alvo").html();
    }

    $(".item266, .item284, .item184, .item266x250, .box304 .img, .box444 .item .top, .box444 .item .img, .combinaEvento .item .top, .combinaEvento .item .img").click(function() {
        if ($(this).parents(".item").parent().hasClass("box444") || $(this).parents(".item").hasClass("boxRelEvento")) {
            window.location = $(this).parents(".item").find("a").attr("href");
        }
        else {
            window.location = $(this).find("a").attr("href");
        };
        return false;
    });

    $(".carroselGarota").removeClass("hide").jcarousel({ scroll: 1 });
    $(".carroselThumbGarota").removeClass("hide").jcarousel({ scroll: 2 });
    $("#scrollParticipeFutebol").removeClass("hide").jcarousel({ vertical: true, scroll: 1 });

    var $zIndex = 0;
    $("ul#listTabFutebol li, ul#navFotoEventos.fotos li").hover(function() {
        $zIndex = $(this).css('zIndex');
        //alert($zIndex);
        $(this).css({ zIndex: '50' });
        $("ul#listTabFutebol li a, ul#navFotoEventos li a").css({ backgroundPosition: 'bottom' });
        $(this).find("a").css({ backgroundPosition: 'top' });
    }, function() {
        $("ul#listTabFutebol li a, ul#navFotoEventos li a").css({ backgroundPosition: 'bottom' });
        $("ul#listTabFutebol li a.hover, ul#navFotoEventos li a.hover").css({ backgroundPosition: 'top' });
        if ($(this).hasClass("hover")) {
            $(this).css({ zIndex: 20 });
        }
        else {
            $(this).css({ zIndex: $zIndex });
        }
    });

    $("#btnNavFotosFolia a.disabled").hover(function() {
        $(this).css("background-position", "bottom");
    });

    $("ul#listTabFutebol li a").click(function() {
        $exibe = $(this).attr("href");
        $("ul#listTabFutebol li, ul#listTabFutebol li a").removeClass("hover");
        $("ul#listTabFutebol li").css({ zIndex: '1' });
        $(this).addClass("hover").parent().addClass("hover");
        $(this).parents("li").css({ zIndex: '20' });
        $(".boxInner").removeClass("boxInnerOn")
        $($exibe).addClass("boxInnerOn").hide().fadeIn();
        return false;
    });

    $(".boxFutebol .boxInner").each(function() {
        $alturaInfo = (48 - $(this).find(".titleTop .info").height()) / 2;
        $(this).find(".titleTop .info").css({ paddingTop: $alturaInfo + "px" });
    });

    $("#btnConvideAmigos").click(function() {
        $id = $(this).attr("rel").split("|")[0];
        $nome = $(this).attr("rel").split("|")[1];
        $email = $(this).attr("rel").split("|")[2];
        $tipoMidia = $(this).attr("rel").split("|")[3];
        jsCompartilhe($id, $nome, $email, $tipoMidia)
    });

    $("#btnNavThumbsPrev, #btnNavThumbsNext").click(function() {
        return false;
    });

    $("ul#carroselThumbGarota li a").click(function() {
        $start = parseInt($(this).attr("rel"));
        $(".alvo").html($htmlAlvo).find(".carroselGarota").removeClass("hide").jcarousel({ scroll: 1, start: $start });
        return false;
    });

    $(".flashNavFotos, #flashWidgets").each(function() {
        $xml = $(this).attr("rel").split("|")[0];
        $xmlTag = $(this).attr("rel").split("|")[1];
        $idCanal = $(this).attr("rel").split("|")[2];
        $(this).flash({ src: '/swf/menuCanais_short.swf', quality: 'autohigh', width: 557, height: 85, wmode: 'transparent', flashvars: { xml: [$xml].join(' '), xmlTag: [$xmlTag].join(' '), idCanal: [$idCanal].join(' ')} }, { version: 9 });
    });

    $(".flashNav").each(function() {
        $xml = $(this).attr("rel").split("|")[0];
        $xmlTag = $(this).attr("rel").split("|")[1];
        $idCanal = $(this).attr("rel").split("|")[2];
        $(this).flash({ src: '/swf/menuCanais.swf', quality: 'autohigh', width: 835, height: 85, wmode: 'transparent', flashvars: { xml: [$xml].join(' '), xmlTag: [$xmlTag].join(' '), idCanal: [$idCanal].join(' ')} }, { version: 9 });
    });

    $(".scrollerVideos").each(function() {
        $(this).removeClass("hide").jcarousel({ scroll: 4 });
    });
    $("#scrollerFotos, #scrollerVideos").removeClass("hide").jcarousel({ scroll: 4 });

    $("#scrollerFotos ul li a").click(function() {
        $src = $(this).attr("href");
        $tit = $(this).find("span").text();
        $desc = $(this).find("small").text();
        $data = $(this).find("em").text();
        $midiaId = $(this).attr("rel").split("|")[0];
        //$userId = $(this).attr("rel").split("|")[1];
        $userId = $globalUsuarioId;
        $mediaPontuacao = $(this).attr("rel").split("|")[2];
        $favoritado = $(this).attr("rel").split("|")[3];
        $userName = $(this).attr("rel").split("|")[4];
        $userLogin = $(this).attr("rel").split("|")[5];
        $midiaTipo = $(this).attr("rel").split("|")[6];
        $(".fotoContainer img").attr("src", $src);
        $("#boxFotoDetalhe .tit h3").html($tit);
        //$(".contentInfo p").html($desc);
        $(".dateInfo").html($data);
        if ($(".flashShareFoto").hasClass("flashFolia")) {
            $urlSwf = "/swf/controles_v5.swf"
            $width = 482;
        }
        else {
            $urlSwf = "/swf/controles.swf"
            $width = 557;
        };

        $(".flashShareFoto").html("").flash({ src: $urlSwf, quality: 'autohigh', width: $width, height: 29, wmode: 'transparent',
            flashvars: {
                midiaId: [$midiaId].join(' '),
                userId: [$userId].join(' '),
                mediaPontuacao: [$mediaPontuacao].join(' '),
                favoritado: [$favoritado].join(' '),
                userName: [$userName].join(' '),
                userLogin: [$userLogin].join(' '),
                midiaTipo: [$midiaTipo].join(' ')
            }
        }, { version: 9 }
		);
        return false;
    });

    $(".flashShareFoto").each(function() {
        $midiaId = $(this).attr("rel").split("|")[0];
        //$userId = $(this).attr("rel").split("|")[1];
        $userId = $globalUsuarioId;
        //alert($globalUsuarioId);
        $mediaPontuacao = $(this).attr("rel").split("|")[2];
        $favoritado = $(this).attr("rel").split("|")[3];
        $userName = $(this).attr("rel").split("|")[4];
        $userLogin = $(this).attr("rel").split("|")[5];
        $midiaTipo = $(this).attr("rel").split("|")[6];

        if ($(".flashShareFoto").hasClass("flashFolia")) {
            $urlSwf = "/swf/controles_v5.swf"
            $width = 482;
        }
        else {
            $urlSwf = "/swf/controles.swf"
            $width = 557;
        };

        $(this).flash({ src: $urlSwf, quality: 'autohigh', width: $width, height: 29, wmode: 'transparent',
            flashvars: {
                midiaId: [$midiaId].join(' '),
                userId: [$userId].join(' '),
                mediaPontuacao: [$mediaPontuacao].join(' '),
                favoritado: [$favoritado].join(' '),
                userName: [$userName].join(' '),
                userLogin: [$userLogin].join(' '),
                midiaTipo: [$midiaTipo].join(' ')
            }
        }, { version: 9 });
    });

    /*$(".flashOqueAchou").each(function() {
    $midiaId = $(this).attr("rel").split("|")[0];
    $userId = $(this).attr("rel").split("|")[1];
    $mediaPontuacao = $(this).attr("rel").split("|")[2];
    $favoritado = $(this).attr("rel").split("|")[3];
    $userName = $(this).attr("rel").split("|")[4];
    $userLogin = $(this).attr("rel").split("|")[5];
    $midiaTipo = $(this).attr("rel").split("|")[6];
    $urlSwf = "/swf/controles_v7.swf"
    $width = 361;
    $(this).flash({ src: $urlSwf, width: $width, height: 30, wmode: 'transparent',
    flashvars: {
    midiaId: [$midiaId].join(' '),
    userId: [$userId].join(' '),
    mediaPontuacao: [$mediaPontuacao].join(' '),
    favoritado: [$favoritado].join(' '),
    userName: [$userName].join(' '),
    userLogin: [$userLogin].join(' '),
    midiaTipo: [$midiaTipo].join(' ')
    }
    }, { version: 9 });
    });*/

    $("#flashNoticias, .flashFolia1, .flashFolia2, .flashFolia3, .flashFolia4").each(function() {
        if ($(this).hasClass("flashFolia1") || $(this).hasClass("flashFolia2") || $(this).hasClass("flashFolia3") || $(this).hasClass("flashFolia4")) {
            $location = $(this).find(".infosVideoDetalheInto");
            $heightFlash = 30;
            if ($(this).hasClass("flashFolia1")) {
                $widthFlash = 438;
                $urlFlash = "/swf/controles_v3.swf";
            }
            else if ($(this).hasClass("flashFolia2")) {
                $widthFlash = 220;
                $urlFlash = "/swf/controles_v4.swf";
            }
            else if ($(this).hasClass("flashFolia3")) {
                $urlFlash = "/swf/controles_v2.swf";
                $widthFlash = 393;
                $heightFlash = 27;
            }
            else {
                $urlFlash = "/swf/controles_v6.swf";
                $widthFlash = 166;
            };
        }
        else {
            $location = $("#flashNoticias .infosVideoDetalheInto");
            $urlFlash = "/swf/controles_v2.swf";
            $widthFlash = 393;
            $heightFlash = 27;
        }

        var regex = "/&amp;/g";
        $midiaId = $(this).attr("rel").split("|")[0];
        //$userId = $(this).attr("rel").split("|")[1];
        $userId = $globalUsuarioId;
        $mediaPontuacao = $(this).attr("rel").split("|")[2];
        $favoritado = $(this).attr("rel").split("|")[3];
        $userName = $(this).attr("rel").split("|")[4];
        $userLogin = $(this).attr("rel").split("|")[5];
        $midiaTipo = $(this).attr("rel").split("|")[6];

        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $urlFlash, quality: 'autohigh', width: $widthFlash, height: $heightFlash, wmode: 'transparent',
            flashvars: {
                midiaId: [$midiaId].join(' '),
                userId: [$userId].join(' '),
                mediaPontuacao: [$mediaPontuacao].join(' '),
                favoritado: [$favoritado].join(' '),
                userName: [$userName].join(' '),
                userLogin: [$userLogin].join(' '),
                midiaTipo: [$midiaTipo].join(' '),
                compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
                fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
                compartilharTitle: $compartilharTitle  // titulo para os links
            }
        }, { version: 9 });
    });

    $(".flashECardsHome").each(function() {
        var regex = "/&amp;/g";
        $location = $(this).parent().find(".boxThumbs ul li a:eq(0)");
        //$userId = $location.attr("rel").split("|")[0];
        $userId = $globalUsuarioId;
        $midiaId = $location.attr("rel").split("|")[1];
        $mediaPontuacao = $location.attr("rel").split("|")[2];
        $favoritado = $location.attr("rel").split("|")[3];
        $img = $location.attr("rel").split("|")[4];

        /*$compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");*/

        $(this).flash({ src: '/swf/skol_futebol_ecards.swf', quality: 'autohigh', width: 300, height: 246, wmode: 'transparent',
            flashvars: {
                idUsuario: [$userId].join(' '),
                idMidia: [$midiaId].join(' '),
                media: [$mediaPontuacao].join(' '),
                favoritado: [$favoritado].join(' '),
                image: [$img].join(' ')
            }
        }, { version: 9 });
    });

    $(".boxECards .boxThumbs ul li a").click(function() {
        //$userId = $(this).attr("rel").split("|")[0];
        $userId = $globalUsuarioId;
        $midiaId = $(this).attr("rel").split("|")[1];
        $mediaPontuacao = $(this).attr("rel").split("|")[2];
        $favoritado = $(this).attr("rel").split("|")[3];
        $img = $(this).attr("rel").split("|")[4];

        $(".flashECardsHome").flash({ src: '/swf/skol_futebol_ecards.swf', quality: 'autohigh', width: 300, height: 246, wmode: 'transparent',
            flashvars: {
                idUsuario: [$userId].join(' '),
                idMidia: [$midiaId].join(' '),
                media: [$mediaPontuacao].join(' '),
                favoritado: [$favoritado].join(' '),
                image: [$img].join(' ')
            }
        }, { version: 9 });

        $("#idConteudoHide").val($midiaId);
        return false;
    });

    $(".flashPlayerGarotaTempo .contentFlash").each(function() {
        $location = $(".infosVideoDetalheInto");
        $novidades = $.trim($location.find("li:eq(0)").html());
        $novidadesUrl = $.trim($location.find("li:eq(1)").html());
        $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
        $pontuado = $.trim($location.find("li:eq(3)").html());
        $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
        $favoritado = $.trim($location.find("li:eq(5)").html());
        $favoritoUrl = $.trim($location.find("li:eq(6)").html());
        $compartilhe = $.trim($location.find("li:eq(7)").html());
        $compartilheId = $.trim($location.find("li:eq(8)").html());
        $videoID = $.trim($location.find("li:eq(9)").html());
        $videoThumb = $.trim($location.find("li:eq(10)").html());

        $(this).flash({ src: '/swf/player_limpo.swf', quality: 'autohigh', width: 450, height: 313, AllowFullScreen: 'true', wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
            videoID: $videoID,
            videoThumb: $videoThumb,
            logo: '',
            logoX: '',
            logoY: '',
            bg: '',
            bgX: '',
            bgY: '',
            label: '',
            title: '',
            text: '',
            angle: 0,
            side: 'left',
            link: '',
            audio_list: '',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId
        }
        }, { version: 9 });
    });

    $("#flashSkolBeats").each(function() {
        $location = $(".contentFlash .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $xml = $item.split("|")[3];
        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars: { xml: [$xml].join(' ')} }, { version: 9 });
    });

    $("#flashSkolFolia").each(function() {
        $location = $("#flashSkolFolia .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());

        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $xml = $item.split("|")[3];
        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars: { xml: [$xml].join(' ')} }, { version: 9 });
    });

    $("#flashSkolSpirit").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashSkolSpirit .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $text = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            logo: '/img/Site/' + $canalNomeCurto + '/logo_canal.swf',
            logoX: '72',
            logoY: '0',
            bg: '/img/Site/' + $canalNomeCurto + '/fundo_canal.swf',
            bgX: '0',
            bgY: '0',
            label: 'Veja mais de ' + $canalNome,
            title: $title,
            texto: $text,
            descricao: $descricao,
            angle: -3,
            link: $link,
            videoRSS: $videoRSS,
            flickr_id: $flickr_id,
            botaoY: '560',
            link: $link,
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId
        }
        }, { version: 9 });
    });

    $("#flashSkolSurf").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashSkolSurf .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $text = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            logo: '/img/Site/' + $canalNomeCurto + '/logo_canal.swf',
            logoX: '80',
            logoY: '47',
            bg: '/img/Site/' + $canalNomeCurto + '/fundo_canal.swf',
            bgX: '0',
            bgY: '55',
            label: 'Veja mais de ' + $canalNome,
            title: $title,
            text: $text,
            descricao: $descricao,
            angle: -3,
            audio_list: 'http://skolsurf.skol.maya.im/blog/?page_id=3',
            link: $link,
            videoRSS: $videoRSS,
            flickr_id: $flickr_id,
            botaoY: '560',
            link: $link,
            videoID: $videoID,
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,

            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive
        }
        }, { version: 9 });
    });

    $("#flashVerao").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashVerao .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $text = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: "/swf/veraoSkol_destaqueCaravela.swf", quality: 'autohigh', width: 471, height: 585, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            logo: '/img/Site/' + $canalNomeCurto + '/logo_canal.swf',
            bg: '/img/Site/' + $canalNomeCurto + '/fundo_canal.swf',
            label: 'Veja mais de ' + $canalNome,
            title: $title,
            text: $text,
            angle: -2,
            side: 'left',
            link: $link,
            modelo: 'videoAudio',
            videoID: 'http://static.skol.com.br/portal/verao/ocamarao.f4v',
            videoThumb: 'http://static.skol.com.br/portal/verao/ocamarao.jpg',
            botaoY: '545',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,

            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive
        }
        }, { version: 9 });
    });

    $("#flashSkolWebVideo").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashSkolWebVideo .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $texto = $.trim($location.find('li[rel="texto"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            videoID: '$conteudo.IdExterno',
            logo: '/img/Site/geral/titleVideos.gif',
            logoX: '60',
            logoY: '50',
            bg: '/img/Site/geral/bgBlank.png',
            bgX: '0',
            bgY: '30',
            label: 'Veja mais vídeos',
            title: $title,
            text: $texto,
            angle: -2,
            side: 'left',
            link: $link,
            audio_list: 'http://skolsurf.skol.maya.im/blog/?page_id=3',
            link: $link,
            videoRSS: $videoRSS,
            flickr_id: $flickr_id,
            botaoY: '560',
            link: $link,
            videoID: $videoID,
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId
        }
        }, { version: 9 });
    });

    $("#flashSkolSensation").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashSkolSensation .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $texto = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            logo: '/img/Site/' + $canalNomeCurto + '/logo_canal.swf',
            logoX: '67',
            logoY: '16',
            bg: '/img/Site/' + $canalNomeCurto + '/fundo_canal.swf',
            bgX: '15',
            bgY: '5',
            label: 'Veja mais de ' + $canalNome,
            title: $title,
            texto: $texto,
            descricao: $descricao,
            angle: -3,
            link: $link,
            videoRSS: $videoRSS,
            flickr_id: $flickr_id,
            botaoY: '560',
            link: $link,
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId
        }
        }, { version: 9 });
    });

    $("#flashSkolWebFoto").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashSkolWebFoto .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $texto = $.trim($location.find('li[rel="texto"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
            {
                logo: '/img/Site/geral/titleFotos.gif',
                logoX: '70',
                logoY: '2',
                bg: '/img/Site/geral/bgBlank.png',
                bgX: '0',
                bgY: '0',
                label: 'Veja mais fotos',
                title: $title,
                texto: $texto,
                descricao: $descricao,
                angle: -3,
                link: $link,
                videoRSS: $videoRSS,
                flickr_id: $flickr_id,
                botaoY: '560',
                link: $link,
                novidades: $novidades,
                novidadesUrl: $novidadesUrl,
                pontuacaoMedia: $pontuacaoMedia,
                pontuado: $pontuado,
                pontuadoUrl: $pontuadoUrl,
                favoritado: $favoritado,
                favoritoUrl: $favoritoUrl,
                compartilhe: $compartilhe,
                compartilheId: $compartilheId
            }
        }, { version: 9 });
    });

    $("#flashGarotaDoTempo").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashGarotaDoTempo .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $texto = $.trim($location.find('li[rel="texto"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: 700, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            logo: '/img/Site/' + $canalNomeCurto + '/logo_canal.swf',
            logoX: '80',
            logoY: '47',
            bg: '/img/Site/' + $canalNomeCurto + '/fundo_canal.swf',
            bgX: '0',
            bgY: '55',
            label: 'Veja mais de ' + $canalNome,
            title: $title,
            texto: $texto,
            descricao: $descricao,
            angle: 2,
            link: $link,
            videoRSS: $videoRSS,
            flickr_id: $flickr_id,
            botaoY: '560',
            link: $link,
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId
        }
        }, { version: 9 });
    });

    $("#flashRedondoRirDaVida").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashRedondoRirDaVida .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = $item.split("|")[1];
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $text = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");

        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            logo: '/img/Site/' + $canalNomeCurto + '/logo_canal.swf',
            logoX: '35',
            logoY: '90',
            bg: '/img/Site/' + $canalNomeCurto + '/fundo_canal.swf',
            bgX: '-10',
            bgY: '50',
            label: 'Veja mais de ' + $canalNome,
            title: $title,
            text: $text,
            side: 'left',
            angle: -3,
            link: $link,
            modelo: 'videoAudio',
            videoID: $videoID,
            botaoY: '525',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,
            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive
        }
        }, { version: 9 });
    });

    $("#flashDiaDoAmigo").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashDiaDoAmigo .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = 520;
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $text = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");
        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            logo: '/img/Site/' + $canalNomeCurto + '/logo_canal.swf',
            logoX: '55',
            logoY: '44',
            bg: '/img/Site/' + $canalNomeCurto + '/fundo_canal.swf',
            bgX: '-9',
            bgY: '47',
            label: 'Veja mais de ' + $canalNome,
            title: $title,
            text: $text,
            side: 'left',
            angle: -3,
            link: $link,
            modelo: 'videoAudio',
            videoID: $videoID,
            botaoY: '525',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,
            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive
        }
        }, { version: 9 });
    });

    $("#flashDescolados").each(function() {
        var regex = "/&amp;/g";
        $location = $("#flashDescolados .infosVideoDetalheInto");
        $item = $.trim($location.find('li[rel="caminhoArquivo"]').html());
        $swf = $item.split("|")[0];
        $w = 520;
        $h = $item.split("|")[2];
        $novidades = $.trim($location.find('li[rel="novidades"]').html());
        $novidadesUrl = $.trim($location.find('li[rel="novidadesUrl"]').html()).replace(eval(regex), "&");
        $pontuacaoMedia = $.trim($location.find('li[rel="pontuacaoMedia"]').html());
        $pontuado = $.trim($location.find('li[rel="pontuado"]').html());
        $pontuadoUrl = $.trim($location.find('li[rel="pontuadoUrl"]').html()).replace(eval(regex), "&");
        $favoritado = $.trim($location.find('li[rel="favoritado"]').html());
        $favoritoUrl = $.trim($location.find('li[rel="favoritoUrl"]').html()).replace(eval(regex), "&");
        $compartilhe = $.trim($location.find('li[rel="compartilhe"]').html());
        $compartilheId = $.trim($location.find('li[rel="compartilheId"]').html());
        $canalNomeCurto = $.trim($location.find('li[rel="canalNomeCurto"]').html());
        $canalNome = $.trim($location.find('li[rel="canalNome"]').html());
        $conteudoNome = $.trim($location.find('li[rel="conteudoNome"]').html());
        $title = $.trim($location.find('li[rel="title"]').html());
        $text = $.trim($location.find('li[rel="text"]').html());
        $descricao = $.trim($location.find('li[rel="descricao"]').html());
        $link = $.trim($location.find('li[rel="link"]').html()).replace(eval(regex), "&");
        $videoRSS = $.trim($location.find('li[rel="videoRSS"]').html()).replace(eval(regex), "&");
        $videoID = $.trim($location.find('li[rel="videoID"]').html()).replace(eval(regex), "&");
        $videoThumb = $.trim($location.find('li[rel="videoThumb"]').html()).replace(eval(regex), "&");
        $caminhoArquivo = $.trim($location.find('li[rel="caminhoArquivo"]').html()).replace(eval(regex), "&");
        $flickr_id = $.trim($location.find('li[rel="flickr_id"]').html()).replace(eval(regex), "&");
        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: $swf, quality: 'autohigh', width: $w, height: $h, AllowFullScreen: 'true', wmode: 'transparent', flashvars:
        {
            logo: '/img/Site/' + $canalNomeCurto + '/logo_canal.swf',
            logoX: '27',
            logoY: '45',
            bg: '/img/Site/' + $canalNomeCurto + '/fundo_canal.swf',
            bgX: '0',
            bgY: '50',
            label: 'Veja mais de ' + $canalNome,
            title: $title,
            text: $text,
            side: 'left',
            angle: -3,
            link: $link,
            modelo: 'videoAudio',
            videoID: $videoID,
            botaoY: '525',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,
            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive
        }
        }, { version: 9 });
    });

    $('#flashRepublicaSkol').flash({
        src: '/swf/box_republica.swf',
        quality: 'autohigh',
        width: 502,
        height: 560,
        AllowScriptAccess: 'always',
        AllowFullScreen: 'true',
        wmode: 'transparent',
        AllowScriptAccess: 'always',
        flashvars: {
            title: 'As repúblicas mais redondas do planeta.',
            text: 'Confira os vídeos com cenas imperdíveis das repúblicas vencedoras. E fique ligado. Em 2010 tem mais.',
            link: '/republica',
            textoBotao: 'Veja Mais de República Redonda',
            linkWindow: '_blank',
            botaoY: '0',
            republicaXML: '/img/Site/RepublicaSkol/canal.xml',
            novidades: 'false',
            novidadesUrl: '/site/util/acompanharnovidades.ashx?novidadeUsuario.Canal.Id=6&novidadeUsuario.Usuario.Id=1&acompanhar=True',
            pontuacaoMedia: '',
            pontuado: '',
            pontuadoUrl: '',
            favoritado: '',
            favoritoUrl: '',
            compartilhe: '',
            compartilheId: ''
        }
    });


    $(".videoContainer").each(function() {
        var regex = "/&amp;/g";
        // Embed do player da interna de Vídeos e da home de Skol Futebol
        if ($(this).hasClass("videoContainerFutebol")) {
            $location = $(this).next();
        }
        else {
            $location = $(".infosVideoDetalheInto");
        }

        $novidades = $.trim($location.find("li:eq(0)").html());
        $novidadesUrl = $.trim($location.find("li:eq(1)").html());
        $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
        $pontuado = $.trim($location.find("li:eq(3)").html());
        $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
        $favoritado = $.trim($location.find("li:eq(5)").html());
        $favoritoUrl = $.trim($location.find("li:eq(6)").html());
        $compartilhe = $.trim($location.find("li:eq(7)").html());
        $compartilheId = $.trim($location.find("li:eq(8)").html());
        $videoID = $.trim($location.find("li:eq(9)").html());
        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: '/swf/player.swf', quality: 'autohigh', AllowFullScreen: 'true', width: 557, height: 350, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
            videoID: $videoID,
            logo: '',
            logoX: '',
            logoY: '',
            bg: '',
            bgX: '',
            bgY: '',
            label: '',
            title: '',
            text: '',
            angle: 0,
            side: 'left',
            link: '',
            audio_list: '',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,
            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive
        }
        }, { version: 9 });
    });

    $(".videoContainerLimpo").each(function() {
        // Embed do player da interna de Vídeos 
        $location = $(".infosVideoDetalheInto");
        $novidades = $.trim($location.find("li:eq(0)").html());
        $novidadesUrl = $.trim($location.find("li:eq(1)").html());
        $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
        $pontuado = $.trim($location.find("li:eq(3)").html());
        $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
        $favoritado = $.trim($location.find("li:eq(5)").html());
        $favoritoUrl = $.trim($location.find("li:eq(6)").html());
        $compartilhe = $.trim($location.find("li:eq(7)").html());
        $compartilheId = $.trim($location.find("li:eq(8)").html());
        $videoID = $.trim($location.find("li:eq(9)").html());

        $(this).flash({ src: '/swf/player_limpo.swf', quality: 'autohigh', AllowFullScreen: 'true', width: 557, height: 350, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
            videoID: $videoID,
            videoThumb: '',
            logo: '',
            logoX: '',
            logoY: '',
            bg: '',
            bgX: '',
            bgY: '',
            label: '',
            title: '',
            text: '',
            angle: 0,
            side: 'left',
            link: '',
            audio_list: '',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId
        }
        }, { version: 9 });
    });

    $("#flashYoutube").each(function() {
        // Embed do player da interna de Vídeos
        var regex = "/&amp;/g";
        $location = $(".infosVideoDetalheInto");
        $novidades = $.trim($location.find("li:eq(0)").html());
        $novidadesUrl = $.trim($location.find("li:eq(1)").html());
        $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
        $pontuado = $.trim($location.find("li:eq(3)").html());
        $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
        $favoritado = $.trim($location.find("li:eq(5)").html());
        $favoritoUrl = $.trim($location.find("li:eq(6)").html());
        $compartilhe = $.trim($location.find("li:eq(7)").html());
        $compartilheId = $.trim($location.find("li:eq(8)").html());
        $videoID = $.trim($location.find("li:eq(9)").html());
        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

        $(this).flash({ src: '/swf/player.swf', quality: 'autohigh', AllowFullScreen: 'true', width: 363, height: 275, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
            videoID: $videoID,
            logo: '',
            logoX: '',
            logoY: '',
            bg: '',
            bgX: '',
            bgY: '',
            label: '',
            title: '',
            text: '',
            angle: 0,
            side: 'left',
            link: '',
            audio_list: '',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,
            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive
        }
        }, { version: 9 });
    });


    $(".videoContainerSurf").each(function() {
        var regex = "/&amp;/g";
        // Embed do player da interna de Vídeos e da home de Skol Futebol
        if ($(this).hasClass("skolNews")) {
            $location = $(".infosVideokolNews");
        } else if ($(this).hasClass("bocao")) {
            $location = $(".infosVideoBocao");

        } else {
            $location = $(".infosVideoDetalheInto");
        }
        $novidades = $.trim($location.find("li:eq(0)").html());
        $novidadesUrl = $.trim($location.find("li:eq(1)").html());
        $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
        $pontuado = $.trim($location.find("li:eq(3)").html());
        $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
        $favoritado = $.trim($location.find("li:eq(5)").html());
        $favoritoUrl = $.trim($location.find("li:eq(6)").html());
        $compartilhe = $.trim($location.find("li:eq(7)").html());
        $compartilheId = $.trim($location.find("li:eq(8)").html());
        $videoID = $.trim($location.find("li:eq(9)").html());
        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");
        $ga = $.trim($location.find("li:eq(22)").html());
        $ga = ($ga == 'GuiaVeraoRedondo') ? 'dest_veraoredondo' : 'dest_skolssurf';

        if ($(this).hasClass('videoBigger')) {
            $width = 640;
            $height = 490;
        } else {
            $width = 406;
            $height = 311;
        }

        $(this).flash({ src: '/swf/playerSkolSurf.swf', quality: 'autohigh', AllowFullScreen: 'true', width: $width, height: $height, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
            videoID: $videoID, logo: '', logoX: '', logoY: '', bg: '', bgX: '', bgY: '', label: '', title: '', text: '', angle: 0, side: 'left', link: '', audio_list: '',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,
            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive,
            ga: $ga
        }
        }, { version: 9 });
    });

    $(".videoContainerSurfGuia").each(function() {
        var regex = "/&amp;/g";
        $location = $(".infosVideoDetalheIntoGuia");
        $novidades = $.trim($location.find("li:eq(0)").html());
        $novidadesUrl = $.trim($location.find("li:eq(1)").html());
        $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
        $pontuado = $.trim($location.find("li:eq(3)").html());
        $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
        $favoritado = $.trim($location.find("li:eq(5)").html());
        $favoritoUrl = $.trim($location.find("li:eq(6)").html());
        $compartilhe = $.trim($location.find("li:eq(7)").html());
        $compartilheId = $.trim($location.find("li:eq(8)").html());
        $videoID = $.trim($location.find("li:eq(9)").html());
        $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
        $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
        $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
        $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
        $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
        $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
        $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
        $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
        $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
        $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
        $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");
        $ga = $.trim($location.find("li:eq(22)").html());
        $ga = ($ga == 'GuiaVeraoRedondo') ? 'dest_veraoredondo' : 'dest_skolssurf';

        $(this).flash({ src: '/swf/playerSkolSurf.swf', quality: 'autohigh', AllowFullScreen: 'true', width: 406, height: 311, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
            videoID: $videoID, logo: '', logoX: '', logoY: '', bg: '', bgX: '', bgY: '', label: '', title: '', text: '', angle: 0, side: 'left', link: '', audio_list: '',
            novidades: $novidades,
            novidadesUrl: $novidadesUrl,
            pontuacaoMedia: $pontuacaoMedia,
            pontuado: $pontuado,
            pontuadoUrl: $pontuadoUrl,
            favoritado: $favoritado,
            favoritoUrl: $favoritoUrl,
            compartilhe: $compartilhe,
            compartilheId: $compartilheId,
            compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
            fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
            compartilharTitle: $compartilharTitle,  // titulo para os links
            cemailcomplete: $cemailcomplete,
            cfavoritos: $cfavoritos,
            cfacebook: $cfacebook,
            ctwitter: $ctwitter,
            cdelicious: $cdelicious,
            cmyspace: $cmyspace,
            cgoogle: $cgoogle,
            clive: $clive,
            ga: $ga
        }
        }, { version: 9 });
    });



    $("ul.listMaisPontosSurf li a, .boxSurf392x102 a").click(function() {
        $id = $(this).attr("href").split("?idConteudo=")[1];
        $tit = $(this).parents(".txt").find("h4").text();
        $.ajax({
            type: 'GET',
            dataType: "html",
            url: '/Site/Util/ConteudoAjax.ashx?idConteudo=' + $id,
            success: function(html) {
                $("ul.infosVideoDetalheIntoGuia").html(html);
                $("h3.titVideo").text($tit);
                $(".videoContainerSurfGuia").each(function() {
                    var regex = "/&amp;/g";
                    $location = $(".infosVideoDetalheIntoGuia");
                    $novidades = $.trim($location.find("li:eq(0)").html());
                    $novidadesUrl = $.trim($location.find("li:eq(1)").html());
                    $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
                    $pontuado = $.trim($location.find("li:eq(3)").html());
                    $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
                    $favoritado = $.trim($location.find("li:eq(5)").html());
                    $favoritoUrl = $.trim($location.find("li:eq(6)").html());
                    $compartilhe = $.trim($location.find("li:eq(7)").html());
                    $compartilheId = $.trim($location.find("li:eq(8)").html());
                    $videoID = $.trim($location.find("li:eq(9)").html());
                    $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
                    $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
                    $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
                    $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
                    $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
                    $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
                    $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
                    $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
                    $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
                    $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
                    $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

                    $(this).html("").flash({ src: '/swf/player.swf', quality: 'autohigh', AllowFullScreen: 'true', width: 406, height: 311, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
                        videoID: $videoID, logo: '', logoX: '', logoY: '', bg: '', bgX: '', bgY: '', label: '', title: '', text: '', angle: 0, side: 'left', link: '', audio_list: '',
                        novidades: $novidades,
                        novidadesUrl: $novidadesUrl,
                        pontuacaoMedia: $pontuacaoMedia,
                        pontuado: $pontuado,
                        pontuadoUrl: $pontuadoUrl,
                        favoritado: $favoritado,
                        favoritoUrl: $favoritoUrl,
                        compartilhe: $compartilhe,
                        compartilheId: $compartilheId,
                        compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
                        fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
                        compartilharTitle: $compartilharTitle,  // titulo para os links
                        cemailcomplete: $cemailcomplete,
                        cfavoritos: $cfavoritos,
                        cfacebook: $cfacebook,
                        ctwitter: $ctwitter,
                        cdelicious: $cdelicious,
                        cmyspace: $cmyspace,
                        cgoogle: $cgoogle,
                        clive: $clive
                    }
                    }, { version: 9 });
                });

            }
        });
        return false;
    });



    $(".videoContainerSurfPontos").each(function() {
        $videoID = $(this).attr("rel");
        $(this).flash({ src: '/swf/player.swf', quality: 'autohigh', AllowFullScreen: 'true', width: 406, height: 311, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: { videoID: $videoID} }, { version: 9 });
    });


    $("#scrollerVideos ul li a, .scrollerVideos ul li a").click(function() {
        $location = $(this).parent().find("ul.infosVideoDetalhe");
        $conteudoId = $(this).parent().find("ul.infosVideoDetalhe").attr("rel");
        $novidades = $.trim($location.find("li:eq(0)").html());
        $novidadesUrl = $.trim($location.find("li:eq(1)").html());
        $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
        $pontuado = $.trim($location.find("li:eq(3)").html());
        $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
        $favoritado = $.trim($location.find("li:eq(5)").html());
        $favoritoUrl = $.trim($location.find("li:eq(6)").html());
        $compartilhe = $.trim($location.find("li:eq(7)").html());
        $compartilheId = $.trim($location.find("li:eq(8)").html());
        $videoID = $.trim($location.find("li:eq(9)").html());
        $title = $(this).find("span").html();
        $desc = $(this).find("small").html();
        $data = $(this).find("em").html();
        $hora = $(this).find("strong").html();

        window.location.href = "/skolweb/video.aspx?idConteudo=" + $conteudoId;
        /*********** 
        Alteração para no clique do video ter reload da página e atualizar URL no browser
        ************
        if ($(".videoContainer").hasClass("videoContainerFutebol")) {
        $nomeFlash = $(this).parents(".boxInner").find(".videoContainer");
        }
        else {
        $nomeFlash = $(".videoContainer");
        }

        $nomeFlash.flash({ src: '/swf/player.swf', AllowFullScreen: 'true', width: 557, height: 350, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
        videoID: $videoID,
        logo: '',
        logoX: '',
        logoY: '',
        bg: '',
        bgX: '',
        bgY: '',
        label: '',
        title: '',
        text: '',
        angle: 0,
        side: 'left',
        link: '',
        audio_list: '',
        novidades: $novidades,
        novidadesUrl: $novidadesUrl,
        pontuacaoMedia: $pontuacaoMedia,
        pontuado: $pontuado,
        pontuadoUrl: $pontuadoUrl,
        favoritado: $favoritado,
        favoritoUrl: $favoritoUrl,
        compartilhe: $compartilhe,
        compartilheId: $compartilheId
        }
        }, { version: 9 });
        */
        $("#boxFotoDetalhe h3").html($title);
        $(".contentInfo").html($desc);
        $(".dateInfo").html("Data: " + $data);

        $(this).parents(".boxInner").find(".titleTop .data").html($data + "<br />" + $hora + ":");
        $(this).parents(".boxInner").find(".titleTop .info").html($desc);

        return false;
    });


    /*$(".videoYoutubeSurf").each(function() {
    $urlVideo = $(this).find("a").attr("href");
    $urlVideo = $urlVideo.replace(new RegExp("watch\\?v=", "i"), 'v/');
    $(this).flash({ width: $(this).width(), height: $(this).height(), wmode: 'opaque' }, { version: 9 }, function(htmlOptions) {
    htmlOptions.src = $urlVideo;
    $(this).html($.fn.flash.transform(htmlOptions));
    });
    });*/


    $("ul#listTabFutebol li:eq(2) a").click(function() {
        $("ul#listTabFutebol li:eq(0)").addClass("btnFlashMobsOf");
    });

    $("ul.listSkol li:even").addClass("even");
    $("ul.listSkol li:odd").addClass("odd");

    $("#formEnviaEcards #btnEnviar, #formGuiaVerao #btnEnviar").click(function() {
        $(this).parent().find("input[type='text'], textarea").each(function() {
            if ($(this).val() == $(this).attr("title") || $(this).val() == "") {
                $(this).val("");
            };
        });
        // variável utilizada no validate
        $verificaClick = true;
    });
    if ($("textarea#amigoMsg").val() == "") {
        $("textarea#amigoMsg").val($("textarea#amigoMsg").attr("title"));
    };
    $("textarea#amigoMsg").focus(function() {
        if ($(this).val() == $(this).attr("title")) {
            $(this).val("");
        };
    });
    $("textarea#amigoMsg").blur(function() {
        if ($.trim($(this).val()) == "") {
            $(this).val($(this).attr("title"));
        };
    });

    if ($(".boxDest1000").hasClass("boxFutebol")) {
        $totalThumbs = $(".boxThumbs ul li").size();
        $totalBoxThumbs = $(".boxThumbs ul").size();
        $tamanhoContainer = 326 * $totalBoxThumbs;
        $indiceLista = 1;
        $indiceItem = 6;

        /*alert($totalThumbs);
        if($totalThumbs >= 6){
        $(".boxThumbs ul li").each(function(){
        if($(".boxThumbs ul li").index(this) % 6 != 0){
        $bla = '$(".boxThumbs ul li:eq(' + $indiceItem + ')");'
        alert($bla);
        }
        else{
        alert('Último');
        };
        $indiceItem++;
        });
        };*/

        $(".boxThumbs .boxInnerThumbsVideos").width($tamanhoContainer + "px");
        $contThumb = 1;
        $("a#btnNavThumbsPrev").addClass("end");
        if ($totalBoxThumbs == 1) {
            $("a#btnNavThumbsNext").addClass("end");
        };
    };

    $("a#btnNavThumbsPrev").click(function() {
        if (!($(this).hasClass("end"))) {
            $(this).parent().find(".boxInnerThumbsVideos").animate({ "left": "+=326px" }, "slow");
            $("a#btnNavThumbsNext").removeClass("end");
            if (--$contThumb == 1) {
                $(this).addClass("end");
            };
        };
    });

    $("a#btnNavThumbsNext").click(function() {
        if (!($(this).hasClass("end"))) {
            $(this).parent().find(".boxInnerThumbsVideos").animate({ "left": "-=326px" }, "slow");
            $("a#btnNavThumbsPrev").removeClass("end");
            if (++$contThumb == $totalBoxThumbs) {
                $(this).addClass("end");
            };
        };
    });


    /*
    $(".boxSkolNewsHome .boxOutrasCategorias ul li a").click(function() {
    $val = $(this).attr("href").split("#")[1];
    $txt = $(this).html();
    $(this).parents(".boxOutrasCategorias").fadeOut().prev().html($txt);
    $.ajax({
    type: 'GET',
    dataType: "html",
    url: '/Site/Rss/Index.ashx?skolRssFeed=' + $val,
    success: function(data) {
    if (data != '') {
    $("#scrollNews ul").html(data).jcarousel({ vertical: true, scroll: 2 });
    $("ul.listSkol li:even").addClass("even");
    $("ul.listSkol li:odd").addClass("odd");
    }
    }
    });
    return false;
    });
    */

    $("#btnAconpanhe").click(function() {
        $.ajax({
            type: 'GET',
            dataType: "json",
            url: $(this).attr("href"),
            success: function(json) {
                if (json.msg == "ok") {
                    $("#btnAconpanhe").fadeOut();
                    //AtualizaNovidades('blá', '1');
                }
            }
        });
        return false;
    });

    $("#btnSimFacul").click(function() {
        $(".exibeFacul").fadeIn();
    });

    $("#btnNaoFacul").click(function() {
        $("#inputCurso, #inputFacul").val("");
        $("#comboAnoTermino option:eq(0)").attr("selected", true);
        $(".exibeFacul").fadeOut("fast");
    });

    $("#scrollFlickr").removeClass("hide").jcarousel({ scroll: 3 });

    $("ul.navYoutubeFlickr li a").click(function() {
        $("ul.navYoutubeFlickr li a").removeClass("hover");
        $(this).addClass("hover").blur();
        $tab = $(this).attr("href");
        $("#boxYoutubeFlickr .content .tab").addClass("hide");
        $($tab).hide().removeClass("hide").fadeIn();
        return false;
    });
    $("ul.navYoutubeFlickr li a:first").trigger("click");

    $("#scrollYouTube").removeClass("hide").jcarousel({ scroll: 3 });
    $("#scrollYouTube ul li a").click(function() {
        if (!($(this).hasClass("boxYoutube"))) {
            var regex = "/&amp;/g";
            $location = $(this).parent().find("ul.infosVideoDetalhe");
            $novidades = $.trim($location.find("li:eq(0)").html());
            $novidadesUrl = $.trim($location.find("li:eq(1)").html());
            $pontuacaoMedia = $.trim($location.find("li:eq(2)").html());
            $pontuado = $.trim($location.find("li:eq(3)").html());
            $pontuadoUrl = $.trim($location.find("li:eq(4)").html());
            $favoritado = $.trim($location.find("li:eq(5)").html());
            $favoritoUrl = $.trim($location.find("li:eq(6)").html());
            $compartilhe = $.trim($location.find("li:eq(7)").html());
            $compartilheId = $.trim($location.find("li:eq(8)").html());
            $videoID = $.trim($location.find("li:eq(9)").html());
            $compartilharUrl = $.trim($location.find('li[rel="compartilharUrl"]').html()).replace(eval(regex), "&");
            $fraseTwitter = $.trim($location.find('li[rel="fraseTwitter"]').html()).replace(eval(regex), "&");
            $compartilharTitle = $.trim($location.find('li[rel="compartilharTitle"]').html()).replace(eval(regex), "&");
            $cemailcomplete = $.trim($location.find('li[rel="cemailcomplete"]').html()).replace(eval(regex), "&");
            $cfavoritos = $.trim($location.find('li[rel="cfavoritos"]').html()).replace(eval(regex), "&");
            $cfacebook = $.trim($location.find('li[rel="cfacebook"]').html()).replace(eval(regex), "&");
            $ctwitter = $.trim($location.find('li[rel="ctwitter"]').html()).replace(eval(regex), "&");
            $cdelicious = $.trim($location.find('li[rel="cdelicious"]').html()).replace(eval(regex), "&");
            $cmyspace = $.trim($location.find('li[rel="cmyspace"]').html()).replace(eval(regex), "&");
            $cgoogle = $.trim($location.find('li[rel="cgoogle"]').html()).replace(eval(regex), "&");
            $clive = $.trim($location.find('li[rel="clive"]').html()).replace(eval(regex), "&");

            $("#flashYoutube").flash({ src: '/swf/player.swf', quality: 'autohigh', AllowFullScreen: 'true', width: 363, height: 275, wmode: 'transparent', AllowScriptAccess: 'always', flashvars: {
                videoID: $videoID, logo: '', logoX: '', logoY: '', bg: '', bgX: '', bgY: '', label: '', title: '', text: '', angle: 0, side: 'left', link: '', audio_list: '',
                novidades: $novidades,
                novidadesUrl: $novidadesUrl,
                pontuacaoMedia: $pontuacaoMedia,
                pontuado: $pontuado,
                pontuadoUrl: $pontuadoUrl,
                favoritado: $favoritado,
                favoritoUrl: $favoritoUrl,
                compartilhe: $compartilhe,
                compartilheId: $compartilheId,
                compartilharUrl: $compartilharUrl, // url desse conteudo em urlencode
                fraseTwitter: $fraseTwitter, // frase do twitter a ser compartilhada
                compartilharTitle: $compartilharTitle,  // titulo para os links
                cemailcomplete: $cemailcomplete,
                cfavoritos: $cfavoritos,
                cfacebook: $cfacebook,
                ctwitter: $ctwitter,
                cdelicious: $cdelicious,
                cmyspace: $cmyspace,
                cgoogle: $cgoogle,
                clive: $clive
            }
            }, { version: 9 });
            return false;
        };
    });

    $("#scrollFlickrSobre").removeClass("hide").jcarousel({ scroll: 1 });
    $scrollTb = setTimeout('$("#holder393x333").jScrollPane({ scrollbarWidth: 19, scrollbarMargin: 10, showArrows: false })', 500);

    $("#boxTwitterVerao .scrollInner").jScrollPane({ scrollbarWidth: 46, scrollbarMargin: 8, showArrows: false }).end().find(".jScrollPaneDrag").addClass("fix");

    $(".history ul li:last").addClass("last");

    $("a.btnHistorico").click(function() {
        $(this).next().animate({ width: "toggle" }, 500, "easeInOutCirc");
        return false;
    });

    $(".navGaleriaMidias li img, .navGaleriaMidias li h3").click(function() {
        window.location = $(this).parents("li").find("a").attr("href");
        return false;
    });

    $("ul.navGaleriaMidias.videos li").append('<span class="icoPlay"></span>');



    $("input + label").live("click", function() {
        if ($(this).prev().attr("type") == 'checkbox') {
            if ($(this).prev().is(":checked")) {
                $(this).prev().attr("checked", false);
            } else {
                $(this).prev().attr("checked", true);
            }
        } else {
            $(this).prev().attr("checked", true);
        }
    });

    $(".percentualCadastro .txt span, .percentualLogin .txt span, .percentualCadastroUsuario .txt span, .percentualCadastroComplementar .txt span").each(function() {
        $val = $(this).html();
        $(this).parent().parent().find(".barra span").css("width", $val + "%");
    });

    $(".uploadFoto").each(function() {
        if ($(this).hasClass("fotoRep")) {
            $urlImgUpload = "/img/btn-incluirFoto.gif";
            $widthImgUpload = "84";
            $heightImgUpload = "17";
        } else {
            $urlImgUpload = "/img/btn-inserir.gif";
            $widthImgUpload = "93";
            $heightImgUpload = "17";
        }
        $(".uploadFoto").fileUpload({
            buttonImg: $urlImgUpload,
            width: $widthImgUpload,
            height: $heightImgUpload,
            uploader: '/swf/uploader.swf',
            script: '/site/cadastro/upload.ashx',
            folder: '/upload/temp',
            cancelImg: '/img/cancel.png',
            sizeLimit: '5000000',
            buttonText: 'Enviar',
            wmode: 'transparent',
            onComplete: function(event, queueID, fileObj, reposnse, data) {
                if ($(".uploadFoto").parents("form").attr("id") == "formCadastro") {
                    $localFoto = "cadastro";
                }
                else {
                    $localFoto = "meusdados";
                }
                //alert(reposnse);
                if (reposnse == 'erro') {
                    alert("Formato de imagem invalido");
                    pageTracker._trackPageview("/skol/" + $localFoto + "/suafoto/erro");
                } else {

                    $("#filesUploaded").html('<img src="' + escape(reposnse) + '" width="140" height="140" />');
                    $("#inputFileName").val(reposnse);
                    var txt = '<img id="jcropTarget" src="' + escape(reposnse) + '" />';

                    $.prompt(txt, {
                        buttons: { Ok: true }
                    });
                    $showCoords = function(c) {
                        // Parâmetros retornados pelo jCrop, e que serão utilizados para criar imagem via Server:
                        $("#x").val(c.x);
                        $("#y").val(c.y);
                        $("#x2").val(c.x2);
                        $("#y2").val(c.y2);
                        $("#w").val(c.w);
                        $("#h").val(c.h);

                        // Apresentação de preview da imagem já com crop:
                        if (parseInt(c.w) > 0) {
                            // Obtem altura e largura da imagem original:
                            var imgHeight = $("#jcropTarget").height();
                            var imgWidth = $("#jcropTarget").width();

                            // Obtem altura e largura da área de crop:
                            var areaHeight = $("#filesUploaded").height();
                            var areaWidth = $("#filesUploaded").width();

                            // Determina a proporção entre imagem original e preview para os eixos X e Y:
                            var rx = areaWidth / c.w;
                            var ry = areaHeight / c.h;

                            // Desloca e transforma imagem original dentro da área de preview, para
                            // usuário visualizar como ficará a imagem final:
                            jQuery("#filesUploaded img").css({
                                width: Math.round(rx * imgWidth) + 'px',
                                height: Math.round(ry * imgHeight) + 'px',
                                marginLeft: '-' + Math.round(rx * c.x) + 'px',
                                marginTop: '-' + Math.round(ry * c.y) + 'px'
                            });
                        }
                    }
                    $("#jcropTarget").Jcrop({ onChange: $showCoords, onSelect: $showCoords, setSelect: [100, 100, 50, 50], aspectRatio: 4 / 4 });

                    pageTracker._trackPageview("/skol/" + $localFoto + "/suafoto/loading");
                }

            },
            auto: true
        });
    });

    $(".uploadFotoCincao").fileUpload({
        buttonImg: '/img/btn-enviarImg.gif',
        width: '347',
        height: '29',
        uploader: '/swf/uploader.swf',
        script: '/Site/Cincao/UploadFotoTemp.ashx',
        folder: '/upload/cincao/temp',
        cancelImg: '/img/cancel.png',
        sizeLimit: '5000000',
        buttonText: 'Enviar',
        wmode: 'transparent',
        onComplete: function(event, queueID, fileObj, reposnse, data) {
            //alert(reposnse);
            if (reposnse == 'erro') {
                alert("Formato de imagem invalido");
            } else {
                $("#filesUploaded").html('<span class="fix"></span><img src="' + escape(reposnse) + '" width="285" height="285" />');
                $("#inputFileName").val(reposnse);
                var txt = '<img id="jcropTarget" src="' + escape(reposnse) + '" />';

                $.prompt(txt, {
                    buttons: { Ok: true }
                });
                $showCoords = function(c) {
                    // Parâmetros retornados pelo jCrop, e que serão utilizados para criar imagem via PHP:
                    $("#x").val(c.x);
                    $("#y").val(c.y);
                    $("#x2").val(c.x2);
                    $("#y2").val(c.y2);
                    $("#w").val(c.w);
                    $("#h").val(c.h);

                    // Apresentação de preview da imagem já com crop:
                    if (parseInt(c.w) > 0) {
                        // Obtem altura e largura da imagem original:
                        var imgHeight = $("#jcropTarget").height();
                        var imgWidth = $("#jcropTarget").width();

                        // Obtem altura e largura da área de crop:
                        var areaHeight = $("#filesUploaded").height();
                        var areaWidth = $("#filesUploaded").width();

                        // Determina a proporção entre imagem original e preview para os eixos X e Y:
                        var rx = areaWidth / c.w;
                        var ry = areaHeight / c.h;

                        // Desloca e transforma imagem original dentro da área de preview, para
                        // usuário visualizar como ficará a imagem final:
                        jQuery("#filesUploaded img").css({
                            width: Math.round(rx * imgWidth) + 'px',
                            height: Math.round(ry * imgHeight) + 'px',
                            marginLeft: '-' + Math.round(rx * c.x) + 'px',
                            marginTop: '-' + Math.round(ry * c.y) + 'px'
                        });
                    }
                }
                $("#jcropTarget").Jcrop({ onChange: $showCoords, onSelect: $showCoords, setSelect: [100, 100, 50, 50], aspectRatio: 4 / 4 });

            }

        },
        auto: true
    });

    $('a.disableCincao').click(function() {
        return false;
    })

    $("a.btnExcluirFoto").click(function() {
        $(".boxExcluirFoto").fadeIn();
        return false;
    });
    $(".boxExcluirFoto a.btnNao").click(function() {
        $(".boxExcluirFoto").fadeOut();
        return false;
    });
    $(".boxExcluirFoto a.btnSim").click(function() {
        window.location = "/site/meusdados/apagarfoto.ashx";
    });

    $(".boxSearch .submit").click(function() {
        if ($(".boxSearch .search").val() == "" || $(".boxSearch .search").val() == "Buscar na Skol") {
            $(this).attr("src", "/img/bg-inputSubmit2.gif");
            $("#boxBuscaTop").fadeIn("fast");
            $(".contentLogin, .contentSenha, .contentLogado").fadeOut("fast");
        }
    });

    $(".boxSearch #inputBusca").keypress(function(e) {
        if (e.which == 13) {
            $(".boxSearch .submit").click();
        }
    });

    $(".boxSearch .search").keyup(function() {
        $("#boxBuscaTop .btnFechar").trigger("click");
    });

    $("#boxBuscaTop .btnFechar").click(function() {
        $(this).parent().fadeOut("fast");
        $("input.submit").attr("src", "/img/bg-inputSubmit.gif");
    });



    $(".ga").click(function() {
        $url = $(this).attr("rel");
        pageTracker._trackPageview($url);
    });

    $("a#btnDestacarPlayer, a#btnRadioSkol").click(function() {
        window.open('http://www.skol.com.br/radio/pop.htm', 'playmeskol', 'status=no , scrollbars=no ,width=811, height=415, top=50 , left=50');
        return false;
    });

    $("a.btnEnviarEmail").click(function() {
        $(".boxForm input.form, .boxForm textarea").val("").removeClass("error");
        $(".msgError").hide();
        $(".boxForm input:first").focus();
    });

    $("#formCadastro #login, #formMeusDados #login").blur(function() {
        $.ajax({
            type: 'GET',
            data: 'login=' + $("#formCadastro #login, #formMeusDados #login").val(),
            dataType: "json",
            url: '/site/cadastro/validaloginunico.ashx',
            success: function(json) {
                if (json.msg == "ok") {
                    $(".msgErrorCadastro").fadeOut();
                } else {
                    if ($("#formCadastro #login").val() != undefined) {
                        $locationValid = ".msgErrorCadastro";
                    }
                    else {
                        $locationValid = ".msgErrorCadastro p.big";
                    }
                    $($locationValid).html("<strong>Erro:</strong> " + json.erroMsg).parent().fadeIn();
                }
            }
        });
    });

    $("#formCadastro #apelido, #formMeusDados #apelido").blur(function() {
        $.ajax({
            type: 'GET',
            data: 'login=' + $("#formCadastro #apelido, #formMeusDados #apelido").val(),
            dataType: "json",
            url: '/site/cadastro/validaapelidounico.ashx',
            success: function(json) {
                if (json.msg == "ok") {
                    $(".msgErrorCadastro").fadeOut();
                } else {
                    $(".msgErrorCadastro").html("<strong>Erro:</strong> " + json.erroMsg).fadeIn();
                }
            }
        });
    });

    $("#formGuiaVerao").validate({ errorContainer: $(".msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'GET',
                data: $("#formGuiaVerao").serialize(),
                dataType: "json",
                url: '/site/nasareias/enviatrocaboa.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        $(".camposFormGuia").hide();
                        $(".msgSucesso").fadeIn("slow");
                    } else {
                        $("#formGuiaVerao .msgError").html("<strong>Erro:</strong> " + json.erroMsg).fadeIn();
                        $("input#email").addClass("error").val("").focus();
                    }
                }
            });
        }
    });
    $("h4#taEnviado").click(function() {
        $(".msgSucesso").hide();
        $("#formGuiaVerao input[type='text']").each(function() {
            $(this).val("").click().blur();
        });
        $(".camposFormGuia").fadeIn("slow");
    });

    $("#formEnviaEcards").validate({ errorContainer: $(".msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formEnviaEcards").serialize(),
                dataType: "json",
                url: '/site/futebol/enviaecard.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        $("#formEnviaEcards .camposForm").hide();
                        $("#formEnviaEcards .msgSucesso p:eq(0)").find("span").html($("#formEnviaEcards #inputSeuNome").val());
                        $("#formEnviaEcards .msgSucesso").fadeIn();
                    } else {
                        $("#formEnviaEcards .msgError").html("<strong>Erro:</strong> " + json.msgRetorno).fadeIn();
                    }
                }
            });
        }
    });

    $("a#btnEnviarMaisAmigos").click(function() {
        $(this).parent().hide();
        $("#amigoMsg, #amigoEmail, #amigoNome").val("").click().blur();
        $("#formEnviaEcards .camposForm").fadeIn();
        return false;
    });

    $("#formEmail").validate({ errorContainer: $(".msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formEmail").serialize(),
                dataType: "json",
                url: '/site/radio/compartilhe.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        pageTracker._trackPageview("/skol/radio/email/sucesso");
                        $(".boxForm").hide();
                        $(".boxSucesso").fadeIn();
                        setTimeout('tb_remove()', 4500);
                        setTimeout(function() {
                            $(".boxSucesso").hide();
                            $(".boxForm").show();
                            $(".boxForm input.form, .boxForm textarea").val("");
                        }, 5000);
                    } else {
                        $(".msgError").html("<span>Erro:</span> " + json.erroMsg).fadeIn();
                        pageTracker._trackPageview("/skol/radio/email/erro");
                    }
                }
            });
        }
    });

    $("#formCadastro").validate({ errorContainer: $(".msgErrorCadastro"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formCadastro").serialize(),
                dataType: "json",
                url: '/site/cadastro/salvar.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        $origem = $("#formCadastro #hdnOrigem").val();

                        if ($origem == "republica") {
                            pageTracker._trackPageview("/skol/tanaroda/republica/cadastro/sucesso");
                            window.location = "/republica/cadastro.aspx"
                        } if ($origem == "redondinha") {
                            pageTracker._trackPageview("/skol/tanaroda/redondinha/cadastro/sucesso");
                            window.location = "/cadastrocomplementar.aspx?origem=" + $origem;
                        } else {
                            pageTracker._trackPageview("/skol/tanaroda/republica/cadastro/erro");
                            window.location = "/cadastrocomplementar.aspx";
                        }
                    } else {
                        $origem = $("#formCadastro #hdnOrigem").val();

                        $(".msgErrorCadastro").html("<strong>Erro:</strong> " + json.erroMsg).fadeIn();
                        if ($origem == "republica") {
                            pageTracker._trackPageview("/skol/tanaroda/republica/cadastro/erro");
                        } if ($origem == "redondinha") {
                            pageTracker._trackPageview("/skol/tanaroda/redondinha/cadastro/erro");
                        } else {
                            pageTracker._trackPageview("/skol/cadastro/erro");
                        }
                    }
                }
            });
        }
    });

    $("#formSac").validate({ errorContainer: $(".msgErrorSac"),
        submitHandler: function() {
            $.ajax({
                type: 'GET',
                data: $("#formSac").serialize(),
                dataType: "json",
                url: '/site/institucional/sacenviar.ashx',
                success: function(json) {
                    $tipo = $("#formSac input[name='tipoPessoa']:checked").val();
                    if (json.msg == "ok") {
                        if ($tipo == 'PF') {
                            pageTracker._trackPageview("/skol/sac/pessoafisica/sucesso");
                        } else {
                            pageTracker._trackPageview("/skol/sac/pessoajuridica/sucesso");
                        }
                        $("#formSac .bg, #formSac #enviar").hide();
                        $("#formSac .confirmSucesso").fadeIn("slow");
                        window.location = "#";
                    }
                    else {
                        if ($tipo == 'PF') {
                            pageTracker._trackPageview("/skol/sac/pessoafisica/erro");
                        }
                        else {
                            pageTracker._trackPageview("/skol/sac/pessoajuridica/erro");
                        }
                        $("#formSac .bg, #formSac #enviar").hide();
                        $("#formSac .confirmErro").fadeIn("slow");
                        pageTracker._trackPageview("/skol/sac/erro");
                        window.location = "#";
                    }
                }
            });
        }
    });

    $(".btnNovaMsg").click(function() {
        $(this).parent().hide();
        $("#formSac .bg, #formSac #enviar").fadeIn("slow");
        $('#formSac #coment').val("").focus();
        return false;
    });

    /*$("input[name='tipoPessoa']").click(function() {
    $(".boxAlteraPF label.error").remove();
    $(".boxAlteraPF, .boxAlteraPJ").hide();
    $(".boxAlteraPF").fadeIn();
    });

	$("#inputPessoaJuridica").click(function() {
    $(".boxAlteraPJ label.error").remove();
    $(".boxAlteraPF, .boxAlteraPJ").hide();
    $(".boxAlteraPJ").fadeIn();
    });*/

    $("input[name='tipoPessoa'] + label, input[name='tipoPessoa']").click(function() {
        $val = $(this).parent().find("input:checked").val();
        $(".boxAlteraPF, .boxAlteraPJ").hide();
        if ($val == 'PF') {
            $(".boxAlteraPJ").find("input").removeClass("required");
            $(".boxAlteraPF").fadeIn().find("input").addClass("required");
        } else {
            $(".boxAlteraPF").find("input").removeClass("required");
            $(".boxAlteraPJ").fadeIn().find("input").addClass("required");
        }
    });

    $("#formSac input, #formCadastro input").live("keyup", function() {
        if ($(this).attr("maxlength") > 0 && $(this).attr("maxlength") < 10) {
            $cont = $(this).attr("tabindex");
            $val = $(this).val().replace("_", "").replace(" ", "");
            if ($val.length == $(this).attr("maxlength")) {
                $("input[tabindex='" + ++$cont + "']").focus();
            }
        }
    });

    $("#contentSkolWeb .menu ul").each(function() {
        $(this).find("li:last").addClass("last");
    });
    $("#contentSkolWeb .menu ul.expand").each(function() {
        $cont = 0;
        $(this).find("li:eq(2), li:eq(3)").addClass("last");
    });
    $("a.linkTotal").click(function() {
        $(this).blur();
        $(this).parents("ul").find("li").removeClass("last");

        $cont = 0;
        $(this).parents("ul").find("li").each(function() {
            $cont++;
        });

        $anterior = parseInt($cont - 2);
        $tamanhoInicial = "76px";
        $tamanhoFinal = parseInt($cont * 19) + "px";
        $posInicial = "57px";
        $posFinal = parseInt(($cont - 1) * 19) + "px";

        $(this).parents("ul").find("li:eq(" + $anterior + ")").addClass("last");

        if ($(this).hasClass("open")) {
            $(this).removeClass("open");
            $(this).parents("ul").animate({ height: $tamanhoInicial }, 600);
            $(this).parent().animate({ top: $posInicial }, 600);
            $("#contentSkolWeb .menu ul").find("li:eq(2), li:eq(3)").addClass("last");
        }
        else {
            $(this).addClass("open");
            $(this).parents("ul").animate({ height: $tamanhoFinal }, 600);
            $(this).parent().animate({ top: $posFinal }, 600);
        };

        return false;
    });

    $("ul.listBtnTabs li a").click(function() {
        $("ul.listBtnTabs li a").removeClass("hover");
        $(this).addClass("hover");
        $("ul.listTabs").hide();
        $($(this).attr("href")).fadeIn("slow");
        return false;
    });
    $("ul.listBtnTabs li a.hover").trigger("click");

    $(".btnPolitica, a.btnPoliticaPrivCincao").click(function() {
        $x = $(window).width() / 2 - 225;
        $y = $(window).height() / 2 - 227;
        $param = "status=0,toolbar=no,menubar=no,resizable=no,scrollbars=no,width=450,height=455,screenX=" + $x + ",screenY=" + $y;
        window.open("/tb/politicaPrivacidade.html", "politica", $param);
        //tb_show('', '/tb/politicaPrivacidade.html?keepThis=true&TB_iframe=true&width=450&height=455&modal=false', false);
    });

    $('a.tb, area.tb, .btnRegRepublica').live("click", function() {
        $verificaParam = $(this).attr('href').split('.')[1];
        $url = $verificaParam == "aspx" ? $(this).attr('href') + "?" : $(this).attr('href') + "&";
        $pagina = $(this).attr('href').split('.')[0];
        $pagina = $pagina.toLowerCase();

        if ($pagina == "tarefasuploadvideo") {
            $width = 328;
            $height = 329;
        } else {
            $width = 711;
            $height = 490;
        }

        parent.tb_show('', '/Republica/' + $url + 'keepThis=true&TB_iframe=true&width=' + $width + '&height=' + $height + '&modal=true', false);
        return false;
    });


    $(".btnTermos, .btnTermosCincao").click(function() {
        $x = $(window).width() / 2 - 225;
        $y = $(window).height() / 2 - 227;
        $param = "status=0,toolbar=no,menubar=no,resizable=no,scrollbars=no,width=450,height=455,screenX=" + $x + ",screenY=" + $y;
        window.open("/tb/termosUso.html", "termos", $param);
        //tb_show('', '/tb/termosUso.html?keepThis=true&TB_iframe=true&width=450&height=455&modal=false', false);
    });

    $(".contentCenterFotoFolia .jcarousel-next-horizontal, .contentCenterFotoFolia .jcarousel-prev-horizontal, .png").ifixpng();

    $("input.hint").hint();
    $("div.check").cssCheckbox();
    $("div.radio").cssRadio();
    $(".datanasc").mask("99/99/9999");
    $(".cep").mask("99999-999", { placeholder: " " });
    $(".cpf").mask("999.999.999-99", { placeholder: " " });
    $(".tel").mask("9999-9999", { placeholder: " " });

    $("#comboUfs").change(function() {
        $siglaUf = $(this).val();
        if ($siglaUf != "") {
            $.ajax({
                dataType: "html",
                url: '/site/municipios/listar.ashx?siglaUf=' + $siglaUf,
                success: function(html) {
                    $comboMunicipios = $("#comboMunicipios");
                    $comboMunicipios.html(html);
                    $comboMunicipios.attr("disabled", "");
                }
            });
        }
    });


    $("#formCadastroComplementar").validate({ errorLabelContainer: $(".msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formCadastroComplementar").serialize(),
                dataType: "json",
                url: '/site/cadastro/salvardadocomplementar.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        pageTracker._trackPageview("/skol/cadastro/complementar/sucesso");
                        $origem = $("#formCadastroComplementar #hdnOrigem").val();
                        if ($origem == "redondinha") window.location = "/redondinha/index.aspx?cadastro=sucesso";
                        else window.location = "/cadastrosucesso.aspx";
                    } else {
                        pageTracker._trackPageview("/skol/cadastro/complementar/erro");
                        $(".msgErrorCadastro").html("<strong>Erro:</strong> " + json.erroMsg).fadeIn();
                    }
                }
            });
        }
    });

    $("#formMeusDados").validate({ errorContainer: $(".msgErrorCadastro"),
        submitHandler: function() {
            $(".msgErrorCadastro").hide();
            $.ajax({
                type: 'POST',
                data: $("#formMeusDados").serialize(),
                dataType: "json",
                url: '/site/meusdados/salvar.ashx',
                success: function(json) {
                    if (json.msg == "ok") {

                        $("#formMeusDados .msgErrorCadastro p.big").html("Dados novos, vida nova.").parent().fadeIn();

                        if (json.reload == "True")
                            window.location = '/meusdadoscomplementares.aspx';

                        $(".percentualCadastro .txt span").each(function() {
                            $(this).html(json.percentualPreenchido)
                            $val = $(this).html();
                            $(this).parent().parent().find(".barra span").css("width", $val + "%");
                        });

                        $(".percentualCadastroComplementar .txt span").each(function() {
                            $(this).html(json.percentualComplementarPreenchido)
                            $val = $(this).html();
                            $(this).parent().parent().find(".barra span").css("width", $val + "%");
                        });

                        $(".percentualCadastroUsuario .txt span").each(function() {
                            $(this).html(json.percentualCadastroUsuario)
                            $val = $(this).html();
                            $(this).parent().parent().find(".barra span").css("width", $val + "%");
                        });
                        pageTracker._trackPageview("/skol/meusdados/sucesso");

                    } else {
                        if (json.erroMsg == "") {
                            switch (Math.floor(Math.random() * 3)) {
                                case 0:
                                    $txt = "Errinho b&aacute;sico.  Disfarce e preencha de novo.";
                                    break;
                                case 1:
                                    $txt = "Houston, we have a problem.";
                                    break;
                                case 2:
                                    $txt = "Resposta  e-e-e-e-errada!";
                                    break;
                            }
                        } else {
                            $txt = json.erroMsg;
                        }
                        $("#formMeusDados .msgErrorCadastro p.big").html($txt).parent().fadeIn();
                        pageTracker._trackPageview("/skol/meusdados/erro");
                    }
                }
            });
        }
    });

    $("#formMeusDadosComplementar").validate({ errorContainer: $(".msgErrorCadastro"),
        submitHandler: function() {
            $(".msgErrorCadastro").hide();
            $.ajax({
                type: 'POST',
                data: $("#formMeusDadosComplementar").serialize(),
                dataType: "json",
                url: '/site/meusdados/salvardadoscomplementares.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        pageTracker._trackPageview("/skol/meusdados/complementar/sucesso");
                        $(".msgErrorCadastro p.big").html("Cadastro atualizado com sucesso").parent().fadeIn();

                        if (json.reload == "True") {
                            window.location = '/meusdadoscomplementares.aspx';
                        }

                        $origem = $("#formMeusDadosComplementar #hdnOrigem").val();
                        if ($origem == "redondinha") window.location = '/redondinha/index.aspx?cadastro=sucesso';

                        $(".percentualCadastro .txt span").each(function() {
                            $(this).html(json.percentualPreenchido)
                            $val = $(this).html();
                            $(this).parent().parent().find(".barra span").css("width", $val + "%");
                        });

                        $(".percentualCadastroComplementar .txt span").each(function() {
                            $(this).html(json.percentualComplementarPreenchido)
                            $val = $(this).html();
                            $(this).parent().parent().find(".barra span").css("width", $val + "%");
                        });

                        $(".percentualCadastroUsuario .txt span").each(function() {
                            $(this).html(json.percentualCadastroUsuario)
                            $val = $(this).html();
                            $(this).parent().parent().find(".barra span").css("width", $val + "%");
                        });
                    } else {
                        pageTracker._trackPageview("/skol/meusdados/complementar/erro");
                        $(".msgErrorCadastro").html("<strong>Erro:</strong> " + json.erroMsg).fadeIn();
                    }
                }
            });
        }
    });

    $("#formMeusDadosAlterarSenha").validate({ errorContainer: $(".msgErrorCadastro"),
        submitHandler: function() {
            $(".msgErrorCadastro").hide();
            $.ajax({
                type: 'POST',
                data: $("#formMeusDadosAlterarSenha").serialize(),
                dataType: "json",
                url: '/site/meusdados/salvaralterarsenha.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        $(".msgErrorCadastro p.big").html("Senha alterada com sucesso").parent().fadeIn();

                        if (json.reload == "True")
                            window.location = '/meusdadoscomplementares.aspx';

                        $(".percentualCadastro .txt span").each(function() {
                            $(this).html(json.percentualPreenchido)
                            $val = $(this).html();
                            $(this).parent().parent().find(".barra span").css("width", $val + "%");
                        });

                        $(".percentualCadastroComplementar .txt span").each(function() {
                            $(this).html(json.percentualComplementarPreenchido)
                            $val = $(this).html();
                            $(this).parent().parent().find(".barra span").css("width", $val + "%");
                        });

                        $(".percentualCadastroUsuario .txt span").each(function() {
                            $(this).html(json.percentualCadastroUsuario)
                            $val = $(this).html();
                            $(this).parent().parent().find(".barra span").css("width", $val + "%");
                        });
                        pageTracker._trackPageview("/skol/meusdados/alterarsenha/sucesso");
                    } else {
                        $(".msgErrorCadastro").html("<strong>Erro:</strong> " + json.erroMsg).fadeIn();
                        pageTracker._trackPageview("/skol/meusdados/alterarsenha/erro");
                    }
                }
            });
        }
    });

    $("#formMeusDados .btnAlterarDados").click(function() {
        switch (Math.floor(Math.random() * 3)) {
            case 0:
                $txt = "Errinho b&aacute;sico.  Disfarce e preencha de novo.";
                break;
            case 1:
                $txt = "Houston, we have a problem.";
                break;
            case 2:
                $txt = "Resposta  e-e-e-e-errada!";
        }
        $("#formMeusDados .msgErrorCadastro p.big").html($txt);
    });

    /*$("ul.checkVisualizando li").live("click", function() {
    $(this).find("label").trigger("click");
    });*/

    $("#formNovidades ul.filtrar a").live("click", function() {
        $rel = $(this).attr("rel");
        if ($rel == "selecionarTodos") {
            $(".itemNews .checkbox label.hidden").trigger("click");
        } else {
            atualizarNovidades($rel);
        }
        return false;
    });

    $("#formFavoritos ul.filtrar a").live("click", function() {
        $rel = $(this).attr("rel");
        if ($rel == "selecionarTodos") {
            $(".itemNews .checkbox label.hidden").trigger("click");
        } else if ($rel == "apagar") {
            $.ajax({
                type: 'POST',
                data: $("#formFavoritos").serialize(),
                dataType: "json",
                url: '/site/favoritos/apagar.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        $("#formFavoritos").submit();
                    }
                }
            });
        }
        return false;
    });

    $(".telMeusDados, .contentFormMeusdados .cep, .contentFormMeusdados .cpf").click().blur();

    $("#formNovidades .itemNews .desc a.btnFechar").live("click", function() {
        $a = $(this);
        $val = $a.attr("href").split("#")[1];
        $.ajax({
            type: 'POST',
            dataType: "json",
            url: '/site/novidades/apagar.ashx?idConteudo=' + $val,
            success: function(json) {
                if (json.msg == "ok") {
                    $a.parents(".itemNews").fadeOut().end().remove();

                    $rel = $a.attr("rel");
                    $spanTotalNovidadesSkol = $("ul.navNovidades span.skol, a.btnNovidadesSkol small strong");
                    $spanTotalNovidadesUsuario = $("ul.navNovidades span.usuario, a.btnSuasNovidades small strong");
                    $spanTotalNovidades = $("div#boxNovidades span.total");

                    $totalNovidadesSkol = parseInt($spanTotalNovidadesSkol.html());
                    $totalNovidadesUsuario = parseInt($spanTotalNovidadesUsuario.html());
                    $totalNovidades = parseInt($spanTotalNovidades.html());

                    $exibirMsg = false;

                    if ($totalNovidadesSkol > 0) {
                        $spanTotalNovidadesSkol.html(--$totalNovidadesSkol);
                        $exibirMsg = true;
                    }

                    if ($rel == "usuario" && $totalNovidadesUsuario > 0) {
                        $spanTotalNovidadesUsuario.html(--$totalNovidadesUsuario);
                        $exibirMsg = true;
                    }

                    if ($totalNovidades > 0) {
                        $spanTotalNovidades.html(--$totalNovidades);
                        $exibirMsg = true;
                    }

                    if (($rel == "usuario" && $totalNovidadesUsuario == 0) || $totalNovidades == 0) {
                        $(".leftFiltro .itemNews").hide();
                        $(".leftFiltro .msgSemNovas").show();
                    }

                    if ($exibirMsg) {
                        $(".rightNews .msgNovidades").show();
                    }
                }
            }
        });
        return false;
    });

    $("#formFavoritos ul.navNews li a").click(function() {
        $("ul.navNews li a").removeClass("hover");
        $(this).addClass("hover");
        $idPilar = $(this).attr("href").split("#")[1];
        $("input[name='idPilar']").val($idPilar);
        $(".rightNews .target").html("&nbsp;<strong>Pesquisando...</strong>");
        carregarBoxFavoritos(true);
        return false;
    });

    $("#formFavoritos ul.listCategoria li ul li, #formFavoritos ul.checkVisualizando > li > label").live("click", function() {
        $(this).animate({ opacity: 1.0 }, 1000, function() {
            carregarBoxFavoritos(false);
        });
        return false;
    });



    $("#formNovidades ul.navNews li a").click(function() {
        $("ul.navNews li a").removeClass("hover");
        $(this).addClass("hover");
        $novidades = $(this).attr("rel");
        $("input[name='novidades']").val($novidades);
        $(".rightNews .target").html("&nbsp;<strong>Pesquisando...</strong>");
        carregarBoxNovidades(true);
        return false;
    });

    $("#formNovidades ul.listCategoria li ul li, #formNovidades ul.checkVisualizando > li > label").live("click", function() {
        $(this).animate({ opacity: 1.0 }, 1000, function() {
            carregarBoxNovidades(false);
        });
        return false;
    });

    $("#boxNovidades a.del").click(function() {
        $a = $(this);
        $val = $a.attr("href").split("#")[1];
        $.ajax({
            type: 'POST',
            dataType: "json",
            url: '/site/novidades/apagar.ashx?idConteudo=' + $val,
            success: function(json) {
                if (json.msg == "ok") {
                    $a.parent().fadeOut().end().remove();
                    $(".scrollerFavoritosSuas").slider({ orientation: "vertical", range: "min", min: 0, max: 100, value: 100, handle: ".scrollerFavoritosSuas-handle", change: $handleSliderChangeSuas, slide: $handleSliderSlideSuas }).find(".ui-slider-handle").css("margin-bottom", "-22px");
                    $(".scrollerFavoritosDaSkol").slider({ orientation: "vertical", range: "min", min: 0, max: 100, value: 100, handle: ".scrollerFavoritosSkol-handle", change: $handleSliderChangeDaSkol, slide: $handleSliderSlideDaSkol }).find(".ui-slider-handle").css("margin-bottom", "-22px");

                    $rel = $a.attr("rel");
                    $spanTotalNovidadesSkol = $("ul.navNovidades span.skol, a.btnNovidadesSkol small strong");
                    $spanTotalNovidadesUsuario = $("ul.navNovidades span.usuario, a.btnSuasNovidades small strong");
                    $spanTotalNovidades = $("div#boxNovidades span.total");

                    $totalNovidadesSkol = parseInt($spanTotalNovidadesSkol.html());
                    $totalNovidadesUsuario = parseInt($spanTotalNovidadesUsuario.html());
                    $totalNovidades = parseInt($spanTotalNovidades.html());

                    if ($totalNovidadesSkol > 0) {
                        $spanTotalNovidadesSkol.html(--$totalNovidadesSkol);
                    }

                    if ($rel == "usuario" && $totalNovidadesUsuario > 0) {
                        $spanTotalNovidadesUsuario.html(--$totalNovidadesUsuario);
                    }

                    if ($totalNovidades > 0) {
                        $spanTotalNovidades.html(--$totalNovidades);
                    }
                }
            }
        });
        return false;
    });

    $(".boxSearch .submit").click(function() {
        $val = $(".boxSearch .search").val();
        if ($val == "" || $val == "Buscar na Skol") {
            $(this).attr("src", "/img/bg-inputSubmit2.gif");
            $("#boxBuscaTop").fadeIn("fast");
            $(".contentLogin, .contentSenha, .contentLogado").fadeOut("fast");
        } else {
            window.location = "/busca/index.aspx?filtro=" + $val;
        }
    });

    $(".boxTwitterHome .boxOutrasCategorias ul li a, .boxTwitterInner .boxOutrasCategorias ul li a").click(function() {
        $("#scrollTwitter").html("Carregando...");
        $val = $(this).attr("href").split("#")[1];
        $txt = $(this).html();
        $(this).parents(".boxOutrasCategorias").fadeOut().prev().html($txt);
        $.ajax({
            type: "GET",
            dataType: "html",
            url: "/site/twitter/posts.ashx?perfil=" + $val,
            success: function(html) {
                if (html != "erro") {
                    $("#scrollTwitter").html(html).jcarousel({ vertical: true, scroll: 2 });
                    $("#scrollTwitter ul li:even").addClass("even");
                    $("#scrollTwitter ul li:odd").addClass("odd");
                }
            }
        });
        return false;
    });

    $("#btnAcompanhe").click(function() {
        $val = $(this).attr("href");
        $("#btnAcompanhe").fadeOut().hide();
        $.ajax({
            type: 'POST',
            dataType: "json",
            url: $val,
            success: function(json) {
                if (json.msg == "ok") {
                    AtualizaNovidades(json.msgRetorno, json.msgTotal);
                } else {
                    // fazer tratamento de erro
                }
            }
        });
        return false;
    });

    $(".boxSkolNewsHome .boxOutrasCategorias ul li a").click(function() {
        $("#scrollNews").html("Carregando...");
        $val = $(this).attr("href").split("#")[1];
        $txt = $(this).html();
        $(this).parents(".boxOutrasCategorias").fadeOut().prev().html($txt);
        $.ajax({
            type: "GET",
            dataType: "html",
            url: "/site/skolweb/newsajax.ashx?idPilar=" + $val,
            success: function(html) {
                if (html != "erro") {
                    $("#scrollNews").html(html).jcarousel({ vertical: true, scroll: 2 });
                    $("#scrollNews ul li:even").addClass("even");
                    $("#scrollNews ul li:odd").addClass("odd");
                }
            }
        });
        return false;
    });

    $(".boxOutrasCategorias").each(function() {
        $(this).hoverIntent(function() {
            $(this).stop("animate");
        }, function() {
            $(this).animate({ opacity: 1.0 }, 2000).slideUp();
        });
    });

    $(".foliaNewsFiltro").click(function() {
        $("input#hdnFiltro").val($(this).attr("href"));
        $("#formFoliaNews").submit();
        return false;
    });

    $(".boxVotacaoInner .bntVotar").not('.jaVotou').click(function() {
        $id = $(this).attr("href").split("#")[1];
        $.ajax({
            type: 'POST',
            dataType: "json",
            url: '/Site/Cincao/VotarImagem.ashx?imagem.Id=' + $id,
            success: function(json) {
                if (json.msg == "ok") {
                    window.location.reload(true);
                } else {
                    alert('Erro ao votar, tente novamente.');
                }
            }
        });
        return false;
    });

    $("#formEnviarFoto").validate({ errorLabelContainer: $(".msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formEnviarFoto").serialize(),
                dataType: "json",
                url: '/Site/Cincao/SalvarImagem.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        pageTracker._trackPageview('/skol/produtos/cincao/participe/lenviarfoto/sucesso/');
                        window.location = "EnviarFotos.aspx?resultado=ok#menuCincao";
                        window.location.reload(true);
                    } else if (json.msg == "limiteImagensAtingido") {
                        pageTracker._trackPageview('/skol/produtos/cincao/participe/lenviarfoto/sucesso/');
                        alert('Limite de imagens atingido.');
                    } else {
                        pageTracker._trackPageview('/skol/produtos/cincao/participe/lenviarfoto/erro/');
                        alert('Erro no envio, tente novamente.');
                    }
                }
            });
        }
    });

    $("#formCadastroCincaoComp").validate({ errorLabelContainer: $("span.msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formCadastroCincaoComp").serialize(),
                dataType: "json",
                url: '/site/meusdados/salvardadoscomplementares.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        $('#formCadastroCincaoComp').hide();
                        $('.msgSucesso').fadeIn();
                        /*setTimeout(function(){
                        parent.window.location = "EnviarFotos.aspx#menuCincao";
                        }, 3000);*/
                        $('a.btnFecharCpf, a.btnFecharCpf2').click(function() {
                            parent.location = "EnviarFotos.aspx#menuCincao";
                        });
                    } else {
                        $('span.msgError2').html('Erro: ' + json.erroMsg).fadeIn();
                    }
                }
            });
        }
    });

    $("#innerCpf").not(".senha").find("a.btnFecharCpf").click(function() {
        parent.tb_remove();
        parent.location = "Login.aspx?confirmarCpf=true";
    });

    $("#formLoginCincao").validate({ errorLabelContainer: $(".msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formLoginCincao").serialize(),
                dataType: "json",
                url: '/site/login/login.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        pageTracker._trackPageview('/skol/produtos/cincao/participe/login/sucesso/');
                        window.location = "EnviarFotos.aspx#menuCincao";
                    } else {
                        pageTracker._trackPageview('/skol/produtos/cincao/participe/login/erro/');
                        $('span.msgErrorLogin').fadeIn();
                    }
                }
            });
        }
    });

    $("#formCadastroCincao").validate({ errorContainer: $(".msgErrorCadastro"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formCadastroCincao").serialize(),
                dataType: "json",
                url: '/site/cadastro/salvar.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        $(".msgErrorLogin").fadeOut();
                        pageTracker._trackPageview('/skol/produtos/cincao/participe/cadastro/sucesso/');
                        window.location = "EnviarFotos.aspx#menuCincao";
                    } else {
                        $("#formCadastroCincao .msgErrorLogin").html("<strong>Erro:</strong> " + json.erroMsg).fadeIn();
                        pageTracker._trackPageview('/skol/produtos/cincao/participe/cadastro/erro/');
                    }
                }
            });
        }
    });

    $("#formCadastroCincao #inputLogin").blur(function() {
        $.ajax({
            type: 'GET',
            data: 'login=' + $("#formCadastroCincao #inputLogin").val(),
            dataType: "json",
            url: '/site/cadastro/validaloginunico.ashx',
            success: function(json) {
                if (json.msg == "ok") {
                    $(".msgErrorLogin").fadeOut();
                } else {
                    $("#formCadastroCincao .msgErrorLogin").html("<strong>Erro:</strong> " + json.erroMsg).fadeIn();
                }
            }
        });
    });

    $("#formEsqueciSenhaCincao").validate({ errorLabelContainer: $(".msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'GET',
                data: $("#formEsqueciSenhaCincao").serialize(),
                dataType: "json",
                url: '/site/login/esquecisenha.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        $('.contForm').hide();
                        $('.success').fadeIn();
                    } else {
                        $('.msgError2').html('Erro: ' + json.msgRetorno).fadeIn();
                    }
                }
            });
        }
    });

    $(".formRepublica").validate({ errorLabelContainer: $(".msgError"), errorContainer: $(".msgErrorTeaser"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formRepublica").serialize(),
                dataType: "json",
                url: "/Site/Republica/SalvarNotificacao.ashx",
                success: function(json) {
                    if (json.msg == "ok") {
                        $('.contFormTeaser').hide();
                        $("#formRepublica").addClass('noBg');
                        $('.msgSucessoTeaser').fadeIn();
                        pageTracker._trackPageview("/skol/tanaroda/republica/avisar/sucesso");
                    } else if (json.msg == "emailJaCadastrado") {
                        pageTracker._trackPageview("/skol/tanaroda/republica/avisar/erro");
                        //alert('E-mail ja cadastrado.');
                        $(".nomeEmail").hide();
                        $('.emailCadastrado').fadeIn();
                    } else {
                        pageTracker._trackPageview("/skol/tanaroda/republica/avisar/erro");
                        alert('Erro ao enviar cadastro.')
                    }
                }
            });
        }
    });

    $("#formRepublica .btnMandar").click(function() {
        if (!($('.alvoCheck').attr('checked'))) {
            $('span.erroCheck').addClass('showErroCheck');
            $('label.aceitoRepublica').css({ 'text-decoration': 'underline' });
        }
    });

    $('.formRepublica .aceitoRepublica').click(function() {
        if (!($(this).prev().attr('checked'))) {
            $('span.erroCheck').removeClass('showErroCheck');
            $('label.aceitoRepublica').css({ 'text-decoration': 'none' });
        };
    });

    $('a.btnVencedoresCincao, a.jaVotou').click(function() {
        return false;
    });

    $("a.openTb").prepend('<span class="lupa fix"></span>')

    $("a.openTb").hover(function() {
        $(this).find('span.lupa').show();
    }, function() {
        $(this).find('span.lupa').hide();
    });

    $("a.openTb").click(function() {
        $nomeImagem = $(this).attr('href');
        tb_show('', '/Cincao/Thickbox.aspx?&nomeImagem=' + $nomeImagem + '&keepThis=true&TB_iframe=true&width=550&height=527&modal=false', false);
        return false;
    });

    $("a.btnEsqueciSenhaCincao").click(function() {
        tb_show('', '/Cincao/EsqueciSenha.aspx?&keepThis=true&TB_iframe=true&width=568&height=337&modal=false', false);
        return false;
    });


    $(".resultadoBuscaCincao .pagination").prepend('<em class="navLeft"></em>').append('<em class="navRight"></em>');

    $(".twitterSurf ul li:even, .listNewsSurf li:even").addClass("even");
    $(".twitterSurf ul li:odd, .listNewsSurf li:odd").addClass("odd");

    $(".foto242x127 .inner a").attr("href", $(".listNewsSurf").find("h4:first a").attr("href"));

    $(".leftContTop ul.listNewsSurf li:first").addClass("first");

    $("a.btnOutrasCategorias").live("click", function() {
        if ($(this).next().is(":visible")) {
            $(this).removeClass("hover").next().slideUp();
        } else {
            $(this).addClass("hover").next().slideDown();
        }
        return false;
    });

});

jQuery.validator.addMethod("cpf", function(value, element) {
	cpf = value.toString().replace( /\.|\-/g, "" );
	var expReg = /^0+$|^1+$|^2+$|^3+$|^4+$|^5+$|^6+$|^7+$|^8+$|^9+$/;
	if (cpf.length != 11 || cpf.match(expReg) ){
		return false;
	}
	add = 0;
	for (i=0; i < 9; i ++){
		add += parseInt(cpf.charAt(i)) * (10 - i);
	}
	rev = 11 - (add % 11);
	
	if (rev == 10 || rev == 11)
		rev = 0;
		
	if (rev != parseInt(cpf.charAt(9))){
		return false;
	}	
	add = 0;
	for (i = 0; i < 10; i ++){
		add += parseInt(cpf.charAt(i)) * (11 - i);
	}
	rev = 11 - (add % 11);
	if (rev == 10 || rev == 11)
		rev = 0;
	
	if (rev != parseInt(cpf.charAt(10))){
		return false;
	}
	return true;
}, "Informe um CPF válido.");

// Posicionamento das fotos dentro da moldura, em SkolWeb/Fotos e SkolFolia/Fotos
$(window).load(function(){
	$(".fotoContainer").each(function(){
		if($(".fotoContainer img").parents(".left").hasClass("contentFotoFolia")){
			$altura = 362;
			$space = "-50px";
		}
		else{
			$altura = 395;
			$space = "-80px";
		}
		if($(".fotoContainer img").attr("height") > $altura){
			$(".fotoContainer img").css({ marginTop: $space });
		};
	});	
	$("#scrollerFotos ul li, .boxCombina ul li").each(function(){
		if($(this).parents(".boxCombina").hasClass("combinaNoticiaFolia")){
			$altura = 53;
			$space = "-8px";
		}
		else{
			$altura = 75;
			$space = "-14px";
		};		
		if($(this).find("img").attr("height") > $altura){
			$(this).find("img").css({ marginTop: $space });
		};
	});
});

/* HINT */
/**
* @author Remy Sharp
* @url http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/
*/
(function($) {

	$.fn.hint = function(blurClass) {
		if (!blurClass) {
			blurClass = 'blur';
		}

		return this.each(function() {
			// get jQuery version of 'this'
			var $input = $(this),

			// capture the rest of the variable to allow for reuse
      title = $input.attr('title'),
      $form = $(this.form),
      $win = $(window);

			function remove() {
				if ($input.val() === title && $input.hasClass(blurClass)) {
					$input.val('').removeClass(blurClass);
				}
			}

			// only apply logic if the element has the attribute
			if (title) {
				// on blur, set value to title attr if text is blank
				$input.blur(function() {
					if (this.value === '') {
						$input.val(title).addClass(blurClass);
					}
				}).focus(remove).blur(); // now change all inputs to title

				// clear the pre-defined text when form is submitted
				$form.submit(remove);
				$win.unload(remove); // handles Firefox's autocomplete
			}
		});
	};

})(jQuery);
/* HINT */

/* jquery.cssRadio */
jQuery.fn.cssRadio = function() {
	var context = this;

	jQuery("input[@type='radio'] + label", this)
		.each(function() {
			if (jQuery(this).prev()[0].checked)
				jQuery(this).addClass("checked");
		})
		.hover(
			function() { $(this).addClass("over"); },
			function() { $(this).removeClass("over"); }
			)
		.click(function() {
			jQuery("input[@type='radio'] + label", context)
				.each(function() {
					jQuery(this)
						.removeClass("over checked")
						.prev()[0].checked = false;
				});
			jQuery(this)
				.addClass("checked")
				.prev()[0].checked = true;
		})
		.prev().hide();
}
/* jquery.cssRadio */

/* jquery.cssCheckbox */
jQuery.fn.cssCheckbox = function() {
	jQuery("input[@type='checkbox'] + label", this)
		.each(function() {
			if (jQuery(this).prev()[0].checked)
				jQuery(this).addClass("checked");
		})
		.hover(
			function() { jQuery(this).addClass("over"); },
			function() { jQuery(this).removeClass("over"); }
		)
		.click(function() {
			jQuery(this)
				.toggleClass("checked");
				/*if ($(this).prev().is(":checked")) {
					$(this).prev().attr("checked", false);
				} else {
					$(this).prev().attr("checked", true);
				}*/
		})
	.prev().hide();
}
jQuery.fn.cssCheckboxAll = function() {
	jQuery("input[@type='checkbox'] + label", this).each(function() {
		if (!jQuery(this).prev()[0].checked) {
			jQuery(this).addClass("checked").prev()[0].checked = !jQuery(this).prev()[0].checked;
		}
	});
}
/* jquery.cssCheckbox */


/* 
* jquery.getUrlParam.js
*/
jQuery.fn.extend({
	/**
	* To get the document params:
	* @example value = $(document).getUrlParam("paramName");
	* 
	* To get the params of a html-attribut (uses src attribute)
	* @example value = $('#imgLink').getUrlParam("paramName");
	*/
	getUrlParam: function(strParamName) {
		strParamName = escape(unescape(strParamName));

		var returnVal = new Array();
		var qString = null;

		if ($(this).attr("nodeName") == "#document") {
			//document-handler

			if (window.location.search.search(strParamName) > -1) {

				qString = window.location.search.substr(1, window.location.search.length).split("&");
			}

		} else if ($(this).attr("src") != "undefined") {

			var strHref = $(this).attr("src")
			if (strHref.indexOf("?") > -1) {
				var strQueryString = strHref.substr(strHref.indexOf("?") + 1);
				qString = strQueryString.split("&");
			}
		} else if ($(this).attr("href") != "undefined") {

			var strHref = $(this).attr("href")
			if (strHref.indexOf("?") > -1) {
				var strQueryString = strHref.substr(strHref.indexOf("?") + 1);
				qString = strQueryString.split("&");
			}
		} else {
			return null;
		}

		if (qString == null) return null;

		for (var i = 0; i < qString.length; i++) {
			if (escape(unescape(qString[i].split("=")[0])) == strParamName) {
				returnVal.push(qString[i].split("=")[1]);
			}
		}

		if (returnVal.length == 0) return null;
		else if (returnVal.length == 1) return returnVal[0];
		else return returnVal;
	}
});

function openPolitica() {
        $x = $(window).width() / 2 - 225;
        $y = $(window).height() / 2 - 227;
        $param = "status=0,toolbar=no,menubar=no,resizable=no,scrollbars=no,width=450,height=455,screenX=" + $x + ",screenY=" + $y;
        window.open("/tb/politicaPrivacidade.html", "politica", $param);
        //tb_show('', '/tb/politicaPrivacidade.html?keepThis=true&TB_iframe=true&width=450&height=455&modal=false', false);
    };

function openTermos() {
        $x = $(window).width() / 2 - 225;
        $y = $(window).height() / 2 - 227;
        $param = "status=0,toolbar=no,menubar=no,resizable=no,scrollbars=no,width=450,height=455,screenX=" + $x + ",screenY=" + $y;
        window.open("/tb/termosUso.html", "termos", $param);
        //tb_show('', '/tb/termosUso.html?keepThis=true&TB_iframe=true&width=450&height=455&modal=false', false);
    };


function openConfirmaCpf(){
	tb_show('', '/Cincao/confirmaCpf.aspx?keepThis=true&TB_iframe=true&width=568&height=337&modal=true', false);
}

function jsCompartilhe(id, nome, email, tipoMidia) {
    tb_show('', '/site/util/compartilhar.ashx?id=' + id + '&nome=' + nome + '&email=' + email + '&tipoMidia=' + tipoMidia + '&keepThis=true&TB_iframe=true&width=213&height=211&modal=false', false);
}

function jsCompartilharCanal(idCanal, nome, email, url) {
    tb_show('', '/site/util/compartilharcanal.ashx?idCanal='+ idCanal +'&url=' + escape(url) + '&nome=' + escape(nome) + '&email=' + escape(email) +'&keepThis=true&TB_iframe=true&width=213&height=211&modal=false', false);
}

function favoritar() {
	var url = document.location.href;
	var title = document.title;
	if (window.sidebar) window.sidebar.addPanel(title, url, "");
	else if (window.opera && window.print) {
		var mbm = document.createElement("a");
		mbm.setAttribute("rel", "sidebar");
		mbm.setAttribute("href", url);
		mbm.setAttribute("title", title);
		mbm.click();
	}
	else if (document.all) { window.external.AddFavorite(url, title); }
}

function AtualizaNovidades(strConteudo, msgTotal) {
	$(".scrollerSuas .holder").html(strConteudo);
	$("ul.navNovidades li a span.usuario").html(msgTotal);
}

function AtualizaFavoritos(strConteudo, msgTotal) {
	$("#boxFavoritos span.total").html(msgTotal);
	$("#boxFavoritos .content ul").html(strConteudo);
}

function carregarNews($ul, $val) {
	$.ajax({
		type: 'GET',
		cache: true,
		dataType: "html",
		url: '/site/rss/item.ashx?skolRssFeed=' + $val,
		success: function(data) {
			if (data != '') {
				$ul.html(data).jcarousel({ vertical: true, scroll: 2 });
				$ul.find("li:even").addClass("even");
				$ul.find("li:odd").addClass("odd");
			}
		}
	});
}

function atualizarNovidades(acao) {
	$("#formNovidades ul.filtrar input#hdnTipoAcao").val(acao);
	$.ajax({
		type: 'POST',
		data: $("#formNovidades").serialize(),
		dataType: "json",
		url: '/site/novidades/atualizar.ashx',
		success: function(json) {
			if (json.msg == "ok") {
				$("#formNovidades #hdnAcaoRealizada").val(acao);
				carregarBoxNovidades(false);
			}
		}
	});
}

function paginarFoliaNews(page) {
    $("input#hdnPagina").val(page);
    $("#formFoliaNews").submit();
}

function paginarFoliaEventos(page) {
    $("input#hdnPagina").val(page);
    $("#formSelectFolia").submit();
}

function paginarNovidades(page) {
	$("#formNovidades div.navigationNews input#hdnPagina").val(page);
	//var targetOffset = $(".navigationNews").offset().top;
	//$("html,body").stop("animate").animate({scrollTop: targetOffset}, 1500);
	carregarBoxNovidades(false);
}

function paginarFavoritos(page) {
	$("div.navigationNews input#hdnPagina").val(page);
	carregarBoxFavoritos(false);
}

function flashFazerLoginBarra(usuarioId) {
    //alert("logar com id :" + usuarioId);
}

function carregarBoxNovidades(selecionarTudo) {
	$(".loadingWrapper").remove();
	$("body").append('<div class="loadingWrapper"><div class="flash"><div></div>').end().find(".loadingWrapper .flash").flash({ src: '/swf/loader_html.swf', quality: 'autohigh', width: 150, height: 100, wmode: 'transparent' }, { version: 9 });
	$(".loadingWrapper").fadeIn("fast", function(){
		$.ajax({
			type: 'POST',
			data: $("#formNovidades").serialize(),
			dataType: "html",
			url: '/Site/Novidades/BoxConteudo.ashx?selecionarTudo=' + selecionarTudo,
			success: function(data) {
				$(".loadingWrapper").fadeOut();
				$(".rightNews").html(data);
				$("div.check").cssCheckbox();
			}
		});
	});
}

function carregarBoxFavoritos(selecionarTudo) {	
	$(".loadingWrapper").remove();
	$("body").append('<div class="loadingWrapper"><div class="flash"><div></div>').end().find(".loadingWrapper .flash").flash({ src: '/swf/loader_html.swf', quality: 'autohigh', width: 150, height: 100, wmode: 'transparent' }, { version: 9 });
	$(".loadingWrapper").fadeIn("fast", function(){
		$.ajax({
			type: 'POST',
			data: $("#formFavoritos").serialize(),
			dataType: "html",
			url: '/Site/Favoritos/BoxConteudo.ashx?selecionarTudo=' + selecionarTudo,
			success: function(data) {
				$(".loadingWrapper").fadeOut();
				$(".rightNews").html(data);
				$("div.check").cssCheckbox();
			}
		});
	});
}

function paginarBusca(page) {
	$val = $("#formResultBusca input#hdnFiltro").val();
	window.location = "/busca/index.aspx?filtro=" + $val + "&page=" + page;
}

function paginarFotos(page) {
	$idCanal = $("#paginacaoGaleriaFotos input#hdnIdCanal").val();	
	if ($val == null) {
		$val = "";
	}
	window.location = "/skolweb/fotos.aspx?idCanal=" + $idCanal + "&page=" + page;
}

function paginarVideos(page) {
	$idCanal = $("#paginacaoGaleriaVideos input#hdnIdCanal").val();	
	if ($val == null) {
		$val = "";
	}
	window.location = "/skolweb/videos.aspx?idCanal=" + $idCanal + "&page=" + page;
}


function exibeProduto($class) {
	$(".itensProdutos .itemProduto").hide();
	$(".itensProdutos ." + $class).fadeIn("slow");
}

function ga(url){
	pageTracker._trackPageview(url);
}

function gaEvent(section,action,url){
	pageTracker._trackEvent(section, action, url);
}

function msgAlert($param){
    alert($param);
}

function formFavoritosPOG() {
    $("#formFavoritos .itemNews .desc a.btnFechar").live("click", function() {
        $a = $(this);
        $val = $a.attr("href").split("#")[1];
        $.ajax({
            type: 'POST',
            dataType: "json",
            url: '/site/favoritos/apagar.ashx?idConteudo=' + $val,
            success: function(json) {
                if (json.msg == "ok") {
                    $a.parents(".itemNews").fadeOut().end().remove();

                    $rel = $a.attr("rel");
                    $spanTotalFavoritosSkol = $("ul.navNews a.btnTodos small strong");
                    $spanTotalFavoritos = $("ul.navNews a.btn" + $rel + "Fav small strong, div#boxFavoritos span.total");

                    $totalFavoritosSkol = parseInt($spanTotalFavoritosSkol.html());
                    $totalFavoritos = parseInt($spanTotalFavoritos.html());

                    $exibirMsg = false;

                    if ($totalFavoritosSkol > 0) {
                        $spanTotalFavoritosSkol.html(--$totalFavoritosSkol);
                        $exibirMsg = true;
                    }

                    if ($totalFavoritos > 0) {
                        $spanTotalFavoritos.html(--$totalFavoritos);
                        $exibirMsg = true;
                    }

                    if ($totalFavoritos == 0) {
                        $(".leftFiltro .itemNews").hide();
                        $(".leftFiltro .msgSemNovas").show();
                    }

                    if ($exibirMsg) {
                        $(".rightNews .msgNovidades").show();
                    }
                }
            }
        });
        return false;
    });

    $("#boxFavoritos h4").live("click", function() {
        if ($("#boxFavoritos .content").hasClass("open")) {
            $("#boxFavoritos .content").animate({ marginTop: "0px", height: "25px" }, 500, "easeInOutCirc", function() {
                $(this).hide();
            });
        } else {
            $("#boxFavoritos .content").show().animate({ marginTop: "-157px", height: "193px" }, 500, "easeInOutCirc");
            $("#boxFavoritos .content").hoverIntent(function() {
                $(this).stop("animate");
            }, function() {
                $(this).animate({ opacity: 1.0 }, 2000).animate({ marginTop: "-0px", height: "0px" }, 500, "easeInOutCirc").removeClass("open");
            });
        }
        if ($("#boxNovidades .content").hasClass("open")) {
            $("a.btnCloseNovidades").trigger("click");
        }
        $("#boxFavoritos .content").toggleClass("open");
        return false;
    });

    $("#boxFavoritos, #boxNovidades").each(function() {
        if ($(this).find("span.total").length > 0 && $(this).find("span.total").html().length <= "3") {
            $(this).find("h4").removeClass("hide title2 title3");
        }
        else if ($(this).find("span.total").length > 0 && $(this).find("span.total").html().length <= "4") {
            $(this).find("h4").removeClass("hide").addClass("title2");
            $(this).find("span.total").css({ 'width': '36px' });
        }
        else {
            $(this).find("h4").removeClass("hide").addClass("title3");
            $(this).find("span.total").css({ 'width': '44px' });
        }
    });

    /* Slider favoritos */
    $handleSliderChangeDaSkol = function(e, ui) {
        var maxScroll = $(".scrollerDaSkol").attr("scrollHeight") - $(".scrollerDaSkol").height();
        $(".scrollerDaSkol").animate({ scrollTop: (100 - ui.value) * (maxScroll / 100) }, 1000);
    }
    $handleSliderSlideDaSkol = function(e, ui) {
        var maxScroll = $(".scrollerDaSkol").attr("scrollHeight") - $(".scrollerDaSkol").height();
        $(".scrollerDaSkol").attr({ scrollTop: (100 - ui.value) * (maxScroll / 100) });
    }

    $(".scrollerFavoritosDaSkol").slider({ orientation: "vertical", range: "min", min: 0, max: 100, value: 100, handle: ".scrollerFavoritosSkol-handle", change: $handleSliderChangeDaSkol, slide: $handleSliderSlideDaSkol }).find(".ui-slider-handle").css("margin-bottom", "-22px");

    $handleSliderChangeSuas = function(e, ui) {
        var maxScroll = $(".scrollerSuas").attr("scrollHeight") - $(".scrollerSuas").height();
        $(".scrollerSuas").animate({ scrollTop: (100 - ui.value) * (maxScroll / 100) }, 1000);
    }
    $handleSliderSlideSuas = function(e, ui) {
        var maxScroll = $(".scrollerSuas").attr("scrollHeight") - $(".scrollerSuas").height();
        $(".scrollerSuas").attr({ scrollTop: (100 - ui.value) * (maxScroll / 100) });
    }
    $(".scrollerFavoritosSuas").slider({ orientation: "vertical", range: "min", min: 0, max: 100, value: 100, handle: ".scrollerFavoritosSuas-handle", change: $handleSliderChangeSuas, slide: $handleSliderSlideSuas }).find(".ui-slider-handle").css("margin-bottom", "-22px");
    /* Slider favoritos */
}

function formNovidadesPOG() {
    $("#boxNovidades h4, a.btnCloseNovidades").click(function() {
        if ($("#boxNovidades .content").hasClass("open")) {
            $("#boxNovidades .content").animate({ marginTop: "-0px", height: "0px" }, 500, "easeInOutCirc");
        } else {
            $("#boxNovidades .content").animate({ marginTop: "-263px", height: "268px" }, 500, "easeInOutCirc");
            $("#boxNovidades .content").hoverIntent(function() {
                $(this).stop("animate");
            }, function() {
                $(this).animate({ opacity: 1.0 }, 2000).animate({ marginTop: "-0px", height: "0px" }, 500, "easeInOutCirc").removeClass("open");
            });
        }
        if ($("#boxFavoritos .content").hasClass("open")) {
            $("#boxFavoritos .content h4").trigger("click");
        }
        $("#boxNovidades .content").toggleClass("open");
        return false;
    });

    $("ul.navNovidades li").each(function() {
        if ($(this).find("span").html().length <= "2") {
            $(this).find("span").removeClass("btnNov2").end().find("a").removeClass("btnNov2");
        }
        else {
            $(this).find("span").addClass("btnNov2").end().find("a").addClass("btnNov2");
        }
    });

    /* Slider categorias */
    $(".sliderCategs").each(function() {
        $handleSliderChangeCategs = function(e, ui) {
            var maxScroll = $(this).prev().attr("scrollHeight") - $(this).prev().height();
            $(this).prev().animate({ scrollTop: (100 - ui.value) * (maxScroll / 100) }, 1000);
        }
        $handleSliderSlideCategs = function(e, ui) {
            var maxScroll = $(this).prev().attr("scrollHeight") - $(this).prev().height();
            $(this).prev().attr({ scrollTop: (100 - ui.value) * (maxScroll / 100) });
        }
        $(this).slider({ orientation: "vertical", range: "min", min: 0, max: 100, value: 100, change: $handleSliderChangeCategs, slide: $handleSliderSlideCategs });
    });
    $(".sliderCategs .ui-slider-handle").append("<span></span>");
    /* Slider categorias */

    $("ul.navNovidades li a").click(function() {
        $tab = $(this).attr("href").split("#")[1];
        $("#boxNovidades .tabs .tab").hide();
        $("ul.navNovidades li a").removeClass("hover");
        $(this).addClass("hover");
        $("." + $tab).fadeIn();
        return false;
    });
    $("ul.navNovidades li a:first").trigger("click");

}

function formLoginPOG() {
    
    $("#formLogin input.required, #formSenha input.required").focus(function() {
        $(this).parents(".boxLogin").addClass("open");
    }).blur(function() {
        $(this).parents(".boxLogin").removeClass("open");
    });

    $("a.btnLoginSkol").click(function() {
        if ($(this).next().is(":visible") || $(".contentSenha").is(":visible")) {
            $(this).removeClass("hover");
            $(".contentLogin, .contentSenha").slideUp();
        } else {
            $(this).addClass("hover").next().slideDown();
            $("#boxBuscaTop").slideUp("fast");
            $(".boxSearch .submit").attr("src", "/img/bg-inputSubmit.gif");
            pageTracker._trackPageview("/skol/login");
        }
        return false;
    });

    $(".contentLogin, .contentSenha, .contentLogado").hoverIntent(function() {
        $(".contentLogin, .contentSenha, .contentLogado").stop("animate");
    }, function() {
        if (!($(".boxLogin").hasClass("open"))) {
            $(this).animate({ opacity: 1.0 }, 2000, function() {
                $(this).slideUp("fast");
                $("a.btnLoginSkol").removeClass("hover");
            });
        };
    });

    $(".contentLogin a.btnEsqueciSenha").click(function() {
        $(".contentLogin, .errorSenha, .sucessSenha").hide();
        $(".contentSenha, .formSenha").show();
        $(".formSenha input[type='text']").removeClass("error").val("").focus();
        pageTracker._trackPageview("/skol/login/esquecisenha");
        return false;
    });

    $(".contentSenha a.btnVoltarLogin124x25, .contentSenha a.btnVoltarLogin116x19").click(function() {
        $(".contentSenha").hide();
        $(".contentLogin").show();
        return false;
    });

    $("a.btnLogado").click(function() {
        $(".boxLogado .contentLogado").toggle();
        return false;
    });

    $verificaClick = false;
    $("#formLogin").validate({ errorLabelContainer: $(".msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'POST',
                data: $("#formLogin").serialize(),
                dataType: "json",
                url: '/site/login/login.ashx',
                success: function(json) {
                    if (json.msg == "ok") {
                        pageTracker._trackPageview("/skol/login/sucesso");
                        location.reload(true);
                        /*if (json.percentualCadastroUsuario < 100) {
                        window.location = '/meusdados.aspx'
                        } else if (json.percentualCadastroComplementar < 100) {
                        window.location = '/meusdadoscomplementares.aspx'
                        } else {
                        location.reload(true);
                        }*/
                    } else {
                        $(".formLogin, .formLoginError div").hide();
                        if (json.msg == "loginUserError") {
                            $(".formLoginError").show().find(".login").fadeIn();
                            pageTracker._trackPageview("/skol/login/erro");
                        } else {
                            $(".formLoginError").show().find(".senha").fadeIn();
                            pageTracker._trackPageview("/skol/login/erro");
                        }
                    }
                }
            });
        }
    });

    $(".formLoginError a.btnVoltarLogin116x19").click(function() {
        $(".formLoginError").hide();
        $(".formLogin").fadeIn();
        return false;
    });

    $("#formSenha").validate({ errorLabelContainer: $(".msgError"),
        submitHandler: function() {
            $.ajax({
                type: 'GET',
                data: $("#formSenha").serialize(),
                dataType: "json",
                url: '/site/login/esquecisenha.ashx',
                success: function(json) {
                    $(".formSenha, .errorSenha, .sucessSenha").hide();
                    if (json.msg == "ok") {
                        $(".sucessSenha").show();
                        pageTracker._trackPageview("/skol/login/esquecisenha/sucesso");
                    } else {
                        $(".errorSenha").show();
                        pageTracker._trackPageview("/skol/login/esquecisenha/erro");
                    }
                }
            });
        }
    });
}