{{terminalErrorHeading}}

An error has occurred

window.setTimeout(function(){ var scope = angular.element('#ng-app').scope(); var t = scope.terms.map(function(e){return e.termId}) if(t.indexOf("TMDFRDUDVXOR")> -1 || t.indexOf("TM689GF867ME")> -1){ $(".angular-terminal-error").hide(); $(".js-terminal-error").show(); $(".angular-terminal-error-heading").text("Lamentamos mas esta oferta é exclusiva a utilizadores que não tiveram, no passado, uma assinatura Observador") } },1)

{{terminalError}}

Dados fiscais

$(function() { setTimeout(function() { var alreadyFilled = false; var paymentData = {}; var $options = null; var $name = null; var $nif = null; var $address = null; var $city = null; var $postalCode = null; function validateNIF(nif) { if (nif === '') { return false; } var re = /^\d{9}$/g; if (re.test(nif)) { var firstDigit = nif[0]; if (firstDigit !== '0' && firstDigit !== '3' && firstDigit !== '4' && firstDigit !== '7') { return true; } } return false; } $("#invoice-save-data").click(function(e) { $name = $(".invoice-name"); $nif = $(".invoice-nif"); $address = $(".invoice-morada"); $city = $(".city"); $postalCode = $(".invoice-postal-code"); if ($name.val() == "") { $(".error-message").html("Tem que preencher o nome."); $(".error-message").addClass("error"); $name.focus(); return; } if ($nif.val() == "" || !validateNIF($nif.val())) { $(".error-message").html("NIF inválido."); $(".error-message").addClass("error"); $nif.focus(); return; } var data = { real_name: $name.val(), nif: $nif.val(), }; if ($address.val()) { data.address = { address: $address.val(), city: $city.val(), postal_code: $postalCode.val() } } window.parent.postMessage({ command: "setUserPaymentData", payload: data }, "*"); }); $(".invoice-checkbox").change(function() { $options = $(".payment-options-wrapper"); $otherBlock = $(".selected-payment-method"); if (this.checked) { $(".error-message").html(""); $name = $(".invoice-name"); $nif = $(".invoice-nif"); $address = $(".invoice-morada"); $city = $(".city"); $postalCode = $(".invoice-postal-code"); if (!alreadyFilled) { $name.val(paymentData.real_name); $nif.val(paymentData.nif); if (paymentData.address) { $address.val(paymentData.address.address ? paymentData.address.address : ""); $city.val(paymentData.address.city ? paymentData.address.city : ""); $postalCode.val(paymentData.address.postal_code ? paymentData.address.postal_code : ""); } alreadyFilled = true; } $otherBlock.addClass("disabled"); $options.addClass("disabled"); } else { $otherBlock.removeClass("disabled"); $options.removeClass("disabled"); } }); window.addEventListener("message", function(e) { if (e.origin.indexOf("observador.pt", e.origin.length - "observador.pt".length) === -1) { return; } if (e.data.command) { switch (e.data.command) { case "getUserPaymentDataRtn": console.log("getUserPaymentDataRtn", e.data); paymentData = e.data.payload; break; case "setUserPaymentDataRtn": $(".error-message").removeClass("error"); if (e.data.payload) { $(".error-message").html("Alterações guardadas."); $options.removeClass("disabled"); $otherBlock.removeClass("disabled"); } else { $(".error-message").html("Ocorreu um erro ao guardar as alterações."); $(".error-message").addClass("error"); } break; } } }, false); window.parent.postMessage({ command: "getUserPaymentData" }, "*"); // Code to make sure credits cards are valid for X months var scope = angular.element('#ng-app').scope(); var cc_min_expiration_months = 0; if (scope.selectedTerm.termId == "TMWL0VDHGVIE") { cc_min_expiration_months = 2; } else if (scope.selectedTerm.termId == "TMZZTEJDYYKJ") { cc_min_expiration_months = 13; } function monthDiff(dateTo) { var dateFrom = new Date(2021, 04); return dateTo.getMonth() - dateFrom.getMonth() + (12 * (dateTo.getFullYear() - dateFrom.getFullYear())); } if (cc_min_expiration_months > 0) { $(".credit").click(function() { window.setTimeout(function() { function ev(e) { // Current input values var valueYear = parseInt(document.querySelector("input[name=expire_year]").value); var valueMonth = parseInt(document.querySelector("input[name=expire_month]").value); // Make sure they're ready to validate console.log(monthDiff(new Date(2000 + valueYear, valueMonth))); if ( valueYear > 9 && valueMonth > 0 && monthDiff(new Date(2000 + valueYear, valueMonth)) < cc_min_expiration_months ) { $(".complete-purchase").addClass("complete-purchase-disabled"); $(".timeframe").text(cc_min_expiration_months); $(".js-message-block").show(); } else { $(".complete-purchase").removeClass("complete-purchase-disabled"); $(".js-message-block").hide(); } } var input = document.querySelector(`input[name=expire_year]`); input.addEventListener("keyup", ev); var input = document.querySelector(`input[name=expire_month]`); input.addEventListener("keyup", ev); }, 600); }); } }); }, 1);

Uma assinatura
para toda a família
só 99€

Celebre connosco
o Dia da Família

Assinatura anual de grupo
para até 5 utilizadores
Termina em 00h 00m 00s
Outras modalidades

function getTimeRemaining(endtime){ const total = Date.parse(endtime) - Date.parse(new Date()); const seconds = Math.floor( (total/1000) % 60 ); const minutes = Math.floor( (total/1000/60) % 60 ); const hours = Math.floor( (total/(1000*60*60)) ); const days = Math.floor( total/(1000*60*60*24) ); return { total, days, hours, minutes, seconds }; } function initializeClock(id, endtime) { const clock = document.getElementById(id); function updateClock(){ const t = getTimeRemaining(endtime); html = ''; if ( t.days > 0 || t.hours > 0 ) { html += t.hours + 'h '; } html += t.minutes + 'm '; html += t.seconds + 's'; if (t.total <= 0) { clearInterval(timeinterval); } clock.innerHTML = html; } updateClock(); // run function once at first to avoid delay var timeinterval = setInterval(updateClock,1000); } const deadline = 'May 15 2021 23:59:59 GMT+0100'; initializeClock('obs-timer', deadline); /* $(function(){ window.parent.postMessage({command: "getColorScheme"}, "*"); window.addEventListener("message", function (e) { if(e.data.command == "setColorScheme"){ document.querySelector(".obs-wrapper").classList.remove("light") document.querySelector(".obs-wrapper").classList.remove("dark") document.querySelector(".obs-wrapper").classList.add(e.data.payload.color_scheme) } }, false); }); */