function fnTrocaCampos(a, c, b) { showObjectD(c); hideObjectD(a); if ($("#" + b).length) { oCampo.focus() } } function showObjectD(a) { if ($("#" + a).length) { $("#" + a).css({ display: "inline" }) } } function hideObjectD(a) { if ($("#" + a).length) { $("#" + a).css({ display: "none" }) } } function changeBookEngineTabs(a) { if ($("#bookEngineTabFlightsActiveContainer").length) { $("#bookEngineTabFlightsActiveContainer").css({ display: "none" }) } if ($("#bookEngineTabHotelsActiveContainer").length) { $("#bookEngineTabHotelsActiveContainer").css({ display: "none" }) } if ($("#bookEngineTabProgramsActiveContainer").length) { $("#bookEngineTabProgramsActiveContainer").css({ display: "none" }) } switch (a) { case "flights": $("#bookEngineTabFlightsActiveContainer").css({ display: "block" }); break; case "hotels": $("#bookEngineTabHotelsActiveContainer").css({ display: "block" }); break; case "hotelsFlights": $("#bookEngineTabHotelsFlightsActiveContainer").css({ display: "block" }); break; case "programs": $("#bookEngineTabProgramsActiveContainer").css({ display: "block" }); break } } function changeBookEngineTabs2(a) { if ($("#bookEngineTabByAirportActive").length) { $("#bookEngineTabByAirportActive").css({ display: "none" }) } if ($("#bookEngineTabByFlightActive").length) { $("#bookEngineTabByFlightActive").css({ display: "none" }) } if ($("#bookEngineTabByRouteActive").length) { $("#bookEngineTabByRouteActive").css({ display: "none" }) } switch (a) { case "ByAirport": $("#bookEngineTabByAirportActiveContainer").css({ display: "block" }); break; case "ByFlight": $("#bookEngineTabByFlightActiveContainer").css({ display: "block" }); break; case "ByRoute": $("#bookEngineTabByRouteActiveContainer").css({ display: "block" }); break } } function changeCalendar(a) { if (a == "show") { $("#globalFormHoraPartida").css({ display: "none" }); $("#globalFormHoraRegresso").css({ display: "none" }); $("#bookEngineCalendar").css({ display: "block" }) } if (a == "hide") { $("#bookEngineCalendar").css({ display: "none" }); $("#globalFormHoraPartida").css({ display: "block" }); $("#globalFormHoraRegresso").css({ display: "block" }) } } function hotelStars(a, c, b) { var f = "stars"; var e = ""; if (typeof (a) == "undefined") { var a = 0 } if (isInt(a)) { if (a > 5) { var a = 5 } for (i = 0; i < a; i++) { e += '<img src="' + c + 'images/hotel/star2011_in.png" border="0" alt="' + a + ' Estrelas" class="' + f + '">' } total = 5; outStars = total - a; if (outStars) { for (i = 0; i < outStars; i++) { e += '<img src="' + c + 'images/hotel/star2011_out.png" border="0" alt="' + a + ' Estrelas" class="' + f + '">' } } } else { var d = 0; var f = ""; a = jQuery.trim(a); if (isInt(a.substr(0, 1))) { d = a.substr(0, 1); if (d > 5) { d = 5 } f = a.substr(a.indexOf(" "), a.lastIndexOf(" ") - 1); if (f.length > 0) { f = jQuery.trim(f).toLowerCase(); for (i = 0; i < d; i++) { e += "<img src='" + c + "images/hotel/" + f + "_in.png' border=0 class='" + f + "' alt='" + a + "'>" } if (f == "estrelas") { total = 5; outStars = total - d; if (outStars) { for (i = 0; i < outStars; i++) { e += "<img src='" + c + "images/hotel/" + f + "_out.png' border=0 class='" + f + "' alt='" + a + "'>" } } } } else { } } } if (typeof b !== "undefined") { $("#" + b + " .productResultsStars").html(e) } } function manageHotelsDetailTabs(a) { changeCalendar(0); if (a == "hosting") { document.getElementById("hotelDetailInfoContainer").style.display = "none"; document.getElementById("hotelDetailHostingContainer").style.display = "block" } if (a == "info") { document.getElementById("hotelDetailInfoContainer").style.display = "block"; document.getElementById("hotelDetailHostingContainer").style.display = "none" } } function SelectComboToText(a, d) { var c = new String(d.options[d.selectedIndex].text); var b = c.split(","); a.value = b[0] } function manageProgramsDetailTabs(a) { changeCalendar(0); if (a == "host") { document.getElementById("programsDetailItContainer").style.display = "none"; document.getElementById("programsDetailHostingContainer").style.display = "block"; document.getElementById("programsDetailCondContainer").style.display = "none"; document.getElementById("programsDetailInfContainer").style.display = "none" } if (a == "it") { document.getElementById("programsDetailItContainer").style.display = "block"; document.getElementById("programsDetailHostingContainer").style.display = "none"; document.getElementById("programsDetailCondContainer").style.display = "none"; document.getElementById("programsDetailInfContainer").style.display = "none" } if (a == "cond") { document.getElementById("programsDetailCondContainer").style.display = "block"; document.getElementById("programsDetailItContainer").style.display = "none"; document.getElementById("programsDetailHostingContainer").style.display = "none"; document.getElementById("programsDetailInfContainer").style.display = "none" } if (a == "inf") { document.getElementById("programsDetailCondContainer").style.display = "none"; document.getElementById("programsDetailItContainer").style.display = "none"; document.getElementById("programsDetailHostingContainer").style.display = "none"; document.getElementById("programsDetailInfContainer").style.display = "block" } } function ChangeHotelSearchLabel(b, a) { var d = b.value; var c = d.split("§"); if (c[2] == "1") { oCampo = document.getElementById("spnLBLabelQuestion"); if ((null != oCampo) && (a == "1")) { oCampo.innerText = "Escolha o tipo de quarto e idade." } oCampo = document.getElementById("spnLabelQuestion"); if ((null != oCampo) && (a == "0")) { oCampo.innerText = "Escolha o tipo de quarto e idade." } } else { oCampo = document.getElementById("spnLBLabelQuestion"); if ((null != oCampo) && (a == "1")) { oCampo.innerText = "Escolha o tipo de quarto." } oCampo = document.getElementById("spnLabelQuestion"); if ((null != oCampo) && (a == "0")) { oCampo.innerText = "Escolha o tipo de quarto." } } } function ChangeMoreInfo(c, b) { var a = document.getElementById(b); var c = document.getElementById(c); if (a.style.display == "block") { a.style.display = "none"; c.innerHTML = "Pesquisa avan&ccedil;ada" } else { a.style.display = "block"; c.innerHTML = "Fechar" } } function CheckHotelCitySearch(a, g) { var f = a; var b = f.toLowerCase(); var c = false; var h = ""; var j = document.getElementById(g); switch (b) { case "amsterdão": c = true; h = "Amsterdão"; break; case "amsterdao": c = true; h = "Amsterdão"; break; case "ams": c = true; h = "Amsterdão"; break; case "134": c = true; h = "Amsterdão"; break; case "barcelona": c = true; h = "Barcelona"; break; case "bcn": c = true; h = "Barcelona"; break; case "638": c = true; h = "Barcelona"; break; case "bruxelas": c = true; h = "Bruxelas"; break; case "bru": c = true; h = "Bruxelas"; break; case "126": c = true; h = "Bruxelas"; break; case "lisboa": c = true; h = "Lisboa"; break; case "lis": c = true; h = "Lisboa"; break; case "113": c = true; h = "Lisboa"; break; case "londres": c = true; h = "Londres"; break; case "lon": c = true; h = "Londres"; break; case "103": c = true; h = "Londres"; break; case "madrid": c = true; h = "Madrid"; break; case "mad": c = true; h = "Madrid"; break; case "108": c = true; h = "Madrid"; break; case "milão": c = true; h = "Milão"; break; case "milao": c = true; h = "Milão"; break; case "mil": c = true; h = "Milão"; break; case "704": c = true; h = "Milão"; break; case "nova iorque": c = true; h = "Nova Iorque"; break; case "nyc": c = true; h = "Nova Iorque"; break; case "919": c = true; h = "Nova Iorque"; break; case "paris": c = true; h = "Paris"; break; case "par": c = true; h = "Paris"; break; case "128": c = true; h = "Paris"; break; case "praga": c = true; h = "Praga"; break; case "prg": c = true; h = "Praga"; break; case "159": c = true; h = "Praga"; break; case "roma": c = true; h = "Roma"; break; case "rom": c = true; h = "Roma"; break; case "136": c = true; h = "Roma"; break } if (c == true) { if (j != null) { j.innerHTML = " * Seleccione categoria do hotel para<br /> filtrar resultados."; j.style.display = "block" } var e = document.getElementById("aHtlMoreOptions"); var d = document.getElementById("divLBHotelMoreInfo"); if (d != null) { d.style.display = "block" } if (e != null) { e.innerHTML = "Fechar" } } else { if (j != null) { j.style.display = "none" } } } function ValidateProgramSearch(b, d, c, a, f, e) { if (b == 1) { document.getElementById(d).disabled = false; if (document.getElementById(c) != null) { document.getElementById(c).disabled = false } document.getElementById(a).disabled = true; document.getElementById(f).disabled = true; document.getElementById(e).disabled = true } if (b == 2) { document.getElementById(d).disabled = true; if (document.getElementById(c) != null) { document.getElementById(c).disabled = true } document.getElementById(a).disabled = false; document.getElementById(f).disabled = false; document.getElementById(e).disabled = false } } function isInt(a) { var b = parseInt(a); if (isNaN(b)) { return false } return a == b && a.toString() == b.toString() } function EnableDisableParkAndFly(a) { if (a.checked == true) { if (jsreqPFlyResp != undefined) { enableValidators(jsreqPFlyResp) } if (jsreqPFlyCar != undefined) { enableValidators(jsreqPFlyCar) } if (jsreqPFlyMatricula != undefined) { enableValidators(jsreqPFlyMatricula) } if (jsreqPFlyDate != undefined) { enableValidators(jsreqPFlyDate) } } else { if (jsreqPFlyResp != undefined) { disableValidators(jsreqPFlyResp) } if (jsreqPFlyCar != undefined) { disableValidators(jsreqPFlyCar) } if (jsreqPFlyMatricula != undefined) { disableValidators(jsreqPFlyMatricula) } if (jsreqPFlyDate != undefined) { disableValidators(jsreqPFlyDate) } } } function formatCurrency(a) { a = a.toString().replace(/\$|\,/g, ""); if (isNaN(a)) { a = "0" } sign = (a == (a = Math.abs(a))); a = Math.floor(a * 100 + 0.50000000001); cents = a % 100; a = Math.floor(a / 100).toString(); if (cents < 10) { cents = "0" + cents } for (var b = 0; b < Math.floor((a.length - (1 + b)) / 3); b++) { a = a.substring(0, a.length - (4 * b + 3)) + "." + a.substring(a.length - (4 * b + 3)) } return (a + "," + cents) } function getCategoryFilterBoxStars(c) { var b = c.substr(c.lastIndexOf("_") + 1); var a = ""; switch (b) { case "OneStar": a = "198"; break; case "TwoStar": a = "199"; break; case "ThreeStar": a = "201"; break; case "FourStar": a = "202"; break; case "FiveStar": a = "203"; break } if (a.length == 0) { a = "0" } return a + "," } var validationTooltips = function () { $("[validationTooltip]").each(function () { $(this).qtip({ content: { text: false, title: false }, show: { when: false, ready: false }, hide: { when: false }, position: { corner: { tooltip: "leftMiddle", target: "rightMiddle" }, adjust: { rezise: true} }, style: { border: { width: 1, radius: 1, color: "#3B4548" }, zIndex: 99999, backgroundColor: "#52585B", color: "#fff", padding: 5, width: "280px", fontSize: "10px", textAlign: "left", tip: true, title: { "background-color": "#3B4548", cursor: "default", color: "#fff"}} }) }) }; $(function () { $("[tooltip]").each(function () { $(this).qtip({ content: { text: false, title: { text: $(this).attr("tooltip")} }, position: { corner: { tooltip: "leftMiddle", target: "rightMiddle" } }, style: { border: { width: 1, radius: 1, color: "#52585B" }, zIndex: 99999, backgroundColor: "#52585B", color: "#fff", padding: 5, fontSize: "11px", textAlign: "left", tip: true, title: { "background-color": "#3B4548", cursor: "default", color: "#fff"}} }) }) }); var buildInfoEscalasTooltip = function (b, a) { $("#infoEscalasTooltip_" + b).qtip({ content: { text: a, title: { text: "DETALHES DO VOO"} }, style: { width: 555, border: { width: 1, radius: 1, color: "#3B4548" }, zIndex: 99999, backgroundColor: "#52585B", color: "#fff", padding: 10, fontSize: "11px", textAlign: "left", tip: true, title: { "background-color": "#3B4548", cursor: "default", color: "#fff", "font-size": "13px", "font-weight": "bold", "border-bottom": "1px solid #fff"} }, position: { corner: { tooltip: "topMiddle", target: "bottomMiddle"}} }) }; function getParameterByName(b) { b = b.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var a = "[\\?&]" + b + "=([^&#]*)"; var d = new RegExp(a); var c = d.exec(window.location.href); if (c == null) { return "" } else { return decodeURIComponent(c[1].replace(/\+/g, " ")) } } function replaceDiacritics(c) { var c; var e = /[a-zA-Z0-9-]/ig; var f = [/[\300-\306]/g, /[\340-\346]/g, /[\310-\313]/g, /[\350-\353]/g, /[\314-\317]/g, /[\354-\357]/g, /[\322-\330]/g, /[\362-\370]/g, /[\331-\334]/g, /[\371-\374]/g, /[\321]/g, /[\361]/g, /[\307]/g, /[\347]/g, ]; var d = ["A", "a", "E", "e", "I", "i", "O", "o", "U", "u", "N", "n", "C", "c"]; for (var b = 0; b < f.length; b++) { c = c.replace(f[b], d[b]); c = c.replace(" - ", "-"); c = c.replace("  ", "-"); c = c.replace(" ", "-") } var a = ""; for (var b = 0; b < c.length; b++) { if (c.charAt(b).match(e)) { a += c.charAt(b) } } return (a.toLowerCase()) };
