$(document).ready(function(){
    $('.Slide').cycle({
        fx:'fade',
        speed:'500',
        timeout:'8000',
        sync: true
    });
    
    $('#en').click(function(){
        $('body').translate('en',{toggle:true, not:'.notranslate'});
        $('menu li').css('margin-right', '14px');
        $.getJSON('pages/idioma/2');
    });
    $('#br').click(function(){
        $('body').translate('pt-br',{toggle:true, not:'.notranslate'});
        $('menu li').css('margin-right', '23px');
        $.getJSON('pages/idioma/1');
    });
    $('#es').click(function(){
        $('body').translate('es',{toggle:true, not:'.notranslate'});
        $('menu li').css('margin-right', '23px');
        $.getJSON('pages/idioma/3');
    });
    $.getJSON('pages/idioma',function(data){ 
        if(data==1){
            $('#br').click();
        }
        if(data==2){
            $('#en').click();
        }
        if(data==3){
            $('#es').click();
        }
    });
    
    $('.Apagar').click(function(){
        if(this.value == this.defaultValue){
            this.value = '';
        }
    });
    $('.Apagar').blur(function(){
        if (this.value == ''){
            this.value = this.defaultValue;
        }
    });
    
    $("a[rel^='prettyPhoto']").prettyPhoto();
    $('.jcarousel-skin-tango').jcarousel();
    $('.Tel').mask('(99) 9999-9999');
    $('.Cpf').mask('999.999.999-99');
    $('.Data').mask('99/99/9999').datePicker();
    
});
