/* J_Inc_Functions.jsp */ /* Recupera las fotos de las habitaciones de un hotel */ function recuperaFotosHotel(idSolRes, codigoHabitacion){ loading.fadeIn(); var params = "idPartner=ALMEIDA"; params += "&lang=en"; params += "&idSolRes=" + idSolRes; if (codigoHabitacion){ params += "&codigoHabitacion=" + codigoHabitacion; } params += "&rand=" + new Date().getTime(); var aFotos = new Array(); var cont = 0; $i.ajax({ type: "POST", async:true, cache:false, url: "../../nReservations/jsp/E_FotosHotel.jsp", data: params, dataType: 'xml', // Reconocemos el browser success: function(xml) { $i(xml).find("foto").each(function() { aFotos[cont] = escape($i(this).find("path").text()).replace("https%3A//","https://"); cont++; }); mostrarFotosHotel(aFotos); }, error:function (xhr, ajaxOptions, thrownError){ try{ loading.fadeOut(); }catch(err){ // } } }); } function mostrarFotosHotel (aFotos){ $i(".yoxview").html("") for(var i=0; i"; $i( foto ).appendTo( ".yoxview" ); } $i(".yoxview").yoxview({ backgroundOpacity:0.6, lang:"en", renderInfo:false, showBarsOnOpen:false }); $i(".yoxview").find("a").eq(0).trigger("click"); loading.fadeOut(); } /** Formatea float **/ function formateFloat(amount){ if (typeof amount === "number") { amount=parseFloat(amount).toFixed(2); } else{ quitarFormatoLocal(amount); amount=parseFloat(amount); } return amount; } /** Format a number to a two-deciaml with mile separation number ** amount is a Double or String zero-decimal or two-decimal number with an unappropiate format **/ function formateaImporteLocal(amount) { if (typeof amount === "number") { amount=parseFloat(amount).toFixed(2); } amount = String(amount); // Setting user locale settings var lcl = "en"; if (lcl.indexOf("en") != -1 || lcl.indexOf("cn") != -1) { var sepMiles = ","; var sepDec = "."; } else if (lcl.indexOf("fr") != -1) { var sepMiles = " "; var sepDec = ","; } else { var sepMiles = "."; var sepDec = ","; } // Identifying the source locale format var formatoImporte = ""; var pos1 = amount.indexOf("."); var pos2 = amount.indexOf(","); if (pos1>0 && pos2>0) { if (pos10 && pos2==-1) { if (pos1 >= amount.length-3) formatoImporte = "im"; /* el . es el separador de decimales */ else formatoImporte = "eu"; /* la , es un separador de miles */ } else if (pos1==-1 && pos2>0) { if (pos2 >= amount.length-3) formatoImporte = "eu"; /* la , es el separador de decimales */ else formatoImporte = "im"; /* el . es un separador de miles */ } else if (pos1==-1 && pos2==-1) { formatoImporte = "eu"; } // Splitting integer and decimal parts if (formatoImporte == "eu") { amount = amount.replace(/\./g,""); amount = amount.replace(/,/g,"|"); } else if (formatoImporte == "im") { amount = amount.replace(/,/g,""); amount = amount.replace(/\./g,"|"); } var arParts = amount.split("\|"); // Formatting integer part var intPart = arParts[0]; var intPartAux = ""; for (var n=intPart.length, i=0; n>0; n--, i++) { intPartAux = intPart.substr(n-1,1) + intPartAux; if (i%3==2 && i>0 && i 1 ? arParts[1] : ''); decPart = (decPart + '00').substr(0,2); // Building and returning formatted number return intPart + sepDec + decPart; } function quitarFormatoLocal(importe) { var pos1 = importe.indexOf("."); var pos2 = importe.indexOf(","); if (pos1 < pos2) { importe = importe.replace(/\./g,""); importe = importe.replace(/\,/g,"."); } else { importe = importe.replace(/\,/g,""); } importe = importe.replace(/\s/g,""); return importe; } function updateProvinces(idSelectCountry, idSelectProvince, selectedProvince) { try{ var selectPais = $i(idSelectCountry).val(); var params = "idPartner=ALMEIDA"; params += "&lang=en"; params += "&origen="+selectPais; $i(idSelectProvince).empty(); $i.ajax({ type: 'POST', url: "../../nReservations/jsp/E_LoadProvinces.jsp", data: encodeURI(params) + "&rand="+Math.random(), dataType: "xml", async: true, success: function(xml){ if(xml != null){ // Vaciamos el select var error = recuperarErrorXML(xml); if (error != ""){ return; } if (xml.getElementsByTagName('ElementoTablaComun').length != 0) { var optValue = ""; var optText = ""; var option = ""; var nodo = xml.getElementsByTagName("ElementoTablaComun"); $i(idSelectProvince).append(""); for (var i=0; i"+optText+""); } } if (selectedProvince != null) { $i(idSelectProvince).val(selectedProvince); } } }, error: function(xhr, textStatus, thrownError){} }); } catch(err){} } function sortCountries(idSelectCountry) { var options = $i(idSelectCountry).find("option[value!='']"); var arr = options.map(function(_, o) { return { t: $i(o).text(), v: o.value }; }).get(); arr.sort(function(o1, o2) { return o1.t > o2.t ? 1 : o1.t < o2.t ? -1 : 0; }); options.each(function(i, o) { o.value = arr[i].v; $i(o).text(arr[i].t); }); } function recuperarErrorXML(xmlDoc){ var cadena = ""; if(xmlDoc){ var objetError = xmlDoc.getElementsByTagName("ErrorBean"); if(objetError){ for (var iError=0; iError\n"; else cadena += getElementFromXMLNode(objetError[iError], "errorcode")+" "+getElementFromXMLNode(objetError[iError], "internalErrorCode")+"\n"; } } } return cadena; } function recuperarElementoXML(xmlDoc, elemento){ var cadena = ""; if(xmlDoc){ var objetInfo = xmlDoc.getElementsByTagName("info"); if(objetInfo){ for(var i=0; i
  • "+error+"
  • "; div.innerHTML = errorHtml; $i('.btns-top').after(div); goTo($i('.btns-top')); } function mostrarErrorPopup(error){ var div = document.createElement("div"); $i(div).addClass("errortext"); var errorHtml = "
    "+ "
    "+error+"
    "; div.innerHTML = errorHtml; document.getElementById('main-popup-extra-services').getElementsByClassName('content')[0].insertBefore(div, document.getElementById('total-room')); } function normalizarTxt(txt){ return txt.toUpperCase() .replace(new RegExp(" ", "g"), "-") .replace(new RegExp("\t", "g"), "-") .replace(new RegExp("\n", "g"), "-") .replace(new RegExp("\r", "g"), "-") .replace(new RegExp("Þ", "g"), "P") .replace(new RegExp("Ð", "g"), "D") .replace(new RegExp("Æ", "g"), "A") .replace(new RegExp("ß", "g"), "SS") .replace(new RegExp("Š", "g"), "S") .replace(new RegExp("Ž", "g"), "Z") .replace(new RegExp("š", "g"), "s") .replace(new RegExp("ž", "g"), "z") .replace(new RegExp("Å", "g"), "A") .replace(new RegExp("Ä", "g"), "A") .replace(new RegExp("Ã", "g"), "A") .replace(new RegExp("Â", "g"), "A") .replace(new RegExp("Á", "g"), "A") .replace(new RegExp("À", "g"), "A") .replace(new RegExp("Ç", "g"), "C") .replace(new RegExp("È", "g"), "E") .replace(new RegExp("É", "g"), "E") .replace(new RegExp("Ë", "g"), "E") .replace(new RegExp("Ì", "g"), "I") .replace(new RegExp("Í", "g"), "I") .replace(new RegExp("Î", "g"), "I") .replace(new RegExp("Ï", "g"), "I") .replace(new RegExp("Ñ", "g"), "N") .replace(new RegExp("Õ", "g"), "O") .replace(new RegExp("Ø", "g"), "O") .replace(new RegExp("Ö", "g"), "O") .replace(new RegExp("Ó", "g"), "O") .replace(new RegExp("Ô", "g"), "O") .replace(new RegExp("Ò", "g"), "O") .replace(new RegExp("Ü", "g"), "U") .replace(new RegExp("Ú", "g"), "U") .replace(new RegExp("Û", "g"), "U") .replace(new RegExp("Ù", "g"), "U") .replace(new RegExp("Ÿ", "g"), "Y") .replace(new RegExp("Ý", "g"), "Y") .replace(new RegExp("<[^>]+>", "g"), "") .replace(new RegExp("/", "g"), "") .replace(new RegExp("'", "g"), "") } function normalizarFecha(dia, mes, anio, sep){ dia = (dia.length < 2) ? "0"+dia : dia; mes = (mes.length < 2) ? "0"+mes : mes; return anio + sep + mes + sep + dia; } function goTop() { var body = $i("html, body"); body.animate({scrollTop:0}, '500', 'swing'); } function goTo(obj, doNotAnimate, optionalHeight) { var optionalHeaderHeight = 0; if (optionalHeight) optionalHeaderHeight = optionalHeight; var body = $i("html, body"); var headerHeight=$i('#logo-small').height() + 10 + optionalHeaderHeight; if (doNotAnimate) { body.scrollTop( $i(obj).offset().top - headerHeight ); } else { body.animate({scrollTop:$i(obj).offset().top - headerHeight}, '500', 'swing'); } } /* Ony permit that the input type text is a number */ function validateNumber(evt) { try { var charCode = evt.which; if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } catch (e) { return false; } } /* Cookies functions */ function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } /* End Cookies functions */ /* External profile functions */ function mostrarFicha(urlFicha ,hotelCode) { var sessionParams = getSessionParams() + getPriceFrom(hotelCode); clickFicha(urlFicha , sessionParams); } function clickFicha(urlFicha, sessionParams) { var urlRequest=""; urlRequest = location.href; // Obtener url actual del propio BE var indexRequestParams = urlRequest.indexOf("?"); var requestParams = urlRequest.substring(indexRequestParams + 1); // Obtener todos los parametros de la url actual // Eliminamos los parámetros después del hash (#) if (urlRequest.indexOf("#")!=-1) { requestParams = requestParams.substr(0, requestParams.indexOf('#')); } window.open(urlFicha + '?rand=' + Math.random() + '&' + requestParams + sessionParams + '&forwardFrom=BE'); } function getSessionParams() { // Si el parámetro no está en la URL, lo cargamos de la sesión var param=""; if (location.href.indexOf('inDay=')==-1) param+="&inDay="; if (location.href.indexOf('inMonth=')==-1) param+="&inMonth="; if (location.href.indexOf('inYear=')==-1) param+="&inYear="; if (location.href.indexOf('outDay=')==-1) param+="&outDay="; if (location.href.indexOf('outMonth=')==-1) param+="&outMonth="; if (location.href.indexOf('outYear=')==-1) param+="&outYear="; if (location.href.indexOf('rooms=')==-1) param+="&rooms="; var h=0; var n=0; if (location.href.indexOf('corpCode=')==-1) param+="&corpCode="; if (location.href.indexOf('agencyCode=')==-1) param+="&agencyCode="; if (location.href.indexOf('promoCode=')==-1) param+="&promoCode="; if (location.href.indexOf('rate=')==-1) param+="&rate="; if (location.href.indexOf('mtqe=')==-1) param+="&mtqe="; return param; } // Recoger el precio y la moneda para clickFicha function getPriceFrom(hotelCode){ return "&priceFrom="+$i("#hotel-"+hotelCode+" .price").text()+"&priceCurrency="+$i("#hotel-"+hotelCode+" .coin").text(); } /* End external profile functions */ // Cerrar todos los popups function closeAllPopups() { $i('.dates .datepicker').find('.ui-widget-content').removeAttr('style').hide(); $i('.module.booking .occupation-data.popup').slideUp("fast"); $i('.module.booking .special-search-data.popup').slideUp("fast"); $i('.module.booking .promotionalcode .popup').slideUp("fast"); $i('.cancel-booking .popup').slideUp("fast"); } function processingRequest(){ $i('#main-popup-loading .line2').html("We are processing your request"); $i('#main-popup-loading .line3').html(""); $i('.mfp-close').trigger('click'); $i.magnificPopup.open({ items: { src: '#main-popup-loading', }, type: 'inline', closeOnBgClick:false }, 0); } function checkNullValue(value) { if (value == null) return ""; else return value; } function activateSlideToggle() { // slideToggle effect $i('.web-ui-slideToggle-effect').find('.web-ui-btn-effect').off('click').on('click', function(e) { var btn = $i(this); var parent_btn = btn.closest('.web-ui-slideToggle-effect'); var content = parent_btn.find('.web-ui-content-effect:eq(0), .web-ui-multiple-content-effect'); e.preventDefault(); if ($i("body").attr("id")!="home" || ($i("body").attr("id")=="home" && (!$i(parent_btn).hasClass("accordion") || ($i(parent_btn).hasClass("accordion") && $i(content).hasClass("web-ui-hidden-content-effect"))))) { if (content.hasClass('web-ui-multiple-content-effect') && content.hasClass('web-ui-content-effect')==false){ $i(this).hasClass('seemore') ? btn.text("ver menos").removeClass('seemore'): btn.text("ver más").addClass('seemore'); content.toggle(); content.toggleClass('web-ui-hidden-content-effect'), btn.toggleClass('web-ui-btn-active-effect').find('.web-ui-icon').toggleClass('active'); } else { content.filter( '.web-ui-content-effect').slideToggle('slow', function() { if ($i(this).hasClass('web-ui-hidden-content-effect')) { btn.attr('title', 'Ocultar contenido'); if (typeof isEditGlobal != 'undefined' && isEditGlobal && $i('#booking_extras').length > 0) { isEditGlobal = false; var esServicioExterno = ($i("#extraServ_" + habIndexGlobal + "_" + servIndexGlobal).length == 0) ? true : false; if (esServicioExterno) goTo("[id^='extraServExt_" + habIndexGlobal + "']", false, 160); else goTo("#extraServ_" + habIndexGlobal + "_" + servIndexGlobal, false, 160); } //hacer scroll para mostrar el contenido de la capa abierta if (parent_btn.offset().top + parent_btn.innerHeight() - $i(window).scrollTop() > $i(window).innerHeight()) { // Si el link está en el carro de compra, tener en cuenta el tamaño de la caja flotante var offset = 0; if (btn.parents("#shopping-cart")) { offset=content.height(); } goTo(content, false, offset); } } else { btn.attr('title', 'Mostrar contenido'); } // esconder o mostrar contenido $i(this).toggleClass('web-ui-hidden-content-effect'); btn.toggleClass('web-ui-btn-active-effect'); //si tiene una flechita, ponerla en su sitio if (content.hasClass('web-ui-hidden-content-effect') && btn.find('.normal-arrow')) { btn.find('.fa-chevron-booking-cart .fa-chevron-up').removeClass('fa-chevron-up').addClass('fa-chevron-right'); btn.find('.normal-arrow .fa.fa-chevron-down').removeClass('fa-chevron-down').addClass('fa-chevron-right').end().find('.normal-arrow .fa.fa-caret-down').removeClass('fa-caret-down').addClass('fa-caret-right'); } else { btn.find('.fa-chevron-booking-cart .fa-chevron-right').removeClass('fa-chevron-right').addClass('fa-chevron-up'); btn.find('.normal-arrow .fa.fa-chevron-right').removeClass('fa-chevron-right').addClass('fa-chevron-down').end().find('.normal-arrow .fa.fa-caret-right').removeClass('fa-caret-right').addClass('fa-caret-down'); } }) } // slideUp others accordion items (only in home) if ($i("body").attr("id")=="home" && parent_btn.siblings('.normal-code').length == 0) { $i(".accordion").find('.web-ui-btn-effect').not(btn).not('.link').not('.map-list a.web-ui-btn').not('.hotel-list a.web-ui-btn').not('.destine-list a.web-ui-btn').each(function() { var btnAccordion = $i(this); var parent_btnAccordion = btnAccordion.closest('.web-ui-slideToggle-effect'); var contentAccordion = parent_btnAccordion.children('.web-ui-content-effect'); contentAccordion.slideUp('slow', function() { $i(this).hasClass('web-ui-hidden-content-effect') ? btnAccordion.attr('title', 'Ocultar contenido') : btnAccordion.attr('title', 'Mostrar contenido'); $i(this).addClass('web-ui-hidden-content-effect'); btnAccordion.removeClass('web-ui-btn-active-effect'); btnAccordion.find('.arrow-display .fa.fa-stack-1x').removeClass('fa-chevron-down'); btnAccordion.find('.arrow-display .fa.fa-stack-1x').addClass('fa-chevron-right'); }); }); } footer.init(); } }); } function currencyExchangeInit() { // Establecemos la moneda a convertir var currentCurrency = ""; if (currentCurrency=="") { $i('.coin').each(function() { if ($i(this).text()!="") { currentCurrency = $i(this).text(); } }); } if (currentCurrency!="") { var hotelsConversionFactor = $i("#currency-filter option:contains('"+currentCurrency+"')").val(); $i('#currency-filter').val(hotelsConversionFactor); $i('#currency-filter').attr("data-currentCurrency",hotelsConversionFactor); } else { $i('#currency-filter').val("1.0"); $i('#currency-filter').attr("data-currentCurrency","1.0"); } // Definimos el comportamiento del cambio de divisas $i('#currency-filter').off("change").on("change", function() { var factorConversionSeleccionado = parseFloat($i(this).val()); $i('.price').each(function() { if ($i(this).next(".fullprice").html()) { var currentPrice = parseFloat(quitarFormatoLocal($i(this).next(".fullprice").html())); } else { var currentPrice = parseFloat(quitarFormatoLocal($i(this).html())); } var factorConversionActual = parseFloat($i("#currency-filter option:contains('"+$i(this).parent().children('.coin').text()+"')").val()); var factorConversion = parseFloat(factorConversionActual / factorConversionSeleccionado); if (!$i(this).next(".fullprice").html()) { $i(this).after(""); } var newPrice = parseFloat(currentPrice * factorConversion); $i(this).next(".fullprice").html( newPrice ); $i(this).html( formateaImporteLocal(newPrice) ); }); $i('.coin').each(function() { $i(this).html( $i('#currency-filter').children(":selected").attr("data-currencysymbol") ); }); if ($i('.converse').next().children('.tcoin').html() == $i('#currency-filter').children(":selected").attr("data-currencysymbol")) { $i('.converse').hide(); } else { $i('.converse').show(); } currencyExchangeTags(); }); // Realizamos la conversión } function activateTooltips() { try { $i('.tooltip').tooltip(); } catch (e) {} } function strPad(text, length, fillChar) { fillChar = fillChar || '0'; text = text + ''; return text.length >= length ? text : new Array(length - text.length + 1).join(fillChar) + text; } /* Session functions */ function showSessionExpiringMessage() { var params = "idPartner=ALMEIDA"; params += "&lang=en"; $i.ajax({ type: "POST", async: true, cache: false, url: "../../nReservations/jsp/E_SessionExpiring.jsp", data: params, success: function(response) { $i.magnificPopup.close(); $i('#pop-up-session').html(response); $i.magnificPopup.open({ modal: true, items: { src: '#pop-up-session', }, type: 'inline', }, 0); } }); } function showSessionExpiredMessage() { var params = "idPartner=ALMEIDA"; params += "&lang=en"; $i.ajax({ type: "POST", async: true, cache: false, url: "../../nReservations/jsp/E_SessionExpired.jsp", data: params, success: function(response) { $i.magnificPopup.close(); $i('#pop-up-session').html(response); $i.magnificPopup.open({ modal: true, items: { src: '#pop-up-session', }, type: 'inline', }, 0); } }); } function refreshSession() { var params = "rand=" + Math.random(); params = encodeURI(params); $i.ajax({ type: 'GET', url: '../../nReservations/jsp/E_CheckSession.jsp', data: params, dataType: "xml", success: function(xml){ if ($i(xml).find('sessionAlive').text() == "Y") { $i.magnificPopup.close(); setTimeout(function(){showSessionExpiringMessage();}, 25*60000); } else { showSessionExpiredMessage(); } }, error: function (xhr, textStatus, thrownError) { closeSession(); } }); } function closeSession() { var url = "https://almeidahotels.idiso.com/desk/nReservations/jsp/../../nReservations/jsp/C_Home.jsp?idPartner=ALMEIDA&lang=&idPrm=MBALMEIDA&idONg=Y37&idNom="; document.location.href=url; } /* Hashmap functions */ HashMap = function(){this._dict = [];} HashMap.prototype._get = function(key){ for(var i=0, couplet; couplet = this._dict[i]; i++){ if(couplet[0] === key){ return couplet; } } } HashMap.prototype.put = function(key, value){ var couplet = this._get(key); if (couplet) { couplet[1] = value; } else { this._dict.push([key, value]); } return this; } HashMap.prototype.get = function(key){ var couplet = this._get(key); if (couplet) { return couplet[1]; } } HashMap.prototype.exists = function(key){ var couplet = this._get(key); if (couplet) { return true; } else { return false; } } /* End hashmap functions */ function showGenericPopup(title, content, f) { $i('#pop-up-generic-message').load("../../nPortlets/jsp/E_GenericPopup.jsp",function() { $i('#genericPopup-title').html(title); $i('#genericPopup-content').html(content); if (f!=undefined && f!="") { $i('#genericPopup-button').on("click", function() { eval(f); }); } $i.magnificPopup.open({ items: { src: '#pop-up-generic-message', }, type: 'inline', }, 0); }); } function sortJsonArrayByProperty(objArray, prop, direction){ if (arguments.length<2) throw new Error("sortJsonArrayByProp requires 2 arguments"); var direct = arguments.length>2 ? arguments[2] : 1; //Default to ascending if (objArray && objArray.constructor===Array){ var propPath = (prop.constructor===Array) ? prop : prop.split("."); objArray.sort(function(a,b){ for (var p in propPath){ if (a[propPath[p]] && b[propPath[p]]){ a = a[propPath[p]]; b = b[propPath[p]]; } } // convert numeric strings to integers a = a.match(/^\d+$/) ? +a : a; b = b.match(/^\d+$/) ? +b : b; return ( (a < b) ? -1*direct : ((a > b) ? 1*direct : 0) ); }); } } function validateEmail(email) { var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; return re.test(email); } /////////////////////////////////////////////////////////////////// // Loading loading={ show:function(){ $i("body").find(".background").show(); $i("body").addClass("hasbackground"); }, hide:function(){ $i("body").find(".background").hide(); $i("body").removeClass("hasbackground"); }, fadeIn:function(){ $i("body").find(".background").fadeIn("fast"); $i("body").removeClass("hasbackground"); }, fadeOut:function(){ $i("body").find(".background").fadeOut("fast"); $i("body").removeClass("hasbackground"); } } // Drop down list dropDown={ init:function(event,elem){ //evitamos el burbujeo if(event.stopPropagation) { event.stopPropagation(); } else { event.returnValue = false; } myDropDownMenu= $i(elem).closest('.submenu.dropdown').find(".dropdown-menu"); if($i(myDropDownMenu).is(":visible")){ $i(myDropDownMenu).hide(); } else{ $i(".dropdown-menu").hide(); this.moveDropDown(elem, myDropDownMenu); $i(myDropDownMenu).show(); $i(document).on( "click", function() { $i(myDropDownMenu).hide( ) $i(document).off("click"); }) } $i(window).on('scroll', function () { myDropDownMenu.hide(); }); }, moveDropDown:function(elem, myDropDownMenu) { var scrollTop = $i(window).scrollTop(); var windowSize = $i(window).height(); var maxSize = Number(scrollTop + windowSize); var myDropDown = $i(elem).closest('.submenu.dropdown'); var buttonTop = myDropDown.offset().top; var buttonSize = myDropDown.outerHeight(); var dropdownMenuSize = myDropDownMenu.outerHeight(); var dropdownEndPosition = Number(buttonTop + buttonSize + dropdownMenuSize) - 3; if (dropdownEndPosition > maxSize) myDropDownMenu.css('top', - (dropdownMenuSize - 6) + 'px'); else myDropDownMenu.css('top', ''); } } // Panel animations animations={ myObject:"", widthObject:"", heightObject:"", positionTopHeader:"", positionTopMain:"", calculateProperties:function(obj){ this.myObject=$i(obj) this.positionTopHeader=$i("#header-flotant").offset().top + $i("#header-flotant").outerHeight(); this.widthObject=$i(obj).outerWidth(); this.heightObject=$i(obj).outerHeight(); this.positionTopMain=$i("body").find("#section").eq(0).find(".main").eq(0).offset().top; }, moduleShop:function(){ this.hideModules(); this.calculateProperties($i(".module.resume")); //la posicion inicial es la posicion del header menos la altura del booking.module menos el alto del contenedor el module.booking(el main) var initPositionY=this.positionTopHeader-this.positionTopMain; var initPositionX=0-this.widthObject; var finishPosition=initPositionX+this.widthObject; this.myObject.css("right",initPositionX); this.myObject.css("top",initPositionY); this.myObject.show(); this.myObject.animate({ right:finishPosition }, 500, function() { }); }, moduleBooking:function(){ this.hideModules(); this.calculateProperties($i(".module.booking")); //el top del modulo es el main, en cambio el top del header es el body. Hay que restar la diferencia. //la posicion inicial es la posicion del header menos la altura del booking.module menos el alto del contenedor el module.booking(el main) var initPosition=this.positionTopHeader-this.heightObject-this.positionTopMain; this.myObject.css("top",initPosition); this.myObject.show(); var finishPosition=initPosition+this.heightObject; this.myObject.animate({ top:finishPosition }, 500, function() { }); }, moduleFilter:function(){ this.hideModules(); this.calculateProperties($i(".module.filter")); //el top del modulo es el main, en cambio el top del header es el body. Hay que restar la diferencia. var initPositionX=0-this.widthObject; var initPositionY=this.positionTopHeader-this.positionTopMain; var finishPosition=initPositionX+this.widthObject; this.myObject.css("left",initPositionX); this.myObject.css("top",initPositionY); this.myObject.show(); this.myObject.animate({ left:finishPosition }, 500, function() { // Animation complete. }); }, hideModules:function(){ $i(".float-panel").removeAttr("style"); } } headerFlotant={ lockRemoving:false, lockCreating:false, checkHeaderTablet:function(){ if($i("#header-flotant .header-tablet").length){ $i('#header-flotant').addClass("hasHeaderTablet"); } }, checkCreation:function(wichClass){ //$i( "#header-flotant >.main,.header-tablet > .main" ).finish(); //escondo el pop up que se ubiese podido abrir antes $i("#header .login .popup").hide(); //si ya existe la capa flotante no creo una nueva. Unicamente añado la clase correspondiente if($i("#header-flotant").length==false && this.lockCreating==false){ headerFlotant.create(wichClass); } else{ $i("#header-flotant").addClass(wichClass) } $i("#header-scroll").show(); $i("#header-no-scroll").hide(); }, checkRemoving:function(wichClass){ //$i( "#header-flotant >.main,.header-tablet > .main" ).finish(); // si realmente no se necesita ningún elemento de la capa flotante la elimino. De lo contrario elimino la clase que toque, que a su vez hará un display none a la parte que no deba utilizar if(responsive.statenew=="widthscreen" && scrolldetect.hasScroll==false && $i("#header-flotant").length==true && this.lockRemoving==false){ //variable para no ejecutar la función varias veces headerFlotant.remove(wichClass); } else{ $i("#header-flotant").removeClass(wichClass); } $i("#header-scroll").hide(); $i("#header-no-scroll").show(); }, create:function(wichClass){ //creando mi capa flotante. this.lockCreating=true; var head=$i("#header").clone(true).attr("id","header-flotant").addClass(wichClass) $i("#header").before( head ); $i( "#header-flotant .header-with-scroll ,#header-flotant .header-tablet >.main" ).css("opacity",0); $i( "#header-flotant .header-with-scroll ,#header-flotant .header-tablet >.main" ).stop().animate({ opacity: 1 }, 500, function() { headerFlotant.lockCreating=false; // Animation complete. }); }, remove:function(wichClass){ this.lockRemoving=true; //console.log("la elimino") // eliminando mi capa flotante $i( "#header-flotant .header-with-scroll ,#header-flotant .header-tablet >.main" ).css("opacity",0); $i("#header-flotant").remove(); headerFlotant.lockRemoving=false; } } // Gestion pop-ups home popUpsHome={ check:function(elem){ var current= elem var content=elem.closest('.destine').find("section[class*='-list']"); if(content.is(":visible")){ content.each(function(index,elem) { if($i(elem).is(":visible")){ $i(elem).not(current).slideUp(function() { if (current[0].classList.contains('map-list')) { $i("#googlemap-content").children().remove(); $i("#googlemap-content").append('
    '); } else if (current[0].classList.contains('hotel-list')) { initHotelListLevel1(); } else if (current[0].classList.contains('destine-list')) { initHotelListLevel2(); } current.slideDown(function(){ if ($i(".map-list").is(":visible")) { initMap(); } }); }); } }) } else{ if (elem[0].classList.contains('hotel-list')) { initHotelListLevel1(); } else if (elem[0].classList.contains('destine-list')) { initHotelListLevel2(); } current.slideDown(function() { if ($i('.web-ui-fieldset.destine').offset().top + current.outerHeight() > $i(window).innerHeight() ) { goTo($i('.web-ui-fieldset.destine')); } }); if ($i(".map-list").is(":visible")) { initMap(); } } } } // Carrito de la compra flotante fixHeader={ init:function(wich){ var height = $i(wich).height(); var width = $i(wich).width(); var offset = $i(wich).offset().top; var heightFlotantHeader = $i('#header-flotant').height(); var Yscroll = offset + heightFlotantHeader; $i(window).on('scroll', function () { fixHeader.check(wich,height,width,Yscroll); }); fixHeader.check(wich,height,width,Yscroll) }, check:function(wich,height,width,Yscroll){ var heightFlotantHeader = $i('#header-flotant').height(); var heightBookingForm = $i('.booking.pnr').outerHeight(); var heightBookingCartHidden = $i(".summary-module-resume .head").height() + $i(".summary-module-resume .web-ui-subtitle").height(); var Yscroll = Yscroll - heightFlotantHeader + heightBookingCartHidden; var height=$i(wich).height(); if($i(window).scrollTop()>=Yscroll - heightBookingForm && responsive.statenew=="widthscreen"){ $i(wich).css("top",0+heightFlotantHeader + heightBookingForm - heightBookingCartHidden); $i(wich).closest("#resume-panel").addClass("floating"); if(($i(".fix-layer").length)==false){ $i(wich).after("
    "); $i('.fix-layer').css("height",height); } $i(wich).css("position","fixed"); $i(wich).css("z-index",900); $i(wich).css("width",width); } else { $i(wich).closest("#resume-panel").removeClass("floating"); $i(wich).css("z-index",1); $i(wich).css("position","relative"); $i(wich).css("top",0); $i(".fix-layer").remove(); } }, reset:function(wich){ $i(wich).closest("#resume-panel").removeClass("floating"); $i(wich).css("z-index",1); $i(wich).css("position","relative"); $i(wich).css("top",0); $i(".fix-layer").remove(); } } fixBookingForm={ init:function(wich){ var height=$i(wich).outerHeight(); var width=$i(wich).outerWidth(); var offset= $i(wich).offset().top; var heightFlotantHeader= $i('#header-flotant').height(); var Yscroll=offset ; $i(window).on('scroll', function () { fixBookingForm.check(wich,height,width,Yscroll) }); fixBookingForm.check(wich,height,width,Yscroll) }, check:function(wich,height,width,Yscroll){ var heightFlotantHeader= $i('#header-flotant').height(); var Yscroll=Yscroll - heightFlotantHeader; var height=$i(wich).outerHeight(); if($i(window).scrollTop()>=Yscroll && responsive.statenew=="widthscreen"){ $i(wich).css("top",0+heightFlotantHeader); $i(wich).closest(".booking.pnr").addClass("floating"); $i(wich).css("position","fixed"); $i(wich).css("z-index",999); $i(wich).css("width",width); if(($i(".fix-layer2").length)==false){ $i(wich).after("
    "); $i('.fix-layer2').css("height",height); } } else{ $i(wich).css("z-index","inherit"); $i(wich).css("position","relative"); $i(wich).css("top",0); $i(wich).closest(".booking.pnr").removeClass("floating"); $i(".fix-layer2").remove(); //$i(wich).css("width","auto"); } }, reset:function(wich){ $i(wich).css("z-index","inherit"); $i(wich).css("position","relative"); $i(wich).css("top",0); $i(wich).closest(".booking.pnr").removeClass("floating"); $i(".fix-layer2").remove(); $i(wich).css("width","auto"); } } // Responsive mode controller responsive={ stateold:"", statenew:"", init:function(){ responsive.check(); }, getScrollBarWidth:function(){ //hacer los cálculos de la pantalla responsive teniendo en cuenta el ancho del scrollbar if($i(document).height() > $i(window).height()){ $i('body').append('
    '); fakeScrollBar = $i('#fakescrollbar'); fakeScrollBar.append('
     
    '); var w1 = fakeScrollBar.find('div').innerWidth(); fakeScrollBar.css('overflow-y', 'scroll'); var w2 = $i('#fakescrollbar').find('div').html('html').innerWidth(); fakeScrollBar.remove(); return (w1-w2); } return 0; }, check:function(){ // checkear si entramos en modo responsive o no. if(parseInt($i(window).width()+responsive.getScrollBarWidth())<1020){ responsive.statenew="thinscreen"; } else{ responsive.statenew="widthscreen"; } if(this.stateold!=this.statenew){ responsive.stateold=responsive.statenew; responsive.moveElements() } }, moveElements:function(){ // cambiando banners de sitio. if(responsive.statenew=="widthscreen"){ $i('.add-panel2 > *').appendTo('.add-panel1'); $i('.callmebackpanel2 > *').appendTo('.callmebackpanel1'); responsive.widthcreen(); } else if(responsive.statenew=="thinscreen"){ $i('.add-panel1 > *').appendTo('.add-panel2'); $i('.callmebackpanel1 > *').appendTo('.callmebackpanel2'); responsive.thinscreen(); } }, widthcreen:function(){ // si no es responsive hemos de resetear una serie de atributos que recolocan la pantalla headerFlotant.checkRemoving("responsive"); $i(".float-panel").removeAttr("style"); $i('.module.booking').removeClass("float-panel"); $i('.module.filter').removeClass("float-panel"); $i('.module.resume').filter(function( index ) { return $i(this).closest(".popup").length==false;}).removeClass("float-panel"); //colocamos el carrito de la compra donde toca por si necesitasemos que fuese flotante if( $i('#resume-panel .summary-module-resume').length){ fixHeader.init($i('#resume-panel .summary-module-resume')); } if( $i('.booking.pnr').length && !$i('.booking.pnr').closest('#advanced-search-panel').length) { fixBookingForm.init($i('.booking.pnr')); } }, thinscreen:function(){ // si es responsive hacemos una recolocación de los módulos añadiendo las clases correspondientes y creando la capa flotante si no está creada ya. headerFlotant.checkCreation("responsive"); $i('.module.resume').filter(function( index ) { return ($i(this).closest(".popup").length || $i(this).hasClass( "not-floating" ))==false }).addClass("float-panel").find('.web-ui-btn-effect').removeClass('web-ui-btn-active-effect'); $i('.module.booking').addClass("float-panel").find('.web-ui-btn-effect').removeClass('web-ui-btn-active-effect'); $i('.module.filter').addClass("float-panel").find('.web-ui-btn-effect').removeClass('web-ui-btn-active-effect'); headerFlotant.checkHeaderTablet(); //colocamos el carrito de la compra donde toca por si fuese flotante y lo mismo con el booking form si fuese flotante fixHeader.reset($i('#resume-panel .summary-module-resume')); fixBookingForm.reset($i('.booking.pnr')); } } // Change header on scroll scrolldetect={ hasScroll:"", init:function(){ scrolldetect.check(); $i(window).on('scroll', function () { scrolldetect.check(); }); }, check:function(){ // comprobando si hemos hecho suficiente scroll como para mostrar la capa flotante correspondiente. if ($i(window).scrollTop() > $i('#header').height() - $i('#logo-small').height() - 10) { this.hasScroll=true; headerFlotant.checkCreation("scroll"); } else { this.hasScroll=false; headerFlotant.checkRemoving("scroll"); } } } /********************* ubicar bien visiblemente los pop ups de multipnr en todo momento *******************************/ // Position placepopup={ check:function(){ if($i(".occupation-data.popup").length>0) { try { if ($i(".occupation-data.popup").offset().left + $i(".occupation-data.popup").width() < $i(document).width()) { $i(".occupation-data.popup").addClass("right"); } else { $i(".occupation-data.popup").removeClass("right"); } } catch (e) {} } if($i(".special-search-data.popup").length>0) { try { if ($i(".special-search-data.popup").offset().left + $i(".special-search-data.popup").width() < $i(document).width()) { $i(".special-search-data.popup").addClass("right"); } else { $i(".special-search-data.popup").removeClass("right"); } } catch (e) {} } } } /* Calendarios sin disponibilidad */ availabilityCalendar={ init:function(){ $i('.web-ui-goto-calendar-widget').on('click', function(e) { try { var btn = $i(this); parent_btn = btn.closest('.web-ui-fadeToggle-effect'), content = parent_btn.find('.web-ui-calendar-widget').eq(0); contents = $i(this).closest('section.content').find('.web-ui-calendar-widget'); //console.log(contents); e.preventDefault(); if(e.stopPropagation) { e.stopPropagation(); } else { e.returnValue = false; } if(content.is(':visible')){ content.fadeToggle("slow"); btn.find(".text1").show(); btn.find(".text2").hide(); $i(document).off("click"); } else{ contents.hide() // Evitar burbujeo eventos al clickar sobre el calendario btn.closest('.display-calendar').on('click', function(e) { if(e.stopPropagation) { e.stopPropagation(); } else { e.returnValue = false; } }); content.fadeToggle("slow"); btn.find(".text1").hide(); btn.find(".text2").show(); // Lo dejamos preparado por si se clica fuera de la ventana, que tambien se cierre $i(document).off("click").on("click", function() { contents.hide(); $i(document).off("click"); btn.find(".text1").show(); btn.find(".text2").hide(); }) } } catch (e) { //console.error('-ERROR-. Not valid format!'); } }) } }; /*funcion para llevar el footer al final de la página*/ footer={ init:function() { footer.calculate(); $i(window).resize(function(){ footer.calculate(); }); }, calculate:function() { var windowHeight=$i(window).height(); var bodyHeight=$i('#section').height(); var customHeaderHeight=$i('#idisobe-client-custom-header').height(); var customFooterHeight=$i('#idisobe-client-custom-footer').height(); var headerHeight=$i('#header').height(); var footerHeight=$i('#footer').height(); if (bodyHeight + customHeaderHeight + customFooterHeight + headerHeight + footerHeight > windowHeight) { $i("#footer").removeClass("bottom"); } else { $i("#footer").addClass("bottom"); } } } //componente menu var menu={ init:function(){ $i('.menu').off("click").on('click', function(e) { $i(this).find("ul").fadeToggle('fast'); }), $i('.menu ul').off("mousenter").off("mouseleave").on({ 'mouseenter' : function(e) { e.preventDefault(); }, 'mouseleave' : function(e) { e.preventDefault(), $i(this).fadeOut('slow') } }) } } var selectMenu={ select:function(elem,elem2){ $i(elem).closest('.tabs').find('.web-ui-tab').not($i(elem)).removeClass('active'); $i(elem).addClass('active'); $i(elem).closest('.pclient').find("div[class^='content']").hide().end().find(elem2).show(); return false; } } /////////////////////////////////////////////////////////////////// $i(function() { var dispositivo = navigator.userAgent.toLowerCase(); if( dispositivo.search(/iphone|ipod|ipad|android/) > -1 ){ $i("body").addClass("tablet") } popupsInit(); scrolldetect.init(); responsive.init(); if ( $i(".booking.pnr").length) { placepopup.check(); } menu.init(); activateTooltips(); activateSlideToggle(); $i(window).on("resize",function() { if( $i(".booking.pnr").length) { placepopup.check() } }); accordeon={ reset:function(exception){ $i('.booking.pnr.floating').length ? scrollBookingForm=$i('.booking.pnr.floating').outerHeight() + $i('#header-flotant').outerHeight() + 10 : scrollBookingForm=0; $i(".accordeon").not(exception).find(".web-ui-btn-active-effect:eq(0)").each(function( index ) { $i(this).removeClass('web-ui-btn-active-effect'); $i(this).closest($i(".accordeon")).find('.web-ui-content-effect:eq(0)').slideUp( { duration:'slow', progress: function(){ var windowTop=exception.offset().top-scrollBookingForm if( $i( window ).scrollTop() > windowTop){ $i( window ).scrollTop(windowTop); } }, complete: function(){ $i(this).addClass('web-ui-hidden-content-effect'); } }); }); } } try { $i(".has-tooltip").tooltip({ items: "*[data-tooltip]", content: function () { return $i(this).attr('data-tooltip'); }, position: { my: 'left-30 bottom-20', at: 'center' }, }); } catch (e) {} // Cerrar todos los popups cuando se haga clic en el documento $i(document).on("mouseup", function(e) { if ($i('body').attr("id")!="home") { if (!$i(".module.booking .occupation-data.popup").is(e.target) && $i(".module.booking .occupation-data.popup").has(e.target).length === 0) { $i(".module.booking .occupation-data.popup").slideUp("fast"); } if (!$i(".module.booking .special-search-data.popup").is(e.target) && $i(".module.booking .special-search-data.popup").has(e.target).length === 0) { $i(".module.booking .special-search-data.popup").slideUp("fast"); } if (!$i(".module.booking .promotionalcode .popup").is(e.target) && $i(".module.booking .promotionalcode .popup").has(e.target).length === 0) { $i(".module.booking .promotionalcode .popup").slideUp("fast"); } if (!$i(".change-my-booking .manage-booking-panel .popup").is(e.target) && $i(".change-my-booking .manage-booking-panel .popup").has(e.target).length === 0) { $i(".change-my-booking .manage-booking-panel .popup").slideUp("fast"); } } if (!$i("#booking-form .calendar_from").closest('.web-ui-input-text').find('.ui-widget-content').is(e.target) && $i("#booking-form .calendar_from").closest('.web-ui-input-text').find('.ui-widget-content').has(e.target).length === 0) { $i("#booking-form .calendar_from").closest('.web-ui-input-text').find('.ui-widget-content').hide() } if (!$i("#booking-form .calendar_to").closest('.web-ui-input-text').find('.ui-widget-content').is(e.target) && $i("#booking-form .calendar_to").closest('.web-ui-input-text').find('.ui-widget-content').has(e.target).length === 0) { $i("#booking-form .calendar_to").closest('.web-ui-input-text').find('.ui-widget-content').hide() } if (!$i("#cancel-form .calendar_from").closest('.web-ui-input-text').find('.ui-widget-content').is(e.target) && $i("#cancel-form .calendar_from").closest('.web-ui-input-text').find('.ui-widget-content').has(e.target).length === 0) { $i("#cancel-form .calendar_from").closest('.web-ui-input-text').find('.ui-widget-content').hide() } if (!$i("#cancel-form .calendar_to").closest('.web-ui-input-text').find('.ui-widget-content').is(e.target) && $i("#cancel-form .calendar_to").closest('.web-ui-input-text').find('.ui-widget-content').has(e.target).length === 0) { $i("#cancel-form .calendar_to").closest('.web-ui-input-text').find('.ui-widget-content').hide() } }); var c = readCookie("ALMEIDA_acceptCookies"); if (!c) { $i('#cookies').fadeIn("slow"); setTimeout(function() { $i('#cookies').fadeOut("fast"); }, 30000) } var btn = $i('#footer .up'), winHeight = $i(window).outerHeight(), docHeight = $i(document).outerHeight(); if (winHeight >= docHeight) btn.html(" "); setTimeout(function(){showSessionExpiringMessage();}, 25*60000); footer.init(); availabilityCalendar.init(); procesaLoyalty(); }); function showModifyPopup(img, title, content) { $i('#pop-up-modify-message').load("../../nPortlets/jsp/E_ModifyPopup.jsp",function() { $i('#modify-popup-img').addClass(img); $i('#modify-popup-title').html(title); $i('#modify-popup-content').html(content); $i.magnificPopup.close(); $i.magnificPopup.open({ items: { src: '#pop-up-modify-message', }, type: 'inline', closeOnBgClick: false, showCloseBtn: false }, 0); }); } function modifyBooking(action) { var params = ""; params += "&action=" + action; var title = ""; var message = ""; var titleError = ""; var messageError = ""; if (action == "MODIFYDATES") { title = "Modified dates" message = "Sent an updated confirmation to {1}"; titleError = "Error updating dates"; messageError = "There was an error updating your booking dates"; } else if (action == "MODIFYOCCUPANCY") { title = "Occupation modified" message = "Sent an updated confirmation to {1}"; titleError = "Error updating occupation"; messageError = "There was an error updating the occupation of your booking."; } else if (action == "ADDCOMMENTS") { title = "Added special requests" message = "Sent an updated confirmation to {1}"; titleError = "Error adding dates"; messageError = "There was an error adding special requests for your booking."; var comments = trim($i("#comentarios").val()); params += "&comments=" + comments; } params += "&rand="+Math.random(); $i.ajax({ type: 'POST', url: "../../nReservations/jsp/E_ManageBooking.jsp", data: encodeURI(params), async: true, dataType: "xml", success: function(xml){ var error = recuperarErrorXML(xml); if (error != ""){ messageResultModifyBooking(titleError, messageError, "-1"); return; } var result = $i(xml).find('RQ_com_desktop_modificar_reserva').text(); if (result == 1) { var email = ""; message = message.replace('{1}', email); messageResultModifyBooking(title, message, "1"); } else { messageResultModifyBooking(titleError, messageError, "-1"); } }, error: function (xhr, textStatus, thrownError){ messageResultModifyBooking(titleError, messageError, "-1"); } }); } function messageResultModifyBooking(title, message, result) { $i("#modify-popup-title").text(title); $i("#modify-popup-content").text(message); $i("#modify-popup-buttons").show(); if (result != -1) { var url = "../../nReservations/jsp/C_Booking_Addons.jsp"; /* Descomentar cuando este hecha la modificacion de servicios dinamicos */ //$i("#modify-popup-buttons").find(".web-ui-fleft").show(); //$i("#modify-popup-buttons").find(".web-ui-fleft").find("a").on("click", function() { $i.magnificPopup.close(); refreshManageBookingScreen(); return false; }); //$i("#modify-popup-buttons").find(".web-ui-fright").show(); //$i("#modify-popup-buttons").find(".web-ui-fright").find("a").on("click", function() { location.href = url; return false; }); /* Borrar cuando este hecha la modificacion de servicios dinamicos */ $i("#modify-popup-buttons").find(".web-ui-fleft").hide(); $i("#modify-popup-buttons").find(".web-ui-fright").show(); $i("#modify-popup-buttons").find(".web-ui-fright").find("a").on("click", function() { $i.magnificPopup.close(); refreshManageBookingScreen(); return false; }); } else { $i("#modify-popup-buttons").find(".web-ui-fleft").hide(); $i("#modify-popup-buttons").find(".web-ui-fright").show(); $i("#modify-popup-buttons").find(".web-ui-fright").find("a").on("click", function() { $i.magnificPopup.close(); return false; }); } } // Recarga de la pagina ManageBooking function refreshManageBookingScreen(){ processingRequest(); var url = "../../nReservations/jsp/C_ManageBooking.jsp?"; url += "idPartner=ALMEIDA"; url += "&bookRef="; url += "&hotelCode="; url += "&lang=en"; location.href = url; } // Función necesaria para partners con Loyalty activado. Muestra u oculta los puntos o la moneda según necesidad function procesaLoyalty(){ $i(".loyalty-points").hide(); } function formatPoints(points){ if (typeof points === "number") { points=parseInt(points); } points = String(points); // Setting user locale settings var lcl = "en"; if (lcl.indexOf("en") != -1 || lcl.indexOf("cn") != -1) { var sepMiles = ","; } else if (lcl.indexOf("fr") != -1) { var sepMiles = " "; } else { var sepMiles = "."; } // Formatting integer part var pointsAux = points; if (points.indexOf(sepMiles)==-1){ pointsAux = ""; for (var n=points.length, i=0; n>0; n--, i++) { pointsAux = points.substr(n-1,1) + pointsAux; if (i%3==2 && i>0 && iRATE INFORMATION"); newWin.document.write(""); newWin.document.write(""); newWin.document.write(""); newWin.document.write(""); newWin.document.write(""); newWin.document.write(""); newWin.document.write(""); newWin.document.write(''+$i('#main-popup-conditions').closest("div.mfp-wrap").html()); newWin.document.close(); setTimeout(function(){newWin.close();},1000); $i("#btnPrintConditions").show(); $i(".mfp-close").show(); } /* / J_Inc_Functions.jsp */