﻿function EscondeDivs() {

    $('.banner').css("height", "380px");
    $('.banner').css("clear", "both");
    $('#slider1').css("height", "180px");
    $('.banner-top').css("height", "310px");
    $('.casos-novidades').css("height", "470px");

}


function AcertaDivDepCaso() {

    $('.dep-casos').css("height", "150px");
    $('.depoimentos').css("height", "150px");
    $('.depoimentos-main').css("height", "150px");

}

function AcertaDivContato() {

    $('.contato-sl').css("height", "450px");
}


function AcertaDivSC() {

    $('#scd').css("height", "580px");
}

function AcertaDivPonto() {

    $('#imagens-sist').css("height", "290px");
}

function AcertaDivDC() {

    $('#solucoes').css("height", "2569px");
} 

function MostraDivs(pDivName) {

    if (pDivName == 'folha') {

        $('.banner-folha')
            .animate({ opacity: 0 }, 'slow', function () {
                $(this)
                    .css({ "display": "inline" })  
                    .animate({ opacity: 1 });
            });

        $('.banner-treina')
            .animate({ opacity: 0 }, 'slow', function () {
                $(this)
                    .css({ "display": "none" })
                    .animate({ opacity: 1 });
            });

        $('.banner-proj')
            .animate({ opacity: 0 }, 'slow', function () {
                $(this)
                    .css({ "display": "none" })
                    .animate({ opacity: 1 });
            });
        
        $('.banner-nav-folha').css("border" , "1px solid #C0C0C0");
        $('.banner-nav-treina').css("border" , "0px solid #C0C0C0");
        $('.banner-nav-proj').css("border" , "0px solid #C0C0C0");

    }

    if (pDivName == 'treina') {

        $('.banner-treina')
            .animate({ opacity: 0 }, 'slow', function () {
                $(this)
                    .css({ "display": "inline" })
                    .animate({ opacity: 1 });
            });

        $('.banner-folha')
            .animate({ opacity: 0 }, 'slow', function () {
                $(this)
                    .css({ "display": "none" })
                    .animate({ opacity: 1 });
            });

        $('.banner-proj')
            .animate({ opacity: 0 }, 'slow', function () {
                $(this)
                    .css({ "display": "none" })
                    .animate({ opacity: 1 });
            });

        $('.banner-nav-folha').css("border" , "0px solid #C0C0C0");
        $('.banner-nav-treina').css("border" , "1px solid #C0C0C0");
        $('.banner-nav-proj').css("border" , "0px solid #C0C0C0");
    }


    if (pDivName == 'proj') {

        $('.banner-proj')
            .animate({ opacity: 0 }, 'slow', function () {
                $(this)
                    .css({ "display": "inline" })
                    .animate({ opacity: 1 });
            });

        $('.banner-folha')
            .animate({ opacity: 0 }, 'slow', function () {
                $(this)
                    .css({ "display": "none" })
                    .animate({ opacity: 1 });
            });

        $('.banner-treina')
            .animate({ opacity: 0 }, 'slow', function () {
                $(this)
                    .css({ "display": "none" })
                    .animate({ opacity: 1 });
            });

        $('.banner-nav-folha').css("border" , "0px solid #C0C0C0");
        $('.banner-nav-treina').css("border" , "0px solid #C0C0C0");
        $('.banner-nav-proj').css("border" , "1px solid #C0C0C0");
    }


}

function AbreMapa() {
    var purl = "http://maps.google.com.br/maps?q=Lato+Software+Ltda+-+Avenida+Doutor+Afonso+Vergueiro,+Sorocaba+-+S%C3%A3o+Paulo&hl=pt-BR&ie=UTF8&sll=-23.504466,-47.475956&sspn=0.008117,0.013937&oq=Lato+Software&hq=Lato+Software+Ltda+-&hnear=Av.+Dr.+Afonso+Vergueiro+-+Sorocaba+-+S%C3%A3o+Paulo,+18040-000&t=h&z=16&iwloc=B";
    mywindow = window.open(purl, "mywindow", "status=0,toolbar=0,resizable=0,width=1010,height=800");
}

function chamaPagina(pagina) {

    if (pagina == 'projeto') {
        window.location.href = "ProjetosSoftware.aspx";
    }

    if (pagina == 'visualfolha') {
        window.location.href = "VisualFolha-Software-Folha-Pagamento.aspx";
    }

    if (pagina == 'ponto') {
        window.location.href = "PontoEletronico.aspx";
    }

    if (pagina == 'visualcargo') {
        window.location.href = "DescriacaodeCargo_e_Treinamento.aspx";
    }

    if (pagina == 'treinamento') {
        window.location.href = "GestaodeTreinamento.aspx";
    }

}

function validaVF() {


    var pComp  = document.getElementById("rbSimVF");
    var pComp2 = document.getElementById("rbNaoVF");
    if ((!pComp.checked) && (!pComp2.checked)) {
        alert('Utiliza Ponto Eletrônico é obrigatório.');
        pComp.focus();
        return false;
    }

    var pComp = document.getElementById("txtNumFuncVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Número de Funcionários é obrigatório.');
        pComp.focus();
        return false;
    }

    var pComp = document.getElementById("txtNomeEmpVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Nome da Empresa é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtNomeVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Seu Nome é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtCidadeVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Cidade é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtEstadoVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Estado é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtEmailVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('E-mail é obrigatório.');
        pComp.focus();
        return false;
    }

    if (!Page_IsValid) {
        alert('E-mail com formato incorreto.');
        pComp.focus();
        return false;
    }

   return true;

}


