$(document).ready(function()
{
    $('#olvidado').click(function(e)
    {
        e.preventDefault();
        $('div#form-olvidado1').toggle('500');
    });
    $('#olvidado').click(function(e)
    {
        e.preventDefault();
        $('div#form-olvidado').toggle('500');
    });
    $('#acceso1').click(function(e)
    {
        e.preventDefault();
        $('div#form-olvidado').toggle('500');
    });
    $('#acceso1').click(function(e)
    {
        e.preventDefault();
        $('div#form-olvidado1').toggle('500');
    });
});

$(document).ready(function()
{
    $('#olvidado2').click(function(e)
    {
        e.preventDefault();
        $('div#form-olvidado2').toggle('500');
    });
    $('#olvidado2').click(function(e)
    {
        e.preventDefault();
        $('div#form-olvidado').toggle('500');
    });
    $('#acceso2').click(function(e)
    {
        e.preventDefault();
        $('div#form-olvidado').toggle('500');
    });
    $('#acceso2').click(function(e)
    {
        e.preventDefault();
        $('div#form-olvidado2').toggle('500');
    });
});

$(document).ready(function()
{    

$('.multiselect').multiselect(
{
    maxHeight: 200,
    filterBehavior: 'value'
});

$('#professionals-0-sectors-ids').multiselect(
{
    maxHeight: 200,
    filterBehavior: 'value'
});

$('#risk-factors-ids').multiselect(
{
    maxHeight: 200,
    filterBehavior: 'value'
});
    
$('#sectors-ids').multiselect(
{
    maxHeight: 200,
    filterBehavior: 'value'
});

$('#tev-options-ids').multiselect(
{
    maxHeight: 200,
    enableFiltering: true,
    enableFullValueFiltering: true,
    enableCaseInsensitiveFiltering: true,
    filterBehavior: 'value'
});

 $('#pain-characteristics-ids').multiselect(
    {
        maxHeight: 200,
        enableFiltering: true,
        enableFullValueFiltering: true,
        enableCaseInsensitiveFiltering: true
        //filterBehavior: 'value'
    });
    $('#pain-characteristic-ids').multiselect(
    {
        maxHeight: 200,
        enableFiltering: true,
        enableFullValueFiltering: true,
        enableCaseInsensitiveFiltering: true
        //filterBehavior: 'value'
    });

    $('#pain-characteristics-id').multiselect(
    {
        maxHeight: 200,
        enableFiltering: true,
        enableFullValueFiltering: true,
        enableCaseInsensitiveFiltering: true
        //filterBehavior: 'value'
    });

    $('#list-antibiotics-ids').multiselect(
    {
        maxHeight: 200,
        enableFiltering: true,
        enableFullValueFiltering: true,
        enableCaseInsensitiveFiltering: true,
        // filterBehavior: 'value'
    });
    $('#professionals-0-specialties-ids').multiselect(
    {
        maxHeight: 200,
        enableFiltering: true,
        enableFullValueFiltering: true,
        enableCaseInsensitiveFiltering: true
    });

    $('#specialties-ids').multiselect(
    {
        maxHeight: 200,
        enableFiltering: true,
        enableFullValueFiltering: true,
        enableCaseInsensitiveFiltering: true
    });

    $('#areas-of-occupation').multiselect(
    {
        maxHeight: 200
    });

    $('#comorbidities-ids').multiselect(
    {
        maxHeight: 200
    });

    $('#other-comorbidities-ids').multiselect(
    {
        maxHeight: 200
    });

    $('#defects-and-anomalies-ids').multiselect(
    {
        maxHeight: 200
    });

     $('.multiselect_yo').multiselect(
    {
        maxHeight: 200
    });


     $('#type-of-anesthesias-ids').multiselect(
    {
        maxHeight: 200
    });

    $('#surgical-materials-ids').multiselect(
    {
        maxHeight: 200
    });

    $('#professionals-ids').multiselect(
    {
        maxHeight: 200
    });

    $('#surgical-complications-ids').multiselect(
    {
        maxHeight: 200
    });

    $('#type_of_anesthesias_idd').multiselect(
    {
        maxHeight: 200
    });

    $('#potenciais-orgaos-ids').multiselect(
    {
        maxHeight: 200,
    });

    $('#orgaos-captados-ids').multiselect(
    {
        maxHeight: 200,
    });

    
     

    $('#birthday').datepicker(
    {
        format: "dd/mm/yyyy",
        language: "pt-BR",
        multidate: false
    });

    $('#expected-discharge-day').datepicker(
    {
        format: "dd/mm/yyyy",
        language: "pt-BR",
        multidate: false
    });

    $('#diagnostic-date').datepicker(
    {
        format: "dd/mm/yyyy",
        language: "pt-BR",
        multidate: false
    });

     $('.date').datepicker(
    {
        format: "dd/mm/yyyy",
        language: "pt-BR",
        multidate: false
    });

    $("#goback").click(function()
    {        
        goBack();

    });

    

});
function goBack(){
        window.history.back();
    }

