/*function carregarSlideFotosP(){
    $(".ImgsLoca").children("div:not(.Visible)").each(function(){
        $(this).fadeOut();
    });
    $(".NavegadorBola").fadeTo("slow", 0.25);
    $(".NavegadorBola.Visible").fadeTo("slow", 1.00);
}

function concluirReserva(){
    var link = "https://gc.synxis.com/rez.aspx?Hotel=53432&Chain=13038&locale=pt-PT";
    var f = $("#reservaOnLine");
    var entrada = f.contents().find("input[name='entrada']").val();
    var saida = f.contents().find("input[name='saida']").val();
    var adulto = f.contents().find("select[name='adulto']").val();
    var crianca = f.contents().find("select[name='crianca']").val();
    var quartos = f.contents().find("select[name='quartos']").val();
    var promocao = f.contents().find("input[name='promocao']").val();	
    if((entrada != null) & (entrada != 0)){
        entrada = "&Arrive="+entrada;
    }
    else{
        entrada = "";
    }
    if((saida != null) & (saida != 0)){
        saida = "&Depart="+saida;
    }
    else{
        saida = "";
    }
    if((adulto != null) & (adulto != 0)){
        adulto = "&Adult="+adulto;
    }
    else{
        adulto = "";
    }
    if((crianca != null) & (crianca != 0)){
        crianca = "&Child="+crianca;
    }
    else{
        crianca = "";
    }
    if((quartos != null) & (quartos != 0)){
        quartos = "&Rooms="+quartos;
    }
    else{
        quartos = "";
    }
    if((promocao != null) & (promocao != 0)  & (f.contents().find("input[name='promocao']").attr("vazio")==0)) {
        promocao = "&Promo="+promocao;
    }
    else{
        promocao = "";
    }
    link = link = link+entrada+saida+adulto+crianca+quartos+promocao+"&Start=1";
    window.location = link;
}

                $().ready(function(){
 
                /*if($("#slider").children().lenght = 1{
					$(".nivo-directionNav").hide();
				}*/
				
                /*carregarSlideFotosP();
				qtdBanners();
				$('.normalTip').aToolTip();
                    
                /* DATEPICKER */    
                //$(".DatePicker").datepicker( "option", "buttonImage", '/img/logoTel.jpg' );

                /*$('.DatePicker').datepicker({ showButtonPanel: true, 
                   onSelect: function(dateText) {
                       var data = dateText;
                       var d = data.substring(0, 2);
                       var m = data.substring(3, 5);
                       var a = data.substring(6, 11);
                       
                    $('.DatePicker2').datepicker({
                        beforeShow: function() {                             
                            $( ".DatePicker2" ).datepicker( "option", "defaultDate", data ); 
                        }
                    });
                    $( ".DatePicker2" ).datepicker( "option", "minDate", new Date(a, m - 1, (parseInt(d) + 1)));
                   }
                });                
                $( ".DatePicker" ).datepicker( "option", "minDate", new Date() );
                $(".DatePicker").datepicker($.datepicker.regional['pt-BR']);                
                               
                
                
                
                /*ANIMAÇÃO RESERVAS*/
				
                /*function qtdBanners(){
                     if($("#slider img").length == 1){
                        $(".Nav").hide();
                     }else{
                        $(".Nav").show();
                     }   
                 }
                
                 /*$(".Continuar").live("click",function(){
                    var a = $(".Passo.Ativo");
                    if(!a.next().length < 1){
                        a.next().addClass("Ativo");
                        if(a.next().children("img").hasClass("ImgPasso3")){
                            a.next().children("img").attr('src','img/fimPassoAtivo2.png');
                            a.prev().children("img").attr('src','img/fimPassoDes.png');
                        }else{
                            a.next().children("img").attr('src','img/fimPassoAtivo.png');
                        }
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoAtivo3.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 300);
                        var inp = $(".Input.Ativo");
                        inp.removeClass("Ativo");
                        inp.next().addClass("Ativo");
                    }else{
                        concluirReserva();
                    }
					return false;
                });*/
               
               /*$(".Continuar").live("click",function(){
                    var a = $(".Passo.Ativo");
                    if(!a.next().length < 1){
                        a.next().addClass("Ativo");
                        if(a.next().children("img").hasClass("ImgPasso3")){                           
                            a.next().children("img").attr('src','img/fimPassoAtivo2.png');
                            a.prev().children("img").attr('src','img/fimPassoDes.png');
                        }else{                            
                            a.next().children("img").attr('src','img/fimPassoAtivo2.png');
                        }
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoAtivo3.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 300);
                        var inp = $(".Input.Ativo");
                        inp.removeClass("Ativo");
                        inp.next().addClass("Ativo");
                    }else{
                        concluirReserva();
                    }
					return false;
                });
                
                $(".Passo").live("click",function(){
                    var a = $(".Passos .Ativo");
                    var inp = $(".Input.Ativo");
                    var index = $(this).index();
                        inp.removeClass("Ativo");
                        $(".Input:eq("+index+")").addClass("Ativo");
                    if(a.index()==2){
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoDes.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        a.prev().children("img").attr('src','img/fimPassoDes.png');
                        a.prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).prev().children("img").attr('src','img/fimPassoAtivo3.png');
                        $(this).prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).addClass("Ativo");
                        $(this).children("img").attr('src','img/fimPassoAtivo.png');
                        $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                    }else{
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoDes2.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        a.prev().children("img").attr('src','img/fimPassoDes.png');
                        a.prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).prev().children("img").attr('src','img/fimPassoAtivo3.png');
                        $(this).prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).addClass("Ativo");
                        if($(this).index()==1){
                             $(this).children("img").attr('src','img/fimPassoAtivo2.png');
                             $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                        }else{
                            $(this).children("img").attr('src','img/fimPassoAtivo.png');
                            $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                        }
                    }
                })
                
                /*CODIGO COM 3
                 *
                 *$(".Passo").live("click",function(){
                    var a = $(".Passos .Ativo");
                    var inp = $(".Input.Ativo");
                    var index = $(this).index();
                        inp.removeClass("Ativo");
                        $(".Input:eq("+index+")").addClass("Ativo");
                    if(a.index()==2){
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoDes2.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        a.prev().children("img").attr('src','img/fimPassoDes.png');
                        a.prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).prev().children("img").attr('src','img/fimPassoAtivo3.png');
                        $(this).prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).addClass("Ativo");
                        $(this).children("img").attr('src','img/fimPassoAtivo.png');
                        $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                    }else{
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoDes.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        a.prev().children("img").attr('src','img/fimPassoDes.png');
                        a.prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).prev().children("img").attr('src','img/fimPassoAtivo3.png');
                        $(this).prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).addClass("Ativo");
                        if($(this).index()==2){
                             $(this).children("img").attr('src','img/fimPassoAtivo2.png');
                             $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                        }else{
                            $(this).children("img").attr('src','img/fimPassoAtivo.png');
                            $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                        }
                    }
                })*/
			
                /* ANIMAÇÃO INFO */        
                function teste(data){                   
                    if(data.state=="on"){                        
                        $(".Resgate").css("background-color","#FF9C00");
                        $(".Resgate").css("cursor","pointer");
                        $(".Resgate").addClass("Ativo");
                    }else if(data.state=="off"){
                        $(".Resgate").css("background-color","#dedede");
                        $(".Resgate").css("cursor","default");
                    }
                }                    
                
                
                
                $(".NavegadorBola").live("click",function(){
                    var antigo = $(this).parent().children(".Visible");
                    antigo.fadeTo("slow", 0.25);

                    antigo.removeClass("Visible");
                    $(this).parent().parent().children(".ImgsLoca").children(".Visible").fadeTo("slow", 0.00);

                    $(this).parent().parent().children(".ImgsLoca").children(".Visible").removeClass("Visible");
                    $(this).fadeTo("slow", 1.00);

                    $(this).addClass("Visible");
                    
                    //alert("INDEX:"+$(this).index());
                    
                    $(this).parent().parent().children(".ImgsLoca").children(":eq("+$(this).index()+")").addClass("Visible");
                    $(this).parent().parent().children(".ImgsLoca").children(":eq("+$(this).index()+")").fadeTo("slow", 1.00);

                });
					
				
				/*if(($("#slider .Atual").next("#slider img").length < 1) AND($("#slider .Atual").prev("#slider img").length < 1)){
					$(.Nav).hide();
				}else{
					$(.Nav).show();
				}*/
                
                function trocarFundoBanner(){
                    //Retira Chamada Atual    
                    var ata = $(".InfoBanner:eq("+$("#slider img.Atual").index()+")");
                    ata.animate({right:'-=315px'},1000); 
                    
                    /*if($("#slider img.Atual").next("img").length == 0){
                        var cor = $("#slider img:first-child").attr("color");
                        $(".ContBanner").animate({ backgroundColor: cor }, 1000);
                    }
                    else{
                        var cor = $("#slider img.Atual").next().attr("color");
                        $(".ContBanner").animate({ backgroundColor: cor }, 1000);
                    }
                    //TrocaBanner
                    /*if($("#slider img.Atual").next("img").length == 0){
                        var cor = $("#slider img:first-child").attr("color");
                    }
                    else{
                        var cor = $("#slider img.Atual").next().attr("color");
                    }
                    $(".ContBanner").animate({ backgroundColor: cor }, 1000);*/
                }                
                /*function trocarChamadaBanner(){
                    var at = $("#slider .Atual");
                    if($("#slider .Atual").next("#slider img").length < 1){
                            $("#slider .Atual").removeClass("Atual");
                            $("#slider img:first-child").addClass("Atual");
                        }
                    else{
                        at.next("#slider img").addClass("Atual");
                        at.removeClass("Atual");
                    }
                    //Posiciona Chamada Nova
                    var atu = $(".InfoBanner:eq("+$("#slider img.Atual").index()+")");                    
                    atu.animate({right:'+=315px'},1000); 
                    
                    var cor = $("#slider img.Atual").attr("color");
                        $(".ContBanner").animate({backgroundColor: cor}, 1000);
                    
                }     
                $('#slider').nivoSlider({
                    effect:'boxRain', // Specify sets like: 'fold,fade,sliceDown'
                    animSpeed:1000, // Slide transition speed
                    pauseTime:4000, // How long each slide will show
                    directionNav:true, // Next & Prev navigation
                    directionNavHide:false,
                    controlNav:false,
                    beforeChange: function(){trocarFundoBanner();},
                    afterChange: function(){trocarChamadaBanner();},
					afterLoad: function(){$("#slider").css("height","363px");}
                });
                
                $(".ExclusividadesP.Visivel .ImgSetaEsq").addClass("Disable");
                $('.ExclusividadesP.Visivel .ImgSetaEsq').animate({opacity: 0.25});
                
                
                
                $(".Hide").click(function(){
                    $(".Atendimento").css("position","absolute");
                    $(".BordaPretaTop").css("position","absolute");
                });               
               
                
                $(".ExcContainer .ImgSetaEsq").click(function(){
                    if(!$(this).hasClass("Disable")){
                        var vis = $(".ExclusividadesP.Visivel");
                        vis.removeClass("Visivel");
                        vis.prev().addClass("Visivel");
                    }
                })
                $(".ExcContainer .ImgSetaDir").click(function(){
                    if(!$(this).hasClass("Disable")){
                        var vis = $(".ExclusividadesP.Visivel");
                        vis.removeClass("Visivel");
                        vis.next().addClass("Visivel");
                  
                        if($(".ExcContainer .ExclusividadesP.Visivel").next().length < 1){
                            $(".ExclusividadesP.Visivel .ImgSetaDir").addClass("Disable");
                            $(".ExclusividadesP.Visivel .ImgSetaDir").animate({opacity: 0.25});
                        }
                    }
                })
                
                $("#newsletter").hide();
                $(".Modal").colorbox();
                $(".Modal2").colorbox({
                    onLoad:function(){
                        $("#newsletter").show();
                    }
                    ,onCleanup:function(){
                        $("#newsletter").hide();
                    }
                    ,inline:true
                    ,href:"#newsletter"
                    ,width:"335"
                });
            
                
                $(".SubMenu").hide();
                $(".MenuPrincipal").hover(function(){
                    $(this).addClass("Hover")
                    $(this).children("ul").show();
                },function () {
                    $(this).children("ul").hide(),
                    $(this).removeClass("Hover")
                    $(".MenuPrincipal").show();
                });
                
                var interval = window.setInterval(function(){
                    trocarExclusividades();                   
                }, 5000);
                
                function trocarExclusividades(){
                    if(!$(".ExcContainer .ExclusividadesP.Visivel .ImgSetaDir").hasClass("Disable")){
                        var vis = $(".ExclusividadesP.Visivel");
                        vis.removeClass("Visivel");
                        vis.next().addClass("Visivel");
                  
                        if($(".ExcContainer .ExclusividadesP.Visivel").next().length < 1){
                            $(".ExclusividadesP.Visivel .ImgSetaDir").addClass("Disable");
                            $(".ExclusividadesP.Visivel .ImgSetaDir").animate({opacity: 0.25});
                        }
                    }else{
                        var viz = $(".ExclusividadesP.Visivel");
                        viz.removeClass("Visivel");
                        $(".ExclusividadesP:first-child").addClass("Visivel");
                    }
                }
                $(".ExcContainer").hover(function(){
                    clearInterval(interval);
                },function (){
                    interval = window.setInterval(function(){
                    trocarExclusividades();                   
                    }, 5000);
                });
                //$("#slider").hover(function(){
                   // $('#slider').data('nivoslider').stop();
                //},function (){
                    //$('#slider').data('nivoslider').start();
                //});
                
                
                
            }); */
                
                
                //////////////////////////////////////////////////////////////IE //////////////////////////////////////////////////////////////////
                
                
    function concluirReserva(){
    var link = "https://gc.synxis.com/rez.aspx?Hotel=53432&Chain=13038&locale=pt-PT";
    var f = $("#reservaOnLine");
    var entrada = f.contents().find("input[name='entrada']").val();
    var saida = f.contents().find("input[name='saida']").val();
    var adulto = f.contents().find("select[name='adulto']").val();
    var crianca = f.contents().find("select[name='crianca']").val();
    var quartos = f.contents().find("select[name='quartos']").val();
    var promocao = f.contents().find("input[name='promocao']").val();
    var start;
    if((entrada != null) & (entrada != 0)){
        entrada = "&Arrive="+entrada;
    }
    else{
        entrada = "";
    }
    if((saida != null) & (saida != 0)){
        saida = "&Depart="+saida;
    }
    else{
        saida = "";
    }
    if(((entrada != null) & (entrada != 0)) & (saida != null) & (saida != 0)){
        start = "&Start=1";
    }
    else{
        start = "";
    }   
    if((adulto != null) & (adulto != 0)){
        adulto = "&Adult="+adulto;
    }
    else{
        adulto = "";
    }
    if((crianca != null) & (crianca != 0)){
        crianca = "&Child="+crianca;
    }
    else{
        crianca = "";
    }
    if((quartos != null) & (quartos != 0)){
        quartos = "&Rooms="+quartos;
    }
    else{
        quartos = "";
    }
    /*if((promocao != null) & (promocao != 0)){
        promocao = "&Promo="+promocao;
    }
    else{
        promocao = "";
    }*/
    link = link+entrada+saida+adulto+crianca+quartos+promocao+start;
    window.location = link;
};

