(function ($) { $.BookingApp = function () { this.Tra = function () { this.currentLang = "et" this.items = {"en":{"arrival":"Arrival","departures":"Departure","nights":"Nights","rooms":"Rooms","adults":"Adults","children":"Children","checkPolicy":"Check hotel children policy under rate description","promoCode":"Promo code:","promoTooltip":"Promocode \/ @Group Code \/ Corporate Code","bookNow":"Search","cancelModify":"Cancel\/Modify","january":"January","february":"February","march":"March","april":"April","may":"May","june":"June","july":"July","august":"August","september":"September","october":"October","november":"November","december":"December","mondayMin":"M","tuesdayMin":"T","wednesdayMin":"W","thursdayMin":"T","fridayMin":"F","saturdayMin":"S","sundayMin":"S","room":"Room","childAge":"Child %sequence% age","bookingTitle":"","childrenTooltip":"Children up to 2 years old free of charge. 3-6 years old 15 \u20ac\/night. 7-15 years old 30\u20ac\/night.16 years old and adults 45 \u20ac\/night."},"ru":{"arrival":"\u041f\u0440\u0438\u0431\u044b\u0442\u0438\u0435","departures":"\u041e\u0442\u044a\u0435\u0437\u0434","nights":"\u041d\u043e\u0447\u0438","rooms":"\u041a\u043e\u043c\u043d\u0430\u0442\u044b","adults":"\u0412\u0437\u0440\u043e\u0441\u043b\u044b\u0435","children":"\u0414\u0435\u0442\u0438","checkPolicy":"Check hotel children policy under rate description.","promoCode":"\u041f\u0440\u043e\u043c\u043e-\u043a\u043e\u0434","promoTooltip":"\u041f\u0440\u043e\u043c\u043e-\u043a\u043e\u0434 \/ @\u041a\u043e\u0434 \u0433\u0440\u0443\u043f\u043f\u044b \/ \u041a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434","bookNow":"\u041f\u043e\u0438\u0441\u043a","cancelModify":"\u041e\u0442\u043c\u0435\u043d\u0430\/\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c","january":"\u042f\u043d\u0432\u0430\u0440\u044c ","february":"\u0424\u0435\u0432\u0440\u0430\u043b\u044c ","march":"M\u0430\u0440\u0442 ","april":"A\u043f\u0440\u0435\u043b\u044c ","may":"M\u0430\u0439 ","june":"\u0418\u044e\u043d\u044c ","july":"\u0418\u044e\u043b\u044c ","august":"A\u0432\u0433\u0443\u0441\u0442 ","september":"C\u0435\u043d\u0442\u044f\u0431\u0440\u044c ","october":"O\u043a\u0442\u044f\u0431\u0440\u044c ","november":"H\u043e\u044f\u0431\u0440\u044c ","december":"\u0414\u0435\u043a\u0430\u0431\u0440\u044c","mondayMin":"\u041f","tuesdayMin":"\u0412","wednesdayMin":"\u0421","thursdayMin":"\u0427","fridayMin":"\u041f","saturdayMin":"\u0421","sundayMin":"\u0412","room":"H\u043e\u043c\u0435\u0440","childAge":"P\u0435\u0431\u0435\u043d\u043e\u043a %sequence% \u0432\u043e\u0437\u0440\u0430\u0441\u0442","bookingTitle":"","childrenTooltip":"\u0414\u0435\u0442\u0438 0-2 \u043b\u0435\u0442 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e, 3-6 \u043b\u0435\u0442 15 \u20ac\/\u0441\u0443\u0442\u043a\u0438, 7-15 \u043b\u0435\u0442 25 \u20ac\/\u0441\u0443\u0442\u043a\u0438, 16 + \u043b\u0435\u0442\u043d\u0438\u0435 \u0434\u0435\u0442\u0438 \u0438 \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0435 45 \u20ac\/\u0441\u0443\u0442\u043a\u0438."},"lv":{"arrival":"Iebrauk\u0161ana","departures":"Izbrauk\u0161ana","nights":"Naktis","rooms":"Numuri","adults":"Pieaugu\u0161ie","children":"B\u0113rni","checkPolicy":"Check hotel children policy under rate description.","promoCode":"Kods","promoTooltip":"Kods \/ @Grupas numurs \/ Korporat\u012bvais numurs","bookNow":"Mekl\u0113\u0161ana","cancelModify":"Atcelt\/izmain\u012bt rezerv\u0101ciju","january":"Janv\u0101ris","february":"Febru\u0101ris","march":"Marts","april":"Apr\u012blis","may":"Maijs","june":"J\u016bnijs","july":"J\u016blijs","august":"Augusts","september":"Septembris","october":"Oktobris","november":"Novembris","december":"Decembris","mondayMin":"P","tuesdayMin":"O","wednesdayMin":"T","thursdayMin":"C","fridayMin":"P","saturdayMin":"S","sundayMin":"S","room":"Numurs","childAge":"B\u0113rns%sequence% vecuma","bookingTitle":"","childrenTooltip":"Children up to 2 years old free of charge. 3-6 years old 15 \u20ac\/night. 7-15 years old 30\u20ac\/night.16 years old and adults 45 \u20ac\/night."},"et":{"arrival":"Saabumine","departures":"Lahkumine","nights":"\u00d6\u00f6d","rooms":"Toad","adults":"T\u00e4iskasvanud","children":"Lapsed","checkPolicy":"Vaata infot laste tingimuste kohta hinna kirjelduses.","promoCode":"Promokood","promoTooltip":"Promokood \/ @Grupi kood \/ Korporatiiv kood","bookNow":"Otsi tube ja hindu","cancelModify":"T\u00fchista\/Muuda","january":"Jaanuar","february":"Veebruar","march":"M\u00e4rts","april":"Aprill","may":"Mai","june":"Juuni","july":"Juuli","august":"August","september":"September","october":"Oktoober","november":"November","december":"Detsember","mondayMin":"E","tuesdayMin":"T","wednesdayMin":"K","thursdayMin":"N","fridayMin":"R","saturdayMin":"L","sundayMin":"P","room":"Tuba","childAge":"Lapse %sequence% vanus","bookingTitle":"","childrenTooltip":"0-2 a. tasuta, 3-6 a. 15\u20ac \u00f6\u00f6p\u00e4ev, 7-15 25\u20ac \u00f6\u00f6p\u00e4ev, 16+ 45\u20ac \u00f6\u00f6p\u00e4ev."},"fi":{"arrival":"Tulo","departures":"L\u00e4hto","nights":"\u00d6it\u00e4","rooms":"Huoneet","adults":"Aikuiset","children":"Lapset","checkPolicy":"Check hotel children policy under rate description.","promoCode":"Kampanjakoodi","promoTooltip":"Tarjouskoodi \/ @Ryhm\u00e4 koodi \/ Yritysten koodi ","bookNow":"Etsi","cancelModify":"Peruuta\/Muokkaa","january":"Tammikuu","february":"Helmikuu","march":"Maaliskuu","april":"Huhtikuu","may":"Toukokuu","june":"Kes\u00e4kuu","july":"Hein\u00e4kuu","august":"Elokuu","september":"Syyskuu","october":"Lokakuu","november":"Marraskuu","december":"Joulukuu","mondayMin":"M","tuesdayMin":"T","wednesdayMin":"K","thursdayMin":"T","fridayMin":"P","saturdayMin":"L","sundayMin":"S","room":"Huone","childAge":"Lapsen %sequence% ik\u00e4","bookingTitle":"","childrenTooltip":"Lapset 0-2-vuotiaat ilmaiseksi. 3-6-vuotiaat lapset 15\u20ac\/vrk. 7-15-vuotiaat lapset 30 \u20ac \/vrk. Yli 16- vuotiaat ja aikuiset 45 \u20ac\/vrk."}}; this.get = function (name, vars) { if (!vars) { vars = ""; } var tra = this.items[this.currentLang][name]; if (tra == undefined) { console.error("Translation " + name + " not found"); return false; } var ex = vars.split(","); for (i = 0; i '; html += '

'; if ($.trim(this.Vars.title)) { html += '

' + this.Tra.get("bookingTitle") + '

'; } html += '
'; if (this.Vars.formType != "horisontal") { //html += ' '; } html += ' '; html += '
'; html += '
'; if (this.Vars.formType != "horisontal") { //html += ' '; } html += ' '; html += '
'; html += ' '; var value, label; if (this.Vars.canUseRooms) { html += '
'; html += ' '; html += ' '; html += '
'; } else { html += ' '; } var clsssName = "roomsWrapper"; if (this.Vars.formType == "horisontal") { clsssName += " formRow"; } html += '
'; html += '
'; var promoTitle = this.Tra.get("promoCode"); if (this.Vars.formType == "horisontal") { html += ''; } html += ' Tooltip'; html += '
'; html += '
'; if (this.Vars.formType == "horisontal") { html += ''; } html += ' '; var cancelUrl = this.Vars.baseLink + this.Vars.currentLang + '/Booking/cancel/client/' + this.Vars.clientName; html += ' '; html += '
'; html += '
'; html += ''; return html; } this.createRoomBlock = function (roomNr) { var html = ''; return html; } this.createChildrenAdultBox = function (roomNr) { var className = "formRow fifty"; if (this.Vars.formType == "horisontal" && this.Vars.baseLinkType == "hx") { className = "formRow"; } else if (this.Vars.formType == "horisontal" && this.Vars.baseLinkType == "mf") { className = "adultsChildren formRow"; } var html = '
'; //if ((this.Vars.formType == "horisontal" && this.Vars.baseLinkType == "mf") || this.Vars.formType != "horisontal") //{ html += ' '; //} html += ' '; html += '
'; //Children box html += '
'; //if ((this.Vars.formType == "horisontal" && this.Vars.baseLinkType == "mf") || this.Vars.formType != "horisontal") //{ html += ' '; //} html += ' '; var tooltip = this.Tra.get("childrenTooltip"); if (tooltip) { html += 'Tooltip'; } html += '
' return html; } this.createChildAgeBox = function (roomNr, childNr) { var html = ''; html += ''; return html; } }; this.$wrapper = false; this.init = function (settings, wrapperSelector) { this.Vars = $.extend(this.Vars, {"language":["en","ru","lv","et","fi"],"clientName":"spatallinn","hotelID":"98","formType":"horisontal","sliding":"none","baseLinkType":"mf","font":"arial, sans-serif","maxRooms":"4","maxChildren":"4","useChildAge":true,"minChildAge":"1","maxChildAge":"18","maxAdults":"4","bookingTitle":{"en":"","ru":"","lv":"","et":"","pl":"","fi":"","sv":"","no":""},"childrenTooltip":{"en":"Children up to 2 years old free of charge. 3-6 years old 15 \u20ac\/night. 7-15 years old 30\u20ac\/night.16 years old and adults 45 \u20ac\/night.","ru":"\u0414\u0435\u0442\u0438 0-2 \u043b\u0435\u0442 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e, 3-6 \u043b\u0435\u0442 15 \u20ac\/\u0441\u0443\u0442\u043a\u0438, 7-15 \u043b\u0435\u0442 25 \u20ac\/\u0441\u0443\u0442\u043a\u0438, 16 + \u043b\u0435\u0442\u043d\u0438\u0435 \u0434\u0435\u0442\u0438 \u0438 \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0435 45 \u20ac\/\u0441\u0443\u0442\u043a\u0438.","lv":"Children up to 2 years old free of charge. 3-6 years old 15 \u20ac\/night. 7-15 years old 30\u20ac\/night.16 years old and adults 45 \u20ac\/night.","et":"0-2 a. tasuta, 3-6 a. 15\u20ac \u00f6\u00f6p\u00e4ev, 7-15 25\u20ac \u00f6\u00f6p\u00e4ev, 16+ 45\u20ac \u00f6\u00f6p\u00e4ev.","pl":"Check hotel children policy under rate description.","fi":"Lapset 0-2-vuotiaat ilmaiseksi. 3-6-vuotiaat lapset 15\u20ac\/vrk. 7-15-vuotiaat lapset 30 \u20ac \/vrk. Yli 16- vuotiaat ja aikuiset 45 \u20ac\/vrk.","sv":"Check hotel children policy under rate description.","no":"Les om hotellets betingelser om barn under prisinformasjon"},"bookNowBgColor":"#363636","inputBgColor":"#F5F5F5","inputBgActiveColor":"#E5E5E5","inputBorderColor":"#EEEEEE","momentDateFormat":"DD.MM.YYYY","currentLang":"en","canUseRooms":1,"baseLink":"http:\/\/web.archive.org\/web\/20150820134925\/https:\/\/booking.edreamhotels.com\/"}); this.Vars = $.extend(this.Vars, settings); this.Tra = new this.Tra(); this.Tra.currentLang = this.Vars.currentLang; this.Vars.datepickerConfig.dayNamesMin = [this.Tra.get("sundayMin"), this.Tra.get("mondayMin"), this.Tra.get("tuesdayMin"), this.Tra.get("wednesdayMin"), this.Tra.get("thursdayMin"), this.Tra.get("fridayMin"), this.Tra.get("saturdayMin")]; this.Vars.datepickerConfig.monthNames = [this.Tra.get("january"), this.Tra.get("february"), this.Tra.get("march"), this.Tra.get("april"), this.Tra.get("may"), this.Tra.get("june"), this.Tra.get("july"), this.Tra.get("august"), this.Tra.get("september"), this.Tra.get("october"), this.Tra.get("november"), this.Tra.get("december")]; $.datepicker.setDefaults(this.Vars.datepickerConfig); this.Form = new this.Form(); this.Form.Tra = this.Tra; this.Form.Vars = this.Vars; this.$wrapper = $(wrapperSelector); this.$wrapper.append(this.Form.create()); this.$wrapper.addClass("bronFormWrapper"); if (this.Vars.formType == "fancybox") { this.$wrapper.hide(); $(".fancy_booking").fancybox(); } this.blocksSlideSpeed = 0; this.$wrapper.delegate("#bookNowButton", "click", this.submitForm.jqBind(this)); this.$wrapper.delegate("#checkin", "change", this.changeArrival.jqBind(this)); this.$wrapper.delegate("#checkout", "change", this.changeDeparture.jqBind(this)); this.$wrapper.delegate("#rooms", "change", this.changeRooms.jqBind(this)); this.$wrapper.delegate(".childrenSelect", "change", this.changeChildren.jqBind(this)); this.$wrapper.find("#rooms").trigger("change"); this.$wrapper.find(".childrenSelect").trigger("change"); this.$wrapper.find(".date-box").datepicker(); this.blocksSlideSpeed = 400; if (this.Vars.sliding != "none") { this.$wrapper.addClass("slideOut"); //$(this.Vars.slideBtnSelector).appendTo("body"); //$(this.Vars.slideBtnSelector).css("top", 0).css("left", 500).css("position", "absolute"); this.makeSlidoutWrapper(); var me = this; $(window).resize(function () { me.makeSlidoutWrapper(); }) $("body").delegate(this.Vars.slideBtnSelector, "click", this.slideOut.jqBind(this)); } this.assignTooltip(); } this.assignTooltip = function () { $('.tooltip').not(".assignedTooltip").tooltipster({ contentAsHTML: true, interactive: true, maxWidth: 400, theme: 'tooltipster-light', arrow: true }).addClass("assignedTooltip"); } this.toMoment = function (date) { if (typeof date == "string") { date = moment(date, this.Vars.momentDateFormat); } return moment(date); }; this.dateFormat = function (date) { if (typeof date == "string") { date = moment(date, this.Vars.momentDateFormat); } else { date = moment(date); } return moment(date).format(this.Vars.momentDateFormat); } this.changeArrival = function ($el) { var arrival = $el.getVal(); $('#checkout').setVal(this.dateFormat(this.toMoment(arrival).add(1, "d"))); return false; } this.makeSlidoutWrapper = function () { var initCss = { overflow: "hidden", position: "absolute" }; var $btn = $(this.Vars.slideBtnSelector); if ($("#bookOuterWrapper").size() '); } var $outerWrapper = $("#bookOuterWrapper"); $outerWrapper.data("isVisible", false); this.$wrapper.show(); $outerWrapper.appendTo("body"); var btnOffset = $btn.offset(); initCss.left = btnOffset.left; initCss.top = btnOffset.top; if (this.Vars.sliding == "slideOutToBottom") { initCss.top = btnOffset.top + $btn.outerHeight(); } else if (this.Vars.sliding == "slideOutToLeft") { initCss.left = btnOffset.left + $btn.outerWidth(); } var right = initCss.left + $outerWrapper.width(); if (right > $(window).width()) { initCss.left -= right - $(window).width(); } $outerWrapper.data("origCss", initCss).css(initCss).show(); if (this.Vars.sliding == "slideOutToBottom" || this.Vars.sliding == "slideOutToTop") { initCss.height = 0; } else { initCss.width = 0; } $outerWrapper.data("origCss", initCss).css(initCss).show(); } this.slideOutClicked = false; this.slideOut = function ($btn) { var $outerWrapper = $("#bookOuterWrapper"); var configCss = {}; var animCss = {}; if ($outerWrapper.data("isVisible")) { $outerWrapper.data("isVisible", false); animCss = $outerWrapper.data("origCss"); } else { if (this.Vars.sliding == "slideOutToTop" || this.Vars.sliding == "slideOutToBottom") { animCss.height = this.$wrapper.refresh().height(); } if (this.Vars.sliding == "slideOutToTop") { animCss.top = $btn.offset().top - this.$wrapper.height(); } if (this.Vars.sliding == "slideOutToLeft" || this.Vars.sliding == "slideOutToRight") { animCss.width = this.$wrapper.width(); } if (this.Vars.sliding == "slideOutToRight") { animCss.left = $btn.offset().left - this.$wrapper.height(); } $outerWrapper.data("isVisible", true); configCss.complete = function () { $(this).css("height", "auto"); } } $outerWrapper.show().animate(animCss, configCss) return false; } this.changeDeparture = function ($el) { var $arrival = $("#checkin"); var arrival = this.toMoment($arrival.getVal()); var departure = this.toMoment($el.getVal()); var $nights = $("#nights"); var nights = $("#nights").getVal(); var diff = departure.diff(arrival, "days"); if (diff 1) { if (this.Vars.formType == "horisontal") { this.$wrapper.find(".roomsWrapper").find(".roomNrLabel").not(":first").slideDown(); } else { this.$wrapper.find(".roomsWrapper").find(".roomNrLabel").slideDown(); } } else { this.$wrapper.find(".roomsWrapper").find(".roomNrLabel").slideUp(); } this.$wrapper.find(".roomBlock").not(".toRemove").slideDown(this.blocksSlideSpeed); this.$wrapper.find(".roomBlock.toRemove").slideUpRemove(this.blocksSlideSpeed); this.assignTooltip(); return false; } this.changeChildren = function ($sel) { if (this.Vars.useChildAge) { var $room = $sel.parents(".roomBlock"); var $childAgeWrapper = $room.find(".childAgeWrapper"); $childAgeWrapper.find(".childAge").addClass("toRemove"); if ($sel.getVal() > 0) { var roomNr = $room.data("room-nr"); for (var c = 1; c 0) { age[i].push(ageVal); } }) age[i] = age[i].join("-"); i++; } ); var url = this.Vars.baseLink + this.Vars.currentLang + '/Booking/available-rooms/client/' + clientName + '/hotels/' + hotelID + '/checkin/' + checkIn + '/checkout/' + checkOut + '/rooms/' + rooms var adultsUrl = ''; var childrenUrl = ''; for (i = 0; i 0) { url += '/code/' + promocode.toUpperCase(); } //debug('https://booking.edreamhotels.com/en/Booking/available-rooms/client/laulasmaa/hotels/85/checkin/20.01.2015/checkout/21.01.2015/rooms/1/adults/2/children/0/age/'); //debug(url); window.open(url); return false; } } $.fn.eBooking = function (options) { var App = new $.BookingApp() App.init(options, this); return this; }; }(jQuery));
https://www.iVisa.com