jQuery(function($)
{
    //var htmlHeight = $( document ).height();

    //$('html').height(htmlHeight);
    //$('html').style.minHeight = htmlHeight;

    $("#birthday").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
    $("#diagnostic-date").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
    $("#expected-discharge-day").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
    $("#date-instalation").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
     $("#date-of-withdrawal").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
     $("#reinsert-date").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
      $("#data-inicio").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
       $("#data-termino").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
         $("#data-da-instalacao").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
    $("#data-da-retirada").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });

    $(".date").mask("99/99/9999",
    {
        placeholder: "dd/mm/yyyy"
    });
    
    //$.mask.definitions['~'] = '([0-9] )?';
    //$("#phone-number").mask("(99) ?99999-9999")

    $("#cellphone-number")
        .mask("(99) 9999-9999?9")
        .focusout(function (event) {  
            var target, phone, element;  
            target = (event.currentTarget) ? event.currentTarget : event.srcElement;  
            phone = target.value.replace(/\D/g, '');
            element = $(target);  
            element.unmask();  
            if(phone.length > 10) {  
                element.mask("(99) 99999-999?9");  
            } else {  
                element.mask("(99) 9999-9999?9");  
            }  
        });
    $("#phone-number")
        .mask("(99) 9999-9999?9")
        .focusout(function (event) {  
            var target, phone, element;  
            target = (event.currentTarget) ? event.currentTarget : event.srcElement;  
            phone = target.value.replace(/\D/g, '');
            element = $(target);  
            element.unmask();  
            if(phone.length > 10) {  
                element.mask("(99) 99999-999?9");  
            } else {  
                element.mask("(99) 9999-9999?9");  
            }  
        });

    $("#telephone-number")
    .mask("(99) 9999-9999?9")
    .focusout(function (event) {  
        var target, phone, element;  
        target = (event.currentTarget) ? event.currentTarget : event.srcElement;  
        phone = target.value.replace(/\D/g, '');
        element = $(target);  
        element.unmask();  
        if(phone.length > 10) {  
            element.mask("(99) 99999-999?9");  
        } else {  
            element.mask("(99) 9999-9999?9");  
        }  
    });

    $(".telephone-number")
    .mask("(99) 9999-9999?9")
    .focusout(function (event) {  
        var target, phone, element;  
        target = (event.currentTarget) ? event.currentTarget : event.srcElement;  
        phone = target.value.replace(/\D/g, '');
        element = $(target);  
        element.unmask();  
        if(phone.length > 10) {  
            element.mask("(99) 99999-999?9");  
        } else {  
            element.mask("(99) 9999-9999?9");  
        }  
    });

    $("#telephone").mask("(99) 9999-9999");
    
    $("#telephones-ids").mask("(99) 9999-9999");
    $("#professionals-0-telephone").mask("(99) 9999-9999");
    $("#cep").mask("99999-999");
    $(".cep").mask("99999-999");

    $('#cpf').mask('999.999.999-99');
    $('#document-number').mask('999.999.999-99');

    $('#professionals-0-cpf').mask('999999999-99');

    $('.time').mask('99:99');
    $('.temp').mask('99,9');
    $('#hour-instalation').mask('99:99');
    $('#withdrawal-time').mask('99:99');
    $('#reinsert-time').mask('99:99');
    $('#hora-da-instalacao').mask('99:99');
    $('#hora-da-retirada').mask('99:99');
    
    

    $(".collapseAccordion").hover(function()
    {
        //$(this).trigger('click');
    });



});