function validaVC() {


    var pComp = document.getElementById("rbSimVC");
    var pComp2 = document.getElementById("rbNaoVC");
    if ((!pComp.checked) && (!pComp2.checked)) {
        alert('Possui Folha de Pagamento é obrigatório.');
        pComp.focus();
        return false;
    }

    var pComp = document.getElementById("txtNumFuncVC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Número de Funcionários é obrigatório.');
        pComp.focus();
        return false;
    }

    var pComp = document.getElementById("txtNomeEmpVC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Nome da Empresa é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtNomeVC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Seu Nome é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtCidadeVC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Cidade é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtEstadoVC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Estado é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtEmailVC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('E-mail é obrigatório.');
        pComp.focus();
        return false;
    }

    if (!Page_IsValid) {
        alert('E-mail com formato incorreto.');
        pComp.focus();
        return false;
    }

    return true;

}


function validaUC() {

    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_UCContato1_txtNomeEmpVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Nome da Empresa é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_UCContato1_txtNomeVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Seu Nome é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_UCContato1_txtCidadeVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Cidade é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_UCContato1_txtEstadoVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Estado é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_UCContato1_txtEmailVF");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('E-mail é obrigatório.');
        pComp.focus();
        return false;
    }

    if (!Page_IsValid) {
        alert('E-mail com formato incorreto.');
        pComp.focus();
        return false;
    }

    return true;

}

function validaP() {

    var pComp = document.getElementById("txtNomeEmpP");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Nome da Empresa é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtNomeP");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Seu Nome é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtCidadeP");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Cidade é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtEstadoP");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Estado é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtEmailP");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('E-mail é obrigatório.');
        pComp.focus();
        return false;
    }

    var pComp = document.getElementById("txtMsgP");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Mensagem é obrigatório.');
        pComp.focus();
        return false;
    }

    if (!Page_IsValid) {
        alert('E-mail com formato incorreto.');
        pComp.focus();
        return false;
    }

    return true;

}


function validaCont() {

    var pComp = document.getElementById("txtNomeEmpC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Nome da Empresa é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtNomeC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Seu Nome é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtCidadeC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Cidade é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtEstadoC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Estado é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("txtEmailC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('E-mail é obrigatório.');
        pComp.focus();
        return false;
    }

    var pComp = document.getElementById("txtMsgC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Mensagem é obrigatório.');
        pComp.focus();
        return false;
    }

    if (!Page_IsValid) {
        alert('E-mail com formato incorreto.');
        pComp.focus();
        return false;
    }

    return true;

}


function validaContato() {

    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_txtNomeEmpC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Nome da Empresa é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_txtNomeC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Seu Nome é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_txtCidadeC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Cidade é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_txtEstadoC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Estado é obrigatório.');
        pComp.focus();
        return false;
    }
    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_txtEmailC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('E-mail é obrigatório.');
        pComp.focus();
        return false;
    }

    var pComp = document.getElementById("ctl00_ContentPlaceHolder1_txtMsgC");
    if (pComp.value == "" || pComp.value == null || pComp.value == "0") {
        alert('Mensagem é obrigatório.');
        pComp.focus();
        return false;
    }

    if (!Page_IsValid) {
        alert('E-mail com formato incorreto.');
        pComp.focus();
        return false;
    }

    return true;

}


function ChamaContato(op) {

    window.open("SolicitaProposta.aspx?tela="+op, "mywindow", "status=0,toolbar=0,width=900,height=580");    
    return false;

}

function chamaSCFolha() {

    wOpen = window.open("VisualFolha-Telas-do-Software.aspx", "mywindow", "status=0,toolbar=0,width=1020,height=630");
    wOpen.focus();
    wOpen.moveTo(0, 0);
    wOpen.resizeTo(screen.availWidth, screen.availHeight);
    return false;

}

function chamaSCPonto() {

    window.open("PontoEletronico-Telas-do-Software.aspx", "mywindow", "status=0,toolbar=0,width=1020,height=800");
    return false;

}

function getUrlVars() {
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for (var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

function MascaraTelefone(pObj, event) {
    
    var retorno = mascararInteiro(event);

    if (retorno) {
        Mascara.mascararTelefone(pObj, event);
    }

    return retorno;
}

function MostraHintProj(obj) {

    var p = $(obj)
    var position = p.position();

    $('#hint').css("visibility", "");
    $('#hint').css("left", position.left + "px");
    $('#hint').css("top", position.top + 50 + "px");
    $("#hint").fadeIn(900);

}


function EscondeHintProj() {

    $('#hint').css("visibility", "hidden");
    $("#hint").fadeOut(900);
}

indexDep = 1;

function TrocaDepoimento() {

    if (indexDep == 0) {
        $('#txtdep').text('Mais do que um fornecedor encontramos na Lato um parceiro para nossos projetos de software. A qualidade dos projetos entregues, aliada ao cumprimento dos prazos acordados, era o diferencial que buscávamos no mercado.');
        $('#txtnome').text('Denise Camargo - Gerente de TI - Iharabras Indústria Química');
        indexDep = indexDep + 1;
        return;
    }

    if (indexDep == 1) {
        $('#txtdep').text('A solução desenvolvida foi exatamente ao encontro daquilo que especificamos: um sistema leve, enxuto e objetivo, que permitisse mobilidade de acesso em qualquer lugar. Estamos plenamente satisfeitos.');
        $('#txtnome').text('Daniel Mathiazzi - Sócio Diretor - BC Consult');
        indexDep = indexDep + 1;
        return;
    }

    if (indexDep == 2) {
        $('#txtdep').text('Com o sistema de Controle de Temperatura (Indicmax), desenvolvido pela Lato Software, ganhamos agilidade e alcançamos o diferencial esperado na comercialização dos nossos produtos.');
        $('#txtnome').text('Alexandre Massaglia - Diretor Italterm Sistemas e Controles Industriais.');
        indexDep = 0;
        return;
    }
}