$().ready(function(){
    
     $(".Hide").click(function(){
        $(".Atendimento").css("position","absolute");
        $(".BordaPretaTop").css("position","absolute");
    });
    
    $(".Resgate.Ativo").live('click',function(){        
        $(".Palco1").animate({top: '-=500'});
        $(".Palco2").animate({top: '-=500'});
		$(".Palco3").animate({top: '-=500'});
        return false;
    });
                qtdBanners();   
						
                $('#slider').cycle({ 
                    fx:      'fade', 
                    speedIn:  500, 
                    speedOut: 500
                });
                $('.normalTip').aToolTip();
               //$(".DatePicker" ).datepicker({buttonImage: '../img/calendario.png'});
               
               $('.DatePicker').datepicker({                    
                   onSelect: function(dateText) {
                       var data = dateText;
                       var d = data.substring(0, 2);
                       var m = data.substring(3, 5);
                       var a = data.substring(6, 11);
                       
                    $('.DatePicker2').datepicker({
                        beforeShow: function() { 
                            $( ".DatePicker2" ).datepicker( "option", "defaultDate", data ); 
                        }
                    });
                    $( ".DatePicker2" ).datepicker( "option", "minDate", new Date(a, m - 1, (parseInt(d) + 1)));
                   }
                });                
                $( ".DatePicker" ).datepicker( "option", "minDate", new Date() );
                $(".DatePicker").datepicker($.datepicker.regional['pt-BR']);
                
                $(".DatePicker").datepicker($.datepicker.regional['pt-BR']);
               
                   /*ANIMAÇÃO RESERVAS*/
               function qtdBanners(){
                 if($("#slider img").length == 1){
                    $(".NavDir").hide();
                    $(".NavEsq").hide();
                 }else{
                    $(".NavDir").show();
                    $(".NavEsq").show();
                 }   
               };
                /*$(".Continuar").live("click",function(){
                    var a = $(".Passo.Ativo");
                    if(!a.next().length < 1){
                        a.next().addClass("Ativo");
                        if(a.next().children("img").hasClass("ImgPasso3")){
                            a.next().children("img").attr('src','img/fimPassoAtivo2.png');
                            a.prev().children("img").attr('src','img/fimPassoDes.png');
                        }else{
                            a.next().children("img").attr('src','img/fimPassoAtivo.png');
                        }
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoAtivo3.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 300);
                        var inp = $(".Input.Ativo");
                        inp.removeClass("Ativo");
                        inp.next().addClass("Ativo");
                    }else{
                        concluirReserva();
                    }
					return false;
                });*/
               
			   $(".Rev").click(function(){
					window.open("http://reveillonemnatal.com.br", "", "fullscreen=yes");			
				});
			   
               $(".Continuar").live("click",function(){
                    var a = $(".Passo.Ativo");
                    if(!a.next().length < 1){
                        a.next().addClass("Ativo");
                        if(a.next().children("img").hasClass("ImgPasso3")){                           
                            a.next().children("img").attr('src','img/fimPassoAtivo2.png');
                            a.prev().children("img").attr('src','img/fimPassoDes.png');
                        }else{                            
                            a.next().children("img").attr('src','img/fimPassoAtivo2.png');
                        }
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoAtivo3.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 300);
                        var inp = $(".Input.Ativo");
                        inp.removeClass("Ativo");
                        inp.next().addClass("Ativo");
                    }else{
                        concluirReserva();
                    }
					return false;
                });
                
               $(".Passo").live("click",function(){
                    var a = $(".Passos .Ativo");
                    var inp = $(".Input.Ativo");
                    var index = $(this).index();
                        inp.removeClass("Ativo");
                        $(".Input:eq("+index+")").addClass("Ativo");
                    if(a.index()==2){
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoDes.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        a.prev().children("img").attr('src','img/fimPassoDes.png');
                        a.prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).prev().children("img").attr('src','img/fimPassoAtivo3.png');
                        $(this).prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).addClass("Ativo");
                        $(this).children("img").attr('src','img/fimPassoAtivo.png');
                        $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                    }else{
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoDes2.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        a.prev().children("img").attr('src','img/fimPassoDes.png');
                        a.prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).prev().children("img").attr('src','img/fimPassoAtivo3.png');
                        $(this).prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).addClass("Ativo");
                        if($(this).index()==1){
                             $(this).children("img").attr('src','img/fimPassoAtivo2.png');
                             $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                        }else{
                            $(this).children("img").attr('src','img/fimPassoAtivo.png');
                            $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                        }
                    }
                })
                
                /*CODIGO COM 3
                 *
                 *$(".Passo").live("click",function(){
                    var a = $(".Passos .Ativo");
                    var inp = $(".Input.Ativo");
                    var index = $(this).index();
                        inp.removeClass("Ativo");
                        $(".Input:eq("+index+")").addClass("Ativo");
                    if(a.index()==2){
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoDes2.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        a.prev().children("img").attr('src','img/fimPassoDes.png');
                        a.prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).prev().children("img").attr('src','img/fimPassoAtivo3.png');
                        $(this).prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).addClass("Ativo");
                        $(this).children("img").attr('src','img/fimPassoAtivo.png');
                        $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                    }else{
                        a.removeClass("Ativo");
                        a.children("img").attr('src','img/fimPassoDes.png');
                        a.children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        a.prev().children("img").attr('src','img/fimPassoDes.png');
                        a.prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).prev().children("img").attr('src','img/fimPassoAtivo3.png');
                        $(this).prev().children('p').animate({backgroundColor: '#f5f4f4'}, 1);
                        $(this).addClass("Ativo");
                        if($(this).index()==2){
                             $(this).children("img").attr('src','img/fimPassoAtivo2.png');
                             $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                        }else{
                            $(this).children("img").attr('src','img/fimPassoAtivo.png');
                            $(this).children('p').animate({backgroundColor: '#ebebeb'}, 1);
                        }
                    }
                })*/

                $(".NavegadorBola").live("click",function(){
                    var antigo = $(this).parent().children(".Visible");
                    antigo.removeClass("Visible");

                    $(this).parent().parent().children(".ImgsLoca").children(".Visible").removeClass("Visible");
                    $(this).addClass("Visible");
                    
                    //alert("INDEX:"+$(this).index());
                    
                    $(this).parent().parent().children(".ImgsLoca").children(":eq("+$(this).index()+")").addClass("Visible");                    

                });
                
                function trocarFundoBanner(){
                    //Retira Chamada Atual    
                    var ata = $(".InfoBanner:eq("+$("#slider img.Atual").index()+")");
                    ata.animate({right:'-=315px'},1000); 
                    
                    /*if($("#slider img.Atual").next("img").length == 0){
                        var cor = $("#slider img:first-child").attr("color");
                        $(".ContBanner").animate({ backgroundColor: cor }, 1000);
                    }
                    else{
                        var cor = $("#slider img.Atual").next().attr("color");
                        $(".ContBanner").animate({ backgroundColor: cor }, 1000);
                    }
                    //TrocaBanner
                    /*if($("#slider img.Atual").next("img").length == 0){
                        var cor = $("#slider img:first-child").attr("color");
                    }
                    else{
                        var cor = $("#slider img.Atual").next().attr("color");
                    }
                    $(".ContBanner").animate({ backgroundColor: cor }, 1000);*/
                };            
                function trocarChamadaBanner(){
                    var at = $("#slider .Atual");
                    if($("#slider .Atual").next("#slider img").length < 1){
                            $("#slider .Atual").removeClass("Atual");
                            $("#slider img:first-child").addClass("Atual");
                        }
                    else{
                        at.next("#slider img").addClass("Atual");
                        at.removeClass("Atual");
                    }
                    //Posiciona Chamada Nova
                    var atu = $(".InfoBanner:eq("+$("#slider img.Atual").index()+")");                    
                    atu.animate({right:'+=315px'},1000); 
                    
                    var cor = $("#slider img.Atual").attr("color");
                        $(".ContBanner").animate({backgroundColor: cor}, 1000);
                    
                };   
                /*$('#slider').nivoSlider({
                    effect:'boxRain', // Specify sets like: 'fold,fade,sliceDown'
                    animSpeed:1000, // Slide transition speed
                    pauseTime:4000, // How long each slide will show
                    directionNav:true, // Next & Prev navigation
                    directionNavHide:false,
                    controlNav:false,
                    beforeChange: function(){trocarFundoBanner();},
                    afterChange: function(){trocarChamadaBanner();},
					afterLoad: function(){$("#slider").css("height","363px");}
                });*/
                
                $(".ExclusividadesP.Visivel .ImgSetaEsq").addClass("Disable");
                $('.ExclusividadesP.Visivel .ImgSetaEsq').animate({opacity: 0.25});
                
                
                
                
                
                $(".ExcContainer .ImgSetaEsq").click(function(){
                    if(!$(this).hasClass("Disable")){
                        var vis = $(".ExclusividadesP.Visivel");
                        vis.removeClass("Visivel");
                        vis.prev().addClass("Visivel");
                    }
                });
                $(".ExcContainer .ImgSetaDir").click(function(){
                    if(!$(this).hasClass("Disable")){
                        var vis = $(".ExclusividadesP.Visivel");
                        vis.removeClass("Visivel");
                        vis.next().addClass("Visivel");
                  
                        if($(".ExcContainer .ExclusividadesP.Visivel").next().length < 1){
                            $(".ExclusividadesP.Visivel .ImgSetaDir").addClass("Disable");
                            $(".ExclusividadesP.Visivel .ImgSetaDir").animate({opacity: 0.25});
                        }
                    }
                });
                
                $("#newsletter").hide();
                $(".Modal").colorbox();
                $(".Modal2").colorbox({
                    onLoad:function(){
                        $("#newsletter").show();
                    }
                    ,onCleanup:function(){
                        $("#newsletter").hide();
                    }
                    ,inline:true
                    ,href:"#newsletter"
                    ,width:"335"
                });
            
                
                $(".SubMenu").hide();
                $(".MenuPrincipal").hover(function(){
                    $(this).addClass("Hover")
                    $(this).children("ul").show();
                },function () {
                    $(this).children("ul").hide(),
                    $(this).removeClass("Hover")
                    $(".MenuPrincipal").show();
                });
                var interval = window.setInterval(function(){
                    trocarExclusividades(); 
                }, 5000); 
            
                function trocarExclusividades(){
                    if(!$(".ExcContainer .ExclusividadesP.Visivel .ImgSetaDir").hasClass("Disable")){
                        var vis = $(".ExclusividadesP.Visivel");
                        vis.removeClass("Visivel");
                        vis.next().addClass("Visivel");
                  
                        if($(".ExcContainer .ExclusividadesP.Visivel").next().length < 1){
                            $(".ExclusividadesP.Visivel .ImgSetaDir").addClass("Disable");
                            $(".ExclusividadesP.Visivel .ImgSetaDir").animate({opacity: 0.25});
                        }
                    }else{
                        var viz = $(".ExclusividadesP.Visivel");
                        viz.removeClass("Visivel");
                        $(".ExclusividadesP:first-child").addClass("Visivel");
                    }
                };
                
                
                function trocarBanner(){                     
                    var x = $("#slider").children().length;
                    if(x>1){
                        $("#slider img").fadeOut();
                    var at = $("#slider .Atual");
                    if($("#slider .Atual").next("#slider img").length < 1){
                            $("#slider .Atual").removeClass("Atual");
                            $("#slider img:first-child").addClass("Atual");
                        }
                    else{
                        at.next("#slider img").addClass("Atual");
                        at.removeClass("Atual");
                    }
                    var atu = $(".InfoBanner:eq("+$("#slider img.Atual").index()+")");                    
                    atu.animate({right:'+=315px'},1000); 
                    $("#slider .Atual").fadeIn();
                    var cor = $("#slider img.Atual").attr("color");
                        $(".ContBanner").css('backgroundColor',cor);
                    }
                };
                
                $(".NavDir").click(function(){
                    $('#slider').cycle('next');
                        $(".VideoV").remove();
                       $(".CloseV").hide(); 
                       $(".Video").hide();
                       $('#slider').cycle('resume');
                    /*var at = $("#slider .Atual");
                    at.fadeOut();
                    if($("#slider .Atual").next("#slider img").length < 1){
                            $("#slider .Atual").removeClass("Atual");
                            $("#slider img:first-child").addClass("Atual");
                        }
                    else{
                        at.next("#slider img").addClass("Atual");
                        at.removeClass("Atual");
                    }
                    $('##slider').cycle(at.next());
                    var atu = $(".InfoBanner:eq("+$("#slider img.Atual").index()+")");                    
                    atu.animate({right:'+=315px'},1000); 
                    $("#slider .Atual").fadeIn();
                    var cor = $("#slider img.Atual").attr("color");
                        $(".ContBanner").css('backgroundColor',cor);*/
                });
                
