﻿var indexBanner = 0;
function validarInvite() {

    $("#divEnvieAmigos ul li input").unbind("blur").blur(function() {
        $("#aspnetForm").validationEngine({ returnIsValid: true });
    });

    return $("#aspnetForm").validationEngine({ returnIsValid: true });
}

$(function() {
    //carregarPostBlog();
    //carregarTweets();

    /*$("#divNavegacaoHeader #menu ul li a").click(function(e) {
    e.preventDefault();
    var target = $(this).attr("href");
    var el = $(target.substring(target.indexOf("#"));

        if(el.length > 0) {
    $.scrollTo(el. 800);
    }
    else {
    window.location = target;
    }
    });*/
    //CHECAR PRIMEIRO ACESSO
    /*var FIRST_ACCESS_TOKEN = "VIVOSELECAOENTRY"
    if(!$.cookie(FIRST_ACCESS_TOKEN))
    {
    $.cookie(FIRST_ACCESS_TOKEN,  'ENTRYPOINT', { path: '/', expires: 365 });
    window.location = '/ComoFunciona/';
    }*/


    $("#divComoFunciona a.btConvide").click(function(e) {
        e.preventDefault();
        $("#divEnvieAmigos").css('top', centralizaFeedback($("#divEnvieAmigos").height()));
        $("#divEnvieAmigos").show();
        $("#divOverlayBlack").show();

        $("#divOverlayBlack").click(function(e) {
            e.preventDefault();
            $("#divEnvieAmigos").hide();
            $("#divOverlayBlack").hide();
        });

        $("#divEnvieAmigos a.fechar").click(function(e) {
            e.preventDefault();
            $("#divEnvieAmigos").hide();
            $("#divOverlayBlack").hide();
        });

    });

    $("li.lnkVoceSabia a").click(function() {
        e.preventDefault();
        var target = $(this).attr("href");
        var el = $(target.substring(target.indexOf("#")));

        if (el.length > 0) {
            $.scrollTo(el, 800);
        }
        else
            window.location = target;
    });

    $("#divEnvieAmigos a.btEnviar").click(function(e) {
        e.preventDefault();

        var valid = validarInvite();

        if (!valid)
            return;

        var nome = $("input.nome").val();

        var destinatarios = "";

        $("input.email", $(this).parents("ul")).each(function(i) {
            if ($(this).val() != "") {
                if (i == 0)
                    destinatarios = $(this).val();
                else
                    destinatarios += "," + $(this).val();

            }
        });


        $.post("/Util/Services/sendInvite.aspx", { ds: destinatarios, nm: nome }, function(ret) {

            if (ret.message == "ok") {
                alert("Convites enviados com sucesso");
                $("#divEnvieAmigos").hide();
                $("#divOverlayBlack").hide();
            }
            else {
                alert(ret.message);
            }


        }, "json");

    });


    $(".formError").live("click", function() {	 // REMOVE BOX ON CLICK
        $(this).fadeOut(150, function() {
            $(this).remove();
        })
    })

    $(window).load(function() {

        if ($("#divRankingAnterior").size() > 0) {
            $("#divRanking").addClass("rankingAnterior");
        }

        //if ($("#divWrapperHeader").length > 0) {
        //$.scrollTo('#divHeaderRedesSociais', 800, { onAfter: function() {
        checkFirstLogin();

        if (PARAMS.getUrlVar("s") == "true") {
            exibirFeedback("cadastro");
        }
        else if (PARAMS.getUrlVar("s") == "false") {
            alert("Ocorreu um erro ao efetuar o cadastro, favor tentar mais tarde!");
        }

        if (PARAMS.getUrlVar("f") == "true") {
            exibirFeedback("faleconosco");
        }
        else if (PARAMS.getUrlVar("f") == "false") {
            alert("Ocorreu um erro ao enviar a mensagem, favor tentar mais tarde!");
        }

        if (PARAMS.getUrlVar("m") == "true") {
            exibirFeedback("migracao");
        }
        else if (PARAMS.getUrlVar("m") == "false") {
            alert("Ocorreu um erro ao migrar seu cadastro, favor tentar mais tarde!");
        }
        //}
        //});
        //}
        //else {
        /// checkFirstLogin();
        //}

        $("#divMeusPontos table tr.itens").each(function() {
            var valorAtualMoedaAmarela = parseInt($("#divMeusPontos table tr.footer td:eq(1)").text());
            var valorAtualMoedaAzul = parseInt($("#divMeusPontos table tr.footer td:eq(2)").text());
            var valorAtualMoedaVerde = parseInt($("#divMeusPontos table tr.footer td:eq(3)").text());
            var valorPontosAtual = parseInt($("#divMeusPontos table tr.footer td:eq(4)").text());

            $("#divMeusPontos table tr.footer td:eq(1)").text(valorAtualMoedaAmarela + parseInt($("td:eq(1)", $(this)).text()));
            $("#divMeusPontos table tr.footer td:eq(2)").text(valorAtualMoedaAzul + parseInt($("td:eq(2)", $(this)).text()));
            $("#divMeusPontos table tr.footer td:eq(3)").text(valorAtualMoedaVerde + parseInt($("td:eq(3)", $(this)).text()));
            $("#divMeusPontos table tr.footer td:eq(4)").text(valorPontosAtual + parseInt($("td:eq(4)", $(this)).text()));



            $("#divMeusPontos table tr.footer td:eq(5)").text(valorPontosAtual + parseInt($("td:eq(4)", $(this)).text()));

        });


        //		else if ($("#divWrapperHeader.visibleunlogged").length > 0) {
        //			$("#divBarraPerfil").show();
        //			$("#divBarraPerfil a.btEsconderPerfil").hide();
        //			$("#divBarraPerfil a.btVerPerfil").show();
        //		}
        //		
        //		$("#divBarraPerfil a.btVerPerfil, #divBarraPerfil a.btEsconderPerfil, #divBarraPerfil a.btFacaSeuLogin").click(function(e) {
        //			e.preventDefault();
        //			toggleHeader(e);
        //		});	

        $(".scroll-horizontal-pane").not(".scroll-applied").jContentSlider();
        $("#divFooter").css("bottom", 0);

        /* TV FLASH */
        if ($("#divTvFlash > div.rotate").length > 1) {
            setInterval(function() {
                if (indexBanner < ($("#divTvFlash > div.rotate").length - 1))
                    indexBanner++;
                else
                    indexBanner = 0;
                $("#divAbasBigBanner ul li a:eq(" + indexBanner + ")").click();
            }, 10000);
        } else $("#divAbasBigBanner").hide();
    });

    $("#divTvFlash > div.rotate:eq(0)").addClass("show");
    $("#divAbasBigBanner ul li:eq(0)").addClass("on");

    $("#divAbasBigBanner ul li a").click(function(e) {
        e.preventDefault();
        var index = $(this).parent().index("#divAbasBigBanner ul li");

        $("#divAbasBigBanner ul li.on").removeClass("on");
        $(this).parent().addClass("on");
        indexBanner = index;
        if ($("#divTvFlash > div.rotate:visible").length > 0) {
            $("#divTvFlash > div.rotate:visible").fadeOut(function() {
                $("#divTvFlash > div.rotate:eq(" + index + ")").fadeIn();
            });
        }
        else {
            $("#divTvFlash > div.rotate:eq(" + index + ")").fadeIn();
        }
    });

    $("#divPerfilAvatar a.monteAvatar").click(function(e) {
        e.preventDefault();
        avatarEditar("criar");
    });

    $("#divFeedbackLoginInicial a.btMontarAvatar").click(function(el) {
        el.preventDefault();
        $("#divFeedbackLoginInicial").hide();
        $("#divOverlay").hide();
        //google analytics
        pageTracker._trackEvent("login", "primeiroLogin", "montarAvatar");
        avatarEditar("criar");
    });

    $("#divHeader #divLogin fieldset ul.redes li.facebook a").click(function(e) {
        e.preventDefault();
        FB.Connect.requireSession(function() {
            FB.Connect.ifUserConnected(function(uid) {


                $.post("/Util/Services/getFacebookUser.aspx",
					{ uid: uid },
					function(ret) {
					    if (ret == 0) {
					        alert("Seu usuário do Facebook não está relacionado a nenhum cadastro");
					    } else if (ret == 1) {
					        window.location = window.location.pathname;
					    }
					});
            }, function() {
                //alert( "User not connected" );
            });
        });
    });

    $("#divLogin a.btEsqueciSenha").click(function(e) {
        e.preventDefault();
        //google analytics
        pageTracker._trackEvent("login", "esqueciMinhaSenha", "AbrirFormulario");
        $("#divHeaderPrincipalLogin #divLogin").hide();
        $("#divHeaderPrincipalLogin #divEsqueciSenha").show();
    });

    $("#divEsqueciSenha button").click(function(e) {
        e.preventDefault();
        //google analytics
        pageTracker._trackEvent("login", "esqueciMinhaSenha", "enviarFormulario");
        $("#divHeaderPrincipalLogin #divEsqueciSenha").hide();
        $("#divHeaderPrincipalLogin #divLogin").show();
    });

    $("#tabs").tabs();
    $("#divRanking").tabs({ selected: 0, show: function(e, ui) { $("#divRanking .scroll-horizontal-pane").jContentSlider(); } });

    $('#divHeaderPremios').flash(
    {
        src: '/Util/Swf/HeaderPremios.swf',
        width: 470,
        height: 290,
        id: "flashHeaderPremios",
        wmode: 'transparent'
    },
		{ expressInstall: true }
    );

    /*
    /*$('#divPerfilAvatar').flash(
    {
    src: '/Util/Swf/Shell.swf',
    width: 346,
    height: 410,
    wmode: 'transparent',
    flashvars: { guid: uniqueId, application: "Perfil.swf" }
    },
    { expressInstall: true }
    );
	
	$('#divAvatarHeader').flash(
    {
    src: '/Util/Swf/HeaderAvatar.swf',
    width: 480,
    height: 293,
    wmode: 'transparent'
    },
    { expressInstall: true }
    );*/

    /* SHOPPING */
    if ($("#divShopping #divExtratoShopping").length > 0) {
        $.getJSON("/Util/Services/recuperarCarrinho.aspx",
			function(ret, status) {
			    $("#divExtratoShopping p.error").remove();
			    if (status != "success") { $("#divExtratoShopping input").before($("<p />").addClass('error').text("Ocorreu um erro ao tentar recuperar seu carrinho. Por favor, tente novamente em instantes.")); return false; }

			    if (ret.code == 0) {
			        atualizaCarrinho(ret, null, true);
			    }
			}

		);
    }

    $("#divShopping #divListagemProdutos ul li button").click(function(e) {
        e.preventDefault();
        var id = $(this).attr("pId");
        var $this = $(this);
        $(this).parent().effect("transfer", { to: '#divExtratoShopping', className: 'ui-effects-transfer' }, 500,
			function() {
			    $.getJSON("/Util/Services/adicionarItemCarrinho.aspx",
					{ pId: id },
					function(ret, status) {
					    $("#divExtratoShopping p.error").remove();
					    if (status != "success") { $("#divExtratoShopping input").before($("<p />").addClass('error').text("Ocorreu um erro ao tentar adicionar seu produto ao carrinho. Por favor, tente novamente em instantes.")); return false; }

					    if (ret.code == 0) {
					        atualizaCarrinho(ret, $this, true);
					        //google analytics
					        pageTracker._trackEvent("shopping", "comprarItem");
					    }
					    else if (ret.code == -1) {
					        $("#divExtratoShopping input").before($("<p />").addClass('error').text(ret.mensagem));
					    }
					}

				);
			}
		);
    });

    $("#divExtratoShopping ul li a").live("click", function(e) {
        e.preventDefault();
        var id = $(this).attr("pId");
        var $this = $(this);
        $(this).parent().effect("transfer", { to: '#divListagemProdutos', className: 'ui-effects-transfer' }, 500,
			function() {
			    $.getJSON("/Util/Services/removerItemCarrinho.aspx",
					{ pId: id },
					function(ret, status) {
					    $("#divExtratoShopping p.error").remove();
					    if (status != "success") { $("#divExtratoShopping input").before($("<p />").addClass('error').text('Ocorreu um erro ao tentar remover seu produto do carrinho. Por favor, tente novamente em instantes.')); return false; }

					    if (ret.code == 0) {
					        atualizaCarrinho(ret, $this, false);
					        //google analytics
					        pageTracker._trackEvent("shopping", "removerItem");
					    }
					    else if (ret.code == -1) {
					        $("#divExtratoShopping input").before($("<p />").addClass('error').text(ret.mensagem));
					    }
					}

				);
			}
		);
    });

    $("#divShopping #divExtratoShopping input").click(function(e) {
        e.preventDefault();

        $.getJSON("/Util/Services/finalizarCompra.aspx",
			function(ret, status) {
			    $("#divExtratoShopping p.error").remove();
			    if (status != "success") { $("#divExtratoShopping input").before($("<p />").addClass('error').text("Ocorreu um erro ao tentar finalizar a compra. Por favor, tente novamente em instantes.")); return false; }

			    if (ret.code == 0) {
			        atualizaCarrinho(ret, null, false);
			        $("#divExtratoShopping ul").remove();
			        $("#divExtratoShopping input")
						.before($("<p />").addClass('sucesso').html('Você finalizou sua compra. Os produtos estarão disponíveis nos seus acessórios'))
						.before($("<a />").attr("href", "").addClass('btAcessorios').text("Ver acessórios"))
						.hide();
			        atualizaSaldo();

			        //google analytics
			        pageTracker._trackEvent("shopping", "finalizarCompra");
			    }
			    else if (ret.code == -1) {

			        $("#divExtratoShopping input").before($("<p />").addClass('error').text(ret.mensagem));
			    }
			}

		);
    });

    $("#divShopping #divExtratoShopping a.btAcessorios").live("click", function(e) {
        e.preventDefault();
        //google analytics
        pageTracker._trackEvent("acessorios", "click", "shopping");
        avatarInventario();
    });

    /* MISC
    $("input[type=text]").focus(function() {
    if (this.value != '') {
    if (this.value == this.title) this.value = '';

            $(this).unbind("blur").blur(function() {
    if (this.value == '') this.value = this.title;
    });
    }
    }); */

    $("#divHeader #divHeaderPrincipalPerfil #divPerfilAtividades #divStatusAtividades ul li > div").hover(
		function(e) {
		    $(".balao", $(this).parent()).stop(true, true).show();
		},
		function() {
		    $(".balao", $(this).parent()).stop(true, true).hide();
		}
	);
    $("#divStatusAtividades ul li a").click(function(e) {
        e.preventDefault();
        var target = $(this).attr("href");
        var pageSession = target.replace("#tabs", "");
        if ($("#divExtrato:hidden").length > 0) {
            $("#divExtrato:hidden").stop(true, true).show("fast", function() {
                $("#divExtrato a[href=" + target + "]").click();
                //google analytics
                pageTracker._trackPageview("/Extrato/" + pageSession);
            });
        }
        else {
            //google analytics
            pageTracker._trackPageview("/Extrato/Atividades" + pageSession);
            $("#divExtrato a[href=" + target + "]").click();
        }
    });

    $("div.overElement a.btFechar").click(function(e) {
        e.preventDefault();
        boxFechar();
    });

    $("#divMenuVivo a.mnuVivo").click(function(e) {
        e.preventDefault();
        $(this).toggleClass("mnuVivoOn");
        $(this).prev().stop(true, true).toggle("slow");
    });

    if ($("input[id='ctl00_ctl00_mastercontent_content_chkSouColaborador']:checked").length != 0) {
        $('td.colaborador').show();
        $('a.chkAlt').attr('href', '/Regulamento/Colaborador/');
        $('#ctl00_ctl00_mastercontent_content_txtRegistroVivo').attr('class', 'validate[required]');
    }


    $("span.bgChk").click(function(e) {
        e.preventDefault();
        $(this).toggleClass("on");
        if ($("input[type=checkbox]", this).is(":checked")) {
            $("input[type=checkbox]", this).removeAttr("checked");
            ret = false;
        }
        else {
            $("input[type=checkbox]", this).attr("checked", true);
            ret = true;
        }

        if ($("input[id=ctl00_ctl00_mastercontent_content_chkSouColaborador]", this).length != 0) {
            if (ret) {
                $('td.colaborador').show();
                $('a.chkAlt').attr('href', '/Regulamento/Colaborador/');
                $('#ctl00_ctl00_mastercontent_content_txtRegistroVivo').attr('class', 'validate[required,custom[onlyNumber]]');
            }
            else {
                $('td.colaborador').hide();
                $('a.chkAlt').attr('href', '/Regulamento/');
                $('#ctl00_ctl00_mastercontent_content_txtRegistroVivo').removeAttr('class');
            }
        }

    });

    $("#divHeader #divHeaderPrincipalLogin #divConteudoExclusivoHeader ul li > a").hover(
		function(e) {
		    $(".balao", $(this).parent()).stop(true, true).show();
		},
		function() {
		    $(".balao", $(this).parent()).stop(true, true).hide();
		}
	);

    $("#divWrapperPontos #divPerfilPontos ul.lstMoedas li").hover(
		function(e) {
		    $(".balao", $(this)).stop(true, true).show();
		},
		function() {
		    $(".balao", $(this)).stop(true, true).hide();
		}
	);

    $("#divHeader #divLogin fieldset ul.redes li").hover(
		function(e) {
		    $(".balao", $(this)).stop(true, true).show();
		},
		function() {
		    $(".balao", $(this)).stop(true, true).hide();
		}
	);

    $("#ctl00_ctl00_mastercontent_content_lblColaborados").hover(
        function(e) {
            $(".balao", $(this)).stop(true, true).show();
        },
        function() {
            $(".balao", $(this)).stop(true, true).hide();
        }

	);

    //Contabiliza no google analytics os tipos de logins mais utilizados
    $("ul.redes li input").click(function() {
        //google analytics
        pageTracker._trackEvent("login", $(this).parent().attr('class'));
    });

    //Contabiliza no google analytics os tipos de logins mais utilizados
    $("#divLogin label.button input.button").click(function() {
        //google analytics
        pageTracker._trackEvent("login", "usuario");
    });

    $(".sendTweet").click(function(e) {
        e.preventDefault();
        //google analytics
        pageTracker._trackEvent("atividade", "click", "sendTweet");
        $(this).hide();
        $(".tweetResult", $(this).parent()).hide();
        var other = $(".tweetResult", $(this).parent()).parent();
        if (other.hasClass("jScrollPaneContainer")) other.hide();
        $(".boxTweetView", $(this).parent()).show();
    });

    $(".sendVideo").click(function(e) {
        e.preventDefault();
        //google analytics
        pageTracker._trackEvent("atividade", "click", "sendVideo");
        $(this).hide();
        $(".lstVideos").hide();
        $(".boxVideoView", $(this).parent()).show();
    });

    $(".sendFoto").click(function(e) {
        e.preventDefault();
        //google analytics
        pageTracker._trackEvent("atividade", "click", "sendFoto");
        $(this).hide();
        $(".lstFotos").hide();
        $(".boxFotoView", $(this).parent()).show();
    });



    var total = 140;
    $('.boxTweet textarea').keydown(function(e) {
        var atual = parseInt($('#counter').text());
        if (e.keyCode == 8 || e.keyCode == 46) {
            if ((atual + 1) > total)
                return false;
            $('#counter').text(this.value.length == total ? 1 : (total - (this.value.length - 1)));
        }
        else if (atual > 0) {
            $('#counter').text(total - (this.value.length + 1));
        }
        else return false;
    });

    $('.boxTweet textarea').keyup(function(e) {
        if (this.value.length == 0)
            $('#counter').text(total);
    });

    $('#divEntendaAtividadesVideos #divVideos #divAbasVideos ul li a, #divConteudoPrincipal.flashmob #divVideos #divAbasVideos ul li a').click(function(e) {
        e.preventDefault();
        var $this = $(this);
        var container = $(this).parents("#divVideos");
        var target = $($(this).attr("href"), container);
        var current = $(".video:visible", container);
        if (target != current) {
            current.hide();
            target.show();
            $("#divAbasVideos ul li", container).removeClass("on");
            $this.parent().addClass("on");
        }
    });

    $('#homeMultimidiaVideos #divAbasVideos ul li a').click(function(e) {
        e.preventDefault();
        var $this = $(this);
        var container = $(this).parents("#homeMultimidiaVideos");
        var target = $($(this).attr("href"), container);
        var current = $(".video:visible", container);
        if (target != current) {
            current.hide();
            target.show();
            $("#divAbasVideos ul li a", container).removeClass("on");
            $this.addClass("on");
        }
    });

    /*Troca fundo dos inputs do box de Login*/

    var ValorInicial1 = $("#divLogin .Formulario .TextBox input:first").val();
    var ValorInicial2 = $("#divLogin .Formulario .TextBox input:last").val();

    function LimpaInput() {
        if (ValorInicial1 != '' || ValorInicial2 != '') {
            $('#divLogin .Formulario .TextBox input').attr('val', '');
            $('#divLogin .Formulario .TextBox input').val('');
            $('#divLogin .Formulario .TextBox input').parent().removeClass('TextBoxGeral');
        };
    };

    LimpaInput();

    function VerificaInput() {

        var ValorInicial3 = $("#divLogin .Formulario .TextBox input:first").val();
        var ValorInicial4 = $("#divLogin .Formulario .TextBox input:last").val();

        if (ValorInicial3 != '' || ValorInicial4 != '') {
            $('#divLogin .Formulario .TextBox input').parent().addClass('TextBoxGeral');
        } else {
            $('#divLogin .Formulario .TextBox input').parent().removeClass('TextBoxGeral');
        };

    };


    $('#divLogin .Formulario .TextBox input').focus(function() {
        VerificaInput();
    });
    $('#divLogin .Formulario .TextBox input').blur(function() {
        VerificaInput();
    });
    $('#divLogin .Formulario .TextBox input').keydown(function() {
        VerificaInput();
    });
    $("#divLogin .Formulario .TextBox input").click(function() {
        $(this).parent().addClass("TextBoxGeral");
    });

    $("#divFeedbackLogar .Formulario .TextBox input").click(function() {
        $(this).parent().addClass("TextBoxGeral");
    });


    /* limpa input de caracteres */

    $('.TextCaptcha').addClass('TextBoxDigite TextCaptcha');
    $('.DigiteCaracteres span strong').addClass('TextBoxDigite TextCaptcha');

    $('.TextCaptcha input, .DigiteCaracteres span input').attr('value', '').val('');

    function VerificaInput() {

        var ValorInicialCaptcha1 = $(".TextCaptcha input").val();
        var ValorInicialCaptcha2 = $(".TextCaptcha input").val();

        if (ValorInicialCaptcha1 != '' || ValorInicialCaptcha2 != '') {
            $('.TextCaptcha input').parent().removeClass('TextBoxDigite');
        } else {
            $('.TextCaptcha input').parent().addClass('TextBoxDigite');
        };

    };


    $('.TextCaptcha input').focus(function() {
        VerificaInput();
    });
    $('.TextCaptcha input').blur(function() {
        VerificaInput();
    });
    $('.TextCaptcha input').keydown(function() {
        VerificaInput();
    });
    $('.TextCaptcha input').click(function() {
        $('.TextCaptcha input').parent().removeClass('TextBoxDigite');
    });

    $('#divEsqueciSenha .TextBox input').click(function() {
        $(this).parent().addClass("TextBoxGeral");
    });


    $('#homeVideosEntretenimento a').click(function(e) {
        e.preventDefault();
        var area = $(this).attr('title').toLowerCase();

        switch (area) {
            case 'videos':
                $('#homeMultimidiaVideos').show();
                $('#homeMultimidiaFotos').hide();
                $('#homeMultimidiaGames').hide();
                break;
            case 'fotos':
                $('#homeMultimidiaVideos').hide();
                $('#homeMultimidiaFotos').show();
                $('#homeMultimidiaGames').hide();
                break;
            case 'games':
                $('#homeMultimidiaVideos').hide();
                $('#homeMultimidiaFotos').hide();
                $('#homeMultimidiaGames').show();
                break;
        }


    });

    $("#boxTwitterComunidade a.btnComentarNoticia, #divComentariosComunidade a.btnComentarNoticia").live("click", function(e) {
        e.preventDefault();
        openPopup("/ComentarNoticia.aspx?hashTagNoticia=" + $("input[type=hidden].hiddenHashTagNoticia").val(), 800, 600);

    });


    $("a.btMensagemAcabouFase").hover(
        function() {
            $(".boxMensagemAcabouFase").show();
        }, function() {
            $(".boxMensagemAcabouFase").hide();
        });

    $('.SubMenu').each(function() {
        $(this).find('ul li:last').addClass("Ultima");
    });

    /*navega pelos menus*/
    $("#menu ul li").hover(function() {
        clearTimeout($(this).data('jQueryMenu'));
        $(this).find('.SubMenu').show();
    }, function() {
        var mm = $(this);
        var timer = setTimeout(function() {
            mm.find('.SubMenu').hide();
        }, 200);
        $(this).data('jQueryMenu', timer);
    });

    $('.ConteudoArredondado').append("\
        <div class='TopLeft'></div>\
        <div class='TopRight'></div>\
        <div class='BottomLeft'></div>\
        <div class='BottomRight'></div>");

    $('#conteudoHomeLeft .DestaqueMobile .ContainerSlide').SlideShow({
        visible: 1,
        scroll: 1,
        velocidade: 500,
        proximo: $('.DestaqueMobile .SetaSlideProximo'),
        anterior: $('.DestaqueMobile .SetaSlideAnterior')
    });

    $('#divGames .DestaqueMobile .ContainerSlide').SlideShow({
        visible: 2,
        scroll: 2,
        velocidade: 500,
        proximo: $('.DestaqueGames .SetaSlideProximo'),
        anterior: $('.DestaqueGames .SetaSlideAnterior')
    });

    $('.SlideVideos .ContainerSlide').SlideShow({
        visible: 3,
        scroll: 3,
        velocidade: 500,
        proximo: $('.SlideVideos .SetaSlideProximo'),
        anterior: $('.SlideVideos .SetaSlideAnterior')
    });

    $('.ConteudoTorcidaCompleta #divEncontreSeusAmigos span.input input, .DestaqueMobile #divSelecaoCelularNoticias input, .DestaquePortalFutebol input').each(function() {
        var default_value = this.value;
        $(this).focus(function() {
            if (this.value == default_value) {
                this.value = '';
            }
        });
        $(this).blur(function() {
            if (this.value == '') {
                this.value = default_value;
            }
        });
    });
});
	
