var avisar = true; function showDialog(title, message) { $("#dialog").dialog("option","draggable", false); $("#dialog").dialog("option","resizable", false); $("#dialog").dialog("option","title",title); $("#dialog").text(message); $("#dialog").dialog("option","modal",true); $("#dialog").dialog('open'); } function avisoConsentimiento() { showDialog('','Pulse en el enlace de la derecha para ver la informacion basica de tratamiento de datos'); return false; } function avisoSolicitud() { showDialog('','Pulse en el enlace de la derecha para ver los terminos de la solicitud'); return false; } function openLegalDialog(name) { setTimeout( function() { var dialog = "#dialog_" + name; $(dialog).dialog('open'); },100 ); } function submitForm(frm, action) { try { document.getElementById('div_err').value = ''; } catch (err) { ; } if (validarFormulario(frm.name, action)) { if (frm.name == 'frmSeleccionPlaza' && action == 'peticionCalculoTasasOEP') { document.getElementById('importe').value = ''; document.getElementById('pct_reduccion').value = ''; document.getElementById('importe_reducido').value = ''; document.getElementById('concepto').value = ''; } if (action) frm.action = action; frm.submit(); return true; } else { return false; } } function getFocus(campo) { /* if (campo.value==campo.title) { // Si en el campo estaba el tooltip y coge el foco // borramos los datos y cambiamos el estilo campo.value = ""; campo.className = "tipoformobli"; } */ } function lostFocus(campo) { /* if (campo.value.length == 0) { // Si en el campo estaba el tooltip y coge el foco // borramos los datos y cambiamos el estilo //campo.value = campo.title; campo.className = "tipoformobli_tooltip"; } */ } function selectItemByValue(elmnt){ for(var i=0; i < elmnt.options.length; i++) { if(elmnt.options[i].value === elmnt.value) { elmnt.selectedIndex = i; break; } } } function actualizarCaptcha(v_url) { var captcha = document.getElementById('captcha_img'); if (captcha !== null) { captcha.src = v_url + '?sid=' + Math.random(); } setTimeout( function() { window.scrollTo(0,document.body.scrollHeight); },500 ); } function turnoChange(turno, div_adaptacion) { var div = document.getElementById('div_adaptacion'); if (turno.value === 'GENERAL') { div.setAttribute("style","display:none"); document.getElementById('adaptacion').value = ''; } else { div.setAttribute("style","display:block") if (avisar) { showDialog('','Recuerde que puede acogerse a una exencion por discapacidad'); avisar = false; } } } function noBackPlease2(window) { window.location.href += "#"; // making sure we have the fruit available for juice (^__^) window.setTimeout(function () { window.location.href += "!"; }, 50); }; // Prevent from working the back button (function (global) { if(typeof (global) === "undefined") { throw new Error("window is undefined"); } var _hash = "!"; var noBackPlease = function () { global.location.href += "#"; // making sure we have the fruit available for juice (^__^) global.setTimeout(function () { global.location.href += "!"; }, 50); }; global.onhashchange = function () { if (global.location.hash !== _hash) { global.location.hash = _hash; } }; global.onload = function () { noBackPlease(); // disables backspace on page except on input fields and textarea.. document.body.onkeydown = function (e) { var elm = e.target.nodeName.toLowerCase(); if (e.which === 8 && (elm !== 'input' && elm !== 'textarea')) { e.preventDefault(); } // stopping event bubbling up the DOM tree.. e.stopPropagation(); }; } })(window);