jQuery(document).ready(function(){
    $('#message').innerfade({
        animationtype: 'slide',
        speed: 1000,
        timeout: 5000,
        containerheight: '53px'
    });
    $("#contentShow").innerfade({
        speed: 1000,
        timeout: 5000,
        type: 'sequence',
        containerheight: '220px'
    });
    $("#listImage").innerfade({
        speed: 1000,
        timeout: 5000,
        type: 'sequence',
        containerheight: '170px'
    });
    $('#nav li').hover(function() {$(this).children('a').addClass('over');$(this).children('ul').slideDown('fast');},function() {$(this).children('a').removeClass('over');$(this).children('ul').slideUp('fast');});
    $('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
                if ($target.length) {
                    var targetOffset = $target.offset().top;
                    $('html,body').animate({scrollTop: targetOffset}, 1000);
                return false;
                }
        }
    });
    $("a[rel^='photo']").prettyPhoto({
        animationSpeed: 'normal',
        padding: 30,
        opacity: 0.65,
        showTitle: false,
        allowresize: true,
        of_label: 'of',
        counter_separator_label: '/',
        theme: 'light_square',
        callback: function(){}
    });
    $('a#lnk').hover(function(){$(this).addClass('back');});
    $('#txtName').valid8({
        'regularExpressions': [
            { expression: /^.+$/, errormessage: 'Nome é requerido. Preencha o campo corretamente!'},
            { expression: /^[a-zA-Z' ']+$/, errormessage: 'Somente permitido letras maiuscúlas e miniscúlas!'}
        ]
    });
    $('#txtPhone').valid8({
        'regularExpressions': [
            { expression: /^({|}||([0-9?(-?)]))+$/, errormessage: 'Telefone não é válido!'},
            { expression: /^({|}||(\(\d{2}\)\d{1,4}\-\d{4}))+$/, errormessage: 'Telefone não é válido!'}
        ]
    });
    $('#txtMessage').valid8('Mensagem não foi preenchido. Preencha o campo corretamente!');
    $('#txtEmail').valid8({
        'regularExpressions': [
            { expression: /^({|}||[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)$/, errormessage: 'Email não é válido!'}
        ]
    });
    $('textarea').elastic();
});
