var wsProxyTimeout = 60000; var oneDay = 60 * 1000 * 60 * 24; function formatNumber(a, b, c, d) { a = a.toString(); var k = ''; if (a.indexOf('-') == 0) { k = '-'; a = a * -1 } a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b); var e = a + ''; var f = e.split('.'); if (!f[0]) f[0] = '0'; if (!f[1]) f[1] = ''; if (f[1].length < b) { var g = f[1]; for (var i = f[1].length + 1; i <= b; i++) { g += '0' } f[1] = g } if (d != '' && f[0].length > 3) { var h = f[0]; f[0] = ''; for (var j = 3; j < h.length; j += 3) { i = h.slice(h.length - j, h.length - j + 3); f[0] = d + i + f[0] + '' } j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3)); f[0] = j + f[0] } c = (b <= 0) ? '' : c; return k + f[0] + c + f[1] } function formatCurr(a, b, c) { var d = ""; if (c != undefined && c != null) { c = parseInt(c) } else { c = 2 } if (b) d = b.toUpperCase(); switch (d) { case "NZD": case "AUD": case "USD": case "CAD": case "HKD": return "$" + formatNumber(a, c, ".", ","); break; case "CNY": case "JPY": return "&#165;" + formatNumber(a, c, ".", ","); break; case "KPW": case "KRW": return "&#8361;" + formatNumber(a, c, ".", ","); break; case "SAR": return "&#65020;" + formatNumber(a, c, ".", ","); break; case "THB": return "&#3647;" + formatNumber(a, c, ".", ","); break; case "EUR": return "&#8364;" + formatNumber(a, c, ",", "."); break; case "GBP": return "&#163;" + formatNumber(a, c, ".", ","); break; case "ZAR": return "R" + formatNumber(a, c, ".", ","); break; case "ZWD": return "Z$" + formatNumber(a, c, ".", ","); break; default: return formatNumber(a, c, ".", ","); break } } function findElementPos(a) { var x = 0; var y = 0; var b; try { while (a != null) { x += a.offsetLeft; y += a.offsetTop; a = a.offsetParent } } catch (ex) { x = 0; y = 0 } b = new function () { this.x = x; this.y = y }; return b } function str2Date(a) { var b; if (a.length == 8) { b = new Date(); b.setFullYear(a.substr(0, 4)); b.setMonth(parseFloat(a.substr(4, 2)) - 1); b.setMonth(parseFloat(a.substr(4, 2)) - 1); b.setDate(a.substr(6, 2)); b.setHours(0, 0, 0, 0) } else { b = new Date(); b.parse(a); b.setHours(0, 0, 0, 0) } return b } function date2Str(a) { var b = ""; var c = ""; var d = ""; b += a.getFullYear(); c += (a.getMonth() + 1); d += a.getDate(); if (c.length < 2) { c = "0" + c } if (d.length < 2) { d = "0" + d } b = b + c + d; return b } function centerElement(a, b) { if (a) { a.style.position = "absolute"; var c = document.body.scrollTop; var d = document.body.scrollLeft; var e = document.body.clientHeight; var f = document.body.clientWidth; if (typeof (window.pageYOffset) == 'number') { c = window.pageYOffset; d = window.pageXOffset } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { c = document.body.scrollTop; d = document.body.scrollLeft } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { c = document.documentElement.scrollTop; d = document.documentElement.scrollLeft } if (typeof (window.innerWidth) == 'number') { f = window.innerWidth; e = window.innerHeight } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { f = document.documentElement.clientWidth; e = document.documentElement.clientHeight } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { f = document.body.clientWidth; e = document.body.clientHeight } var g; var h; if (b) { g = 0; h = 0; a.style.width = document.body.parentNode.scrollWidth + "px"; a.style.height = document.body.parentNode.scrollHeight + "px" } else { var i = false; var j = 0; var k = 0; if (a.style.display == "none") { i = true; a.style.display = "block" } j = a.offsetHeight; k = a.offsetWidth; if (i) { a.style.display = "none" } var l = Math.ceil(e / 2 - j / 2); var m = Math.ceil(f / 2 - k / 2); g = Math.max(c + l - 40, 0); h = Math.max(d + m - 70, 0) } a.style.top = g + "px"; a.style.left = h + "px" } } function validateEmailAddress(a, b) { if (b && a == "") { return true } if (a && typeof a == "string") { var c = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"; return a.match(new RegExp(c)) } return false } function findFirstElementByClassName(a, b) { if (b.className == a) { return b } for (var i = 0; i < b.childNodes.length; i++) { var c = findFirstElementByClassName(a, b.childNodes[i]); if (c) { return c } } return null } function setupQtyDrop(a) { if (a) { var b = parseInt(a.getAttribute("MinVal")); var c = parseInt(a.getAttribute("MaxVal")); var d = parseInt(a.getAttribute("Org")); if (!isNaN(b) && !isNaN(c) && b <= c) { if (a.length == (c + 1 - b)) { return } a.innerHTML = ""; for (var i = b; i <= c; i++) { var e = document.createElement("OPTION"); e.text = i; e.value = i; a.options.add(e); if (i == d) { a.value = i } } } } }; function executeFunctionByName(a, b) { var c = Array.prototype.slice.call(arguments, 2); var d = a.split("."); var e = d.pop(); for (var i = 0; i < d.length; i++) { b = b[d[i]] } return b[e].apply(b, c) } function Rate(c) { var d; this.div = c; this.tdRate = c.parentNode.parentNode; this.trRate = this.tdRate.parentNode; this.rateRowID = this.trRate.getAttribute("RRID"); if (this.rateRowID == null) { return null } d = this.rateRowID.split("_"); this.serviceID = null; if (d.length > 0) { this.serviceID = parseInt(d[0]) } this.timeSlotID = null; if (d.length > 6) { this.timeSlotID = parseInt(d[6]) } if (isNaN(this.timeSlotID) || this.timeSlotID == -1) { this.timeSlotID = null } this.ACI = this.trRate.getAttribute("ACI"); this.rateDate = this.tdRate.getAttribute("RDate"); this.availability = parseInt(this.tdRate.getAttribute("Avail")); this.allotName = this.trRate.getAttribute("AlName"); this.allotCount = parseInt(c.getAttribute("AlCount")); this.rateID = parseInt(c.getAttribute("RID")); this.rateAmount = parseFloat(c.getAttribute("Rate")); this.rateAdult = parseFloat(c.getAttribute("RateA")); this.rateChild = parseFloat(c.getAttribute("RateC")); this.rateInfant = parseFloat(c.getAttribute("RateI")); if (isNaN(this.rateAmount)) this.rateAmount = 0; if (isNaN(this.rateAdult)) this.rateAdult = 0; if (isNaN(this.rateChild)) this.rateChild = 0; if (isNaN(this.rateInfant)) this.rateInfant = 0; this.ticked = (c.getAttribute("Tick") == "1"); this.set_ticked = function (a, b) { if (a == true) { c.setAttribute("Tick", "1"); c.className = b.rateTickedClass } else { c.setAttribute("Tick", "0"); c.className = b.rateUntickedClass } } } function SelState() { function SelStateItem(j, k, l, m, n, o, p, q, r) { this.init = function (a, b, c, d, e, f, g, h, i) { if (a != undefined && a != null) { this.supplierID = parseInt(a) } if (b != undefined && b != null) { this.serviceID = parseInt(b) } if (c != undefined && c != null) { this.timeSlotID = parseInt(c) } if (d != undefined && d != null) { this.rateRowID = d } if (e != undefined && e != null) { this.rateID = parseInt(e) } if (f != undefined && f != null) { if (typeof f == "string") { this.rateDate = str2Date(f) } else { this.rateDate = f } } if (g != undefined && g != null) { this.rateAmount = parseFloat(g) } if (h != undefined && h != null) { this.availability = parseInt(h) } if (i != undefined && i != null) { this.ACI = i } }; this.init(j, k, l, m, n, o, p, q, r); this.toString = function () { return "SS#" + this.supplierID + "#" + this.serviceID + "#" + this.timeSlotID + "#" + this.rateRowID + "#" + this.rateID + "#" + date2Str(this.rateDate) + "#" + this.rateAmount + "#" + this.ACI + "=" + this.availability }; this.parse = function (a) { if (a.indexOf("SS#") == 0) { var b = a.split("="); if (b.length > 1) { var c = b[0].split("#"); if (c.length > 8) { this.init(c[1], c[2], c[3], c[4], c[5], c[6], c[7], b[1], c[8]) } } } } } this.items = new Array(); this.isMatch = function (a, b, c, d, e, f, g, h, i, j) { if (b == null || b == undefined || b == a.supplierID) { if (c == null || c == undefined || c == a.serviceID) { if (d == null || d == undefined || d == a.timeSlotID) { if (e == null || e == undefined || e == a.rateRowID) { if (f == null || f == undefined || f == a.rateID) { if (g == null || g == undefined || g.getTime() == a.rateDate.getTime()) { if (h == null || h == undefined || h == a.rateAmount) { if (i == null || i == undefined || i == a.availability) { if (j == null || j == undefined || j == a.ACI) { return true } } } } } } } } } return false }; this.find = function (a, b, c, d, e, f, g, h, j) { var k = new Array(); for (var i = 0; i < this.items.length; i++) { var l = this.items[i]; if (f != null && f != undefined && typeof f == "string") f = str2Date(f); if (this.isMatch(l, a, b, c, d, e, f, g, h, j)) { k[k.length] = l } } return k }; this.remove = function (a, b, c, d, e, f, g, h, j) { var i = 0; while (i < this.items.length) { var k = this.items[i]; if (f != null && f != undefined && typeof f == "string") f = str2Date(f); if (this.isMatch(k, a, b, c, d, e, f, g, h, j)) { var l = this.items[i].toString(); this.items.splice(i, 1); delete this.items[l] } else { i++ } } }; this.add = function (a, b, c, d, e, f, g, h, i) { var j; if (f != null && f != undefined && typeof f == "string") f = str2Date(f); j = new SelStateItem(a, b, c, d, e, f, g, h, i); this.items[this.items.length] = j; this.items[j.toString()] = j }; this.parse = function (a, b) { if (!b) { var c = this.items.length; if (c > 0) { this.items.splice(0, c) } } var d = a.split("&"); for (var i = 0; i < d.length; i++) { if (d[i] != "") { var e = new SelStateItem(); e.parse(d[i]); this.add(e.supplierID, e.serviceID, e.timeSlotID, e.rateRowID, e.rateID, e.rateDate, e.rateAmount, e.availability, e.ACI) } } }; this.toString = function () { var a = ""; for (var i = 0; i < this.items.length; i++) { if (i > 0) a += "&"; a += this.items[i].toString() } return a } } function BookEngine(S, T, U, V, W, X, Y, Z, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm, cn, co, cp, cq, cr, cs, ct, cu, cv, cw, cx, cy, cz, cA, cB, cC, cD, cE, cF, cG, cH, cI, cJ) { this.ID = S; this.uniqueID = S.replace(/_/g, "$"); this.supplierID = T; this.clientIDRate = V; this.supplierName = Z; this.serviceID = W; this.categoryID = U; this.timeSlotMode = X; this.rateCode = Y; this.currencyCode = ba; this.currRate = bb; this.bsAmendID = bc; this.visibleDates = bd; this.jumpSize = be; this.scrollSize = bf; this.showUnavailableServices = bg; this.strNoSelectionsMsg = cr; this.strSomeServicesOnRequestMsg = cs; this.strRateCondMinStay = cC; this.strRateCondMaxStay = cD; this.strRateCondMinPax = cE; this.strRateCondMaxPax = cF; this.strRateCellContentHTMLTemplate = cG; this.strConfirmDelSelections = cH; this.strAvailability = cI; this.headerDateClass = bp; this.headerDateAltClass = bq; this.toolTipLoadingClass = br; this.rateNameCellClass = bs; this.rateTipClass = bt; this.rateTickedClass = bu; this.rateUntickedClass = bv; this.rateEmptyClass = bw; this.rateNotAvailClass = bx; this.rateAvailClass = by; this.rateRequestClass = bz; this.rateSelectedClass = bA; this.dayNames = bE.split(","); this.monthNames = bF.split(","); this.availability = new function () { var a = bG.split(","); this.unknown = parseInt(a[0]); this.unavailable = parseInt(a[1]); this.available = parseInt(a[2]); this.onRequest = parseInt(a[3]) }; this.strAdult = cw; this.strChild = cy; this.strInfant = cA; this.showAvailTip = bn; this.hideRateName = bo; this.onRateMouseOverStr = cn; this.onRateMouseLeaveStr = co; this.services = new Array(); this.regService = function (a) { var b = "service_" + a.serviceID; if (a.timeSlotID != null) b += "_" + a.timeSlotID.toString(); this.services[this.services.length] = a; this.services[b] = a }; this.cleanupServices = function (a) { var i = 0; while (i < this.services.length) { var b = this.services[i]; var c = "service_" + b.serviceID; if (b.timeSlotID != null) { c += "_" + b.timeSlotID.toString() } var d = 0; if (b) { d = b.removeEmptyRateRows() } var e = 0; if (b.timeSlotID != null) { if (!this.timeSlotMode) { e = 1 } else if (this.timeSlotMode && i == 0) { e = 1 } } if ((e == 0) && d == 0 && !(this.showUnavailableServices) && !(b.get_hasSelections()) && (b.get_selectedQty() <= 1) && (a == null || a == undefined || a[c] != true)) { var f = b.get_tblService(); if (f && f.parentNode) { f.parentNode.removeChild(f) } this.services.splice(i, 1); if (this.services[c]) delete this.services[c] } else { i++ } } }; this.get_serviceByID = function (a, b) { var c = "service_" + a; if (b != undefined && b != null && b != "" && !isNaN(b)) c += "_" + b.toString(); return this.services[c] }; this.refresh = function () { var a = document.getElementById(bP); if (a) { a.click() } }; this.get_selectState = function () { var a = document.getElementById(bQ).value; var b = new SelState(); b.parse(a, false); return b }; this.show_selectState = function () { var a = this.get_selectState(); var b = ""; for (var i = 0; i < a.items.length; i++) { if (a.items[i]) { if (b != "") { b += "\n" } b += a.items[i] } } if (b != "") { alert(b) } else { alert("No selection state.") } }; this.set_selectState = function (a) { var b = document.getElementById(bQ); if (b && a) { b.value = a.toString() } }; this.get_rateTicks = function (a, b) { var c = []; var d = null; if (a) { d = document.getElementById(a.tblServiceID) } else { d = document.getElementById(bY) } if (d) { var e = d.getElementsByTagName("div"); for (var j = 0; j < e.length; j++) { var f = new Rate(e[j]); if (f && f.rateRowID != null && (a == null || a == undefined || a.serviceID == f.serviceID)) { if (b == null || b == undefined || b == f.rateRowID) { c.push(f) } } } } return c }; this.date2HeaderDateStr = function (a) { var b = this.dayNames[a.getDay()] + "<br/>" + a.getDate() + " " + this.monthNames[a.getMonth()]; return b }; this.date2SummaryStr = function (a) { var b = this.dayNames[a.getDay()] + " " + a.getDate() + " " + this.monthNames[a.getMonth()] + " '" + a.getFullYear().toString().substr(2, 2); return b }; this.minDate = str2Date(bi); this.maxDate = str2Date(bj); this.get_startDateStr = function () { var a = document.getElementById(bR); if (a) { return a.value } return "" }; this.get_startDate = function () { var a = this.get_startDateStr(); if (a && a != "") return str2Date(a) }; this.set_startDate = function (a) { var b = document.getElementById(bR); if (b) { a.setHours(0, 0, 0, 0); b.value = date2Str(a) } }; this.get_lastVisibleDate = function () { var a = this.get_startDate(); return new Date(a.getFullYear(), a.getMonth(), a.getDate() + (this.visibleDates - 1)) }; this.buildRateContentRequest = function (a, b, c) { var d = ""; try { d += ("SID=" + a); if (b != undefined && b != null && !isNaN(b)) d += ("&TSID=" + b); d += ("&QTY=" + c); d += ("|||||") } catch (ex) { d = "" } return d }; this.get_visibleRateRowIDs = function () { var a = new Array(); try { for (var i = 0; i < this.services.length; i++) { var b = this.services[i]; if (b) { var c = b.get_visibleRateRowIDs(); if (c) { for (var j = 0; j < c.length; j++) { a[a.length] = c[j] } } } } } catch (ex) { } return a }; this.get_visibleServiceKeys = function () { var a = new Array(); try { for (var i = 0; i < this.services.length; i++) { var b = this.services[i]; if (b) { var c = this.supplierID + "_" + b.serviceID; if (b.timeSlotID != null) c += "_" + b.timeSlotID.toString(); a[a.length] = c } } } catch (ex) { } return a }; this.requestRateContent = function (a, b, c, d, e) { var f = ""; var g = this.get_selectState(); if (b == undefined || b == null) { b = this.serviceID } var h = this.get_visibleRateRowIDs().join(","); var j = this.get_visibleServiceKeys().join(","); var k = ""; k += ("SupID=" + this.supplierID); k += ("&CatID=" + this.categoryID); k += ("&ClIDR=" + this.clientIDRate); k += ("&SID=" + b); k += ("&TSMode=" + (this.timeSlotMode ? 1 : 0)); k += ("&RC=" + this.rateCode); k += ("&BSAmendID=" + this.bsAmendID); k += ("&SDate=" + this.get_startDateStr()); k += ("&RSDate=" + date2Str(d)); k += ("&REDate=" + date2Str(e)); k += ("&VisDates=" + this.visibleDates); if (h != "") { k += ("&VisRRIDs=" + h) } if (j != "") { k += ("&VisSKeys=" + j) } k += ("&CurCode=" + this.currencyCode); k += ("&As=" + bk); k += ("&Cs=" + bl); k += ("&Is=" + bm); if (g != "") { k += ("&" + g.toString()) } k += ("|||||"); a = ""; for (var i = 0; i < this.services.length; i++) { var l = this.services[i]; a += this.buildRateContentRequest(l.serviceID, l.timeSlotID, l.get_selectedQty()) } var m = new Evolution.BookEngineWebService(); m.set_timeout(wsProxyTimeout); if (c) { f = "NOCLEANUP" } m.GetRateContent(k + a, this.rateContentSuccess, this.rateContentFailed, f) }; this.rateContentSuccess = function (a, b, d) { try { if (!a || a == "") return; var e = document[S]; var f = e.get_selectState(); var g = e.get_selectState(); var h = a.split("|||||"); var j = new Array(); for (var i = 0; i < h.length; i++) { var k = false; var l = h[i].split("====="); if (l.length > 0) { var m = l[0].split(","); for (var n = 0; n < m.length; n++) { m[n] = m[n].replace(/\\x2C/g, ",") } if (m && m.length > 0 && m[0] != "") { switch (m[0]) { case "1": e.refresh(); return; break; case "3": if (m.length > 2) { var o = parseInt(m[1]); var p = parseInt(m[2]); if (isNaN(p)) p = null; var q = e.get_serviceByID(o, p); var r = "service_" + o; if (p != null) r += "_" + p.toString(); j[r] = true; k = true } break; case "9999": msg = m[1]; stack = m[2]; exType = m[3]; return; break; default: break } if (!k) { try { var s = m[1]; var t = m[2]; var u = m[3]; var v = parseFloat(m[4]); var w = parseInt(m[5]); var x = parseFloat(m[6]); var y = parseFloat(m[7]); var z = parseFloat(m[8]); var A = parseFloat(m[9]); var B = m[10]; e.currRate = parseFloat(m[11]); var C = C = m[12]; var D = parseInt(m[13]); var E = false; var F = s.split("_"); var o = parseInt(F[0]); var p = null; if (parseInt(F[6]) > -1) { p = parseInt(F[6]) } var G = "ACIGX"; for (var c = 0; c < G.length; c++) { var H = G.charAt(c); var I = false; switch (H) { case 'A': if (!isNaN(x)) { I = true; v = x } break; case 'C': if (!isNaN(y)) { I = true; v = y } break; case 'I': if (!isNaN(z)) { I = true; v = z } break; case 'G': if (!isNaN(A)) { I = true; H = "G"; v = A } break; default: if (isNaN(x) && isNaN(y) && isNaN(z) && isNaN(A)) { I = true } break } if (w == e.availability.unavailable || w == e.availability.unknown) { g.remove(undefined, o, p, s, undefined, u, undefined, undefined, H); E = false } else { E = (g.find(e.supplierID, o, p, s, t, u, undefined, undefined, H).length > 0) } if (E) { g.remove(e.supplierID, o, p, s, t, u, undefined, undefined, H); g.add(e.supplierID, o, p, s, t, u, v, w, H) } var q = e.get_serviceByID(o, p); var J = q.get_rateCell(s, H, u); if (J) { q.set_rateCellContent(J, w, str2Date(u), t, v, E, e.ID + ".rateClick(this);", x, y, z, C, D); q.set_rateStyle(J, E, w) } else { } if (B != null && B != "&*") { q.set_rateNameByRateRowID(s, H, B, C) } } } catch (ex) { } } } } } e.set_selectState(g); if (b != "NOCLEANUP") { e.cleanupServices(j) } else { for (var i = 0; i < e.services.length; i++) { var r = "service_" + e.services[i].serviceID; if (e.services[i].timeSlotID != null) { r += "_" + e.services[i].timeSlotID.toString() } if (j[r] != true) { e.services[i].removeEmptyRateRows() } } } var K = document.getElementById(bO); if (K && e.services.length == 0) { K.style.display = "inline" } else if (K) { K.style.display = "none" } var L = document.getElementById(bI); if (L) { var M = e.get_visibleRateRowIDs(); L.style.display = (M.length > bh) ? "block" : "none" } if (g.items.length < f.items.length) { var N = new Array(); N[0] = "Some selections were removed as they were no longer available."; e.showSummary(N) } else { e.showSummary() } } catch (ex) { } }; this.rateContentFailed = function (a, b, c) { if (a.get_timedOut()) { alert("The connection to the server timed out.") } else { alert(a.get_exceptionType() + ": \"" + a.get_message() + "\"") } }; this.scrollHeaderDates = function (a, b, c, d) { try { if (c > 0) { c = c - 1 } if (d > 0) { d = d - 1 } var e = document.getElementById(a); e.deleteCell(c); var f = e.insertCell(d); f.innerHTML = this.date2HeaderDateStr(b); f.className = this.headerDateClass; var g = f.previousSibling; if (!g) { g = f.nextSibling } if (g && g.className == this.headerDateClass) { f.className = this.headerDateAltClass } } catch (ex) { } }; var cK = false; this.doScroll = function (a, b) { if (cK) return ""; cK = true; var c; var d; var e = ""; var f; var g; var h; try { if (a == 0) { return "" } if (a > 0) { f = new Date(this.get_startDate().getTime()); f.setDate(f.getDate() + this.visibleDates); if (f.getTime() > this.maxDate.getTime()) return ""; var k = new Date(this.get_startDate().getTime()); k.setDate(k.getDate() + 1); this.set_startDate(k); c = -1; d = 1; if (this.get_startDate().getDate() > 26) { g = this.get_startDate(); g.setDate(g.getDate() + 7) } h = this.get_lastVisibleDate() } else { f = new Date(this.get_startDate().getTime()); f.setDate(f.getDate() - 1); if (f.getTime() < this.minDate.getTime()) return ""; this.set_startDate(f); c = 1; d = -1; if (this.get_startDate().getDate() < 4) { g = this.get_startDate(); g.setDate(g.getDate() - 7) } h = this.get_startDate() } this.scrollHeaderDates(bJ, f, d, c); this.scrollHeaderDates(bK, f, d, c); for (var i = 0; i < this.services.length; i++) { var l = this.services[i]; var m = l.get_ratesRows(); if (m) { for (var j = 0; j < m.length; j++) { m[j].deleteCell(d); var n = l.get_rateRowIDByRow(m[j]); var o = l.get_ACIByRow(m[j]); var p = l.buildRateCell(m[j], c, date2Str(f), cn, co) } } } if (!b) { this.requestRateContent(e, null, null, h, h) } } catch (ex) { } finally { cK = false } return e }; this.isJumping = false; this.doJump = function (a) { if (this.isJumping) return false; this.isJumping = true; try { var b = ""; var c; var d; var e; if (a == 0) return false; c = new Date(this.get_startDate().getFullYear(), this.get_startDate().getMonth(), this.get_startDate().getDate() + a); c.setHours(0, 0, 0, 0); if ((c.getTime() + (this.visibleDates * oneDay) - oneDay) >= this.maxDate.getTime()) c = new Date(this.maxDate.getFullYear(), this.maxDate.getMonth(), this.maxDate.getDate() - this.visibleDates + 1); if (c.getTime() < this.minDate.getTime()) c = new Date(this.minDate.getTime()); if (this.get_startDate().getTime() == c.getTime()) return false; if (a > 0) { do { var f = this.doScroll(1, true); var g = c; var h = new Date(c.getFullYear(), c.getMonth(), c.getDate() + this.visibleDates - 1); var i = new Date(this.get_startDate().getFullYear(), this.get_startDate().getMonth(), this.get_startDate().getDate() + this.visibleDates - 1); g.setHours(0, 0, 0, 0); h.setHours(0, 0, 0, 0); i.setHours(0, 0, 0, 0); if (i.getTime() >= g.getTime() && i.getTime() <= h.getTime()) { b += f } } while (this.get_startDate().getTime() < c.getTime()); d = new Date(this.get_startDate().getFullYear(), this.get_startDate().getMonth(), this.get_startDate().getDate() + (this.visibleDates - a)); e = this.get_lastVisibleDate() } else { do { var f = this.doScroll(-1, true); var g = c; var h = new Date(c.getFullYear(), c.getMonth(), c.getDate() + this.visibleDates - 1); var i = this.get_startDate(); g.setHours(0, 0, 0, 0); h.setHours(0, 0, 0, 0); i.setHours(0, 0, 0, 0); if (i.getTime() >= g.getTime() && i.getTime() <= h.getTime()) { b += f } } while (this.get_startDate().getTime() > c.getTime()); d = this.get_startDate(); e = new Date(this.get_startDate().getFullYear(), this.get_startDate().getMonth(), this.get_startDate().getDate() + ((0 - a) - 1)) } this.updateMonthJump(bL); this.updateMonthJump(bM); this.requestRateContent(b, null, null, d, e); return false } catch (ex) { } finally { this.isJumping = false } }; this.updateMonthJump = function (a) { var b = document.getElementById(a); if (b) { var c = this.get_startDateStr().substring(0, 6); for (var i = 0; i < b.length; i++) { if (b.item(i).value.substring(0, 6) == c && b.selectedIndex != i) { b.selectedIndex = i; return } } } }; this.monthJump = function (a) { if (a) { this.set_startDate(str2Date(a.value)); this.refresh() } }; this.refreshServiceRates = function (a, b, c) { var d = ""; var e = null; if (a == null || a == undefined) { a = null; e = this.services } else { e = new Array(); e[0] = this.get_serviceByID(a, b) } if (c) { if (e.length > 2) { this.refresh() } else if (e.length > 0) { for (var i = 0; i < e.length; i++) { e[i].refresh() } } } else { for (var i = 0; i < e.length; i++) { var f = e[i]; var g = f.get_ratesRows(); if (g) { for (var j = 0; j < g.length; j++) { for (var k = 1; k < g[j].cells.length; k++) { var h = f.get_rateDateStrByCell(g[j].cells[k]); f.buildRateCell(g[j], k, h, this.onRateMouseOverStr, this.onRateMouseLeaveStr, true) } } } } var l = this.get_startDate(); var m = new Date(this.get_startDate().getFullYear(), this.get_startDate().getMonth(), this.get_startDate().getDate() + (this.visibleDates - 1)); this.requestRateContent(d, a, true, l, m) } }; this.rateClick = function (a, b, c) { var d = this.supplierID; var e = new Rate(a); var f = e.serviceID; var g = e.rateRowID; var h = e.ACI; var j = e.rateDate; var k = e.availability; var l = e.rateID; var m = e.rateAmount; var n = e.timeSlotID; var o = this.get_serviceByID(f, n); if (!e.ticked) { var p = this.get_selectState(); if (p.find(d, f, n, g).length == 0) { this.condTipShow(a, d, f, n, g, h) } else { this.condTipShow() } if (o.servicePerID != 1 && o.servicePerID != 3 && o.servicePerID != 6 && o.servicePerID != 7) { var q = this.get_rateTicks(o); for (var i = 0; i < q.length; i++) { var r = q[i]; if (r.div != a && r.ticked && r.rateDate == j && r.rateRowID != g) { this.rateClick(r.div, true, true) } } p = this.get_selectState(); var s = 0; while (s < p.items.length) { var t = p.items[s]; if (t.supplierID == d && t.serviceid && t.rateDate == j && t.rateRowID != g) { var u = p.items[s].toString(); this.items.splice(s, 1); delete this.items[u] } else { s++ } } this.set_selectState(p) } else if (o.servicePerID == 1) { var q = this.get_rateTicks(o); for (var i = 0; i < q.length; i++) { var r = q[i]; if (r.div != a && r.ticked) { this.rateClick(r.div, true, true) } } p = this.get_selectState(); p.remove(d, f); this.set_selectState(p) } e.set_ticked(true, this); p.add(d, f, n, g, l, j, m, k, h); this.set_selectState(p); if (!c && o.get_selectedQty() == "0") { o.set_selectedQty("1") } if (!c && o.get_paxQtyValByID(g, h) == "0") { o.set_paxQtyValByID(g, h, "1") } o.set_rateStyle(e.tdRate, true, k) } else { this.condTipShow(); e.set_ticked(false, this); var p = this.get_selectState(); p.remove(d, f, n, g, undefined, j, undefined, undefined, h); this.set_selectState(p); if (!c && o.get_selectedQty() == 1) { if (p.items.length == 0 || p.find(d, f, n).length == 0) { o.set_selectedQty("0") } } if (o.get_paxQtyValByID(g, h) > 0) { if (p.items.length == 0 || p.find(d, f, n, g, undefined, undefined, undefined, undefined, h).length == 0) { o.set_paxQtyValByID(g, h, "0") } } o.set_rateStyle(e.tdRate, false, k) } if (!b) this.showSummary() }; this.serviceTipShow = function (a, b, c, d, e) { var f = document.getElementById(bS); var g = document.getElementById(bT); var h = document.getElementById(bU); var i = document.getElementById(bY); if (g && f && h) { f.style.display = "none"; g.style.display = "block"; g.innerHTML = "&nbsp;"; g.className = this.toolTipLoadingClass; h.innerHTML = e; var j = findElementPos(a); if (i != null && i.scrollTop != undefined && i.scrollLeft != undefined) { j.x = j.x - i.scrollLeft; j.y = j.y - i.scrollTop; if (j.x < 0) j.x = 0; if (j.y < 0) j.y = 0 } f.style.position = "absolute"; f.style.left = j.x + "px"; f.style.top = j.y + "px"; $telerik.$("#" + bS).fadeIn("fast"); var k = ""; k += ("ServiceID=" + c); k += ("&LanguageID=" + d); var l = new Evolution.BookEngineWebService(); l.set_timeout(wsProxyTimeout); l.GetServiceTip(k, this.serviceTipSuccess, this.serviceTipFail, ""); f.serviceID = c } }; this.serviceTipSuccess = function (a, b, c) { var d = document.getElementById(bT); if (d && a != "") { d.className = ""; d.innerHTML = a } }; this.serviceTipFail = function (a, b, c) { if (a.get_timedOut()) { alert("The connection to the server timed out.") } else { alert(a.get_exceptionType() + ": \"" + a.get_message() + "\"") } }; this.serviceTipClose = function () { $telerik.$("#" + bS).fadeOut("fast") }; this.serviceMore = function (a) { if (cp != "" && a != undefined && a != null) { this.serviceTipClose(); var b = cp + "?pop=1&hidebe=1&beslinksoff=1&sid=" + a; popAvail(b) } }; this.genTipShow = function (a, b, c, d, e, f, g, h) { var i = document.getElementById(bV); var j = document.getElementById(bW); var k = document.getElementById(bX); if (i) { i.style.display = "none"; i.style.position = "absolute"; var l = document[bV + "_W"]; var m = document[bV + "_H"]; if (l == undefined || l == null) document[bV + "_W"] = i.style.width; if (m == undefined || m == null) document[bV + "_H"] = i.style.height; l = document[bV + "_W"]; m = document[bV + "_H"]; if (a) { var n = null; var o = null; if (g == undefined || g == null) g = l; if (h == undefined || h == null) h = m; if (g != "" && !isNaN(g)) g = g + "px"; if (h != "" && !isNaN(h)) h = h + "px"; i.style.width = g; i.style.height = h; if (d) { var p = findElementPos(d); if (!(isNaN(p.x) || isNaN(p.y))) { n = p.x; o = p.y } if (e != null && e != undefined && f != null && f != undefined) { if (n == null) n = 0; if (o == null) o = 0; n = n + e; o = o + f } } else if (e != null && e != undefined && f != null && f != undefined) { n = e; o = f } if (n != null && o != null) { i.style.left = n + "px"; i.style.top = o + "px" } else { centerElement(i) } } else { return } if (j) { while (j.firstChild) j.removeChild(j.firstChild); if (b != undefined && b != null) { var q = document.createElement("span"); q.innerHTML = b; j.appendChild(q) } } if (k) { while (k.firstChild) k.removeChild(k.firstChild); if (c != undefined && c != null) { var q = document.createElement("span"); q.innerHTML = c; k.appendChild(q) } } $telerik.$("#" + bV).slideDown("fast") } }; this.genTipClose = function () { $telerik.$("#" + bV).fadeOut("fast") }; this.condTipShow = function (a, b, c, d, e, f) { try { if (a == null || a == undefined || b == null || b == undefined || c == undefined || c == null) { this.genTipClose(); return } if (d != undefined && d != null && isNaN(d)) d = null; var g = this.get_serviceByID(c, d); if (g) { var h = document.getElementById(bY); var i = findElementPos(a); if (h && h.scrollTop != undefined && h.scrollLeft != undefined) { if (i && i.x != undefined && i.x != null && i.y != undefined && i.y != undefined) { i.x = i.x - h.scrollLeft; i.y = i.y - h.scrollTop } } var j = g.get_conditionIDByRateRowID(e, f); if (j == null || j == undefined || j == -1) return; var k = c + "#"; if (d != null) k += d; k += "#" + e + "#" + f + "#" + (i.x + 40) + "#" + (i.y - 30); var l = new Evolution.BookEngineWebService(); l.set_timeout(wsProxyTimeout); var m = ""; m += ("supplierID=" + b); m += ("&conditionID=" + j); l.GetCondTip(m, this.condTipSuccess, this.condTipFail, k) } } catch (ex) { } }; this.condTipGen = function (a, b, c, d, e, f) { try { if (b == undefined || b == null || isNaN(b)) b = null; var g = this.get_serviceByID(a, b); if (g) { var h = g.get_conditionByRateRowID(c, d); if (h && h.text != null && h.text != undefined) { this.genTipShow(true, ct, h.text, null, e, f) } else { this.genTipClose() } } } catch (ex) { } }; this.condTipSuccess = function (a, b, c) { try { var d = b.split("#"); var e = document[S]; var r = a.split("====="); if (!r || r.length == 0 || r[1] == "") { if (d && d.length >= 5) { e.condTipGen(d[0], d[1], d[2], d[3], d[4], d[5]) } } else { var f = r[1]; if (d && d.length >= 6) { f = f.replace(/\\r\\n/g, "<BR/>"); f = f.replace(/\\r/g, "<BR/>"); f = f.replace(/\\n/g, "<BR/>"); e.genTipShow(true, ct, f, null, d[4], d[5]) } } } catch (ex) { } }; this.condTipFail = function (a, b, c) { try { var d = b.split("#"); if (d && d.length >= 6) { this.condTipGen(d[0], d[1], d[2], d[3], d[4], d[5]) } } catch (a) { } }; this.rateTipShow = function (a) { this.genTipShow() }; this.rateTipClose = function (a) { this.genTipShow() }; this.validateBooking = function () { var a = new Array(); a.success = true; var b = ""; try { b = this.get_selectState(); if (b.items.length == 0) { if (cm) { a.success = true; return } else { a[a.length] = this.strNoSelectionsMsg; a.success = false; return } } } catch (ex) { a[a.length] = cq + "<br/>" + ex.message; a.success = false } finally { return a } }; this.get_serviceSummary = function (e, f, g, h) { var k = new Date(0); var l = new Date(0); var m = false; var n = new Array(); var o = null; switch (g.servicePerID) { case 1: case 3: case 6: case 7: var p = e.find(f, g.serviceID, g.timeSlotID); var q = new Array(); for (var i = 0; i < p.length; i++) { var r = "RATECODE__" + p[i].rateRowID; if (!q[r]) { q[q.length] = p[i].rateRowID; q[r] = p[i].rateRowID } } for (var i = 0; i < q.length; i++) { var s = q[i].replace("RATECODE__", ""); p = e.find(f, g.serviceID, g.timeSlotID, q[i]); p.sort(function (a, b) { return a.rateDate.getTime() - b.rateDate.getTime() }); var t = null; for (var j = 0; j < p.length; j++) { if (t == null || (p[j].rateDate.getTime() != t.getTime())) { o = new function () { this.selections = new Array(); this.earliestDate = p[j].rateDate; this.latestDate = p[j].rateDate }; n[n.length] = o } o.selections[o.selections.length] = p[j]; o.latestDate = p[j].rateDate; t = p[j].rateDate } } break; default: var p = e.find(f, g.serviceID, g.timeSlotID); p.sort(function (a, b) { return a.rateDate.getTime() - b.rateDate.getTime() }); var t = null; var u = null; var v = new Array(); for (var i = 0; i < p.length; i++) { var r = date2Str(p[i].rateDate) + "|||||" + p[i].rateRowID; var w = v[r]; if (w == null) { w = new function () { this.A = 0; this.C = 0; this.I = 0 }; v[r] = w; v[v.length] = r } switch (p[i].ACI) { case "A": w.A = 1; break; case "C": w.C = 1; break; case "I": w.I = 1; break; default: break } } for (var i = 0; i < p.length; i++) { var x = v[date2Str(p[i].rateDate) + "|||||" + p[i].rateRowID]; if (t == null || (p[i].rateDate.getTime() - t.getTime()) > oneDay || u == null || (u.A != x.A || u.C != x.C || u.I != x.I)) { o = new function () { this.selections = new Array(); this.earliestDate = p[i].rateDate; this.latestDate = p[i].rateDate }; n[n.length] = o } o.selections[o.selections.length] = p[i]; o.latestDate = p[i].rateDate; t = p[i].rateDate; u = x } break } var y = new Array(); for (var i = 0; i < n.length; i++) { o = n[i]; var z = new Array(); var A = new function () { this.earliestDate = o.earliestDate; this.latestDate = o.latestDate; this.summaryLines = new Array(); this.totalSelections = 0; this.quantity = 0; this.subTotal = 0; this.total = 0; this.onRequest }; switch (g.servicePerID) { case 3: case 4: case 7: case 8: for (j = 0; j < o.selections.length; j++) { var B = o.selections[j]; var C = "aci_" + B.ACI; if (B.availability == this.availability.onRequest) m = true; var D = g.get_paxQtyValByID(B.rateRowID, B.ACI); if (!z[C]) { z[C] = new function () { this.price = B.rateAmount; this.rateRowID = B.rateRowID; this.paxQty = D }; z[z.length] = C } else { var E = z[C]; if (B.rateRowID != E.rateRowID) E.rateRowID = ""; E.paxQty += D } } z.sort(); for (var j = 0; j < z.length; j++) { var r = z[j]; var F = r.replace("aci_", ""); var E = z[r]; var G = parseFloat(E.price) * this.currRate; var H = E.paxQty; var s = E.rateRowID; var D = parseInt(E.paxQty); A.summaryLines[A.summaryLines.length] = new function () { this.price = G; this.selectionCount = H; this.rateRowID = s; this.ACI = F }; A.totalSelections += H; A.subTotal += (G * D); A.total = (A.subTotal * 1) } break; default: for (j = 0; j < o.selections.length; j++) { var B = o.selections[j]; var I = "price_" + (B.rateAmount * this.currRate); if (B.availability == this.availability.onRequest) m = true; if (!z[I]) { z[I] = new function () { this.rateRowID = B.rateRowID; this.count = 1 }; z[z.length] = I } else { var E = z[I]; if (B.rateRowID != E.rateRowID) E.rateRowID = ""; E.count += 1 } } z.sort(function (a, b) { var c = parseFloat(a.replace("price_", "")); var d = parseFloat(b.replace("price_", "")); return c - d }); for (var j = 0; j < z.length; j++) { var r = z[j]; var G = parseFloat(r.replace("price_", "")); var E = z[r]; var H = E.count; var s = E.rateRowID; A.summaryLines[A.summaryLines.length] = new function () { this.price = G; this.selectionCount = H; this.rateRowID = s }; A.totalSelections += H; switch (g.servicePerID) { case 1: case 3: case 6: A.subTotal = parseFloat(z[0].replace("price_", "")); break; default: A.subTotal += (G * H); break } A.total = (A.subTotal * h) } } A.quantity = h; A.onRequest = m; y[y.length] = A } return y }; this.showSummary = function (f, g, h, k, l) { var m = this.get_selectState(); var n = 0; var o = 0; var p = 0; var q = false; var r = document.getElementById(cb); r.createLine = function () { var a = r.insertRow(r.rows.length - 1); a.height = "20px"; var b = a.insertCell(-1); var c = a.insertCell(-1); var d = a.insertCell(-1); var e = a.insertCell(-1); b.innerHTML = "&nbsp;"; c.innerHTML = "&nbsp;"; d.innerHTML = "&nbsp;"; e.innerHTML = "&nbsp;"; b.align = "left"; c.align = "left"; d.align = "right"; e.align = "right"; b.vAlign = "top"; c.vAlign = "top"; d.vAlign = "top"; e.vAlign = "top"; b.classname = bB; c.classname = bB; d.classname = bB; e.classname = bB; a.tdService = b; a.tdDate = c; a.tdStay = d; a.tdPrice = e; return a }; while (r.rows.length > 2) { r.deleteRow(1) } if (this.services.length == 0) return; var s = new Array(); for (var i = 0; i < this.services.length; i++) { var t = this.services[i]; var u = this.get_serviceSummary(m, t.supplierID, t, t.get_selectedQty()); if (u) { for (j = 0; j < u.length; j++) { var v = u[j]; if (v) { var w = new function () { this.service = t; this.summary = v }; s[s.length] = w } } } } s.sort(function (a, b) { return a.summary.earliestDate.getTime() - b.summary.earliestDate.getTime() }); for (var i = 0; i < s.length; i++) { var t = s[i].service; var v = s[i].summary; if (v.onRequest) q = true; for (var j = 0; j < v.summaryLines.length; j++) { var x = r.createLine(); if (j == 0) { var y = "<span class=\"" + bD + "\" style=\"font-weight: bold; white-space: nowrap;\">" + this.supplierName + "&nbsp;-</span> "; y += "<span class=\"" + bD + "\" style=\"font-weight: bold; white-space: nowrap;\">" + t.serviceName; if (t.timeSlotID != null && t.timeSlotName != "") y += (" (" + t.timeSlotName + ")"); y += "</span>"; x.tdService.innerHTML = y; var z = null; switch (t.servicePerID) { case 2: case 4: case 5: case 8: case 9: case 10: z = new Date(v.latestDate.getTime()); z.setDate(z.getDate() + 1); break; default: z = new Date(v.latestDate.getTime()); break } var A = "<span class=\"" + bD + "\">" + this.date2SummaryStr(v.earliestDate); if (z != null && z.getTime() != v.earliestDate.getTime()) { A += (" to " + this.date2SummaryStr(z)) } A += "</span>"; x.tdDate.innerHTML = A; x.tdDate.colSpan = "3"; x.tdDate.style.textAlign = "left"; x.deleteCell(3); x.deleteCell(2); x = r.createLine() } var B = (v.quantity > 1) ? (v.quantity + "x ") : ""; var C = (v.summaryLines[j].selectionCount == 1) ? t.strServicePer : t.strServicePerPlural; var D = (v.summaryLines[j].rateRowID == "") ? cu : t.get_rateNameByRateRowID(v.summaryLines[j].rateRowID, v.summaryLines[j].ACI); x.tdService.innerHTML = "<span class=\"" + bD + "\">" + D + "</span>"; x.tdStay.innerHTML = "<span class=\"" + bD + "\">" + B + v.summaryLines[j].selectionCount + " " + C + " @" + "</span>"; x.tdPrice.innerHTML = "<span class=\"" + bD + "\">" + formatCurr(v.summaryLines[j].price, this.currencyCode, 0) + "</span>" } if (v.summaryLines.length > 0) { n += v.total; o += v.summaryLines.length; p += v.quantity; r.createLine() } } var E = document.getElementById(cc); E.innerHTML = formatCurr(n, this.currencyCode, 0); var F = document.getElementById(cd); if (F) { var G; if (!l) G = this.validateBooking(); if (!G) G = new Array(); if (!f) f = new Array(); for (var H = 0; H < G; H++) { f[f.length] = G[H] } if (q) { f[f.length] = this.strSomeServicesOnRequestMsg } if ((f && f.length > 0) || k) { if (!k) { while (F.rows.length > 1) { F.deleteRow(F.rows.length - 1) } } for (var i = 0; i < f.length; i++) { var I = F.insertRow(F.rows.length); I.valign = "top"; var J = I.insertCell(-1); J.innerHTML = "<span class=\"" + bD + "\">*&nbsp;&nbsp;</span>"; var K = I.insertCell(-1); K.innerHTML = "<span class=\"" + bD + "\">" + f[i] + "</span>"; K.className = this.summaryMsgClass } F.style.display = "" } else { while (F.rows.length > 1) { F.deleteRow(F.rows.length - 1) } F.style.display = "none" } } var L = document.getElementById(ca); if ((F && F.rows.length < 2) && !k && !g && m.items.length == 0) { if (L) L.style.display = "none"; var M = document.getElementById(bN); if (M) { M.innerHTML = formatCurr(n, this.currencyCode, 0) } var N = document.getElementById(ci); if (N) { N.innerHTML = "(" + this.currencyCode + ")" } var O = document.getElementById(cj); if (O) { O.innerHTML = "(" + this.currencyCode + ")" } return } if (L) L.style.display = ""; var P = document.getElementById(bZ); if (P && L && g) { P.style.display = ""; centerElement(P, true); centerElement(L); L.style.display = "none"; $telerik.$("#" + ca).fadeIn("fast"); var Q = document.getElementById(cg); if (Q) Q.style.display = "" } var R = document.getElementById(cf); if (R) R.style.display = (h || !g) ? "" : "none"; var M = document.getElementById(bN); if (M) { M.innerHTML = formatCurr(n, this.currencyCode, 0) } var N = document.getElementById(ci); if (N) { N.innerHTML = "(" + this.currencyCode + ")" } var O = document.getElementById(cj); if (O) { O.innerHTML = "(" + this.currencyCode + ")" } }; this.closeSummary = function () { var a = document.getElementById(bZ); var b = document.getElementById(ca); if (a && b) { a.style.display = "none"; b.style.position = "relative"; b.style.top = "0px"; b.style.left = "0px"; var c = document.getElementById(cg); if (c) c.style.display = "none"; var d = document.getElementById(cf); if (d) d.style.display = "" } return false }; this.submitBooking = function () { var a = false; try { var b = this.validateBooking(); if ((b && b.length > 0) || (!b)) { a = false; if (cl) { this.showSummary(b, true, false, false, true) } else { document.location.href = "#" + ce } } else if (b.success) { a = true; if (ck) { this.showSummary(b, true, true, false, true); a = false } } } catch (ex) { a = false; alert("Error while submitting Booking: " + ex.message) } return a }; this.currencyChanged = function () { var a = document.getElementById(ch); if (a) { var b = a.value; if (b != undefined && b != null && b != "") { var c = ""; c += ("SupplierID=" + this.supplierID); c += ("&CurrCode=" + b); var d = new Evolution.BookEngineWebService(); d.set_timeout(wsProxyTimeout); d.GetCurrRate(c, this.currRateSuccess, this.currRateFailed, b) } } }; this.currRateSuccess = function (a, b, c) { var d = document[S]; if (isNaN(a) || parseFloat(a) < 0) { var e = document.getElementById(ch); if (e) { for (var i = 0; i < e.length; i++) { if (e[i].value == d.currencyCode) { e.selectedIndex = i; break } } } alert(cJ) } else { d.currencyCode = b; d.currRate = parseFloat(a); var f = d.get_rateTicks(); for (var i = 0; i < f.length; i++) { var g = f[i]; var h = d.get_selectState().find(d.supplierID, g.serviceID, g.timeSlotID, g.rateRowID, g.rateID, g.rateDate, null, null, g.ACI); var j = (h.length && h.length > 0); if (j != null && g.rateRowID != null && g.rateID != null && g.rateDate != null && g.rateAmount != null && g.rateAdult != null && g.rateChild != null && g.rateInfant != null && g.ACI != null) { var k = d.get_serviceByID(g.serviceID, g.timeSlotID); k.set_rateCellContent(g.tdRate, g.availability, str2Date(g.rateDate), g.rateID, g.rateAmount, j, d.ID + ".rateClick(this);", g.rateAdult, g.rateChild, g.rateInfant, g.allotName, g.allotCount) } } d.showSummary() } }; this.currRateFailed = function (a, b, c) { if (a.get_timedOut()) { alert("The connection to the server timed out.") } else { alert(a.get_exceptionType() + ": \"" + a.get_message() + "\"") } } } function BookEngineService(r, s, t, u, v, w, x, y, z, A, B, C, D, E, F) { this.engineObjectID = r; this.controlID = s; this.supplierID = t; this.serviceID = u; this.timeSlotID = w; this.timeSlotName = x; this.serviceName = v; this.servicePerID = y; this.strServicePer = E; this.strServicePerPlural = F; this.parent = document[r]; this.tblServiceID = A; this.refresh = function () { var a = document.getElementById(z); if (a) { a.click() } }; this.get_tblService = function () { return document.getElementById(A) }; this.get_selectedQty = function () { var a = document.getElementById(B); if (a) { setupQtyDrop(a); return parseInt(a.value) } return 0 }; this.set_selectedQty = function (a) { var b = document.getElementById(B); if (b) { setupQtyDrop(b); try { var c = ($(b).find(":contains('" + a + "')").length > 0); if (c) { b.value = a; this.qtyChanging(b) } } catch (ex) { b.value = a; this.qtyChanging(b) } } }; this.get_ratesRows = function () { var a = document.getElementById(D); if (a) return a.rows; return null }; this.get_visibleRateRowIDs = function () { var a = document.getElementById(D); var b = new Array(); if (a) { for (var i = 0; i < a.rows.length; i++) { var c = a.rows[i]; var d = this.get_rateRowIDByRow(c); if (d) { if (b[d] == null || b[d] == undefined) { b[b.length] = d; b[d] = b.length } } } } return b }; this.get_rateRowIDByRow = function (a) { return a.getAttribute("RRID") }; this.get_ACIByRow = function (a) { return a.getAttribute("ACI") }; this.get_rateRowByRateRowID = function (a, b) { var c = document.getElementById(D); if (c) { for (var i = 0; i < c.rows.length; i++) { var d = c.rows[i]; if (this.get_rateRowIDByRow(d) == a) { var e = this.get_ACIByRow(d); if (b == e || b == null || b == undefined || (e == null && b == "X")) { return d } } } } return null }; this.get_rateCell = function (a, b, c) { var d = (this.controlID + "_" + a + "_" + c + "_" + b).replace(/-/g, "_"); return document.getElementById(d) }; this.get_rateDescCellByRateRowID = function (a, b) { var c = this.get_rateRowByRateRowID(a, b); if (c && c.cells.length > 0) return c.cells[0]; return null }; this.get_paxQtyByRow = function (a) { var b = (this.controlID + "_" + "ddlPaxQty_" + this.get_rateRowIDByRow(a) + "_" + this.get_ACIByRow(a)).replace(/-/g, "_"); if (b) { return document.getElementById(b) } return null }; this.get_paxQtyByID = function (a, b) { var c = this.get_rateRowByRateRowID(a, b); if (c) { return this.get_paxQtyByRow(c) } return null }; this.get_paxQtyValByID = function (a, b) { var c = this.get_paxQtyByID(a, b); if (c) { setupQtyDrop(c); return parseInt(c.value) } return 0 }; this.set_paxQtyValByID = function (a, b, c) { var d = this.get_paxQtyByID(a, b); if (d) { setupQtyDrop(d); try { var e = ($(d).find(":contains('" + c + "')").length > 0); if (e) { d.value = c; this.ACIPaxQtyChanging(d) } } catch (ex) { d.value = c; this.ACIPaxQtyChanging(d) } } return null }; this.get_rateNameByRateRowID = function (a, b) { var c = this.get_rateRowByRateRowID(a, b); if (c) { return c.getAttribute("RName") } return "" }; this.get_rateDateStrByCell = function (a) { if (a) { return a.getAttribute("RDate") } }; this.set_rateNameByRateRowID = function (a, b, c, d) { var e = document[r]; var f = this.get_rateRowByRateRowID(a, b); if (f) { var g = ""; switch (b) { case "A": if (this.get_rateRowByRateRowID(a, "C") != null || this.get_rateRowByRateRowID(a, "I") != null) { g = e.strAdult } break; case "C": g = e.strChild; break; case "I": g += e.strInfant; break } if (c != "" && g != "") { c += " " } c += g; f.setAttribute("RName", c); var h = findFirstElementByClassName(e.rateNameCellClass, f); if (h && h.innerHTML) { if (e.hideRateName) h.innerHTML = g; else h.innerHTML = c; if (h.innerHTML == "") h.innerHTML = "&nbsp;" } if (d != undefined) { f.setAttribute("AlName", d) } } }; this.get_conditionIDByRateRowID = function (a, b) { var c = this.get_rateRowByRateRowID(a, b); if (c) return c.getAttribute("CondID"); return null }; this.get_conditionByRateRowID = function (a, b) { var c = document[r]; var d = this.get_rateRowByRateRowID(a, b); if (d && d.getAttribute("CondName")) { var e = ""; var f = ""; var g = -1; var h = -1; var j = -1; var k = -1; var l = ""; var m; e = d.getAttribute("RName"); f = d.getAttribute("CondName"); g = parseInt(d.getAttribute("MinStay")); h = parseInt(d.getAttribute("MaxStay")); j = parseInt(d.getAttribute("MinPax")); k = parseInt(d.getAttribute("MaxPax")); var n = new Array(); if (g > 1) { var o = c.strRateCondMinStay; o = o.replace("{SUPPLIERNAME}", c.supplierName); o = o.replace("{SERVICENAME}", this.serviceName); o = o.replace("{MINSTAY}", g.toString()); o = o.replace("{SERVICEPERPLURAL}", this.strServicePerPlural); o = o.replace("{RATENAME}", e); n[n.length] = o } if (h > 0) { var o = c.strRateCondMaxStay; o = o.replace("{SUPPLIERNAME}", c.supplierName); o = o.replace("{SERVICENAME}", this.serviceName); o = o.replace("{MAXSTAY}", h.toString()); o = o.replace("{SERVICEPERPLURAL}", this.strServicePerPlural); o = o.replace("{RATENAME}", e); n[n.length] = o } if (j > 1) { var o = c.strRateCondMinPax; o = o.replace("{SUPPLIERNAME}", c.supplierName); o = o.replace("{SERVICENAME}", this.serviceName); o = o.replace("{MINPERSONS}", j.toString()); n[n.length] = o } if (k > 0) { var o = c.strRateCondMaxPax; o = o.replace("{SUPPLIERNAME}", c.supplierName); o = o.replace("{SERVICENAME}", this.serviceName); o = o.replace("{MAXPERSONS}", k.toString()); n[n.length] = o } for (var i = 0; i < n.length; i++) { if (i == 0) { l = "<ul>" } l += ("<li>" + n[i] + "</li>"); if (i == n.length - 1) { l += "</ul>" } } var p = new function () { this.rateRowID = a; this.rateName = e; this.conditionName = f; this.minStay = g; this.maxStay = h; this.minPax = j; this.maxPax = k; this.text = l }; return p } return null }; this.get_hasSelections = function () { var a = document[r]; var b = a.get_selectState(); var c = b.find(this.supplierID, this.serviceID, this.timeSlotID); return (c.length > 0) }; this.buildRateCell = function (a, b, c, d, e, f) { var g = document[this.engineObjectID]; var h = this.get_rateRowIDByRow(a); var i = this.get_ACIByRow(a); var j; if (f) { j = a.cells[b] } else { j = a.insertCell(b) } if (j) { j.id = (this.controlID + "_" + h + "_" + c + "_" + i).replace(/-/g, "_"); j.innerHTML = "&nbsp;"; j.className = g.rateEmptyClass; j.setAttribute("RDate", c); j.setAttribute("Avail", g.availability.unknown); this.set_rateCellEvents(j); return j } return null }; this.set_rateCellEvents = function (a) { var b = this.parent.onRateMouseOverStr; var c = this.parent.onRateMouseLeaveStr; if (this.parent.onRateMouseOverStr != "") { a.onmouseover = function () { executeFunctionByName(b, window, a) } } if (this.parent.onRateMouseLeaveStr != "") { a.onmouseleave = function () { executeFunctionByName(c, window, a) } } }; this.set_rateCellContent = function (a, b, c, d, e, f, g, h, i, j, k, l, m) { if (!a) return; var n = document[this.engineObjectID]; switch (b) { case n.availability.available: case n.availability.onRequest: var o = n.strRateCellContentHTMLTemplate; o = o.replace("{RID}", d); o = o.replace("{RATE}", formatNumber(e, 2, ".", "")); o = o.replace("{RATEDISP}", formatCurr((e * n.currRate), null, 0)); o = o.replace("{SELECTED}", f ? "1" : "0"); o = o.replace("{ONCLICK}", g); o = o.replace("{CLASS}", f ? n.rateTickedClass : n.rateUntickedClass); o = o.replace("{ALCOUNT}", l); if (isNaN(h)) { o = o.replace("{RATEA}", "") } else { o = o.replace("{RATEA}", formatNumber(h, 2, ".", "")) } if (isNaN(i)) { o = o.replace("{RATEC}", "") } else { o = o.replace("{RATEC}", formatNumber(i, 2, ".", "")) } if (isNaN(j)) { o = o.replace("{RATEI}", "") } else { o = o.replace("{RATEI}", formatNumber(j, 2, ".", "")) } break; default: o = "X"; break } a.innerHTML = o; var p = ""; if (n.showAvailTip) { var q = c.getDate() + " " + n.monthNames[c.getMonth()] + " " + c.getFullYear(); if (k == "") { p = n.strAvailability + " [" + q + "]" } else { p = "\"" + k + "\" " + n.strAvailability + " [" + q + "]" } p += ": " + l.toString() } a.setAttribute("title", p) }; this.set_rateStyle = function (a, b, c) { var d = document[this.engineObjectID]; if (a) { if (b) { a.className = d.rateSelectedClass } else { var d = document[r]; switch (parseInt(c)) { case d.availability.unavailable: a.className = d.rateNotAvailClass; break; case d.availability.available: a.className = d.rateAvailClass; break; case d.availability.onRequest: a.className = d.rateRequestClass; break; default: a.className = d.rateEmptyClass; break } } a.setAttribute("Avail", c) } }; this.removeEmptyRateRows = function () { var a = document[r]; var b = document.getElementById(D); var c = 0; if (b) { var d = 0; c = b.rows.length; while (d < b.rows.length) { var e = b.rows[d]; var f = false; var g = 1; while (g < e.cells.length && f == false) { var h = e.cells[g]; var i = h.getAttribute("Avail"); if (i == a.availability.onRequest || i == a.availability.available) { f = true } g++ } if (!f) b.deleteRow(d); else d++ } return d } return 0 }; this.removeSelections = function () { var a = document[r]; var b = a.get_rateTicks(this); for (var i = 0; i < b.length; i++) { var c = b[i]; if (c.ticked) { a.rateClick(c.div, true, true) } } var d = a.get_selectState(); d.remove(this.supplierID, this.serviceID, this.timeSlotID); a.set_selectState(d) }; this.qtyChanging = function (a) { try { var b = document[this.engineObjectID]; var c = parseInt(a.getAttribute("Org")); var d = parseInt(a.value); if (c > 0 && d == 0 && this.get_hasSelections()) { var e = confirm(b.strConfirmDelSelections); if (e) { this.removeSelections() } else { a.value = c; d = c } } else if (d > c && d > a.length) { a.value = c; d = c } if ((c > 1 && d <= 1) || (c <= 1 && d > 1) || (c > 1 && d > 1 && c != d)) { b.refreshServiceRates(u, w) } else { b.showSummary() } } catch (ex) { } finally { if (a) { a.setAttribute("Org", a.value) } } }; this.tsClicked = function (a) { this.oldTimeSlotID = a.value }; this.tsChanged = function (a) { var b = document[r]; answer = true; if (this.get_hasSelections()) { answer = confirm(b.strConfirmDelSelections) } if (answer) { this.removeSelections(); b.refreshServiceRates(u, w, true) } else { for (var i = 0; i < a.length; i++) { if (a[i].value == this.oldTimeSlotID) { a.selectedIndex = i; break } } } }; this.ACIPaxQtyChanging = function (a) { try { var b = parseInt(a.getAttribute("Org")); var c = parseInt(a.value); var d = document[this.engineObjectID]; var e = d.get_selectState(); var f = a.getAttribute("RRID"); var g = a.getAttribute("ACI"); var h = e.find(this.supplierID, this.serviceID, this.timeSlotID, f, undefined, undefined, undefined, undefined, g); if (b > 0 && c == 0 && h.length > 0) { var j = confirm(d.strConfirmDelSelections); if (j) { var k = d.get_rateTicks(this, f); for (var i = 0; i < k.length; i++) { var l = k[i]; if (l.ticked && l.ACI == g) { d.rateClick(l.div, true, true) } } var e = d.get_selectState(); e.remove(this.supplierID, this.serviceID, this.timeSlotID, f, undefined, undefined, undefined, undefined, g); d.set_selectState(e) } else { a.value = b; c = b } } else if (b < c && c > 1) { if (c < a.get_minValue() || c > a.get_maxValue()) { a.value = b; c = b } else { } } } catch (ex) { } finally { if (a) { a.setAttribute("Org", a.value) } if (d) { d.showSummary() } } }; var G = this.get_ratesRows(); if (G) { for (var i = 0; i < G.length; i++) { for (var j = 1; j < G[i].cells.length; j++) { this.set_rateCellEvents(G[i].cells[j]) } } } } function BookExtra(b) { this.checkBox = b; this.ID = b.parentNode.getAttribute("BEID"); this.bsID = b.parentNode.getAttribute("BSID"); this.bsdID = b.parentNode.getAttribute("BSDID"); this.lblBSTotalID = b.parentNode.getAttribute("lblBSTotalID"); this.lblBSDTotalID = b.parentNode.getAttribute("lblBSDTotalID"); this.bsdPriceBeforeExtra = parseFloat(b.parentNode.getAttribute("BSDPriceBeforeExtra")); this.bsdPriceOverriden = b.parentNode.getAttribute("BSDPriceOverriden") == "true"; this.amount = parseFloat(b.parentNode.getAttribute("amount")); this.exclusiveIDs = b.parentNode.getAttribute("ExclusiveIDs").split(","); this.get_selected = function () { return this.checkBox.checked }; this.set_selected = function (a) { this.checkBox.checked = a } } function becoExtraClicked(a, b, c) { if (a.checked) { becoCheckExtraExclusivity(a) } becoCalcExtras(b, c) } function becoCheckExtraExclusivity(a) { var b = new BookExtra(a); var c = document.getElementsByTagName("input"); for (var i = 0; i < c.length; i++) { var d = c[i]; if (d.type.toLowerCase() == "checkbox" && d.parentNode && d.parentNode.getAttribute("IsBSExtra") == "true" && d.parentNode.getAttribute("BSDID") == b.bsdID) { var e = new BookExtra(d); for (var j = 0; j < b.exclusiveIDs.length; j++) { if (e.ID == b.exclusiveIDs[j]) { e.set_selected(false) } } } } } function becoCalcExtras(a, b) { var c = new Array(); var d = document.getElementsByTagName("input"); for (var i = 0; i < d.length; i++) { var e = d[i]; if (e.type.toLowerCase() == "checkbox" && e.parentNode && e.parentNode.getAttribute("IsBSExtra") == "true") { var f = new BookExtra(e); var g; if (c[f.lblBSTotalID]) { g = c[f.lblBSTotalID] } else { g = new Array(); c[f.lblBSTotalID] = g; c[c.length] = f.lblBSTotalID } if (g[f.lblBSDTotalID] != null && g[f.lblBSDTotalID] != undefined) { } else { g[f.lblBSDTotalID] = f.bsdPriceBeforeExtra; g[g.length] = f.lblBSDTotalID } if (f.BSDPriceOverriden) { g[f.lblBSDTotalID] = f.bsdPriceBeforeExtra } else if (f.get_selected()) { g[f.lblBSDTotalID] = g[f.lblBSDTotalID] + f.amount } } } var h = 0; for (var i = 0; i < c.length; i++) { var k = c[i]; var l = document.getElementById(k); var m = 0; var g = c[k]; for (var j = 0; j < g.length; j++) { var n = g[j]; var o = document.getElementById(n); var p = g[n]; if (o) { o.innerHTML = formatCurr(p * b, a, 2) } m += p } h += m; if (l) { l.innerHTML = formatCurr(m * b, a, 2) } } becoUpdateTotals(a, b, h) } function becoAjaxLoad(a, e) { becoHideShowFunctions(false) } function becoToggleConfigMore(a, b, c, d, e) { try { var f = document.getElementById(a); var g = document.getElementById(b); var h = document.getElementById(c); if (g && f && h) { g.style.display = (g.style.display.toLowerCase() == "none") ? "" : "none"; f.value = (g.style.display.toLowerCase() == "none") ? "0" : "1"; h.src = (g.style.display.toLowerCase() == "none") ? d : e } } finally { return false } } function becoValidateEmail(a) { if (a && validateEmailAddress(a.value, true)) { return } if (a) { a.focus() } } function becoOverrideChanged(a, b, d) { var e = document.getElementById(d); var o = parseFloat(a.value); var c = parseFloat(b); if (e && a.value == "") { e.click() } else if (o.toString() == NaN.toString()) { a.focus() } else if (e && o != c) { e.click() } } function becoRedir(a, b, c) { var d = null; try { if (c) { d = document.getElementById(c); if (d) { centerElement(d, true); d.style.display = "" } } } catch (ex) { } finally { if (a != null && a != undefined && a != "") alert(a); window.location.href = b; if (d) { d.style.display = "none" } } } function becoShowLogin(a, b, c) { if (b && c) { var d = document.getElementById(b); if (d) { centerElement(d, true); d.style.display = "" } } if (a) { var e = document.getElementById(a); if (e) { if (c) { centerElement(e); try { $telerik.$("#" + a).fadeIn("fast") } finally { e.style.display = "" } } else { e.style.display = "" } } } } function becoHideShowFunctions(a) { if (beco_hideOnAjaxIDs && beco_hideOnAjaxIDs.length != undefined && beco_hideOnAjaxIDs.length > 0) { for (var i = 0; i < beco_hideOnAjaxIDs.length; i++) { becoHideShowFunction(beco_hideOnAjaxIDs[i], a) } } } function becoHideShowFunction(a, b) { try { if (a != null && a != undefined) { var c = document.getElementById(a); if (c) { c.style.display = b ? "" : "none" } } } catch (ex) { } } function becoPayNowClicked(a, b) { becoHideShowFunctions(false); if (a != null && a != undefined) { var c = document.getElementById(a); if (c) { if (!c.checked) { alert(b); becoHideShowFunctions(true); return false } else { return true } } } return false } function becoCCValidated(a, b) { if (!b.success) { becoHideShowFunctions(true) } return b.success } function becoConfirmAction(a) { var b = window[a]; if (b) b.show() } function becoActionConfirmed() { becoHideShowFunctions() } function becoClearBedding(a) { var b = document.getElementsByName(a); if (b) { for (var i = 0; i < b.length; i++) { if (b[i].checked) { b[i].checked = false; return } } } } function BookConfirm(h, i, j, k, l, m, n, o) { this.show = function () { var a = $find(h); if (a) a.show() }; this.wndShow = function (a, b) { var c = document.getElementById(i); if (c) { c.value = "" } a.argument = o }; this.wndClose = function (a, b) { var c = document.getElementById(i); var d = document.getElementById(j); var e = null; var f = null; if (k != null && k != "") f = eval(k); if (l != null && l != "") e = eval(l); if (c && d) { var g = b.get_argument(); if (g != null) { if (f != null) f(this, g); if (m) { c.value = g; d.click() } } else { if (e != null) e(this, g); if (n) { c.value = ""; d.click() } } } } } var niftyOk = (document.getElementById && document.createElement && Array.prototype.push); var niftyCss = false; String.prototype.find = function (a) { return (this.indexOf(a) >= 0 ? true : false) }; var oldonload = window.onload; if (typeof (NiftyLoad) != 'function') NiftyLoad = function () { }; if (typeof (oldonload) == 'function') window.onload = function () { oldonload(); AddCss(); NiftyLoad() }; else window.onload = function () { AddCss(); NiftyLoad() }; function AddCss() { } function Nifty(a, b) { if (niftyOk == false) return; if (niftyCss == false) AddCss(); var i, v = a.split(","), h = 0; if (b == null) b = ""; if (b.find("fixed-height")) h = getElementsBySelector(v[0])[0].offsetHeight; for (i = 0; i < v.length; i++) Rounded(v[i], b); if (b.find("height")) SameHeight(a, h) } function Rounded(a, b) { var i, top = "", bottom = "", v = new Array(); if (b != "") { b = b.replace("left", "tl bl"); b = b.replace("right", "tr br"); b = b.replace("top", "tr tl"); b = b.replace("bottom", "br bl"); b = b.replace("transparent", "alias"); if (b.find("tl")) { top = "both"; if (!b.find("tr")) top = "left" } else if (b.find("tr")) top = "right"; if (b.find("bl")) { bottom = "both"; if (!b.find("br")) bottom = "left" } else if (b.find("br")) bottom = "right" } if (top == "" && bottom == "" && !b.find("none")) { top = "both"; bottom = "both" } v = getElementsBySelector(a); for (i = 0; i < v.length; i++) { FixIE(v[i]); if (top != "") AddTop(v[i], top, b); if (bottom != "") AddBottom(v[i], bottom, b) } } function AddTop(a, b, c) { var d = CreateEl("b"), lim = 4, border = "", p, i, btype = "r", bk, color; d.style.marginLeft = "-" + getPadding(a, "Left") + "px"; d.style.marginRight = "-" + getPadding(a, "Right") + "px"; if (c.find("alias") || (color = getBk(a)) == "transparent") { color = "transparent"; bk = "transparent"; border = getParentBk(a); btype = "t" } else { bk = getParentBk(a); border = Mix(color, bk) } d.style.background = bk; d.className = "niftycorners"; p = getPadding(a, "Top"); if (c.find("small")) { d.style.marginBottom = (p - 2) + "px"; btype += "s"; lim = 2 } else if (c.find("big")) { d.style.marginBottom = (p - 10) + "px"; btype += "b"; lim = 8 } else d.style.marginBottom = (p - 5) + "px"; for (i = 1; i <= lim; i++) d.appendChild(CreateStrip(i, b, color, border, btype)); a.style.paddingTop = "0"; a.insertBefore(d, a.firstChild) } function AddBottom(a, b, c) { var d = CreateEl("b"), lim = 4, border = "", p, i, btype = "r", bk, color; d.style.marginLeft = "-" + getPadding(a, "Left") + "px"; d.style.marginRight = "-" + getPadding(a, "Right") + "px"; if (c.find("alias") || (color = getBk(a)) == "transparent") { color = "transparent"; bk = "transparent"; border = getParentBk(a); btype = "t" } else { bk = getParentBk(a); border = Mix(color, bk) } d.style.background = bk; d.className = "niftycorners"; p = getPadding(a, "Bottom"); if (c.find("small")) { d.style.marginTop = (p - 2) + "px"; btype += "s"; lim = 2 } else if (c.find("big")) { d.style.marginTop = (p - 10) + "px"; btype += "b"; lim = 8 } else d.style.marginTop = (p - 5) + "px"; for (i = lim; i > 0; i--) d.appendChild(CreateStrip(i, b, color, border, btype)); a.style.paddingBottom = 0; a.appendChild(d) } function CreateStrip(a, b, c, d, e) { var x = CreateEl("b"); x.className = e + a; x.style.backgroundColor = c; x.style.borderColor = d; if (b == "left") { x.style.borderRightWidth = "0"; x.style.marginRight = "0" } else if (b == "right") { x.style.borderLeftWidth = "0"; x.style.marginLeft = "0" } return (x) } function CreateEl(x) { return (document.createElement(x)) } function FixIE(a) { if (a.currentStyle != null && a.currentStyle.hasLayout != null && a.currentStyle.hasLayout == false) a.style.display = "inline-block" } function SameHeight(a, b) { var i, v = a.split(","), t, j, els = [], gap; for (i = 0; i < v.length; i++) { t = getElementsBySelector(v[i]); els = els.concat(t) } for (i = 0; i < els.length; i++) { if (els[i].offsetHeight > b) b = els[i].offsetHeight; els[i].style.height = "auto" } for (i = 0; i < els.length; i++) { gap = b - els[i].offsetHeight; if (gap > 0) { t = CreateEl("b"); t.className = "niftyfill"; t.style.height = gap + "px"; nc = els[i].lastChild; if (nc.className == "niftycorners") els[i].insertBefore(t, nc); else els[i].appendChild(t) } } } function getElementsBySelector(b) { var i, j, selid = "", selclass = "", tag = b, tag2 = "", v2, k, f, a, s = [], objlist = [], c; if (b.find("#")) { if (b.find(" ")) { s = b.split(" "); var d = s[0].split("#"); if (d.length == 1) return (objlist); f = document.getElementById(d[1]); if (f) { v = f.getElementsByTagName(s[1]); for (i = 0; i < v.length; i++) objlist.push(v[i]) } return (objlist) } else { s = b.split("#"); tag = s[0]; selid = s[1]; if (selid != "") { f = document.getElementById(selid); if (f) objlist.push(f); return (objlist) } } } if (b.find(".")) { s = b.split("."); tag = s[0]; selclass = s[1]; if (selclass.find(" ")) { s = selclass.split(" "); selclass = s[0]; tag2 = s[1] } } var v = document.getElementsByTagName(tag); if (selclass == "") { for (i = 0; i < v.length; i++) objlist.push(v[i]); return (objlist) } for (i = 0; i < v.length; i++) { c = v[i].className.split(" "); for (j = 0; j < c.length; j++) { if (c[j] == selclass) { if (tag2 == "") objlist.push(v[i]); else { v2 = v[i].getElementsByTagName(tag2); for (k = 0; k < v2.length; k++) objlist.push(v2[k]) } } } } return (objlist) } function getParentBk(x) { var a = x.parentNode, c; while (a.tagName.toUpperCase() != "HTML" && (c = getBk(a)) == "transparent") a = a.parentNode; if (c == "transparent") c = "#FFFFFF"; return (c) } function getBk(x) { var c = getStyleProp(x, "backgroundColor"); if (c == null || c == "transparent" || c.find("rgba(0, 0, 0, 0)")) return ("transparent"); if (c.find("rgb")) c = rgb2hex(c); return (c) } function getPadding(x, a) { var p = getStyleProp(x, "padding" + a); if (p == null || !p.find("px")) return (0); return (parseInt(p)) } function getStyleProp(x, a) { if (x.currentStyle) return (x.currentStyle[a]); if (document.defaultView.getComputedStyle) return (document.defaultView.getComputedStyle(x, '')[a]); return (null) } function rgb2hex(a) { var b = "", v, h, i; var c = /([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/; var h = c.exec(a); for (i = 1; i < 4; i++) { v = parseInt(h[i]).toString(16); if (v.length == 1) b += "0" + v; else b += v } return ("#" + b) } function Mix(a, b) { var i, step1, step2, x, y, r = new Array(3); if (a.length == 4) step1 = 1; else step1 = 2; if (b.length == 4) step2 = 1; else step2 = 2; for (i = 0; i < 3; i++) { x = parseInt(a.substr(1 + step1 * i, step1), 16); if (step1 == 1) x = 16 * x + x; y = parseInt(b.substr(1 + step2 * i, step2), 16); if (step2 == 1) y = 16 * y + y; r[i] = Math.floor((x * 50 + y * 50) / 100); r[i] = r[i].toString(16); if (r[i].length == 1) r[i] = "0" + r[i] } return ("#" + r[0] + r[1] + r[2]) } try { if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded() } catch (ex) { }
