﻿/*function mostrar_reserva() {
    $("#div_frm_reserva").dialog('destroy');

    $("#div_frm_reserva").setTemplateURL('./templates/formulariocreareserva.htm', null, { filter_data: false });
    $("#div_frm_reserva").setParam('DivId', 'master');
    $("#div_frm_reserva").setParam('MostrarTelefonoReserva', 'GMostrarTelefonoReserva');
    $("#div_frm_reserva").setParam('MostrarMailReserva', 'GMostrarMailReserva');
    $("#div_frm_reserva").processTemplate();

    $("#div_frm_reserva").show("blind");

    $('#div_frm_reserva').show();
    $("#div_frm_reserva").dialog({
        bgiframe: true,
        resizable: false,
        modal: true,
        width: 436,
        show: 'slide',
        zIndex: 0,
        buttons: {
            'Cancelar': function() {
                $(this).dialog('close');
            },
            'Aceptar': function() {
                //$('#frm_reserva_master').validate();
                //if ($('#frm_reserva_master').valid()) {
                var myFormParams = $('#frm_reserva_master').serialize();
                var j = params2json(myFormParams);
                $.ajax({
                    type: "POST",
                    url: "Reserva.aspx/agregarreserva",
                    data: "{data:'" + j + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(data) {
                        data.d = data.d.replace(/\n/g, " ").replace(/\r/g, " ");
                        res = $.evalJSON(data.d);
                        if (res.status == "OK") {
                            $("#div_reservaactual").html('<strong>RESERVA: ' + res.mensaje + '</strong>');
                            alerta("Su reserva ha sido agregada.");
                            GCrearReserva = "N";
                        }
                        else if (res.status == "ERR") {
                            alerta(res.mensaje);
                        }
                    }
                });

                $(this).dialog('close');
                $("#div_resultadocarrito").dialog('close');
                //}
            }
        }
    });
}*/

function mostrar_reserva() {
    GCrearReserva = "S";
    $("#div_reservaactual").html('<strong>RESERVA: ' + 'Ingrese su reserva' + '</strong>');
    $.ajax({
        type: "POST",
        url: "Reserva.aspx/nuevaReserva",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json"
    });
}

function mostrar_reservas() {
    if (VerificarLogin() == "N") {
        mostrar_login();
        return;
    }
    document.location.href = "./MisReservas.aspx";
}
