function ver_voucher() { var cant_items_no_vacios = 0; if ($('#txtNroVoucherToSearch').val() != '') { cant_items_no_vacios++; } if ($('#txtApellidoVoucherToSearch').val() != '') { cant_items_no_vacios++; } if ($('#txtNombreVoucherToSearch').val()) { cant_items_no_vacios++; } if (cant_items_no_vacios > 1) { window.open("https://www.my-trip-assist.com/voucher.php?nro={VOUCHER}&apellido={APELLIDO}&nombre={NOMBRE}".replace("{VOUCHER}", $('#txtNroVoucherToSearch').val()).replace("{APELLIDO}", $('#txtApellidoVoucherToSearch').val()).replace("{NOMBRE}", $('#txtNombreVoucherToSearch').val())); } else { alerta('Al menos debe ingresar dos datos para verificar su voucher'); } } function ValidateFormContactoEmergencia() { var sError = ''; sError += ChequearInputVacio('txtNombreApellido', 'Nombre y Apellido'); sError += ChequearInputVacio('txtNroVoucher', 'Nº de voucher'); sError += ChequearInputVacio('txtPais', 'País donde se encuentra'); sError += ChequearInputVacio('txtMail', 'Email'); sError += ChequearMailValido('txtMail', 'Email'); sError += ChequearInputVacio('txtNombreContacto', 'Nombre de contacto'); sError += ChequearInputVacio('txtCiudad', 'Ciudad donde se encuentra'); sError += ChequearInputVacio('txtDomicilio', 'Domicilio'); sError += ChequearInputVacio('txtMensaje', 'Mensaje'); return sError; } function enviar_contacto_emergencia() { if (TestSubmitForm("frmContactoEmergencia", "", ValidateFormContactoEmergencia, false)) { showLoading(); var tipo = 'contacto_emergencia' grecaptcha.ready(function() { var form = $('#frmContactoEmergencia') grecaptcha.execute('6LcmzxkiAAAAAGp1yrX3qNiwk6N3TuSaZaqtuJvX', {action: tipo}).then(function(token) { form.prepend(''); form.prepend(''); $.post("https://www.my-trip-assist.com/ajax/solicitud_contacto_emergencia", form.serialize(), function (data) { resultado_enviar_solicitud_contacto_emergencia(data); hideLoading(); }); }); }); } return false; } function enviar_contacto() { if (TestSubmitForm("frmContacto", "", ValidateFormContacto, false)) { var tipo = $('#cmbMotivoContacto').val() tipo = (tipo ? tipo : "contacto") grecaptcha.ready(function() { var form = $('#frmContacto') grecaptcha.execute('6LcmzxkiAAAAAGp1yrX3qNiwk6N3TuSaZaqtuJvX', {action: tipo}).then(function(token) { form.prepend(''); form.prepend(''); $.post("https://www.my-trip-assist.com/ajax/solicitud_contacto", form.serialize(), function (data) { resultado_enviar_solicitud_contacto(data); }); }); }); } return false; } function ValidateFormContacto() { var sError = ''; if ($('#cmbMotivoContacto').length > 0) { sError += ChequearInputVacio('cmbMotivoContacto', 'Motivo de contacto'); } sError += ChequearInputVacio('txtNombreApellido', 'Nombre y Apellido'); sError += ChequearInputVacio('txtMailContacto', 'Email'); sError += ChequearMailValido('txtMailContacto', 'Email'); sError += ChequearInputVacio('txtMensajeContacto', 'Mensaje'); return sError; } function resultado_enviar_solicitud_contacto(data) { var result = eval('(' + data + ')'); if (result.status) { var mensaje = 'El mensaje ha sido enviado.

A la brevedad un representate se pondrá en contacto con usted.

'; if ($("#txtNroSolicitud").val()) { mensaje += '\nEl código de su solicitud es: "' + $("#txtNroSolicitud").val() + '" por favor guárdelo para futuras referencias.'; } $('#frmContacto').trigger('reset'); if ($("#txtNroSolicitud").length > 0) { $("#txtNroSolicitud").val(makeid(10)); } show_popup('
' + mensaje + '
', { afterClose: reloadPageFancyBox }); } else { show_popup('
El mensaje no ha podido ser enviado.

Por favor, intentelo nuevamente màs tarde.

', { afterClose: reloadPageFancyBox }); } return false; } function reloadPageFancyBox(ins, cur) { window.location.reload(true); } function resultado_enviar_solicitud_contacto_emergencia(data) { var result = eval('(' + data + ')'); if (result.status) { show_popup('
El mensaje ha sido enviado.

A la brevedad un representate se pondrá en contacto con usted.

', { afterClose: reloadPageFancyBox }); } else { show_popup('
El mensaje no ha podido ser enviado.

Por favor, intentelo nuevamente màs tarde.

', { afterClose: reloadPageFancyBox }); } return false; } function encode_utf8(s) { return unescape(encodeURIComponent(s)); }