$(document).ready(function(){

    $('.Slide').cycle({
        fx:'fade',
        speed:'500',
        timeout:'6000',
        sync: true,
        pager:'.Paginator',
        prev: '.ArrowLeft',
        next: '.ArrowRight'
    });
    $('.FanpageSlide').cycle({
        fx:'fade',
        speed:'500',
        timeout:'6000',
        sync: true,
        pager:'.Paginator',
        prev: '.FanpageSlideLeft',
        next: '.FanpageSlideRight'
    });
    $('.Carousel1').cycle({
        fx:'scrollHorz',
        speed:'500',
        timeout:0,
        prev: '.Carousel1Left',
        next: '.Carousel1Right'
    });
    $('.Carousel12').cycle({
        fx:'scrollHorz',
        speed:'500',
        timeout:0,
        prev: '.Carousel12Left',
        next: '.Carousel12Right'
    });
    $('.Carousel2').cycle({
        fx:'scrollHorz',
        speed:'500',
        timeout:0,
        prev: '.Carousel2Left',
        next: '.Carousel2Right'
    });
    $('.Carousel3').cycle({
        fx:'scrollHorz',
        speed:'500',
        timeout:0,
        prev: '.Carousel3Left',
        next: '.Carousel3Right'
    });
    $("form.jqtransform").jqTransform();
    $('.Date').datepicker();
    $('.Tel').mask('(99) 9999-9999');
    $("a[rel^='prettyPhoto']").prettyPhoto();
    
    $('.Box4').hover(function(){
        $(this).css('background-image', 'url("img/bg5.png")');
        $(this).find('a').css('color', '#978517');
        $(this).find('p').css('color', '#978517');
    }, function(){
        $(this).css('background-image', 'url("img/bg4.png")');
        $(this).find('a').css('color', '#0064AB');
        $(this).find('p').css('color', '#0064AB');
    })
    $('.SocialTwitter').hover(function(){
        $(this).attr('src', 'img/twitter2.png');
    }, function(){
        $(this).attr('src', 'img/twitter.png');
    })
    $('.SocialFacebook').hover(function(){
        $(this).attr('src', 'img/facebook2.png');
    }, function(){
        $(this).attr('src', 'img/facebook.png');
    })
    $('.SocialYoutube').hover(function(){
        $(this).attr('src', 'img/youtube2.png');
    }, function(){
        $(this).attr('src', 'img/youtube.png');
    })
    
    
    /*$('#en').click(function(){
        $('body').translate('en',{toggle:true, not:'.notranslate'});
         $('menu li').css('font-size', '19px');
        $.getJSON('pages/idioma/2');
    });
    $('#br').click(function(){
        $('body').translate('pt-br',{toggle:true, not:'.notranslate'});
        $('menu li').css('font-size', '22px');
        $.getJSON('pages/idioma/1');
    });
    $('#es').click(function(){
        $('body').translate('es',{toggle:true, not:'.notranslate'});
        $.getJSON('pages/idioma/3');
    });
    $.getJSON('pages/idioma',function(data){
        alert(data);
        if(data==1){
            $('#br').click();
        }
        if(data==2){
            $('#en').click();
        }
        if(data==3){
            $('#es').click();
        }
    });*/

    $('#en').click(function(){
        $('body').translate('en',{
            toggle:true, 
            not:'.notranslate'
        });
        $('menu li').css('font-size', '19px');
        $.cookie("locale", "en", {
            expires: 7
        });
    });

    $('#es').click(function(){
        $('html').translate('es');
        $.cookie("locale", "es", {
            expires: 7
        });
    });
    $('#br').click(function(){
        $('body').translate('pt-br',{
            toggle:true, 
            not:'.notranslate'
        });
        $('menu li').css('font-size', '22px');
        $.cookie("locale", "pt", {
            expires: 7
        });
    });

    $("#" + $.cookie('locale')).click();
    
});
