﻿//-------------------------------------------------------------------------------
// BANNER

$(document).ready(function () {

    $(".ItemShow a + a").click(function () {
        $("#ListaVip").fadeIn();
        $("#Mailing").hide();
        $('.Code').val($(this).attr('title'))
                

    });

    $("#RecebaMailing").click(function () {
        $("#Mailing").fadeIn();
        $("#ListaVip").hide();
    });

    $(".CloseWindow").click(function () {
        $(".janelaBox").fadeOut();
    });


});




$(document).ready(function () {
    $('#banner').cycle({
        fx: 'scrollUp',
        speed: 300,
        timeout: 5000

    });
});

//-------------------------------------------------------------------------------
// GALERIAS

$(document).ready(function () {
    $("area[rel^='prettyPhoto']").prettyPhoto();

    $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({ animation_speed: 'normal', theme: 'facebook', slideshow: false, autoplay_slideshow: false });
    $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({ animation_speed: 'fast', slideshow: 10000, hideflash: true });

    $("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
        custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
        changepicturecallback: function () { initialize(); }
    });

    $("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
        custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
        changepicturecallback: function () { _bsap.exec(); }
    });
});


//-------------------------------------------------------------------------------
// VALIDAÇÕES 
function validaMailing() {
    with (document.forms[0]) {

        if (ContentPlaceHolder1_AddMailing_tbNome.value == '') {
            alert('Insira seu Nome')
            ContentPlaceHolder1_AddMailing_tbNome.focus();
            return false;
        }

        if (ctl00$ContentPlaceHolder1$tbEmail.value == '') {
            alert('Insira seu Email')
            ctl00$ContentPlaceHolder1$tbEmail.focus();
            return false;
        } 
    } 
}

function validaLista() {
    with (document.forms[0]) {

        if ((ctl00$ContentPlaceHolder1$AddLista$tbNome.value).replace(/^\s+|\s+$/g, "") == '') {
            alert('Insira seu Nome')
            ctl00$ContentPlaceHolder1$AddLista$tbNome.focus();
            return false;
        }

        var campo_email = ctl00$ContentPlaceHolder1$AddLista$tbEmail.value;
        //Checando se o endereço e-mail não esta vazio
        if (campo_email == "") {
            alert("É necessário o preenchimento deste campo.");
            campo_email.focus();
            return false;
        }

        //Checando se o endereço de e-mail é válido
        if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(campo_email))) {
            alert("É necessário o preenchimento de um endereço de e-mail válido.");
            campo_email.focus();
            return false;
        }
    }
}