/////////////////////////////// XXXXXXX ////////////////////////////////////////////////////////////////////////////////////////                
                
                $(".Video").hide();
                $(".CloseV").hide();
                
                $(".BannerV").click(function(){
                   $('#slider').cycle('pause');   
                   $(".Video").show();
                   $(".Video").append("<object class='VideoV' width='940' height='363'><param name='movie' value='http://www.youtube.com/embed/0DsWvXteN9U?rel=0&autoplay=1&autohide=1&controls=1'><param name='type' value='application/x-shockwave-flash'><param name='allowfullscreen' value='true'><param name='allowscriptaccess' value='always'><param name='wmode' value='opaque' /><embed width='940' height='363' src='http://www.youtube.com/v/0DsWvXteN9U&hl=en&fs=1' type='application/x-shockwave-flash' allowfullscreen='true' allowscriptaccess='always' wmode='opaque'></embed></object>");
                   $(".CloseV").show();
                });
                $(".CloseV").click(function(){
                   $(".VideoV").remove();
                   $(".CloseV").hide(); 
                   $(".Video").hide();
                   $('#slider').cycle('resume');
                });
                
                $(".NavEsq").click(function(){
                    $('#slider').cycle('prev');
                    $(".VideoV").remove();
                   $(".CloseV").hide(); 
                   $(".Video").hide();
                   $('#slider').cycle('resume');
                    /*var at = $("#slider .Atual");
                    at.fadeOut();
                    if($("#slider .Atual").prev("#slider img").length < 1){
                            $("#slider .Atual").removeClass("Atual");
                            $("#slider img:last-child").addClass("Atual");
                        }
                    else{
                        at.prev("#slider img").addClass("Atual");
                        at.removeClass("Atual");
                    }
                    var atu = $(".InfoBanner:eq("+$("#slider img.Atual").index()+")");                    
                    atu.animate({right:'+=315px'},1000); 
                    $("#slider .Atual").fadeIn();
                    var cor = $("#slider img.Atual").attr("color");
                        $(".ContBanner").css('backgroundColor',cor);*/
                });
                
/////////////////////////////// XXXXXXX ////////////////////////////////////////////////////////////////////////////////////////                
                
                $(".ExcContainer").hover(function(){
                    clearInterval(interval);
                },function (){
                    interval = window.setInterval(function(){
                    trocarExclusividades();     
                    trocarBanner();
                    }, 5000);
                });
                $("#slider").hover(function(){
                    $('#slider').cycle('pause');
                },function (){  
                    $('#slider').cycle('resume');
                });
            }); 


