$(document).ready(function(){
    $("a[rel^='prettyPhoto']").prettyPhoto();
    $('.Apagar').click(function(){
        if(this.value == this.defaultValue){
            this.value = '';
        }
    });
    $('.Apagar').blur(function(){
        if (this.value == ''){
            this.value = this.defaultValue;
        }
    });
    $('.Slide').cycle({
        fx:'fade',
        speed:'500',
        timeout:'6000',
        pagerAnchorBuilder: function(idx, slide) { 
            if(idx == 0){
                return '<li>Lazer</li>'; 
            }else if(idx == 1){
                return '<li>Serviços</li>'; 
            }else if(idx == 2){
                return '<li>Acomodações</li>'; 
            }else if(idx == 3){
                return '<li>O Hotel</li>'; 
            }else if(idx == 4){
                return '<li>Praia</li>'; 
            }else if(idx == 5){
                return '<li>Salão de eventos</li>'; 
            }
        }, 
        sync: true,
        pager:'.Paginator'
    });
    $('.Paginator li[class!=activeSlide]').live('hover', function(){
        $(this).addClass('hoverSlide');
    });
    $('.Paginator li[class!=activeSlide] a').live('hover', function(){
        $(this).parent().addClass('hoverSlide');
    });
    $('.Paginator li[class!=activeSlide]').live('mouseout', function(){
        $(this).removeClass('hoverSlide');
    });
    $('.Paginator li[class!=activeSlide] a').live('mouseout', function(){
        $(this).parent().addClass('hoverSlide');
    });
    
    $('#en').click(function(){
        $('body').translate('en',{toggle:true, not:'.notranslate'});
        $.getJSON('pages/idioma/2');
    });
    $('#br').click(function(){
        $('body').translate('pt-br',{toggle:true, not:'.notranslate'});
        $.getJSON('pages/idioma/1');
    });
    $('#es').click(function(){
        $('body').translate('es',{toggle:true, not:'.notranslate'});
        $.getJSON('pages/idioma/3');
    });
    $.getJSON('pages/idioma',function(data){ 
        if(data==1){
            $('#br').click();
        }
        if(data==2){
            $('#en').click();
        }
        if(data==3){
            $('#es').click();
        }
    }); 
    $('.Data').datepicker();
    $('.Tel').mask('(99) 9999-9999');
    $('.Data').mask('99/99/9999');
    $('.Cep').mask('99.999-999');
    $('.Cpf').mask('999.999.999-99');
    
});
