/* Comment Generated by Combres - Resource '~/Resources/Scripts/jquery-1.7.1.min.js' (Mode: Static) */ /*! jQuery v1.7.1 jquery.com | jquery.org/license */ (function (a, b) { function cy(a) { return f.isWindow(a) ? a : a.nodeType === 9 ? a.defaultView || a.parentWindow : !1 } function cv(a) { if (!ck[a]) { var b = c.body, d = f("<" + a + ">").appendTo(b), e = d.css("display"); d.remove(); if (e === "none" || e === "") { cl || (cl = c.createElement("iframe"), cl.frameBorder = cl.width = cl.height = 0), b.appendChild(cl); if (!cm || !cl.createElement) cm = (cl.contentWindow || cl.contentDocument).document, cm.write((c.compatMode === "CSS1Compat" ? "" : "") + ""), cm.close(); d = cm.createElement(a), cm.body.appendChild(d), e = f.css(d, "display"), b.removeChild(cl) } ck[a] = e } return ck[a] } function cu(a, b) { var c = {}; f.each(cq.concat.apply([], cq.slice(0, b)), function () { c[this] = a }); return c } function ct() { cr = b } function cs() { setTimeout(ct, 0); return cr = f.now() } function cj() { try { return new a.ActiveXObject("Microsoft.XMLHTTP") } catch (b) { } } function ci() { try { return new a.XMLHttpRequest } catch (b) { } } function cc(a, c) { a.dataFilter && (c = a.dataFilter(c, a.dataType)); var d = a.dataTypes, e = {}, g, h, i = d.length, j, k = d[0], l, m, n, o, p; for (g = 1; g < i; g++) { if (g === 1) for (h in a.converters) typeof h == "string" && (e[h.toLowerCase()] = a.converters[h]); l = k, k = d[g]; if (k === "*") k = l; else if (l !== "*" && l !== k) { m = l + " " + k, n = e[m] || e["* " + k]; if (!n) { p = b; for (o in e) { j = o.split(" "); if (j[0] === l || j[0] === "*") { p = e[j[1] + " " + k]; if (p) { o = e[o], o === !0 ? n = p : p === !0 && (n = o); break } } } } !n && !p && f.error("No conversion from " + m.replace(" ", " to ")), n !== !0 && (c = n ? n(c) : p(o(c))) } } return c } function cb(a, c, d) { var e = a.contents, f = a.dataTypes, g = a.responseFields, h, i, j, k; for (i in g) i in d && (c[g[i]] = d[i]); while (f[0] === "*") f.shift(), h === b && (h = a.mimeType || c.getResponseHeader("content-type")); if (h) for (i in e) if (e[i] && e[i].test(h)) { f.unshift(i); break } if (f[0] in d) j = f[0]; else { for (i in d) { if (!f[0] || a.converters[i + " " + f[0]]) { j = i; break } k || (k = i) } j = j || k } if (j) { j !== f[0] && f.unshift(j); return d[j] } } function ca(a, b, c, d) { if (f.isArray(b)) f.each(b, function (b, e) { c || bE.test(a) ? d(a, e) : ca(a + "[" + (typeof e == "object" || f.isArray(e) ? b : "") + "]", e, c, d) }); else if (!c && b != null && typeof b == "object") for (var e in b) ca(a + "[" + e + "]", b[e], c, d); else d(a, b) } function b_(a, c) { var d, e, g = f.ajaxSettings.flatOptions || {}; for (d in c) c[d] !== b && ((g[d] ? a : e || (e = {}))[d] = c[d]); e && f.extend(!0, a, e) } function b$(a, c, d, e, f, g) { f = f || c.dataTypes[0], g = g || {}, g[f] = !0; var h = a[f], i = 0, j = h ? h.length : 0, k = a === bT, l; for (; i < j && (k || !l); i++) l = h[i](c, d, e), typeof l == "string" && (!k || g[l] ? l = b : (c.dataTypes.unshift(l), l = b$(a, c, d, e, l, g))); (k || !l) && !g["*"] && (l = b$(a, c, d, e, "*", g)); return l } function bZ(a) { return function (b, c) { typeof b != "string" && (c = b, b = "*"); if (f.isFunction(c)) { var d = b.toLowerCase().split(bP), e = 0, g = d.length, h, i, j; for (; e < g; e++) h = d[e], j = /^\+/.test(h), j && (h = h.substr(1) || "*"), i = a[h] = a[h] || [], i[j ? "unshift" : "push"](c) } } } function bC(a, b, c) { var d = b === "width" ? a.offsetWidth : a.offsetHeight, e = b === "width" ? bx : by, g = 0, h = e.length; if (d > 0) { if (c !== "border") for (; g < h; g++) c || (d -= parseFloat(f.css(a, "padding" + e[g])) || 0), c === "margin" ? d += parseFloat(f.css(a, c + e[g])) || 0 : d -= parseFloat(f.css(a, "border" + e[g] + "Width")) || 0; return d + "px" } d = bz(a, b, b); if (d < 0 || d == null) d = a.style[b] || 0; d = parseFloat(d) || 0; if (c) for (; g < h; g++) d += parseFloat(f.css(a, "padding" + e[g])) || 0, c !== "padding" && (d += parseFloat(f.css(a, "border" + e[g] + "Width")) || 0), c === "margin" && (d += parseFloat(f.css(a, c + e[g])) || 0); return d + "px" } function bp(a, b) { b.src ? f.ajax({ url: b.src, async: !1, dataType: "script" }) : f.globalEval((b.text || b.textContent || b.innerHTML || "").replace(bf, "/*$0*/")), b.parentNode && b.parentNode.removeChild(b) } function bo(a) { var b = c.createElement("div"); bh.appendChild(b), b.innerHTML = a.outerHTML; return b.firstChild } function bn(a) { var b = (a.nodeName || "").toLowerCase(); b === "input" ? bm(a) : b !== "script" && typeof a.getElementsByTagName != "undefined" && f.grep(a.getElementsByTagName("input"), bm) } function bm(a) { if (a.type === "checkbox" || a.type === "radio") a.defaultChecked = a.checked } function bl(a) { return typeof a.getElementsByTagName != "undefined" ? a.getElementsByTagName("*") : typeof a.querySelectorAll != "undefined" ? a.querySelectorAll("*") : [] } function bk(a, b) { var c; if (b.nodeType === 1) { b.clearAttributes && b.clearAttributes(), b.mergeAttributes && b.mergeAttributes(a), c = b.nodeName.toLowerCase(); if (c === "object") b.outerHTML = a.outerHTML; else if (c !== "input" || a.type !== "checkbox" && a.type !== "radio") { if (c === "option") b.selected = a.defaultSelected; else if (c === "input" || c === "textarea") b.defaultValue = a.defaultValue } else a.checked && (b.defaultChecked = b.checked = a.checked), b.value !== a.value && (b.value = a.value); b.removeAttribute(f.expando) } } function bj(a, b) { if (b.nodeType === 1 && !!f.hasData(a)) { var c, d, e, g = f._data(a), h = f._data(b, g), i = g.events; if (i) { delete h.handle, h.events = {}; for (c in i) for (d = 0, e = i[c].length; d < e; d++) f.event.add(b, c + (i[c][d].namespace ? "." : "") + i[c][d].namespace, i[c][d], i[c][d].data) } h.data && (h.data = f.extend({}, h.data)) } } function bi(a, b) { return f.nodeName(a, "table") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a } function U(a) { var b = V.split("|"), c = a.createDocumentFragment(); if (c.createElement) while (b.length) c.createElement(b.pop()); return c } function T(a, b, c) { b = b || 0; if (f.isFunction(b)) return f.grep(a, function (a, d) { var e = !!b.call(a, d, a); return e === c }); if (b.nodeType) return f.grep(a, function (a, d) { return a === b === c }); if (typeof b == "string") { var d = f.grep(a, function (a) { return a.nodeType === 1 }); if (O.test(b)) return f.filter(b, d, !c); b = f.filter(b, d) } return f.grep(a, function (a, d) { return f.inArray(a, b) >= 0 === c }) } function S(a) { return !a || !a.parentNode || a.parentNode.nodeType === 11 } function K() { return !0 } function J() { return !1 } function n(a, b, c) { var d = b + "defer", e = b + "queue", g = b + "mark", h = f._data(a, d); h && (c === "queue" || !f._data(a, e)) && (c === "mark" || !f._data(a, g)) && setTimeout(function () { !f._data(a, e) && !f._data(a, g) && (f.removeData(a, d, !0), h.fire()) }, 0) } function m(a) { for (var b in a) { if (b === "data" && f.isEmptyObject(a[b])) continue; if (b !== "toJSON") return !1 } return !0 } function l(a, c, d) { if (d === b && a.nodeType === 1) { var e = "data-" + c.replace(k, "-$1").toLowerCase(); d = a.getAttribute(e); if (typeof d == "string") { try { d = d === "true" ? !0 : d === "false" ? !1 : d === "null" ? null : f.isNumeric(d) ? parseFloat(d) : j.test(d) ? f.parseJSON(d) : d } catch (g) { } f.data(a, c, d) } else d = b } return d } function h(a) { var b = g[a] = {}, c, d; a = a.split(/\s+/); for (c = 0, d = a.length; c < d; c++) b[a[c]] = !0; return b } var c = a.document, d = a.navigator, e = a.location, f = function () { function J() { if (!e.isReady) { try { c.documentElement.doScroll("left") } catch (a) { setTimeout(J, 1); return } e.ready() } } var e = function (a, b) { return new e.fn.init(a, b, h) }, f = a.jQuery, g = a.$, h, i = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, j = /\S/, k = /^\s+/, l = /\s+$/, m = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, n = /^[\],:{}\s]*$/, o = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, p = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, q = /(?:^|:|,)(?:\s*\[)+/g, r = /(webkit)[ \/]([\w.]+)/, s = /(opera)(?:.*version)?[ \/]([\w.]+)/, t = /(msie) ([\w.]+)/, u = /(mozilla)(?:.*? rv:([\w.]+))?/, v = /-([a-z]|[0-9])/ig, w = /^-ms-/, x = function (a, b) { return (b + "").toUpperCase() }, y = d.userAgent, z, A, B, C = Object.prototype.toString, D = Object.prototype.hasOwnProperty, E = Array.prototype.push, F = Array.prototype.slice, G = String.prototype.trim, H = Array.prototype.indexOf, I = {}; e.fn = e.prototype = { constructor: e, init: function (a, d, f) { var g, h, j, k; if (!a) return this; if (a.nodeType) { this.context = this[0] = a, this.length = 1; return this } if (a === "body" && !d && c.body) { this.context = c, this[0] = c.body, this.selector = a, this.length = 1; return this } if (typeof a == "string") { a.charAt(0) !== "<" || a.charAt(a.length - 1) !== ">" || a.length < 3 ? g = i.exec(a) : g = [null, a, null]; if (g && (g[1] || !d)) { if (g[1]) { d = d instanceof e ? d[0] : d, k = d ? d.ownerDocument || d : c, j = m.exec(a), j ? e.isPlainObject(d) ? (a = [c.createElement(j[1])], e.fn.attr.call(a, d, !0)) : a = [k.createElement(j[1])] : (j = e.buildFragment([g[1]], [k]), a = (j.cacheable ? e.clone(j.fragment) : j.fragment).childNodes); return e.merge(this, a) } h = c.getElementById(g[2]); if (h && h.parentNode) { if (h.id !== g[2]) return f.find(a); this.length = 1, this[0] = h } this.context = c, this.selector = a; return this } return !d || d.jquery ? (d || f).find(a) : this.constructor(d).find(a) } if (e.isFunction(a)) return f.ready(a); a.selector !== b && (this.selector = a.selector, this.context = a.context); return e.makeArray(a, this) }, selector: "", jquery: "1.7.1", length: 0, size: function () { return this.length }, toArray: function () { return F.call(this, 0) }, get: function (a) { return a == null ? this.toArray() : a < 0 ? this[this.length + a] : this[a] }, pushStack: function (a, b, c) { var d = this.constructor(); e.isArray(a) ? E.apply(d, a) : e.merge(d, a), d.prevObject = this, d.context = this.context, b === "find" ? d.selector = this.selector + (this.selector ? " " : "") + c : b && (d.selector = this.selector + "." + b + "(" + c + ")"); return d }, each: function (a, b) { return e.each(this, a, b) }, ready: function (a) { e.bindReady(), A.add(a); return this }, eq: function (a) { a = +a; return a === -1 ? this.slice(a) : this.slice(a, a + 1) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, slice: function () { return this.pushStack(F.apply(this, arguments), "slice", F.call(arguments).join(",")) }, map: function (a) { return this.pushStack(e.map(this, function (b, c) { return a.call(b, c, b) })) }, end: function () { return this.prevObject || this.constructor(null) }, push: E, sort: [].sort, splice: [].splice }, e.fn.init.prototype = e.fn, e.extend = e.fn.extend = function () { var a, c, d, f, g, h, i = arguments[0] || {}, j = 1, k = arguments.length, l = !1; typeof i == "boolean" && (l = i, i = arguments[1] || {}, j = 2), typeof i != "object" && !e.isFunction(i) && (i = {}), k === j && (i = this, --j); for (; j < k; j++) if ((a = arguments[j]) != null) for (c in a) { d = i[c], f = a[c]; if (i === f) continue; l && f && (e.isPlainObject(f) || (g = e.isArray(f))) ? (g ? (g = !1, h = d && e.isArray(d) ? d : []) : h = d && e.isPlainObject(d) ? d : {}, i[c] = e.extend(l, h, f)) : f !== b && (i[c] = f) } return i }, e.extend({ noConflict: function (b) { a.$ === e && (a.$ = g), b && a.jQuery === e && (a.jQuery = f); return e }, isReady: !1, readyWait: 1, holdReady: function (a) { a ? e.readyWait++ : e.ready(!0) }, ready: function (a) { if (a === !0 && ! --e.readyWait || a !== !0 && !e.isReady) { if (!c.body) return setTimeout(e.ready, 1); e.isReady = !0; if (a !== !0 && --e.readyWait > 0) return; A.fireWith(c, [e]), e.fn.trigger && e(c).trigger("ready").off("ready") } }, bindReady: function () { if (!A) { A = e.Callbacks("once memory"); if (c.readyState === "complete") return setTimeout(e.ready, 1); if (c.addEventListener) c.addEventListener("DOMContentLoaded", B, !1), a.addEventListener("load", e.ready, !1); else if (c.attachEvent) { c.attachEvent("onreadystatechange", B), a.attachEvent("onload", e.ready); var b = !1; try { b = a.frameElement == null } catch (d) { } c.documentElement.doScroll && b && J() } } }, isFunction: function (a) { return e.type(a) === "function" }, isArray: Array.isArray || function (a) { return e.type(a) === "array" }, isWindow: function (a) { return a && typeof a == "object" && "setInterval" in a }, isNumeric: function (a) { return !isNaN(parseFloat(a)) && isFinite(a) }, type: function (a) { return a == null ? String(a) : I[C.call(a)] || "object" }, isPlainObject: function (a) { if (!a || e.type(a) !== "object" || a.nodeType || e.isWindow(a)) return !1; try { if (a.constructor && !D.call(a, "constructor") && !D.call(a.constructor.prototype, "isPrototypeOf")) return !1 } catch (c) { return !1 } var d; for (d in a); return d === b || D.call(a, d) }, isEmptyObject: function (a) { for (var b in a) return !1; return !0 }, error: function (a) { throw new Error(a) }, parseJSON: function (b) { if (typeof b != "string" || !b) return null; b = e.trim(b); if (a.JSON && a.JSON.parse) return a.JSON.parse(b); if (n.test(b.replace(o, "@").replace(p, "]").replace(q, ""))) return (new Function("return " + b))(); e.error("Invalid JSON: " + b) }, parseXML: function (c) { var d, f; try { a.DOMParser ? (f = new DOMParser, d = f.parseFromString(c, "text/xml")) : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(c)) } catch (g) { d = b } (!d || !d.documentElement || d.getElementsByTagName("parsererror").length) && e.error("Invalid XML: " + c); return d }, noop: function () { }, globalEval: function (b) { b && j.test(b) && (a.execScript || function (b) { a.eval.call(a, b) })(b) }, camelCase: function (a) { return a.replace(w, "ms-").replace(v, x) }, nodeName: function (a, b) { return a.nodeName && a.nodeName.toUpperCase() === b.toUpperCase() }, each: function (a, c, d) { var f, g = 0, h = a.length, i = h === b || e.isFunction(a); if (d) { if (i) { for (f in a) if (c.apply(a[f], d) === !1) break } else for (; g < h; ) if (c.apply(a[g++], d) === !1) break } else if (i) { for (f in a) if (c.call(a[f], f, a[f]) === !1) break } else for (; g < h; ) if (c.call(a[g], g, a[g++]) === !1) break; return a }, trim: G ? function (a) { return a == null ? "" : G.call(a) } : function (a) { return a == null ? "" : (a + "").replace(k, "").replace(l, "") }, makeArray: function (a, b) { var c = b || []; if (a != null) { var d = e.type(a); a.length == null || d === "string" || d === "function" || d === "regexp" || e.isWindow(a) ? E.call(c, a) : e.merge(c, a) } return c }, inArray: function (a, b, c) { var d; if (b) { if (H) return H.call(b, a, c); d = b.length, c = c ? c < 0 ? Math.max(0, d + c) : c : 0; for (; c < d; c++) if (c in b && b[c] === a) return c } return -1 }, merge: function (a, c) { var d = a.length, e = 0; if (typeof c.length == "number") for (var f = c.length; e < f; e++) a[d++] = c[e]; else while (c[e] !== b) a[d++] = c[e++]; a.length = d; return a }, grep: function (a, b, c) { var d = [], e; c = !!c; for (var f = 0, g = a.length; f < g; f++) e = !!b(a[f], f), c !== e && d.push(a[f]); return d }, map: function (a, c, d) { var f, g, h = [], i = 0, j = a.length, k = a instanceof e || j !== b && typeof j == "number" && (j > 0 && a[0] && a[j - 1] || j === 0 || e.isArray(a)); if (k) for (; i < j; i++) f = c(a[i], i, d), f != null && (h[h.length] = f); else for (g in a) f = c(a[g], g, d), f != null && (h[h.length] = f); return h.concat.apply([], h) }, guid: 1, proxy: function (a, c) { if (typeof c == "string") { var d = a[c]; c = a, a = d } if (!e.isFunction(a)) return b; var f = F.call(arguments, 2), g = function () { return a.apply(c, f.concat(F.call(arguments))) }; g.guid = a.guid = a.guid || g.guid || e.guid++; return g }, access: function (a, c, d, f, g, h) { var i = a.length; if (typeof c == "object") { for (var j in c) e.access(a, j, c[j], f, g, d); return a } if (d !== b) { f = !h && f && e.isFunction(d); for (var k = 0; k < i; k++) g(a[k], c, f ? d.call(a[k], k, g(a[k], c)) : d, h); return a } return i ? g(a[0], c) : b }, now: function () { return (new Date).getTime() }, uaMatch: function (a) { a = a.toLowerCase(); var b = r.exec(a) || s.exec(a) || t.exec(a) || a.indexOf("compatible") < 0 && u.exec(a) || []; return { browser: b[1] || "", version: b[2] || "0"} }, sub: function () { function a(b, c) { return new a.fn.init(b, c) } e.extend(!0, a, this), a.superclass = this, a.fn = a.prototype = this(), a.fn.constructor = a, a.sub = this.sub, a.fn.init = function (d, f) { f && f instanceof e && !(f instanceof a) && (f = a(f)); return e.fn.init.call(this, d, f, b) }, a.fn.init.prototype = a.fn; var b = a(c); return a }, browser: {} }), e.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (a, b) { I["[object " + b + "]"] = b.toLowerCase() }), z = e.uaMatch(y), z.browser && (e.browser[z.browser] = !0, e.browser.version = z.version), e.browser.webkit && (e.browser.safari = !0), j.test(" ") && (k = /^[\s\xA0]+/, l = /[\s\xA0]+$/), h = e(c), c.addEventListener ? B = function () { c.removeEventListener("DOMContentLoaded", B, !1), e.ready() } : c.attachEvent && (B = function () { c.readyState === "complete" && (c.detachEvent("onreadystatechange", B), e.ready()) }); return e } (), g = {}; f.Callbacks = function (a) { a = a ? g[a] || h(a) : {}; var c = [], d = [], e, i, j, k, l, m = function (b) { var d, e, g, h, i; for (d = 0, e = b.length; d < e; d++) g = b[d], h = f.type(g), h === "array" ? m(g) : h === "function" && (!a.unique || !o.has(g)) && c.push(g) }, n = function (b, f) { f = f || [], e = !a.memory || [b, f], i = !0, l = j || 0, j = 0, k = c.length; for (; c && l < k; l++) if (c[l].apply(b, f) === !1 && a.stopOnFalse) { e = !0; break } i = !1, c && (a.once ? e === !0 ? o.disable() : c = [] : d && d.length && (e = d.shift(), o.fireWith(e[0], e[1]))) }, o = { add: function () { if (c) { var a = c.length; m(arguments), i ? k = c.length : e && e !== !0 && (j = a, n(e[0], e[1])) } return this }, remove: function () { if (c) { var b = arguments, d = 0, e = b.length; for (; d < e; d++) for (var f = 0; f < c.length; f++) if (b[d] === c[f]) { i && f <= k && (k--, f <= l && l--), c.splice(f--, 1); if (a.unique) break } } return this }, has: function (a) { if (c) { var b = 0, d = c.length; for (; b < d; b++) if (a === c[b]) return !0 } return !1 }, empty: function () { c = []; return this }, disable: function () { c = d = e = b; return this }, disabled: function () { return !c }, lock: function () { d = b, (!e || e === !0) && o.disable(); return this }, locked: function () { return !d }, fireWith: function (b, c) { d && (i ? a.once || d.push([b, c]) : (!a.once || !e) && n(b, c)); return this }, fire: function () { o.fireWith(this, arguments); return this }, fired: function () { return !!e } }; return o }; var i = [].slice; f.extend({ Deferred: function (a) { var b = f.Callbacks("once memory"), c = f.Callbacks("once memory"), d = f.Callbacks("memory"), e = "pending", g = { resolve: b, reject: c, notify: d }, h = { done: b.add, fail: c.add, progress: d.add, state: function () { return e }, isResolved: b.fired, isRejected: c.fired, then: function (a, b, c) { i.done(a).fail(b).progress(c); return this }, always: function () { i.done.apply(i, arguments).fail.apply(i, arguments); return this }, pipe: function (a, b, c) { return f.Deferred(function (d) { f.each({ done: [a, "resolve"], fail: [b, "reject"], progress: [c, "notify"] }, function (a, b) { var c = b[0], e = b[1], g; f.isFunction(c) ? i[a](function () { g = c.apply(this, arguments), g && f.isFunction(g.promise) ? g.promise().then(d.resolve, d.reject, d.notify) : d[e + "With"](this === i ? d : this, [g]) }) : i[a](d[e]) }) }).promise() }, promise: function (a) { if (a == null) a = h; else for (var b in h) a[b] = h[b]; return a } }, i = h.promise({}), j; for (j in g) i[j] = g[j].fire, i[j + "With"] = g[j].fireWith; i.done(function () { e = "resolved" }, c.disable, d.lock).fail(function () { e = "rejected" }, b.disable, d.lock), a && a.call(i, i); return i }, when: function (a) { function m(a) { return function (b) { e[a] = arguments.length > 1 ? i.call(arguments, 0) : b, j.notifyWith(k, e) } } function l(a) { return function (c) { b[a] = arguments.length > 1 ? i.call(arguments, 0) : c, --g || j.resolveWith(j, b) } } var b = i.call(arguments, 0), c = 0, d = b.length, e = Array(d), g = d, h = d, j = d <= 1 && a && f.isFunction(a.promise) ? a : f.Deferred(), k = j.promise(); if (d > 1) { for (; c < d; c++) b[c] && b[c].promise && f.isFunction(b[c].promise) ? b[c].promise().then(l(c), j.reject, m(c)) : --g; g || j.resolveWith(j, b) } else j !== a && j.resolveWith(j, d ? [a] : []); return k } }), f.support = function () { var b, d, e, g, h, i, j, k, l, m, n, o, p, q = c.createElement("div"), r = c.documentElement; q.setAttribute("className", "t"), q.innerHTML = "
a", d = q.getElementsByTagName("*"), e = q.getElementsByTagName("a")[0]; if (!d || !d.length || !e) return {}; g = c.createElement("select"), h = g.appendChild(c.createElement("option")), i = q.getElementsByTagName("input")[0], b = { leadingWhitespace: q.firstChild.nodeType === 3, tbody: !q.getElementsByTagName("tbody").length, htmlSerialize: !!q.getElementsByTagName("link").length, style: /top/.test(e.getAttribute("style")), hrefNormalized: e.getAttribute("href") === "/a", opacity: /^0.55/.test(e.style.opacity), cssFloat: !!e.style.cssFloat, checkOn: i.value === "on", optSelected: h.selected, getSetAttribute: q.className !== "t", enctype: !!c.createElement("form").enctype, html5Clone: c.createElement("nav").cloneNode(!0).outerHTML !== "<:nav>", submitBubbles: !0, changeBubbles: !0, focusinBubbles: !1, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0 }, i.checked = !0, b.noCloneChecked = i.cloneNode(!0).checked, g.disabled = !0, b.optDisabled = !h.disabled; try { delete q.test } catch (s) { b.deleteExpando = !1 } !q.addEventListener && q.attachEvent && q.fireEvent && (q.attachEvent("onclick", function () { b.noCloneEvent = !1 }), q.cloneNode(!0).fireEvent("onclick")), i = c.createElement("input"), i.value = "t", i.setAttribute("type", "radio"), b.radioValue = i.value === "t", i.setAttribute("checked", "checked"), q.appendChild(i), k = c.createDocumentFragment(), k.appendChild(q.lastChild), b.checkClone = k.cloneNode(!0).cloneNode(!0).lastChild.checked, b.appendChecked = i.checked, k.removeChild(i), k.appendChild(q), q.innerHTML = "", a.getComputedStyle && (j = c.createElement("div"), j.style.width = "0", j.style.marginRight = "0", q.style.width = "2px", q.appendChild(j), b.reliableMarginRight = (parseInt((a.getComputedStyle(j, null) || { marginRight: 0 }).marginRight, 10) || 0) === 0); if (q.attachEvent) for (o in { submit: 1, change: 1, focusin: 1 }) n = "on" + o, p = n in q, p || (q.setAttribute(n, "return;"), p = typeof q[n] == "function"), b[o + "Bubbles"] = p; k.removeChild(q), k = g = h = j = q = i = null, f(function () { var a, d, e, g, h, i, j, k, m, n, o, r = c.getElementsByTagName("body")[0]; !r || (j = 1, k = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;", m = "visibility:hidden;border:0;", n = "style='" + k + "border:5px solid #000;padding:0;'", o = "
" + "" + "
", a = c.createElement("div"), a.style.cssText = m + "width:0;height:0;position:static;top:0;margin-top:" + j + "px", r.insertBefore(a, r.firstChild), q = c.createElement("div"), a.appendChild(q), q.innerHTML = "
t
", l = q.getElementsByTagName("td"), p = l[0].offsetHeight === 0, l[0].style.display = "", l[1].style.display = "none", b.reliableHiddenOffsets = p && l[0].offsetHeight === 0, q.innerHTML = "", q.style.width = q.style.paddingLeft = "1px", f.boxModel = b.boxModel = q.offsetWidth === 2, typeof q.style.zoom != "undefined" && (q.style.display = "inline", q.style.zoom = 1, b.inlineBlockNeedsLayout = q.offsetWidth === 2, q.style.display = "", q.innerHTML = "
", b.shrinkWrapBlocks = q.offsetWidth !== 2), q.style.cssText = k + m, q.innerHTML = o, d = q.firstChild, e = d.firstChild, h = d.nextSibling.firstChild.firstChild, i = { doesNotAddBorder: e.offsetTop !== 5, doesAddBorderForTableAndCells: h.offsetTop === 5 }, e.style.position = "fixed", e.style.top = "20px", i.fixedPosition = e.offsetTop === 20 || e.offsetTop === 15, e.style.position = e.style.top = "", d.style.overflow = "hidden", d.style.position = "relative", i.subtractsBorderForOverflowNotVisible = e.offsetTop === -5, i.doesNotIncludeMarginInBodyOffset = r.offsetTop !== j, r.removeChild(a), q = a = null, f.extend(b, i)) }); return b } (); var j = /^(?:\{.*\}|\[.*\])$/, k = /([A-Z])/g; f.extend({ cache: {}, uuid: 0, expando: "jQuery" + (f.fn.jquery + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function (a) { a = a.nodeType ? f.cache[a[f.expando]] : a[f.expando]; return !!a && !m(a) }, data: function (a, c, d, e) { if (!!f.acceptData(a)) { var g, h, i, j = f.expando, k = typeof c == "string", l = a.nodeType, m = l ? f.cache : a, n = l ? a[j] : a[j] && j, o = c === "events"; if ((!n || !m[n] || !o && !e && !m[n].data) && k && d === b) return; n || (l ? a[j] = n = ++f.uuid : n = j), m[n] || (m[n] = {}, l || (m[n].toJSON = f.noop)); if (typeof c == "object" || typeof c == "function") e ? m[n] = f.extend(m[n], c) : m[n].data = f.extend(m[n].data, c); g = h = m[n], e || (h.data || (h.data = {}), h = h.data), d !== b && (h[f.camelCase(c)] = d); if (o && !h[c]) return g.events; k ? (i = h[c], i == null && (i = h[f.camelCase(c)])) : i = h; return i } }, removeData: function (a, b, c) { if (!!f.acceptData(a)) { var d, e, g, h = f.expando, i = a.nodeType, j = i ? f.cache : a, k = i ? a[h] : h; if (!j[k]) return; if (b) { d = c ? j[k] : j[k].data; if (d) { f.isArray(b) || (b in d ? b = [b] : (b = f.camelCase(b), b in d ? b = [b] : b = b.split(" "))); for (e = 0, g = b.length; e < g; e++) delete d[b[e]]; if (!(c ? m : f.isEmptyObject)(d)) return } } if (!c) { delete j[k].data; if (!m(j[k])) return } f.support.deleteExpando || !j.setInterval ? delete j[k] : j[k] = null, i && (f.support.deleteExpando ? delete a[h] : a.removeAttribute ? a.removeAttribute(h) : a[h] = null) } }, _data: function (a, b, c) { return f.data(a, b, c, !0) }, acceptData: function (a) { if (a.nodeName) { var b = f.noData[a.nodeName.toLowerCase()]; if (b) return b !== !0 && a.getAttribute("classid") === b } return !0 } }), f.fn.extend({ data: function (a, c) { var d, e, g, h = null; if (typeof a == "undefined") { if (this.length) { h = f.data(this[0]); if (this[0].nodeType === 1 && !f._data(this[0], "parsedAttrs")) { e = this[0].attributes; for (var i = 0, j = e.length; i < j; i++) g = e[i].name, g.indexOf("data-") === 0 && (g = f.camelCase(g.substring(5)), l(this[0], g, h[g])); f._data(this[0], "parsedAttrs", !0) } } return h } if (typeof a == "object") return this.each(function () { f.data(this, a) }); d = a.split("."), d[1] = d[1] ? "." + d[1] : ""; if (c === b) { h = this.triggerHandler("getData" + d[1] + "!", [d[0]]), h === b && this.length && (h = f.data(this[0], a), h = l(this[0], a, h)); return h === b && d[1] ? this.data(d[0]) : h } return this.each(function () { var b = f(this), e = [d[0], c]; b.triggerHandler("setData" + d[1] + "!", e), f.data(this, a, c), b.triggerHandler("changeData" + d[1] + "!", e) }) }, removeData: function (a) { return this.each(function () { f.removeData(this, a) }) } }), f.extend({ _mark: function (a, b) { a && (b = (b || "fx") + "mark", f._data(a, b, (f._data(a, b) || 0) + 1)) }, _unmark: function (a, b, c) { a !== !0 && (c = b, b = a, a = !1); if (b) { c = c || "fx"; var d = c + "mark", e = a ? 0 : (f._data(b, d) || 1) - 1; e ? f._data(b, d, e) : (f.removeData(b, d, !0), n(b, c, "mark")) } }, queue: function (a, b, c) { var d; if (a) { b = (b || "fx") + "queue", d = f._data(a, b), c && (!d || f.isArray(c) ? d = f._data(a, b, f.makeArray(c)) : d.push(c)); return d || [] } }, dequeue: function (a, b) { b = b || "fx"; var c = f.queue(a, b), d = c.shift(), e = {}; d === "inprogress" && (d = c.shift()), d && (b === "fx" && c.unshift("inprogress"), f._data(a, b + ".run", e), d.call(a, function () { f.dequeue(a, b) }, e)), c.length || (f.removeData(a, b + "queue " + b + ".run", !0), n(a, b, "queue")) } }), f.fn.extend({ queue: function (a, c) { typeof a != "string" && (c = a, a = "fx"); if (c === b) return f.queue(this[0], a); return this.each(function () { var b = f.queue(this, a, c); a === "fx" && b[0] !== "inprogress" && f.dequeue(this, a) }) }, dequeue: function (a) { return this.each(function () { f.dequeue(this, a) }) }, delay: function (a, b) { a = f.fx ? f.fx.speeds[a] || a : a, b = b || "fx"; return this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d) } }) }, clearQueue: function (a) { return this.queue(a || "fx", []) }, promise: function (a, c) { function m() { --h || d.resolveWith(e, [e]) } typeof a != "string" && (c = a, a = b), a = a || "fx"; var d = f.Deferred(), e = this, g = e.length, h = 1, i = a + "defer", j = a + "queue", k = a + "mark", l; while (g--) if (l = f.data(e[g], i, b, !0) || (f.data(e[g], j, b, !0) || f.data(e[g], k, b, !0)) && f.data(e[g], i, f.Callbacks("once memory"), !0)) h++, l.add(m); m(); return d.promise() } }); var o = /[\n\t\r]/g, p = /\s+/, q = /\r/g, r = /^(?:button|input)$/i, s = /^(?:button|input|object|select|textarea)$/i, t = /^a(?:rea)?$/i, u = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, v = f.support.getSetAttribute, w, x, y; f.fn.extend({ attr: function (a, b) { return f.access(this, a, b, !0, f.attr) }, removeAttr: function (a) { return this.each(function () { f.removeAttr(this, a) }) }, prop: function (a, b) { return f.access(this, a, b, !0, f.prop) }, removeProp: function (a) { a = f.propFix[a] || a; return this.each(function () { try { this[a] = b, delete this[a] } catch (c) { } }) }, addClass: function (a) { var b, c, d, e, g, h, i; if (f.isFunction(a)) return this.each(function (b) { f(this).addClass(a.call(this, b, this.className)) }); if (a && typeof a == "string") { b = a.split(p); for (c = 0, d = this.length; c < d; c++) { e = this[c]; if (e.nodeType === 1) if (!e.className && b.length === 1) e.className = a; else { g = " " + e.className + " "; for (h = 0, i = b.length; h < i; h++) ~g.indexOf(" " + b[h] + " ") || (g += b[h] + " "); e.className = f.trim(g) } } } return this }, removeClass: function (a) { var c, d, e, g, h, i, j; if (f.isFunction(a)) return this.each(function (b) { f(this).removeClass(a.call(this, b, this.className)) }); if (a && typeof a == "string" || a === b) { c = (a || "").split(p); for (d = 0, e = this.length; d < e; d++) { g = this[d]; if (g.nodeType === 1 && g.className) if (a) { h = (" " + g.className + " ").replace(o, " "); for (i = 0, j = c.length; i < j; i++) h = h.replace(" " + c[i] + " ", " "); g.className = f.trim(h) } else g.className = "" } } return this }, toggleClass: function (a, b) { var c = typeof a, d = typeof b == "boolean"; if (f.isFunction(a)) return this.each(function (c) { f(this).toggleClass(a.call(this, c, this.className, b), b) }); return this.each(function () { if (c === "string") { var e, g = 0, h = f(this), i = b, j = a.split(p); while (e = j[g++]) i = d ? i : !h.hasClass(e), h[i ? "addClass" : "removeClass"](e) } else if (c === "undefined" || c === "boolean") this.className && f._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : f._data(this, "__className__") || "" }) }, hasClass: function (a) { var b = " " + a + " ", c = 0, d = this.length; for (; c < d; c++) if (this[c].nodeType === 1 && (" " + this[c].className + " ").replace(o, " ").indexOf(b) > -1) return !0; return !1 }, val: function (a) { var c, d, e, g = this[0]; { if (!!arguments.length) { e = f.isFunction(a); return this.each(function (d) { var g = f(this), h; if (this.nodeType === 1) { e ? h = a.call(this, d, g.val()) : h = a, h == null ? h = "" : typeof h == "number" ? h += "" : f.isArray(h) && (h = f.map(h, function (a) { return a == null ? "" : a + "" })), c = f.valHooks[this.nodeName.toLowerCase()] || f.valHooks[this.type]; if (!c || !("set" in c) || c.set(this, h, "value") === b) this.value = h } }) } if (g) { c = f.valHooks[g.nodeName.toLowerCase()] || f.valHooks[g.type]; if (c && "get" in c && (d = c.get(g, "value")) !== b) return d; d = g.value; return typeof d == "string" ? d.replace(q, "") : d == null ? "" : d } } } }), f.extend({ valHooks: { option: { get: function (a) { var b = a.attributes.value; return !b || b.specified ? a.value : a.text } }, select: { get: function (a) { var b, c, d, e, g = a.selectedIndex, h = [], i = a.options, j = a.type === "select-one"; if (g < 0) return null; c = j ? g : 0, d = j ? g + 1 : i.length; for (; c < d; c++) { e = i[c]; if (e.selected && (f.support.optDisabled ? !e.disabled : e.getAttribute("disabled") === null) && (!e.parentNode.disabled || !f.nodeName(e.parentNode, "optgroup"))) { b = f(e).val(); if (j) return b; h.push(b) } } if (j && !h.length && i.length) return f(i[g]).val(); return h }, set: function (a, b) { var c = f.makeArray(b); f(a).find("option").each(function () { this.selected = f.inArray(f(this).val(), c) >= 0 }), c.length || (a.selectedIndex = -1); return c } } }, attrFn: { val: !0, css: !0, html: !0, text: !0, data: !0, width: !0, height: !0, offset: !0 }, attr: function (a, c, d, e) { var g, h, i, j = a.nodeType; if (!!a && j !== 3 && j !== 8 && j !== 2) { if (e && c in f.attrFn) return f(a)[c](d); if (typeof a.getAttribute == "undefined") return f.prop(a, c, d); i = j !== 1 || !f.isXMLDoc(a), i && (c = c.toLowerCase(), h = f.attrHooks[c] || (u.test(c) ? x : w)); if (d !== b) { if (d === null) { f.removeAttr(a, c); return } if (h && "set" in h && i && (g = h.set(a, d, c)) !== b) return g; a.setAttribute(c, "" + d); return d } if (h && "get" in h && i && (g = h.get(a, c)) !== null) return g; g = a.getAttribute(c); return g === null ? b : g } }, removeAttr: function (a, b) { var c, d, e, g, h = 0; if (b && a.nodeType === 1) { d = b.toLowerCase().split(p), g = d.length; for (; h < g; h++) e = d[h], e && (c = f.propFix[e] || e, f.attr(a, e, ""), a.removeAttribute(v ? e : c), u.test(e) && c in a && (a[c] = !1)) } }, attrHooks: { type: { set: function (a, b) { if (r.test(a.nodeName) && a.parentNode) f.error("type property can't be changed"); else if (!f.support.radioValue && b === "radio" && f.nodeName(a, "input")) { var c = a.value; a.setAttribute("type", b), c && (a.value = c); return b } } }, value: { get: function (a, b) { if (w && f.nodeName(a, "button")) return w.get(a, b); return b in a ? a.value : null }, set: function (a, b, c) { if (w && f.nodeName(a, "button")) return w.set(a, b, c); a.value = b } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function (a, c, d) { var e, g, h, i = a.nodeType; if (!!a && i !== 3 && i !== 8 && i !== 2) { h = i !== 1 || !f.isXMLDoc(a), h && (c = f.propFix[c] || c, g = f.propHooks[c]); return d !== b ? g && "set" in g && (e = g.set(a, d, c)) !== b ? e : a[c] = d : g && "get" in g && (e = g.get(a, c)) !== null ? e : a[c] } }, propHooks: { tabIndex: { get: function (a) { var c = a.getAttributeNode("tabindex"); return c && c.specified ? parseInt(c.value, 10) : s.test(a.nodeName) || t.test(a.nodeName) && a.href ? 0 : b } }} }), f.attrHooks.tabindex = f.propHooks.tabIndex, x = { get: function (a, c) { var d, e = f.prop(a, c); return e === !0 || typeof e != "boolean" && (d = a.getAttributeNode(c)) && d.nodeValue !== !1 ? c.toLowerCase() : b }, set: function (a, b, c) { var d; b === !1 ? f.removeAttr(a, c) : (d = f.propFix[c] || c, d in a && (a[d] = !0), a.setAttribute(c, c.toLowerCase())); return c } }, v || (y = { name: !0, id: !0 }, w = f.valHooks.button = { get: function (a, c) { var d; d = a.getAttributeNode(c); return d && (y[c] ? d.nodeValue !== "" : d.specified) ? d.nodeValue : b }, set: function (a, b, d) { var e = a.getAttributeNode(d); e || (e = c.createAttribute(d), a.setAttributeNode(e)); return e.nodeValue = b + "" } }, f.attrHooks.tabindex.set = w.set, f.each(["width", "height"], function (a, b) { f.attrHooks[b] = f.extend(f.attrHooks[b], { set: function (a, c) { if (c === "") { a.setAttribute(b, "auto"); return c } } }) }), f.attrHooks.contenteditable = { get: w.get, set: function (a, b, c) { b === "" && (b = "false"), w.set(a, b, c) } }), f.support.hrefNormalized || f.each(["href", "src", "width", "height"], function (a, c) { f.attrHooks[c] = f.extend(f.attrHooks[c], { get: function (a) { var d = a.getAttribute(c, 2); return d === null ? b : d } }) }), f.support.style || (f.attrHooks.style = { get: function (a) { return a.style.cssText.toLowerCase() || b }, set: function (a, b) { return a.style.cssText = "" + b } }), f.support.optSelected || (f.propHooks.selected = f.extend(f.propHooks.selected, { get: function (a) { var b = a.parentNode; b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex); return null } })), f.support.enctype || (f.propFix.enctype = "encoding"), f.support.checkOn || f.each(["radio", "checkbox"], function () { f.valHooks[this] = { get: function (a) { return a.getAttribute("value") === null ? "on" : a.value } } }), f.each(["radio", "checkbox"], function () { f.valHooks[this] = f.extend(f.valHooks[this], { set: function (a, b) { if (f.isArray(b)) return a.checked = f.inArray(f(a).val(), b) >= 0 } }) }); var z = /^(?:textarea|input|select)$/i, A = /^([^\.]*)?(?:\.(.+))?$/, B = /\bhover(\.\S+)?\b/, C = /^key/, D = /^(?:mouse|contextmenu)|click/, E = /^(?:focusinfocus|focusoutblur)$/, F = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, G = function (a) { var b = F.exec(a); b && (b[1] = (b[1] || "").toLowerCase(), b[3] = b[3] && new RegExp("(?:^|\\s)" + b[3] + "(?:\\s|$)")); return b }, H = function (a, b) { var c = a.attributes || {}; return (!b[1] || a.nodeName.toLowerCase() === b[1]) && (!b[2] || (c.id || {}).value === b[2]) && (!b[3] || b[3].test((c["class"] || {}).value)) }, I = function (a) { return f.event.special.hover ? a : a.replace(B, "mouseenter$1 mouseleave$1") }; f.event = { add: function (a, c, d, e, g) { var h, i, j, k, l, m, n, o, p, q, r, s; if (!(a.nodeType === 3 || a.nodeType === 8 || !c || !d || !(h = f._data(a)))) { d.handler && (p = d, d = p.handler), d.guid || (d.guid = f.guid++), j = h.events, j || (h.events = j = {}), i = h.handle, i || (h.handle = i = function (a) { return typeof f != "undefined" && (!a || f.event.triggered !== a.type) ? f.event.dispatch.apply(i.elem, arguments) : b }, i.elem = a), c = f.trim(I(c)).split(" "); for (k = 0; k < c.length; k++) { l = A.exec(c[k]) || [], m = l[1], n = (l[2] || "").split(".").sort(), s = f.event.special[m] || {}, m = (g ? s.delegateType : s.bindType) || m, s = f.event.special[m] || {}, o = f.extend({ type: m, origType: l[1], data: e, handler: d, guid: d.guid, selector: g, quick: G(g), namespace: n.join(".") }, p), r = j[m]; if (!r) { r = j[m] = [], r.delegateCount = 0; if (!s.setup || s.setup.call(a, e, n, i) === !1) a.addEventListener ? a.addEventListener(m, i, !1) : a.attachEvent && a.attachEvent("on" + m, i) } s.add && (s.add.call(a, o), o.handler.guid || (o.handler.guid = d.guid)), g ? r.splice(r.delegateCount++, 0, o) : r.push(o), f.event.global[m] = !0 } a = null } }, global: {}, remove: function (a, b, c, d, e) { var g = f.hasData(a) && f._data(a), h, i, j, k, l, m, n, o, p, q, r, s; if (!!g && !!(o = g.events)) { b = f.trim(I(b || "")).split(" "); for (h = 0; h < b.length; h++) { i = A.exec(b[h]) || [], j = k = i[1], l = i[2]; if (!j) { for (j in o) f.event.remove(a, j + b[h], c, d, !0); continue } p = f.event.special[j] || {}, j = (d ? p.delegateType : p.bindType) || j, r = o[j] || [], m = r.length, l = l ? new RegExp("(^|\\.)" + l.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; for (n = 0; n < r.length; n++) s = r[n], (e || k === s.origType) && (!c || c.guid === s.guid) && (!l || l.test(s.namespace)) && (!d || d === s.selector || d === "**" && s.selector) && (r.splice(n--, 1), s.selector && r.delegateCount--, p.remove && p.remove.call(a, s)); r.length === 0 && m !== r.length && ((!p.teardown || p.teardown.call(a, l) === !1) && f.removeEvent(a, j, g.handle), delete o[j]) } f.isEmptyObject(o) && (q = g.handle, q && (q.elem = null), f.removeData(a, ["events", "handle"], !0)) } }, customEvent: { getData: !0, setData: !0, changeData: !0 }, trigger: function (c, d, e, g) { if (!e || e.nodeType !== 3 && e.nodeType !== 8) { var h = c.type || c, i = [], j, k, l, m, n, o, p, q, r, s; if (E.test(h + f.event.triggered)) return; h.indexOf("!") >= 0 && (h = h.slice(0, -1), k = !0), h.indexOf(".") >= 0 && (i = h.split("."), h = i.shift(), i.sort()); if ((!e || f.event.customEvent[h]) && !f.event.global[h]) return; c = typeof c == "object" ? c[f.expando] ? c : new f.Event(h, c) : new f.Event(h), c.type = h, c.isTrigger = !0, c.exclusive = k, c.namespace = i.join("."), c.namespace_re = c.namespace ? new RegExp("(^|\\.)" + i.join("\\.(?:.*\\.)?") + "(\\.|$)") : null, o = h.indexOf(":") < 0 ? "on" + h : ""; if (!e) { j = f.cache; for (l in j) j[l].events && j[l].events[h] && f.event.trigger(c, d, j[l].handle.elem, !0); return } c.result = b, c.target || (c.target = e), d = d != null ? f.makeArray(d) : [], d.unshift(c), p = f.event.special[h] || {}; if (p.trigger && p.trigger.apply(e, d) === !1) return; r = [[e, p.bindType || h]]; if (!g && !p.noBubble && !f.isWindow(e)) { s = p.delegateType || h, m = E.test(s + h) ? e : e.parentNode, n = null; for (; m; m = m.parentNode) r.push([m, s]), n = m; n && n === e.ownerDocument && r.push([n.defaultView || n.parentWindow || a, s]) } for (l = 0; l < r.length && !c.isPropagationStopped(); l++) m = r[l][0], c.type = r[l][1], q = (f._data(m, "events") || {})[c.type] && f._data(m, "handle"), q && q.apply(m, d), q = o && m[o], q && f.acceptData(m) && q.apply(m, d) === !1 && c.preventDefault(); c.type = h, !g && !c.isDefaultPrevented() && (!p._default || p._default.apply(e.ownerDocument, d) === !1) && (h !== "click" || !f.nodeName(e, "a")) && f.acceptData(e) && o && e[h] && (h !== "focus" && h !== "blur" || c.target.offsetWidth !== 0) && !f.isWindow(e) && (n = e[o], n && (e[o] = null), f.event.triggered = h, e[h](), f.event.triggered = b, n && (e[o] = n)); return c.result } }, dispatch: function (c) { c = f.event.fix(c || a.event); var d = (f._data(this, "events") || {})[c.type] || [], e = d.delegateCount, g = [].slice.call(arguments, 0), h = !c.exclusive && !c.namespace, i = [], j, k, l, m, n, o, p, q, r, s, t; g[0] = c, c.delegateTarget = this; if (e && !c.target.disabled && (!c.button || c.type !== "click")) { m = f(this), m.context = this.ownerDocument || this; for (l = c.target; l != this; l = l.parentNode || this) { o = {}, q = [], m[0] = l; for (j = 0; j < e; j++) r = d[j], s = r.selector, o[s] === b && (o[s] = r.quick ? H(l, r.quick) : m.is(s)), o[s] && q.push(r); q.length && i.push({ elem: l, matches: q }) } } d.length > e && i.push({ elem: this, matches: d.slice(e) }); for (j = 0; j < i.length && !c.isPropagationStopped(); j++) { p = i[j], c.currentTarget = p.elem; for (k = 0; k < p.matches.length && !c.isImmediatePropagationStopped(); k++) { r = p.matches[k]; if (h || !c.namespace && !r.namespace || c.namespace_re && c.namespace_re.test(r.namespace)) c.data = r.data, c.handleObj = r, n = ((f.event.special[r.origType] || {}).handle || r.handler).apply(p.elem, g), n !== b && (c.result = n, n === !1 && (c.preventDefault(), c.stopPropagation())) } } return c.result }, props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (a, b) { a.which == null && (a.which = b.charCode != null ? b.charCode : b.keyCode); return a } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (a, d) { var e, f, g, h = d.button, i = d.fromElement; a.pageX == null && d.clientX != null && (e = a.target.ownerDocument || c, f = e.documentElement, g = e.body, a.pageX = d.clientX + (f && f.scrollLeft || g && g.scrollLeft || 0) - (f && f.clientLeft || g && g.clientLeft || 0), a.pageY = d.clientY + (f && f.scrollTop || g && g.scrollTop || 0) - (f && f.clientTop || g && g.clientTop || 0)), !a.relatedTarget && i && (a.relatedTarget = i === a.target ? d.toElement : i), !a.which && h !== b && (a.which = h & 1 ? 1 : h & 2 ? 3 : h & 4 ? 2 : 0); return a } }, fix: function (a) { if (a[f.expando]) return a; var d, e, g = a, h = f.event.fixHooks[a.type] || {}, i = h.props ? this.props.concat(h.props) : this.props; a = f.Event(g); for (d = i.length; d; ) e = i[--d], a[e] = g[e]; a.target || (a.target = g.srcElement || c), a.target.nodeType === 3 && (a.target = a.target.parentNode), a.metaKey === b && (a.metaKey = a.ctrlKey); return h.filter ? h.filter(a, g) : a }, special: { ready: { setup: f.bindReady }, load: { noBubble: !0 }, focus: { delegateType: "focusin" }, blur: { delegateType: "focusout" }, beforeunload: { setup: function (a, b, c) { f.isWindow(this) && (this.onbeforeunload = c) }, teardown: function (a, b) { this.onbeforeunload === b && (this.onbeforeunload = null) } } }, simulate: function (a, b, c, d) { var e = f.extend(new f.Event, c, { type: a, isSimulated: !0, originalEvent: {} }); d ? f.event.trigger(e, null, b) : f.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault() } }, f.event.handle = f.event.dispatch, f.removeEvent = c.removeEventListener ? function (a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1) } : function (a, b, c) { a.detachEvent && a.detachEvent("on" + b, c) }, f.Event = function (a, b) { if (!(this instanceof f.Event)) return new f.Event(a, b); a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || a.returnValue === !1 || a.getPreventDefault && a.getPreventDefault() ? K : J) : this.type = a, b && f.extend(this, b), this.timeStamp = a && a.timeStamp || f.now(), this[f.expando] = !0 }, f.Event.prototype = { preventDefault: function () { this.isDefaultPrevented = K; var a = this.originalEvent; !a || (a.preventDefault ? a.preventDefault() : a.returnValue = !1) }, stopPropagation: function () { this.isPropagationStopped = K; var a = this.originalEvent; !a || (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0) }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = K, this.stopPropagation() }, isDefaultPrevented: J, isPropagationStopped: J, isImmediatePropagationStopped: J }, f.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (a, b) { f.event.special[a] = { delegateType: b, bindType: b, handle: function (a) { var c = this, d = a.relatedTarget, e = a.handleObj, g = e.selector, h; if (!d || d !== c && !f.contains(c, d)) a.type = e.origType, h = e.handler.apply(this, arguments), a.type = b; return h } } }), f.support.submitBubbles || (f.event.special.submit = { setup: function () { if (f.nodeName(this, "form")) return !1; f.event.add(this, "click._submit keypress._submit", function (a) { var c = a.target, d = f.nodeName(c, "input") || f.nodeName(c, "button") ? c.form : b; d && !d._submit_attached && (f.event.add(d, "submit._submit", function (a) { this.parentNode && !a.isTrigger && f.event.simulate("submit", this.parentNode, a, !0) }), d._submit_attached = !0) }) }, teardown: function () { if (f.nodeName(this, "form")) return !1; f.event.remove(this, "._submit") } }), f.support.changeBubbles || (f.event.special.change = { setup: function () { if (z.test(this.nodeName)) { if (this.type === "checkbox" || this.type === "radio") f.event.add(this, "propertychange._change", function (a) { a.originalEvent.propertyName === "checked" && (this._just_changed = !0) }), f.event.add(this, "click._change", function (a) { this._just_changed && !a.isTrigger && (this._just_changed = !1, f.event.simulate("change", this, a, !0)) }); return !1 } f.event.add(this, "beforeactivate._change", function (a) { var b = a.target; z.test(b.nodeName) && !b._change_attached && (f.event.add(b, "change._change", function (a) { this.parentNode && !a.isSimulated && !a.isTrigger && f.event.simulate("change", this.parentNode, a, !0) }), b._change_attached = !0) }) }, handle: function (a) { var b = a.target; if (this !== b || a.isSimulated || a.isTrigger || b.type !== "radio" && b.type !== "checkbox") return a.handleObj.handler.apply(this, arguments) }, teardown: function () { f.event.remove(this, "._change"); return z.test(this.nodeName) } }), f.support.focusinBubbles || f.each({ focus: "focusin", blur: "focusout" }, function (a, b) { var d = 0, e = function (a) { f.event.simulate(b, a.target, f.event.fix(a), !0) }; f.event.special[b] = { setup: function () { d++ === 0 && c.addEventListener(a, e, !0) }, teardown: function () { --d === 0 && c.removeEventListener(a, e, !0) } } }), f.fn.extend({ on: function (a, c, d, e, g) { var h, i; if (typeof a == "object") { typeof c != "string" && (d = c, c = b); for (i in a) this.on(i, c, d, a[i], g); return this } d == null && e == null ? (e = c, d = c = b) : e == null && (typeof c == "string" ? (e = d, d = b) : (e = d, d = c, c = b)); if (e === !1) e = J; else if (!e) return this; g === 1 && (h = e, e = function (a) { f().off(a); return h.apply(this, arguments) }, e.guid = h.guid || (h.guid = f.guid++)); return this.each(function () { f.event.add(this, a, e, d, c) }) }, one: function (a, b, c, d) { return this.on.call(this, a, b, c, d, 1) }, off: function (a, c, d) { if (a && a.preventDefault && a.handleObj) { var e = a.handleObj; f(a.delegateTarget).off(e.namespace ? e.type + "." + e.namespace : e.type, e.selector, e.handler); return this } if (typeof a == "object") { for (var g in a) this.off(g, c, a[g]); return this } if (c === !1 || typeof c == "function") d = c, c = b; d === !1 && (d = J); return this.each(function () { f.event.remove(this, a, d, c) }) }, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, live: function (a, b, c) { f(this.context).on(a, this.selector, b, c); return this }, die: function (a, b) { f(this.context).off(a, this.selector || "**", b); return this }, delegate: function (a, b, c, d) { return this.on(b, a, c, d) }, undelegate: function (a, b, c) { return arguments.length == 1 ? this.off(a, "**") : this.off(b, a, c) }, trigger: function (a, b) { return this.each(function () { f.event.trigger(a, b, this) }) }, triggerHandler: function (a, b) { if (this[0]) return f.event.trigger(a, b, this[0], !0) }, toggle: function (a) { var b = arguments, c = a.guid || f.guid++, d = 0, e = function (c) { var e = (f._data(this, "lastToggle" + a.guid) || 0) % d; f._data(this, "lastToggle" + a.guid, e + 1), c.preventDefault(); return b[e].apply(this, arguments) || !1 }; e.guid = c; while (d < b.length) b[d++].guid = c; return this.click(e) }, hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a) } }), f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) { f.fn[b] = function (a, c) { c == null && (c = a, a = null); return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) }, f.attrFn && (f.attrFn[b] = !0), C.test(b) && (f.event.fixHooks[b] = f.event.keyHooks), D.test(b) && (f.event.fixHooks[b] = f.event.mouseHooks) }), function () { function x(a, b, c, e, f, g) { for (var h = 0, i = e.length; h < i; h++) { var j = e[h]; if (j) { var k = !1; j = j[a]; while (j) { if (j[d] === c) { k = e[j.sizset]; break } if (j.nodeType === 1) { g || (j[d] = c, j.sizset = h); if (typeof b != "string") { if (j === b) { k = !0; break } } else if (m.filter(b, [j]).length > 0) { k = j; break } } j = j[a] } e[h] = k } } } function w(a, b, c, e, f, g) { for (var h = 0, i = e.length; h < i; h++) { var j = e[h]; if (j) { var k = !1; j = j[a]; while (j) { if (j[d] === c) { k = e[j.sizset]; break } j.nodeType === 1 && !g && (j[d] = c, j.sizset = h); if (j.nodeName.toLowerCase() === b) { k = j; break } j = j[a] } e[h] = k } } } var a = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, d = "sizcache" + (Math.random() + "").replace(".", ""), e = 0, g = Object.prototype.toString, h = !1, i = !0, j = /\\/g, k = /\r\n/g, l = /\W/; [0, 0].sort(function () { i = !1; return 0 }); var m = function (b, d, e, f) { e = e || [], d = d || c; var h = d; if (d.nodeType !== 1 && d.nodeType !== 9) return []; if (!b || typeof b != "string") return e; var i, j, k, l, n, q, r, t, u = !0, v = m.isXML(d), w = [], x = b; do { a.exec(""), i = a.exec(x); if (i) { x = i[3], w.push(i[1]); if (i[2]) { l = i[3]; break } } } while (i); if (w.length > 1 && p.exec(b)) if (w.length === 2 && o.relative[w[0]]) j = y(w[0] + w[1], d, f); else { j = o.relative[w[0]] ? [d] : m(w.shift(), d); while (w.length) b = w.shift(), o.relative[b] && (b += w.shift()), j = y(b, j, f) } else { !f && w.length > 1 && d.nodeType === 9 && !v && o.match.ID.test(w[0]) && !o.match.ID.test(w[w.length - 1]) && (n = m.find(w.shift(), d, v), d = n.expr ? m.filter(n.expr, n.set)[0] : n.set[0]); if (d) { n = f ? { expr: w.pop(), set: s(f)} : m.find(w.pop(), w.length === 1 && (w[0] === "~" || w[0] === "+") && d.parentNode ? d.parentNode : d, v), j = n.expr ? m.filter(n.expr, n.set) : n.set, w.length > 0 ? k = s(j) : u = !1; while (w.length) q = w.pop(), r = q, o.relative[q] ? r = w.pop() : q = "", r == null && (r = d), o.relative[q](k, r, v) } else k = w = [] } k || (k = j), k || m.error(q || b); if (g.call(k) === "[object Array]") if (!u) e.push.apply(e, k); else if (d && d.nodeType === 1) for (t = 0; k[t] != null; t++) k[t] && (k[t] === !0 || k[t].nodeType === 1 && m.contains(d, k[t])) && e.push(j[t]); else for (t = 0; k[t] != null; t++) k[t] && k[t].nodeType === 1 && e.push(j[t]); else s(k, e); l && (m(l, h, e, f), m.uniqueSort(e)); return e }; m.uniqueSort = function (a) { if (u) { h = i, a.sort(u); if (h) for (var b = 1; b < a.length; b++) a[b] === a[b - 1] && a.splice(b--, 1) } return a }, m.matches = function (a, b) { return m(a, null, null, b) }, m.matchesSelector = function (a, b) { return m(b, null, null, [a]).length > 0 }, m.find = function (a, b, c) { var d, e, f, g, h, i; if (!a) return []; for (e = 0, f = o.order.length; e < f; e++) { h = o.order[e]; if (g = o.leftMatch[h].exec(a)) { i = g[1], g.splice(1, 1); if (i.substr(i.length - 1) !== "\\") { g[1] = (g[1] || "").replace(j, ""), d = o.find[h](g, b, c); if (d != null) { a = a.replace(o.match[h], ""); break } } } } d || (d = typeof b.getElementsByTagName != "undefined" ? b.getElementsByTagName("*") : []); return { set: d, expr: a} }, m.filter = function (a, c, d, e) { var f, g, h, i, j, k, l, n, p, q = a, r = [], s = c, t = c && c[0] && m.isXML(c[0]); while (a && c.length) { for (h in o.filter) if ((f = o.leftMatch[h].exec(a)) != null && f[2]) { k = o.filter[h], l = f[1], g = !1, f.splice(1, 1); if (l.substr(l.length - 1) === "\\") continue; s === r && (r = []); if (o.preFilter[h]) { f = o.preFilter[h](f, s, d, r, e, t); if (!f) g = i = !0; else if (f === !0) continue } if (f) for (n = 0; (j = s[n]) != null; n++) j && (i = k(j, f, n, s), p = e ^ i, d && i != null ? p ? g = !0 : s[n] = !1 : p && (r.push(j), g = !0)); if (i !== b) { d || (s = r), a = a.replace(o.match[h], ""); if (!g) return []; break } } if (a === q) if (g == null) m.error(a); else break; q = a } return s }, m.error = function (a) { throw new Error("Syntax error, unrecognized expression: " + a) }; var n = m.getText = function (a) { var b, c, d = a.nodeType, e = ""; if (d) { if (d === 1 || d === 9) { if (typeof a.textContent == "string") return a.textContent; if (typeof a.innerText == "string") return a.innerText.replace(k, ""); for (a = a.firstChild; a; a = a.nextSibling) e += n(a) } else if (d === 3 || d === 4) return a.nodeValue } else for (b = 0; c = a[b]; b++) c.nodeType !== 8 && (e += n(c)); return e }, o = m.selectors = { order: ["ID", "NAME", "TAG"], match: { ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function (a) { return a.getAttribute("href") }, type: function (a) { return a.getAttribute("type") } }, relative: { "+": function (a, b) { var c = typeof b == "string", d = c && !l.test(b), e = c && !d; d && (b = b.toLowerCase()); for (var f = 0, g = a.length, h; f < g; f++) if (h = a[f]) { while ((h = h.previousSibling) && h.nodeType !== 1); a[f] = e || h && h.nodeName.toLowerCase() === b ? h || !1 : h === b } e && m.filter(b, a, !0) }, ">": function (a, b) { var c, d = typeof b == "string", e = 0, f = a.length; if (d && !l.test(b)) { b = b.toLowerCase(); for (; e < f; e++) { c = a[e]; if (c) { var g = c.parentNode; a[e] = g.nodeName.toLowerCase() === b ? g : !1 } } } else { for (; e < f; e++) c = a[e], c && (a[e] = d ? c.parentNode : c.parentNode === b); d && m.filter(b, a, !0) } }, "": function (a, b, c) { var d, f = e++, g = x; typeof b == "string" && !l.test(b) && (b = b.toLowerCase(), d = b, g = w), g("parentNode", b, f, a, d, c) }, "~": function (a, b, c) { var d, f = e++, g = x; typeof b == "string" && !l.test(b) && (b = b.toLowerCase(), d = b, g = w), g("previousSibling", b, f, a, d, c) } }, find: { ID: function (a, b, c) { if (typeof b.getElementById != "undefined" && !c) { var d = b.getElementById(a[1]); return d && d.parentNode ? [d] : [] } }, NAME: function (a, b) { if (typeof b.getElementsByName != "undefined") { var c = [], d = b.getElementsByName(a[1]); for (var e = 0, f = d.length; e < f; e++) d[e].getAttribute("name") === a[1] && c.push(d[e]); return c.length === 0 ? null : c } }, TAG: function (a, b) { if (typeof b.getElementsByTagName != "undefined") return b.getElementsByTagName(a[1]) } }, preFilter: { CLASS: function (a, b, c, d, e, f) { a = " " + a[1].replace(j, "") + " "; if (f) return a; for (var g = 0, h; (h = b[g]) != null; g++) h && (e ^ (h.className && (" " + h.className + " ").replace(/[\t\n\r]/g, " ").indexOf(a) >= 0) ? c || d.push(h) : c && (b[g] = !1)); return !1 }, ID: function (a) { return a[1].replace(j, "") }, TAG: function (a, b) { return a[1].replace(j, "").toLowerCase() }, CHILD: function (a) { if (a[1] === "nth") { a[2] || m.error(a[0]), a[2] = a[2].replace(/^\+|\s*/g, ""); var b = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2] === "even" && "2n" || a[2] === "odd" && "2n+1" || !/\D/.test(a[2]) && "0n+" + a[2] || a[2]); a[2] = b[1] + (b[2] || 1) - 0, a[3] = b[3] - 0 } else a[2] && m.error(a[0]); a[0] = e++; return a }, ATTR: function (a, b, c, d, e, f) { var g = a[1] = a[1].replace(j, ""); !f && o.attrMap[g] && (a[1] = o.attrMap[g]), a[4] = (a[4] || a[5] || "").replace(j, ""), a[2] === "~=" && (a[4] = " " + a[4] + " "); return a }, PSEUDO: function (b, c, d, e, f) { if (b[1] === "not") if ((a.exec(b[3]) || "").length > 1 || /^\w/.test(b[3])) b[3] = m(b[3], null, null, c); else { var g = m.filter(b[3], c, d, !0 ^ f); d || e.push.apply(e, g); return !1 } else if (o.match.POS.test(b[0]) || o.match.CHILD.test(b[0])) return !0; return b }, POS: function (a) { a.unshift(!0); return a } }, filters: { enabled: function (a) { return a.disabled === !1 && a.type !== "hidden" }, disabled: function (a) { return a.disabled === !0 }, checked: function (a) { return a.checked === !0 }, selected: function (a) { a.parentNode && a.parentNode.selectedIndex; return a.selected === !0 }, parent: function (a) { return !!a.firstChild }, empty: function (a) { return !a.firstChild }, has: function (a, b, c) { return !!m(c[3], a).length }, header: function (a) { return /h\d/i.test(a.nodeName) }, text: function (a) { var b = a.getAttribute("type"), c = a.type; return a.nodeName.toLowerCase() === "input" && "text" === c && (b === c || b === null) }, radio: function (a) { return a.nodeName.toLowerCase() === "input" && "radio" === a.type }, checkbox: function (a) { return a.nodeName.toLowerCase() === "input" && "checkbox" === a.type }, file: function (a) { return a.nodeName.toLowerCase() === "input" && "file" === a.type }, password: function (a) { return a.nodeName.toLowerCase() === "input" && "password" === a.type }, submit: function (a) { var b = a.nodeName.toLowerCase(); return (b === "input" || b === "button") && "submit" === a.type }, image: function (a) { return a.nodeName.toLowerCase() === "input" && "image" === a.type }, reset: function (a) { var b = a.nodeName.toLowerCase(); return (b === "input" || b === "button") && "reset" === a.type }, button: function (a) { var b = a.nodeName.toLowerCase(); return b === "input" && "button" === a.type || b === "button" }, input: function (a) { return /input|select|textarea|button/i.test(a.nodeName) }, focus: function (a) { return a === a.ownerDocument.activeElement } }, setFilters: { first: function (a, b) { return b === 0 }, last: function (a, b, c, d) { return b === d.length - 1 }, even: function (a, b) { return b % 2 === 0 }, odd: function (a, b) { return b % 2 === 1 }, lt: function (a, b, c) { return b < c[3] - 0 }, gt: function (a, b, c) { return b > c[3] - 0 }, nth: function (a, b, c) { return c[3] - 0 === b }, eq: function (a, b, c) { return c[3] - 0 === b } }, filter: { PSEUDO: function (a, b, c, d) { var e = b[1], f = o.filters[e]; if (f) return f(a, c, b, d); if (e === "contains") return (a.textContent || a.innerText || n([a]) || "").indexOf(b[3]) >= 0; if (e === "not") { var g = b[3]; for (var h = 0, i = g.length; h < i; h++) if (g[h] === a) return !1; return !0 } m.error(e) }, CHILD: function (a, b) { var c, e, f, g, h, i, j, k = b[1], l = a; switch (k) { case "only": case "first": while (l = l.previousSibling) if (l.nodeType === 1) return !1; if (k === "first") return !0; l = a; case "last": while (l = l.nextSibling) if (l.nodeType === 1) return !1; return !0; case "nth": c = b[2], e = b[3]; if (c === 1 && e === 0) return !0; f = b[0], g = a.parentNode; if (g && (g[d] !== f || !a.nodeIndex)) { i = 0; for (l = g.firstChild; l; l = l.nextSibling) l.nodeType === 1 && (l.nodeIndex = ++i); g[d] = f } j = a.nodeIndex - e; return c === 0 ? j === 0 : j % c === 0 && j / c >= 0 } }, ID: function (a, b) { return a.nodeType === 1 && a.getAttribute("id") === b }, TAG: function (a, b) { return b === "*" && a.nodeType === 1 || !!a.nodeName && a.nodeName.toLowerCase() === b }, CLASS: function (a, b) { return (" " + (a.className || a.getAttribute("class")) + " ").indexOf(b) > -1 }, ATTR: function (a, b) { var c = b[1], d = m.attr ? m.attr(a, c) : o.attrHandle[c] ? o.attrHandle[c](a) : a[c] != null ? a[c] : a.getAttribute(c), e = d + "", f = b[2], g = b[4]; return d == null ? f === "!=" : !f && m.attr ? d != null : f === "=" ? e === g : f === "*=" ? e.indexOf(g) >= 0 : f === "~=" ? (" " + e + " ").indexOf(g) >= 0 : g ? f === "!=" ? e !== g : f === "^=" ? e.indexOf(g) === 0 : f === "$=" ? e.substr(e.length - g.length) === g : f === "|=" ? e === g || e.substr(0, g.length + 1) === g + "-" : !1 : e && d !== !1 }, POS: function (a, b, c, d) { var e = b[2], f = o.setFilters[e]; if (f) return f(a, c, b, d) } } }, p = o.match.POS, q = function (a, b) { return "\\" + (b - 0 + 1) }; for (var r in o.match) o.match[r] = new RegExp(o.match[r].source + /(?![^\[]*\])(?![^\(]*\))/.source), o.leftMatch[r] = new RegExp(/(^(?:.|\r|\n)*?)/.source + o.match[r].source.replace(/\\(\d+)/g, q)); var s = function (a, b) { a = Array.prototype.slice.call(a, 0); if (b) { b.push.apply(b, a); return b } return a }; try { Array.prototype.slice.call(c.documentElement.childNodes, 0)[0].nodeType } catch (t) { s = function (a, b) { var c = 0, d = b || []; if (g.call(a) === "[object Array]") Array.prototype.push.apply(d, a); else if (typeof a.length == "number") for (var e = a.length; c < e; c++) d.push(a[c]); else for (; a[c]; c++) d.push(a[c]); return d } } var u, v; c.documentElement.compareDocumentPosition ? u = function (a, b) { if (a === b) { h = !0; return 0 } if (!a.compareDocumentPosition || !b.compareDocumentPosition) return a.compareDocumentPosition ? -1 : 1; return a.compareDocumentPosition(b) & 4 ? -1 : 1 } : (u = function (a, b) { if (a === b) { h = !0; return 0 } if (a.sourceIndex && b.sourceIndex) return a.sourceIndex - b.sourceIndex; var c, d, e = [], f = [], g = a.parentNode, i = b.parentNode, j = g; if (g === i) return v(a, b); if (!g) return -1; if (!i) return 1; while (j) e.unshift(j), j = j.parentNode; j = i; while (j) f.unshift(j), j = j.parentNode; c = e.length, d = f.length; for (var k = 0; k < c && k < d; k++) if (e[k] !== f[k]) return v(e[k], f[k]); return k === c ? v(a, f[k], -1) : v(e[k], b, 1) }, v = function (a, b, c) { if (a === b) return c; var d = a.nextSibling; while (d) { if (d === b) return -1; d = d.nextSibling } return 1 }), function () { var a = c.createElement("div"), d = "script" + (new Date).getTime(), e = c.documentElement; a.innerHTML = "", e.insertBefore(a, e.firstChild), c.getElementById(d) && (o.find.ID = function (a, c, d) { if (typeof c.getElementById != "undefined" && !d) { var e = c.getElementById(a[1]); return e ? e.id === a[1] || typeof e.getAttributeNode != "undefined" && e.getAttributeNode("id").nodeValue === a[1] ? [e] : b : [] } }, o.filter.ID = function (a, b) { var c = typeof a.getAttributeNode != "undefined" && a.getAttributeNode("id"); return a.nodeType === 1 && c && c.nodeValue === b }), e.removeChild(a), e = a = null } (), function () { var a = c.createElement("div"); a.appendChild(c.createComment("")), a.getElementsByTagName("*").length > 0 && (o.find.TAG = function (a, b) { var c = b.getElementsByTagName(a[1]); if (a[1] === "*") { var d = []; for (var e = 0; c[e]; e++) c[e].nodeType === 1 && d.push(c[e]); c = d } return c }), a.innerHTML = "", a.firstChild && typeof a.firstChild.getAttribute != "undefined" && a.firstChild.getAttribute("href") !== "#" && (o.attrHandle.href = function (a) { return a.getAttribute("href", 2) }), a = null } (), c.querySelectorAll && function () { var a = m, b = c.createElement("div"), d = "__sizzle__"; b.innerHTML = "

"; if (!b.querySelectorAll || b.querySelectorAll(".TEST").length !== 0) { m = function (b, e, f, g) { e = e || c; if (!g && !m.isXML(e)) { var h = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b); if (h && (e.nodeType === 1 || e.nodeType === 9)) { if (h[1]) return s(e.getElementsByTagName(b), f); if (h[2] && o.find.CLASS && e.getElementsByClassName) return s(e.getElementsByClassName(h[2]), f) } if (e.nodeType === 9) { if (b === "body" && e.body) return s([e.body], f); if (h && h[3]) { var i = e.getElementById(h[3]); if (!i || !i.parentNode) return s([], f); if (i.id === h[3]) return s([i], f) } try { return s(e.querySelectorAll(b), f) } catch (j) { } } else if (e.nodeType === 1 && e.nodeName.toLowerCase() !== "object") { var k = e, l = e.getAttribute("id"), n = l || d, p = e.parentNode, q = /^\s*[+~]/.test(b); l ? n = n.replace(/'/g, "\\$&") : e.setAttribute("id", n), q && p && (e = e.parentNode); try { if (!q || p) return s(e.querySelectorAll("[id='" + n + "'] " + b), f) } catch (r) { } finally { l || k.removeAttribute("id") } } } return a(b, e, f, g) }; for (var e in a) m[e] = a[e]; b = null } } (), function () { var a = c.documentElement, b = a.matchesSelector || a.mozMatchesSelector || a.webkitMatchesSelector || a.msMatchesSelector; if (b) { var d = !b.call(c.createElement("div"), "div"), e = !1; try { b.call(c.documentElement, "[test!='']:sizzle") } catch (f) { e = !0 } m.matchesSelector = function (a, c) { c = c.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if (!m.isXML(a)) try { if (e || !o.match.PSEUDO.test(c) && !/!=/.test(c)) { var f = b.call(a, c); if (f || !d || a.document && a.document.nodeType !== 11) return f } } catch (g) { } return m(c, null, null, [a]).length > 0 } } } (), function () { var a = c.createElement("div"); a.innerHTML = "
"; if (!!a.getElementsByClassName && a.getElementsByClassName("e").length !== 0) { a.lastChild.className = "e"; if (a.getElementsByClassName("e").length === 1) return; o.order.splice(1, 0, "CLASS"), o.find.CLASS = function (a, b, c) { if (typeof b.getElementsByClassName != "undefined" && !c) return b.getElementsByClassName(a[1]) }, a = null } } (), c.documentElement.contains ? m.contains = function (a, b) { return a !== b && (a.contains ? a.contains(b) : !0) } : c.documentElement.compareDocumentPosition ? m.contains = function (a, b) { return !!(a.compareDocumentPosition(b) & 16) } : m.contains = function () { return !1 }, m.isXML = function (a) { var b = (a ? a.ownerDocument || a : 0).documentElement; return b ? b.nodeName !== "HTML" : !1 }; var y = function (a, b, c) { var d, e = [], f = "", g = b.nodeType ? [b] : b; while (d = o.match.PSEUDO.exec(a)) f += d[0], a = a.replace(o.match.PSEUDO, ""); a = o.relative[a] ? a + "*" : a; for (var h = 0, i = g.length; h < i; h++) m(a, g[h], e, c); return m.filter(f, e) }; m.attr = f.attr, m.selectors.attrMap = {}, f.find = m, f.expr = m.selectors, f.expr[":"] = f.expr.filters, f.unique = m.uniqueSort, f.text = m.getText, f.isXMLDoc = m.isXML, f.contains = m.contains } (); var L = /Until$/, M = /^(?:parents|prevUntil|prevAll)/, N = /,/, O = /^.[^:#\[\.,]*$/, P = Array.prototype.slice, Q = f.expr.match.POS, R = { children: !0, contents: !0, next: !0, prev: !0 }; f.fn.extend({ find: function (a) { var b = this, c, d; if (typeof a != "string") return f(a).filter(function () { for (c = 0, d = b.length; c < d; c++) if (f.contains(b[c], this)) return !0 }); var e = this.pushStack("", "find", a), g, h, i; for (c = 0, d = this.length; c < d; c++) { g = e.length, f.find(a, this[c], e); if (c > 0) for (h = g; h < e.length; h++) for (i = 0; i < g; i++) if (e[i] === e[h]) { e.splice(h--, 1); break } } return e }, has: function (a) { var b = f(a); return this.filter(function () { for (var a = 0, c = b.length; a < c; a++) if (f.contains(this, b[a])) return !0 }) }, not: function (a) { return this.pushStack(T(this, a, !1), "not", a) }, filter: function (a) { return this.pushStack(T(this, a, !0), "filter", a) }, is: function (a) { return !!a && (typeof a == "string" ? Q.test(a) ? f(a, this.context).index(this[0]) >= 0 : f.filter(a, this).length > 0 : this.filter(a).length > 0) }, closest: function (a, b) { var c = [], d, e, g = this[0]; if (f.isArray(a)) { var h = 1; while (g && g.ownerDocument && g !== b) { for (d = 0; d < a.length; d++) f(g).is(a[d]) && c.push({ selector: a[d], elem: g, level: h }); g = g.parentNode, h++ } return c } var i = Q.test(a) || typeof a != "string" ? f(a, b || this.context) : 0; for (d = 0, e = this.length; d < e; d++) { g = this[d]; while (g) { if (i ? i.index(g) > -1 : f.find.matchesSelector(g, a)) { c.push(g); break } g = g.parentNode; if (!g || !g.ownerDocument || g === b || g.nodeType === 11) break } } c = c.length > 1 ? f.unique(c) : c; return this.pushStack(c, "closest", a) }, index: function (a) { if (!a) return this[0] && this[0].parentNode ? this.prevAll().length : -1; if (typeof a == "string") return f.inArray(this[0], f(a)); return f.inArray(a.jquery ? a[0] : a, this) }, add: function (a, b) { var c = typeof a == "string" ? f(a, b) : f.makeArray(a && a.nodeType ? [a] : a), d = f.merge(this.get(), c); return this.pushStack(S(c[0]) || S(d[0]) ? d : f.unique(d)) }, andSelf: function () { return this.add(this.prevObject) } }), f.each({ parent: function (a) { var b = a.parentNode; return b && b.nodeType !== 11 ? b : null }, parents: function (a) { return f.dir(a, "parentNode") }, parentsUntil: function (a, b, c) { return f.dir(a, "parentNode", c) }, next: function (a) { return f.nth(a, 2, "nextSibling") }, prev: function (a) { return f.nth(a, 2, "previousSibling") }, nextAll: function (a) { return f.dir(a, "nextSibling") }, prevAll: function (a) { return f.dir(a, "previousSibling") }, nextUntil: function (a, b, c) { return f.dir(a, "nextSibling", c) }, prevUntil: function (a, b, c) { return f.dir(a, "previousSibling", c) }, siblings: function (a) { return f.sibling(a.parentNode.firstChild, a) }, children: function (a) { return f.sibling(a.firstChild) }, contents: function (a) { return f.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : f.makeArray(a.childNodes) } }, function (a, b) { f.fn[a] = function (c, d) { var e = f.map(this, b, c); L.test(a) || (d = c), d && typeof d == "string" && (e = f.filter(d, e)), e = this.length > 1 && !R[a] ? f.unique(e) : e, (this.length > 1 || N.test(d)) && M.test(a) && (e = e.reverse()); return this.pushStack(e, a, P.call(arguments).join(",")) } }), f.extend({ filter: function (a, b, c) { c && (a = ":not(" + a + ")"); return b.length === 1 ? f.find.matchesSelector(b[0], a) ? [b[0]] : [] : f.find.matches(a, b) }, dir: function (a, c, d) { var e = [], g = a[c]; while (g && g.nodeType !== 9 && (d === b || g.nodeType !== 1 || !f(g).is(d))) g.nodeType === 1 && e.push(g), g = g[c]; return e }, nth: function (a, b, c, d) { b = b || 1; var e = 0; for (; a; a = a[c]) if (a.nodeType === 1 && ++e === b) break; return a }, sibling: function (a, b) { var c = []; for (; a; a = a.nextSibling) a.nodeType === 1 && a !== b && c.push(a); return c } }); var V = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", W = / jQuery\d+="(?:\d+|null)"/g, X = /^\s+/, Y = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, Z = /<([\w:]+)/, $ = /", ""], legend: [1, "
", "
"], thead: [1, "", "
"], tr: [2, "", "
"], td: [3, "", "
"], col: [2, "", "
"], area: [1, "", ""], _default: [0, "", ""] }, bh = U(c); bg.optgroup = bg.option, bg.tbody = bg.tfoot = bg.colgroup = bg.caption = bg.thead, bg.th = bg.td, f.support.htmlSerialize || (bg._default = [1, "div
", "
"]), f.fn.extend({ text: function (a) { if (f.isFunction(a)) return this.each(function (b) { var c = f(this); c.text(a.call(this, b, c.text())) }); if (typeof a != "object" && a !== b) return this.empty().append((this[0] && this[0].ownerDocument || c).createTextNode(a)); return f.text(this) }, wrapAll: function (a) { if (f.isFunction(a)) return this.each(function (b) { f(this).wrapAll(a.call(this, b)) }); if (this[0]) { var b = f(a, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && b.insertBefore(this[0]), b.map(function () { var a = this; while (a.firstChild && a.firstChild.nodeType === 1) a = a.firstChild; return a }).append(this) } return this }, wrapInner: function (a) { if (f.isFunction(a)) return this.each(function (b) { f(this).wrapInner(a.call(this, b)) }); return this.each(function () { var b = f(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) { var b = f.isFunction(a); return this.each(function (c) { f(this).wrapAll(b ? a.call(this, c) : a) }) }, unwrap: function () { return this.parent().each(function () { f.nodeName(this, "body") || f(this).replaceWith(this.childNodes) }).end() }, append: function () { return this.domManip(arguments, !0, function (a) { this.nodeType === 1 && this.appendChild(a) }) }, prepend: function () { return this.domManip(arguments, !0, function (a) { this.nodeType === 1 && this.insertBefore(a, this.firstChild) }) }, before: function () { if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this) }); if (arguments.length) { var a = f.clean(arguments); a.push.apply(a, this.toArray()); return this.pushStack(a, "before", arguments) } }, after: function () { if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this.nextSibling) }); if (arguments.length) { var a = this.pushStack(this, "after", arguments); a.push.apply(a, f.clean(arguments)); return a } }, remove: function (a, b) { for (var c = 0, d; (d = this[c]) != null; c++) if (!a || f.filter(a, [d]).length) !b && d.nodeType === 1 && (f.cleanData(d.getElementsByTagName("*")), f.cleanData([d])), d.parentNode && d.parentNode.removeChild(d); return this }, empty: function () { for (var a = 0, b; (b = this[a]) != null; a++) { b.nodeType === 1 && f.cleanData(b.getElementsByTagName("*")); while (b.firstChild) b.removeChild(b.firstChild) } return this }, clone: function (a, b) { a = a == null ? !1 : a, b = b == null ? a : b; return this.map(function () { return f.clone(this, a, b) }) }, html: function (a) { if (a === b) return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(W, "") : null; if (typeof a == "string" && !ba.test(a) && (f.support.leadingWhitespace || !X.test(a)) && !bg[(Z.exec(a) || ["", ""])[1].toLowerCase()]) { a = a.replace(Y, "<$1>"); try { for (var c = 0, d = this.length; c < d; c++) this[c].nodeType === 1 && (f.cleanData(this[c].getElementsByTagName("*")), this[c].innerHTML = a) } catch (e) { this.empty().append(a) } } else f.isFunction(a) ? this.each(function (b) { var c = f(this); c.html(a.call(this, b, c.html())) }) : this.empty().append(a); return this }, replaceWith: function (a) { if (this[0] && this[0].parentNode) { if (f.isFunction(a)) return this.each(function (b) { var c = f(this), d = c.html(); c.replaceWith(a.call(this, b, d)) }); typeof a != "string" && (a = f(a).detach()); return this.each(function () { var b = this.nextSibling, c = this.parentNode; f(this).remove(), b ? f(b).before(a) : f(c).append(a) }) } return this.length ? this.pushStack(f(f.isFunction(a) ? a() : a), "replaceWith", a) : this }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a, c, d) { var e, g, h, i, j = a[0], k = []; if (!f.support.checkClone && arguments.length === 3 && typeof j == "string" && bd.test(j)) return this.each(function () { f(this).domManip(a, c, d, !0) }); if (f.isFunction(j)) return this.each(function (e) { var g = f(this); a[0] = j.call(this, e, c ? g.html() : b), g.domManip(a, c, d) }); if (this[0]) { i = j && j.parentNode, f.support.parentNode && i && i.nodeType === 11 && i.childNodes.length === this.length ? e = { fragment: i} : e = f.buildFragment(a, this, k), h = e.fragment, h.childNodes.length === 1 ? g = h = h.firstChild : g = h.firstChild; if (g) { c = c && f.nodeName(g, "tr"); for (var l = 0, m = this.length, n = m - 1; l < m; l++) d.call(c ? bi(this[l], g) : this[l], e.cacheable || m > 1 && l < n ? f.clone(h, !0, !0) : h) } k.length && f.each(k, bp) } return this } }), f.buildFragment = function (a, b, d) { var e, g, h, i, j = a[0]; b && b[0] && (i = b[0].ownerDocument || b[0]), i.createDocumentFragment || (i = c), a.length === 1 && typeof j == "string" && j.length < 512 && i === c && j.charAt(0) === "<" && !bb.test(j) && (f.support.checkClone || !bd.test(j)) && (f.support.html5Clone || !bc.test(j)) && (g = !0, h = f.fragments[j], h && h !== 1 && (e = h)), e || (e = i.createDocumentFragment(), f.clean(a, i, e, d)), g && (f.fragments[j] = h ? e : 1); return { fragment: e, cacheable: g} }, f.fragments = {}, f.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) { f.fn[a] = function (c) { var d = [], e = f(c), g = this.length === 1 && this[0].parentNode; if (g && g.nodeType === 11 && g.childNodes.length === 1 && e.length === 1) { e[b](this[0]); return this } for (var h = 0, i = e.length; h < i; h++) { var j = (h > 0 ? this.clone(!0) : this).get(); f(e[h])[b](j), d = d.concat(j) } return this.pushStack(d, a, e.selector) } }), f.extend({ clone: function (a, b, c) { var d, e, g, h = f.support.html5Clone || !bc.test("<" + a.nodeName) ? a.cloneNode(!0) : bo(a); if ((!f.support.noCloneEvent || !f.support.noCloneChecked) && (a.nodeType === 1 || a.nodeType === 11) && !f.isXMLDoc(a)) { bk(a, h), d = bl(a), e = bl(h); for (g = 0; d[g]; ++g) e[g] && bk(d[g], e[g]) } if (b) { bj(a, h); if (c) { d = bl(a), e = bl(h); for (g = 0; d[g]; ++g) bj(d[g], e[g]) } } d = e = null; return h }, clean: function (a, b, d, e) { var g; b = b || c, typeof b.createElement == "undefined" && (b = b.ownerDocument || b[0] && b[0].ownerDocument || c); var h = [], i; for (var j = 0, k; (k = a[j]) != null; j++) { typeof k == "number" && (k += ""); if (!k) continue; if (typeof k == "string") if (!_.test(k)) k = b.createTextNode(k); else { k = k.replace(Y, "<$1>"); var l = (Z.exec(k) || ["", ""])[1].toLowerCase(), m = bg[l] || bg._default, n = m[0], o = b.createElement("div"); b === c ? bh.appendChild(o) : U(b).appendChild(o), o.innerHTML = m[1] + k + m[2]; while (n--) o = o.lastChild; if (!f.support.tbody) { var p = $.test(k), q = l === "table" && !p ? o.firstChild && o.firstChild.childNodes : m[1] === "" && !p ? o.childNodes : []; for (i = q.length - 1; i >= 0; --i) f.nodeName(q[i], "tbody") && !q[i].childNodes.length && q[i].parentNode.removeChild(q[i]) } !f.support.leadingWhitespace && X.test(k) && o.insertBefore(b.createTextNode(X.exec(k)[0]), o.firstChild), k = o.childNodes } var r; if (!f.support.appendChecked) if (k[0] && typeof (r = k.length) == "number") for (i = 0; i < r; i++) bn(k[i]); else bn(k); k.nodeType ? h.push(k) : h = f.merge(h, k) } if (d) { g = function (a) { return !a.type || be.test(a.type) }; for (j = 0; h[j]; j++) if (e && f.nodeName(h[j], "script") && (!h[j].type || h[j].type.toLowerCase() === "text/javascript")) e.push(h[j].parentNode ? h[j].parentNode.removeChild(h[j]) : h[j]); else { if (h[j].nodeType === 1) { var s = f.grep(h[j].getElementsByTagName("script"), g); h.splice.apply(h, [j + 1, 0].concat(s)) } d.appendChild(h[j]) } } return h }, cleanData: function (a) { var b, c, d = f.cache, e = f.event.special, g = f.support.deleteExpando; for (var h = 0, i; (i = a[h]) != null; h++) { if (i.nodeName && f.noData[i.nodeName.toLowerCase()]) continue; c = i[f.expando]; if (c) { b = d[c]; if (b && b.events) { for (var j in b.events) e[j] ? f.event.remove(i, j) : f.removeEvent(i, j, b.handle); b.handle && (b.handle.elem = null) } g ? delete i[f.expando] : i.removeAttribute && i.removeAttribute(f.expando), delete d[c] } } } }); var bq = /alpha\([^)]*\)/i, br = /opacity=([^)]*)/, bs = /([A-Z]|^ms)/g, bt = /^-?\d+(?:px)?$/i, bu = /^-?\d/, bv = /^([\-+])=([\-+.\de]+)/, bw = { position: "absolute", visibility: "hidden", display: "block" }, bx = ["Left", "Right"], by = ["Top", "Bottom"], bz, bA, bB; f.fn.css = function (a, c) { if (arguments.length === 2 && c === b) return this; return f.access(this, a, c, !0, function (a, c, d) { return d !== b ? f.style(a, c, d) : f.css(a, c) }) }, f.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = bz(a, "opacity", "opacity"); return c === "" ? "1" : c } return a.style.opacity } } }, cssNumber: { fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": f.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, c, d, e) { if (!!a && a.nodeType !== 3 && a.nodeType !== 8 && !!a.style) { var g, h, i = f.camelCase(c), j = a.style, k = f.cssHooks[i]; c = f.cssProps[i] || i; if (d === b) { if (k && "get" in k && (g = k.get(a, !1, e)) !== b) return g; return j[c] } h = typeof d, h === "string" && (g = bv.exec(d)) && (d = +(g[1] + 1) * +g[2] + parseFloat(f.css(a, c)), h = "number"); if (d == null || h === "number" && isNaN(d)) return; h === "number" && !f.cssNumber[i] && (d += "px"); if (!k || !("set" in k) || (d = k.set(a, d)) !== b) try { j[c] = d } catch (l) { } } }, css: function (a, c, d) { var e, g; c = f.camelCase(c), g = f.cssHooks[c], c = f.cssProps[c] || c, c === "cssFloat" && (c = "float"); if (g && "get" in g && (e = g.get(a, !0, d)) !== b) return e; if (bz) return bz(a, c) }, swap: function (a, b, c) { var d = {}; for (var e in b) d[e] = a.style[e], a.style[e] = b[e]; c.call(a); for (e in b) a.style[e] = d[e] } }), f.curCSS = f.css, f.each(["height", "width"], function (a, b) { f.cssHooks[b] = { get: function (a, c, d) { var e; if (c) { if (a.offsetWidth !== 0) return bC(a, b, d); f.swap(a, bw, function () { e = bC(a, b, d) }); return e } }, set: function (a, b) { if (!bt.test(b)) return b; b = parseFloat(b); if (b >= 0) return b + "px" } } }), f.support.opacity || (f.cssHooks.opacity = { get: function (a, b) { return br.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? parseFloat(RegExp.$1) / 100 + "" : b ? "1" : "" }, set: function (a, b) { var c = a.style, d = a.currentStyle, e = f.isNumeric(b) ? "alpha(opacity=" + b * 100 + ")" : "", g = d && d.filter || c.filter || ""; c.zoom = 1; if (b >= 1 && f.trim(g.replace(bq, "")) === "") { c.removeAttribute("filter"); if (d && !d.filter) return } c.filter = bq.test(g) ? g.replace(bq, e) : g + " " + e } }), f(function () { f.support.reliableMarginRight || (f.cssHooks.marginRight = { get: function (a, b) { var c; f.swap(a, { display: "inline-block" }, function () { b ? c = bz(a, "margin-right", "marginRight") : c = a.style.marginRight }); return c } }) }), c.defaultView && c.defaultView.getComputedStyle && (bA = function (a, b) { var c, d, e; b = b.replace(bs, "-$1").toLowerCase(), (d = a.ownerDocument.defaultView) && (e = d.getComputedStyle(a, null)) && (c = e.getPropertyValue(b), c === "" && !f.contains(a.ownerDocument.documentElement, a) && (c = f.style(a, b))); return c }), c.documentElement.currentStyle && (bB = function (a, b) { var c, d, e, f = a.currentStyle && a.currentStyle[b], g = a.style; f === null && g && (e = g[b]) && (f = e), !bt.test(f) && bu.test(f) && (c = g.left, d = a.runtimeStyle && a.runtimeStyle.left, d && (a.runtimeStyle.left = a.currentStyle.left), g.left = b === "fontSize" ? "1em" : f || 0, f = g.pixelLeft + "px", g.left = c, d && (a.runtimeStyle.left = d)); return f === "" ? "auto" : f }), bz = bA || bB, f.expr && f.expr.filters && (f.expr.filters.hidden = function (a) { var b = a.offsetWidth, c = a.offsetHeight; return b === 0 && c === 0 || !f.support.reliableHiddenOffsets && (a.style && a.style.display || f.css(a, "display")) === "none" }, f.expr.filters.visible = function (a) { return !f.expr.filters.hidden(a) }); var bD = /%20/g, bE = /\[\]$/, bF = /\r?\n/g, bG = /#.*$/, bH = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, bI = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, bJ = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, bK = /^(?:GET|HEAD)$/, bL = /^\/\//, bM = /\?/, bN = /)<[^<]*)*<\/script>/gi, bO = /^(?:select|textarea)/i, bP = /\s+/, bQ = /([?&])_=[^&]*/, bR = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, bS = f.fn.load, bT = {}, bU = {}, bV, bW, bX = ["*/"] + ["*"]; try { bV = e.href } catch (bY) { bV = c.createElement("a"), bV.href = "", bV = bV.href } bW = bR.exec(bV.toLowerCase()) || [], f.fn.extend({ load: function (a, c, d) { if (typeof a != "string" && bS) return bS.apply(this, arguments); if (!this.length) return this; var e = a.indexOf(" "); if (e >= 0) { var g = a.slice(e, a.length); a = a.slice(0, e) } var h = "GET"; c && (f.isFunction(c) ? (d = c, c = b) : typeof c == "object" && (c = f.param(c, f.ajaxSettings.traditional), h = "POST")); var i = this; f.ajax({ url: a, type: h, dataType: "html", data: c, complete: function (a, b, c) { c = a.responseText, a.isResolved() && (a.done(function (a) { c = a }), i.html(g ? f("
").append(c.replace(bN, "")).find(g) : c)), d && i.each(d, [c, b, a]) } }); return this }, serialize: function () { return f.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { return this.elements ? f.makeArray(this.elements) : this }).filter(function () { return this.name && !this.disabled && (this.checked || bO.test(this.nodeName) || bI.test(this.type)) }).map(function (a, b) { var c = f(this).val(); return c == null ? null : f.isArray(c) ? f.map(c, function (a, c) { return { name: b.name, value: a.replace(bF, "\r\n")} }) : { name: b.name, value: c.replace(bF, "\r\n")} }).get() } }), f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (a, b) { f.fn[b] = function (a) { return this.on(b, a) } }), f.each(["get", "post"], function (a, c) { f[c] = function (a, d, e, g) { f.isFunction(d) && (g = g || e, e = d, d = b); return f.ajax({ type: c, url: a, data: d, success: e, dataType: g }) } }), f.extend({ getScript: function (a, c) { return f.get(a, b, c, "script") }, getJSON: function (a, b, c) { return f.get(a, b, c, "json") }, ajaxSetup: function (a, b) { b ? b_(a, f.ajaxSettings) : (b = a, a = f.ajaxSettings), b_(a, b); return a }, ajaxSettings: { url: bV, isLocal: bJ.test(bW[1]), global: !0, type: "GET", contentType: "application/x-www-form-urlencoded", processData: !0, async: !0, accepts: { xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", "*": bX }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, converters: { "* text": a.String, "text html": !0, "text json": f.parseJSON, "text xml": f.parseXML }, flatOptions: { context: !0, url: !0} }, ajaxPrefilter: bZ(bT), ajaxTransport: bZ(bU), ajax: function (a, c) { function w(a, c, l, m) { if (s !== 2) { s = 2, q && clearTimeout(q), p = b, n = m || "", v.readyState = a > 0 ? 4 : 0; var o, r, u, w = c, x = l ? cb(d, v, l) : b, y, z; if (a >= 200 && a < 300 || a === 304) { if (d.ifModified) { if (y = v.getResponseHeader("Last-Modified")) f.lastModified[k] = y; if (z = v.getResponseHeader("Etag")) f.etag[k] = z } if (a === 304) w = "notmodified", o = !0; else try { r = cc(d, x), w = "success", o = !0 } catch (A) { w = "parsererror", u = A } } else { u = w; if (!w || a) w = "error", a < 0 && (a = 0) } v.status = a, v.statusText = "" + (c || w), o ? h.resolveWith(e, [r, w, v]) : h.rejectWith(e, [v, w, u]), v.statusCode(j), j = b, t && g.trigger("ajax" + (o ? "Success" : "Error"), [v, d, o ? r : u]), i.fireWith(e, [v, w]), t && (g.trigger("ajaxComplete", [v, d]), --f.active || f.event.trigger("ajaxStop")) } } typeof a == "object" && (c = a, a = b), c = c || {}; var d = f.ajaxSetup({}, c), e = d.context || d, g = e !== d && (e.nodeType || e instanceof f) ? f(e) : f.event, h = f.Deferred(), i = f.Callbacks("once memory"), j = d.statusCode || {}, k, l = {}, m = {}, n, o, p, q, r, s = 0, t, u, v = { readyState: 0, setRequestHeader: function (a, b) { if (!s) { var c = a.toLowerCase(); a = m[c] = m[c] || a, l[a] = b } return this }, getAllResponseHeaders: function () { return s === 2 ? n : null }, getResponseHeader: function (a) { var c; if (s === 2) { if (!o) { o = {}; while (c = bH.exec(n)) o[c[1].toLowerCase()] = c[2] } c = o[a.toLowerCase()] } return c === b ? null : c }, overrideMimeType: function (a) { s || (d.mimeType = a); return this }, abort: function (a) { a = a || "abort", p && p.abort(a), w(0, a); return this } }; h.promise(v), v.success = v.done, v.error = v.fail, v.complete = i.add, v.statusCode = function (a) { if (a) { var b; if (s < 2) for (b in a) j[b] = [j[b], a[b]]; else b = a[v.status], v.then(b, b) } return this }, d.url = ((a || d.url) + "").replace(bG, "").replace(bL, bW[1] + "//"), d.dataTypes = f.trim(d.dataType || "*").toLowerCase().split(bP), d.crossDomain == null && (r = bR.exec(d.url.toLowerCase()), d.crossDomain = !(!r || r[1] == bW[1] && r[2] == bW[2] && (r[3] || (r[1] === "http:" ? 80 : 443)) == (bW[3] || (bW[1] === "http:" ? 80 : 443)))), d.data && d.processData && typeof d.data != "string" && (d.data = f.param(d.data, d.traditional)), b$(bT, d, c, v); if (s === 2) return !1; t = d.global, d.type = d.type.toUpperCase(), d.hasContent = !bK.test(d.type), t && f.active++ === 0 && f.event.trigger("ajaxStart"); if (!d.hasContent) { d.data && (d.url += (bM.test(d.url) ? "&" : "?") + d.data, delete d.data), k = d.url; if (d.cache === !1) { var x = f.now(), y = d.url.replace(bQ, "$1_=" + x); d.url = y + (y === d.url ? (bM.test(d.url) ? "&" : "?") + "_=" + x : "") } } (d.data && d.hasContent && d.contentType !== !1 || c.contentType) && v.setRequestHeader("Content-Type", d.contentType), d.ifModified && (k = k || d.url, f.lastModified[k] && v.setRequestHeader("If-Modified-Since", f.lastModified[k]), f.etag[k] && v.setRequestHeader("If-None-Match", f.etag[k])), v.setRequestHeader("Accept", d.dataTypes[0] && d.accepts[d.dataTypes[0]] ? d.accepts[d.dataTypes[0]] + (d.dataTypes[0] !== "*" ? ", " + bX + "; q=0.01" : "") : d.accepts["*"]); for (u in d.headers) v.setRequestHeader(u, d.headers[u]); if (d.beforeSend && (d.beforeSend.call(e, v, d) === !1 || s === 2)) { v.abort(); return !1 } for (u in { success: 1, error: 1, complete: 1 }) v[u](d[u]); p = b$(bU, d, c, v); if (!p) w(-1, "No Transport"); else { v.readyState = 1, t && g.trigger("ajaxSend", [v, d]), d.async && d.timeout > 0 && (q = setTimeout(function () { v.abort("timeout") }, d.timeout)); try { s = 1, p.send(l, w) } catch (z) { if (s < 2) w(-1, z); else throw z } } return v }, param: function (a, c) { var d = [], e = function (a, b) { b = f.isFunction(b) ? b() : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) }; c === b && (c = f.ajaxSettings.traditional); if (f.isArray(a) || a.jquery && !f.isPlainObject(a)) f.each(a, function () { e(this.name, this.value) }); else for (var g in a) ca(g, a[g], c, e); return d.join("&").replace(bD, "+") } }), f.extend({ active: 0, lastModified: {}, etag: {} }); var cd = f.now(), ce = /(\=)\?(&|$)|\?\?/i; f.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { return f.expando + "_" + cd++ } }), f.ajaxPrefilter("json jsonp", function (b, c, d) { var e = b.contentType === "application/x-www-form-urlencoded" && typeof b.data == "string"; if (b.dataTypes[0] === "jsonp" || b.jsonp !== !1 && (ce.test(b.url) || e && ce.test(b.data))) { var g, h = b.jsonpCallback = f.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, i = a[h], j = b.url, k = b.data, l = "$1" + h + "$2"; b.jsonp !== !1 && (j = j.replace(ce, l), b.url === j && (e && (k = k.replace(ce, l)), b.data === k && (j += (/\?/.test(j) ? "&" : "?") + b.jsonp + "=" + h))), b.url = j, b.data = k, a[h] = function (a) { g = [a] }, d.always(function () { a[h] = i, g && f.isFunction(i) && a[h](g[0]) }), b.converters["script json"] = function () { g || f.error(h + " was not called"); return g[0] }, b.dataTypes[0] = "json"; return "script" } }), f.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /javascript|ecmascript/ }, converters: { "text script": function (a) { f.globalEval(a); return a } } }), f.ajaxPrefilter("script", function (a) { a.cache === b && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1) }), f.ajaxTransport("script", function (a) { if (a.crossDomain) { var d, e = c.head || c.getElementsByTagName("head")[0] || c.documentElement; return { send: function (f, g) { d = c.createElement("script"), d.async = "async", a.scriptCharset && (d.charset = a.scriptCharset), d.src = a.url, d.onload = d.onreadystatechange = function (a, c) { if (c || !d.readyState || /loaded|complete/.test(d.readyState)) d.onload = d.onreadystatechange = null, e && d.parentNode && e.removeChild(d), d = b, c || g(200, "success") }, e.insertBefore(d, e.firstChild) }, abort: function () { d && d.onload(0, 1) } } } }); var cf = a.ActiveXObject ? function () { for (var a in ch) ch[a](0, 1) } : !1, cg = 0, ch; f.ajaxSettings.xhr = a.ActiveXObject ? function () { return !this.isLocal && ci() || cj() } : ci, function (a) { f.extend(f.support, { ajax: !!a, cors: !!a && "withCredentials" in a }) } (f.ajaxSettings.xhr()), f.support.ajax && f.ajaxTransport(function (c) { if (!c.crossDomain || f.support.cors) { var d; return { send: function (e, g) { var h = c.xhr(), i, j; c.username ? h.open(c.type, c.url, c.async, c.username, c.password) : h.open(c.type, c.url, c.async); if (c.xhrFields) for (j in c.xhrFields) h[j] = c.xhrFields[j]; c.mimeType && h.overrideMimeType && h.overrideMimeType(c.mimeType), !c.crossDomain && !e["X-Requested-With"] && (e["X-Requested-With"] = "XMLHttpRequest"); try { for (j in e) h.setRequestHeader(j, e[j]) } catch (k) { } h.send(c.hasContent && c.data || null), d = function (a, e) { var j, k, l, m, n; try { if (d && (e || h.readyState === 4)) { d = b, i && (h.onreadystatechange = f.noop, cf && delete ch[i]); if (e) h.readyState !== 4 && h.abort(); else { j = h.status, l = h.getAllResponseHeaders(), m = {}, n = h.responseXML, n && n.documentElement && (m.xml = n), m.text = h.responseText; try { k = h.statusText } catch (o) { k = "" } !j && c.isLocal && !c.crossDomain ? j = m.text ? 200 : 404 : j === 1223 && (j = 204) } } } catch (p) { e || g(-1, p) } m && g(j, k, m, l) }, !c.async || h.readyState === 4 ? d() : (i = ++cg, cf && (ch || (ch = {}, f(a).unload(cf)), ch[i] = d), h.onreadystatechange = d) }, abort: function () { d && d(0, 1) } } } }); var ck = {}, cl, cm, cn = /^(?:toggle|show|hide)$/, co = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, cp, cq = [["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"], ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"], ["opacity"]], cr; f.fn.extend({ show: function (a, b, c) { var d, e; if (a || a === 0) return this.animate(cu("show", 3), a, b, c); for (var g = 0, h = this.length; g < h; g++) d = this[g], d.style && (e = d.style.display, !f._data(d, "olddisplay") && e === "none" && (e = d.style.display = ""), e === "" && f.css(d, "display") === "none" && f._data(d, "olddisplay", cv(d.nodeName))); for (g = 0; g < h; g++) { d = this[g]; if (d.style) { e = d.style.display; if (e === "" || e === "none") d.style.display = f._data(d, "olddisplay") || "" } } return this }, hide: function (a, b, c) { if (a || a === 0) return this.animate(cu("hide", 3), a, b, c); var d, e, g = 0, h = this.length; for (; g < h; g++) d = this[g], d.style && (e = f.css(d, "display"), e !== "none" && !f._data(d, "olddisplay") && f._data(d, "olddisplay", e)); for (g = 0; g < h; g++) this[g].style && (this[g].style.display = "none"); return this }, _toggle: f.fn.toggle, toggle: function (a, b, c) { var d = typeof a == "boolean"; f.isFunction(a) && f.isFunction(b) ? this._toggle.apply(this, arguments) : a == null || d ? this.each(function () { var b = d ? a : f(this).is(":hidden"); f(this)[b ? "show" : "hide"]() }) : this.animate(cu("toggle", 3), a, b, c); return this }, fadeTo: function (a, b, c, d) { return this.filter(":hidden").css("opacity", 0).show().end().animate({ opacity: b }, a, c, d) }, animate: function (a, b, c, d) { function g() { e.queue === !1 && f._mark(this); var b = f.extend({}, e), c = this.nodeType === 1, d = c && f(this).is(":hidden"), g, h, i, j, k, l, m, n, o; b.animatedProperties = {}; for (i in a) { g = f.camelCase(i), i !== g && (a[g] = a[i], delete a[i]), h = a[g], f.isArray(h) ? (b.animatedProperties[g] = h[1], h = a[g] = h[0]) : b.animatedProperties[g] = b.specialEasing && b.specialEasing[g] || b.easing || "swing"; if (h === "hide" && d || h === "show" && !d) return b.complete.call(this); c && (g === "height" || g === "width") && (b.overflow = [this.style.overflow, this.style.overflowX, this.style.overflowY], f.css(this, "display") === "inline" && f.css(this, "float") === "none" && (!f.support.inlineBlockNeedsLayout || cv(this.nodeName) === "inline" ? this.style.display = "inline-block" : this.style.zoom = 1)) } b.overflow != null && (this.style.overflow = "hidden"); for (i in a) j = new f.fx(this, b, i), h = a[i], cn.test(h) ? (o = f._data(this, "toggle" + i) || (h === "toggle" ? d ? "show" : "hide" : 0), o ? (f._data(this, "toggle" + i, o === "show" ? "hide" : "show"), j[o]()) : j[h]()) : (k = co.exec(h), l = j.cur(), k ? (m = parseFloat(k[2]), n = k[3] || (f.cssNumber[i] ? "" : "px"), n !== "px" && (f.style(this, i, (m || 1) + n), l = (m || 1) / j.cur() * l, f.style(this, i, l + n)), k[1] && (m = (k[1] === "-=" ? -1 : 1) * m + l), j.custom(l, m, n)) : j.custom(l, h, "")); return !0 } var e = f.speed(b, c, d); if (f.isEmptyObject(a)) return this.each(e.complete, [!1]); a = f.extend({}, a); return e.queue === !1 ? this.each(g) : this.queue(e.queue, g) }, stop: function (a, c, d) { typeof a != "string" && (d = c, c = a, a = b), c && a !== !1 && this.queue(a || "fx", []); return this.each(function () { function h(a, b, c) { var e = b[c]; f.removeData(a, c, !0), e.stop(d) } var b, c = !1, e = f.timers, g = f._data(this); d || f._unmark(!0, this); if (a == null) for (b in g) g[b] && g[b].stop && b.indexOf(".run") === b.length - 4 && h(this, g, b); else g[b = a + ".run"] && g[b].stop && h(this, g, b); for (b = e.length; b--; ) e[b].elem === this && (a == null || e[b].queue === a) && (d ? e[b](!0) : e[b].saveState(), c = !0, e.splice(b, 1)); (!d || !c) && f.dequeue(this, a) }) } }), f.each({ slideDown: cu("show", 1), slideUp: cu("hide", 1), slideToggle: cu("toggle", 1), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle"} }, function (a, b) { f.fn[a] = function (a, c, d) { return this.animate(b, a, c, d) } }), f.extend({ speed: function (a, b, c) { var d = a && typeof a == "object" ? f.extend({}, a) : { complete: c || !c && b || f.isFunction(a) && a, duration: a, easing: c && b || b && !f.isFunction(b) && b }; d.duration = f.fx.off ? 0 : typeof d.duration == "number" ? d.duration : d.duration in f.fx.speeds ? f.fx.speeds[d.duration] : f.fx.speeds._default; if (d.queue == null || d.queue === !0) d.queue = "fx"; d.old = d.complete, d.complete = function (a) { f.isFunction(d.old) && d.old.call(this), d.queue ? f.dequeue(this, d.queue) : a !== !1 && f._unmark(this) }; return d }, easing: { linear: function (a, b, c, d) { return c + d * a }, swing: function (a, b, c, d) { return (-Math.cos(a * Math.PI) / 2 + .5) * d + c } }, timers: [], fx: function (a, b, c) { this.options = b, this.elem = a, this.prop = c, b.orig = b.orig || {} } }), f.fx.prototype = { update: function () { this.options.step && this.options.step.call(this.elem, this.now, this), (f.fx.step[this.prop] || f.fx.step._default)(this) }, cur: function () { if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) return this.elem[this.prop]; var a, b = f.css(this.elem, this.prop); return isNaN(a = parseFloat(b)) ? !b || b === "auto" ? 0 : b : a }, custom: function (a, c, d) { function h(a) { return e.step(a) } var e = this, g = f.fx; this.startTime = cr || cs(), this.end = c, this.now = this.start = a, this.pos = this.state = 0, this.unit = d || this.unit || (f.cssNumber[this.prop] ? "" : "px"), h.queue = this.options.queue, h.elem = this.elem, h.saveState = function () { e.options.hide && f._data(e.elem, "fxshow" + e.prop) === b && f._data(e.elem, "fxshow" + e.prop, e.start) }, h() && f.timers.push(h) && !cp && (cp = setInterval(g.tick, g.interval)) }, show: function () { var a = f._data(this.elem, "fxshow" + this.prop); this.options.orig[this.prop] = a || f.style(this.elem, this.prop), this.options.show = !0, a !== b ? this.custom(this.cur(), a) : this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()), f(this.elem).show() }, hide: function () { this.options.orig[this.prop] = f._data(this.elem, "fxshow" + this.prop) || f.style(this.elem, this.prop), this.options.hide = !0, this.custom(this.cur(), 0) }, step: function (a) { var b, c, d, e = cr || cs(), g = !0, h = this.elem, i = this.options; if (a || e >= i.duration + this.startTime) { this.now = this.end, this.pos = this.state = 1, this.update(), i.animatedProperties[this.prop] = !0; for (b in i.animatedProperties) i.animatedProperties[b] !== !0 && (g = !1); if (g) { i.overflow != null && !f.support.shrinkWrapBlocks && f.each(["", "X", "Y"], function (a, b) { h.style["overflow" + b] = i.overflow[a] }), i.hide && f(h).hide(); if (i.hide || i.show) for (b in i.animatedProperties) f.style(h, b, i.orig[b]), f.removeData(h, "fxshow" + b, !0), f.removeData(h, "toggle" + b, !0); d = i.complete, d && (i.complete = !1, d.call(h)) } return !1 } i.duration == Infinity ? this.now = e : (c = e - this.startTime, this.state = c / i.duration, this.pos = f.easing[i.animatedProperties[this.prop]](this.state, c, 0, 1, i.duration), this.now = this.start + (this.end - this.start) * this.pos), this.update(); return !0 } }, f.extend(f.fx, { tick: function () { var a, b = f.timers, c = 0; for (; c < b.length; c++) a = b[c], !a() && b[c] === a && b.splice(c--, 1); b.length || f.fx.stop() }, interval: 13, stop: function () { clearInterval(cp), cp = null }, speeds: { slow: 600, fast: 200, _default: 400 }, step: { opacity: function (a) { f.style(a.elem, "opacity", a.now) }, _default: function (a) { a.elem.style && a.elem.style[a.prop] != null ? a.elem.style[a.prop] = a.now + a.unit : a.elem[a.prop] = a.now } } }), f.each(["width", "height"], function (a, b) { f.fx.step[b] = function (a) { f.style(a.elem, b, Math.max(0, a.now) + a.unit) } }), f.expr && f.expr.filters && (f.expr.filters.animated = function (a) { return f.grep(f.timers, function (b) { return a === b.elem }).length }); var cw = /^t(?:able|d|h)$/i, cx = /^(?:body|html)$/i; "getBoundingClientRect" in c.documentElement ? f.fn.offset = function (a) { var b = this[0], c; if (a) return this.each(function (b) { f.offset.setOffset(this, a, b) }); if (!b || !b.ownerDocument) return null; if (b === b.ownerDocument.body) return f.offset.bodyOffset(b); try { c = b.getBoundingClientRect() } catch (d) { } var e = b.ownerDocument, g = e.documentElement; if (!c || !f.contains(g, b)) return c ? { top: c.top, left: c.left} : { top: 0, left: 0 }; var h = e.body, i = cy(e), j = g.clientTop || h.clientTop || 0, k = g.clientLeft || h.clientLeft || 0, l = i.pageYOffset || f.support.boxModel && g.scrollTop || h.scrollTop, m = i.pageXOffset || f.support.boxModel && g.scrollLeft || h.scrollLeft, n = c.top + l - j, o = c.left + m - k; return { top: n, left: o} } : f.fn.offset = function (a) { var b = this[0]; if (a) return this.each(function (b) { f.offset.setOffset(this, a, b) }); if (!b || !b.ownerDocument) return null; if (b === b.ownerDocument.body) return f.offset.bodyOffset(b); var c, d = b.offsetParent, e = b, g = b.ownerDocument, h = g.documentElement, i = g.body, j = g.defaultView, k = j ? j.getComputedStyle(b, null) : b.currentStyle, l = b.offsetTop, m = b.offsetLeft; while ((b = b.parentNode) && b !== i && b !== h) { if (f.support.fixedPosition && k.position === "fixed") break; c = j ? j.getComputedStyle(b, null) : b.currentStyle, l -= b.scrollTop, m -= b.scrollLeft, b === d && (l += b.offsetTop, m += b.offsetLeft, f.support.doesNotAddBorder && (!f.support.doesAddBorderForTableAndCells || !cw.test(b.nodeName)) && (l += parseFloat(c.borderTopWidth) || 0, m += parseFloat(c.borderLeftWidth) || 0), e = d, d = b.offsetParent), f.support.subtractsBorderForOverflowNotVisible && c.overflow !== "visible" && (l += parseFloat(c.borderTopWidth) || 0, m += parseFloat(c.borderLeftWidth) || 0), k = c } if (k.position === "relative" || k.position === "static") l += i.offsetTop, m += i.offsetLeft; f.support.fixedPosition && k.position === "fixed" && (l += Math.max(h.scrollTop, i.scrollTop), m += Math.max(h.scrollLeft, i.scrollLeft)); return { top: l, left: m} }, f.offset = { bodyOffset: function (a) { var b = a.offsetTop, c = a.offsetLeft; f.support.doesNotIncludeMarginInBodyOffset && (b += parseFloat(f.css(a, "marginTop")) || 0, c += parseFloat(f.css(a, "marginLeft")) || 0); return { top: b, left: c} }, setOffset: function (a, b, c) { var d = f.css(a, "position"); d === "static" && (a.style.position = "relative"); var e = f(a), g = e.offset(), h = f.css(a, "top"), i = f.css(a, "left"), j = (d === "absolute" || d === "fixed") && f.inArray("auto", [h, i]) > -1, k = {}, l = {}, m, n; j ? (l = e.position(), m = l.top, n = l.left) : (m = parseFloat(h) || 0, n = parseFloat(i) || 0), f.isFunction(b) && (b = b.call(a, c, g)), b.top != null && (k.top = b.top - g.top + m), b.left != null && (k.left = b.left - g.left + n), "using" in b ? b.using.call(a, k) : e.css(k) } }, f.fn.extend({ position: function () { if (!this[0]) return null; var a = this[0], b = this.offsetParent(), c = this.offset(), d = cx.test(b[0].nodeName) ? { top: 0, left: 0} : b.offset(); c.top -= parseFloat(f.css(a, "marginTop")) || 0, c.left -= parseFloat(f.css(a, "marginLeft")) || 0, d.top += parseFloat(f.css(b[0], "borderTopWidth")) || 0, d.left += parseFloat(f.css(b[0], "borderLeftWidth")) || 0; return { top: c.top - d.top, left: c.left - d.left} }, offsetParent: function () { return this.map(function () { var a = this.offsetParent || c.body; while (a && !cx.test(a.nodeName) && f.css(a, "position") === "static") a = a.offsetParent; return a }) } }), f.each(["Left", "Top"], function (a, c) { var d = "scroll" + c; f.fn[d] = function (c) { var e, g; if (c === b) { e = this[0]; if (!e) return null; g = cy(e); return g ? "pageXOffset" in g ? g[a ? "pageYOffset" : "pageXOffset"] : f.support.boxModel && g.document.documentElement[d] || g.document.body[d] : e[d] } return this.each(function () { g = cy(this), g ? g.scrollTo(a ? f(g).scrollLeft() : c, a ? c : f(g).scrollTop()) : this[d] = c }) } }), f.each(["Height", "Width"], function (a, c) { var d = c.toLowerCase(); f.fn["inner" + c] = function () { var a = this[0]; return a ? a.style ? parseFloat(f.css(a, d, "padding")) : this[d]() : null }, f.fn["outer" + c] = function (a) { var b = this[0]; return b ? b.style ? parseFloat(f.css(b, d, a ? "margin" : "border")) : this[d]() : null }, f.fn[d] = function (a) { var e = this[0]; if (!e) return a == null ? null : this; if (f.isFunction(a)) return this.each(function (b) { var c = f(this); c[d](a.call(this, b, c[d]())) }); if (f.isWindow(e)) { var g = e.document.documentElement["client" + c], h = e.document.body; return e.document.compatMode === "CSS1Compat" && g || h && h["client" + c] || g } if (e.nodeType === 9) return Math.max(e.documentElement["client" + c], e.body["scroll" + c], e.documentElement["scroll" + c], e.body["offset" + c], e.documentElement["offset" + c]); if (a === b) { var i = f.css(e, d), j = parseFloat(i); return f.isNumeric(j) ? j : i } return this.css(d, typeof a == "string" ? a : a + "px") } }), a.jQuery = a.$ = f, typeof define == "function" && define.amd && define.amd.jQuery && define("jquery", [], function () { return f }) })(window);; /* Comment Generated by Combres - Resource '~/Resources/Scripts/venus.thirdparty.min.js' (Mode: Static) */ /* CSS Browser Selector v0.4.0 (Nov 02, 2010) Rafael Lima (http://rafael.adm.br) http://rafael.adm.br/css_browser_selector License: http://creativecommons.org/licenses/by/2.5/ Contributors: http://rafael.adm.br/css_browser_selector#contributors */ function css_browser_selector(u) { var ua = u.toLowerCase(), is = function (t) { return ua.indexOf(t) > -1 }, g = 'gecko', w = 'webkit', s = 'safari', o = 'opera', m = 'mobile', h = document.documentElement, b = [(!(/opera|webtv/i.test(ua)) && /msie\s(\d)/.test(ua)) ? ('ie ie' + RegExp.$1) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3.6') ? g + ' ff3 ff3_6' : is('firefox/3') ? g + ' ff3' : is('index-65.html') ? g : is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.$1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) : is('konqueror') ? 'konqueror' : is('blackberry') ? m + ' blackberry' : is('android') ? m + ' android' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('index-66.html') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') : is('index-67.html') ? g : '', is('j2me') ? m + ' j2me' : is('iphone') ? m + ' iphone' : is('ipod') ? m + ' ipod' : is('ipad') ? m + ' ipad' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' + (is('windows nt 6.0') ? ' vista' : '') : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js']; c = b.join(' '); h.className += ' ' + c; return c; }; css_browser_selector(navigator.userAgent); // http://stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area $.fn.selectRange = function (start, end) { return this.each(function () { if (this.setSelectionRange) { this.focus(); this.setSelectionRange(start, end); } else if (this.createTextRange) { var range = this.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', start); range.select(); } }); }; jQuery.fn.highlightFade = function (settings) { var o = (settings && settings.constructor == String) ? { start: settings} : settings || {}; var d = jQuery.highlightFade.defaults; var i = o['interval'] || d['interval']; var a = o['attr'] || d['attr']; var ts = { 'linear': function (s, e, t, c) { return parseInt(s + (c / t) * (e - s)); }, 'sinusoidal': function (s, e, t, c) { return parseInt(s + Math.sin(((c / t) * 90) * (Math.PI / 180)) * (e - s)); }, 'exponential': function (s, e, t, c) { return parseInt(s + (Math.pow(c / t, 2)) * (e - s)); } }; var t = (o['iterator'] && o['iterator'].constructor == Function) ? o['iterator'] : ts[o['iterator']] || ts[d['iterator']] || ts['linear']; if (d['iterator'] && d['iterator'].constructor == Function) t = d['iterator']; return this.each(function () { if (!this.highlighting) this.highlighting = {}; var e = (this.highlighting[a]) ? this.highlighting[a].end : jQuery.highlightFade.getBaseValue(this, a) || [255, 255, 255]; var c = jQuery.highlightFade.getRGB(o['start'] || o['colour'] || o['color'] || d['start'] || [255, 255, 128]); var s = jQuery.speed(o['speed'] || d['speed']); var r = o['final'] || (this.highlighting[a] && this.highlighting[a].orig) ? this.highlighting[a].orig : jQuery.curCSS(this, a); if (o['end'] || d['end']) r = jQuery.highlightFade.asRGBString(e = jQuery.highlightFade.getRGB(o['end'] || d['end'])); if (typeof o['final'] != 'undefined') r = o['final']; if (this.highlighting[a] && this.highlighting[a].timer) window.clearInterval(this.highlighting[a].timer); this.highlighting[a] = { steps: ((s.duration) / i), interval: i, currentStep: 0, start: c, end: e, orig: r, attr: a }; jQuery.highlightFade(this, a, o['complete'], t); }); }; jQuery.highlightFade = function (e, a, o, t) { e.highlighting[a].timer = window.setInterval(function () { var newR = t(e.highlighting[a].start[0], e.highlighting[a].end[0], e.highlighting[a].steps, e.highlighting[a].currentStep); var newG = t(e.highlighting[a].start[1], e.highlighting[a].end[1], e.highlighting[a].steps, e.highlighting[a].currentStep); var newB = t(e.highlighting[a].start[2], e.highlighting[a].end[2], e.highlighting[a].steps, e.highlighting[a].currentStep); jQuery(e).css(a, jQuery.highlightFade.asRGBString([newR, newG, newB])); if (e.highlighting[a].currentStep++ >= e.highlighting[a].steps) { jQuery(e).css(a, e.highlighting[a].orig || ''); window.clearInterval(e.highlighting[a].timer); e.highlighting[a] = null; if (o && o.constructor == Function) o.call(e); } }, e.highlighting[a].interval); }; jQuery.highlightFade.defaults = { start: [255, 255, 128], interval: 50, speed: 200, attr: 'color' }; jQuery.highlightFade.getRGB = function (c, d) { var result; if (c && c.constructor == Array && c.length == 3) return c; if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c)) return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; else if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c)) return [parseFloat(result[1]) * 2.55, parseFloat(result[2]) * 2.55, parseFloat(result[3]) * 2.55]; else if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c)) return [parseInt("0x" + result[1]), parseInt("0x" + result[2]), parseInt("0x" + result[3])]; else if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c)) return [parseInt("0x" + result[1] + result[1]), parseInt("0x" + result[2] + result[2]), parseInt("0x" + result[3] + result[3])]; else return jQuery.highlightFade.checkColorName(c) || d || null; }; jQuery.highlightFade.asRGBString = function (a) { return "rgb(" + a.join(",") + ")"; }; jQuery.highlightFade.getBaseValue = function (e, a, b) { var s, t; b = b || false; t = a = a || jQuery.highlightFade.defaults['attr']; do { s = jQuery(e).css(t || 'color'); if ((s != '' && s != 'transparent') || (e.tagName.toLowerCase() == "body") || (!b && e.highlighting && e.highlighting[a] && e.highlighting[a].end)) break; t = false; } while (e = e.parentNode); if (!b && e.highlighting && e.highlighting[a] && e.highlighting[a].end) s = e.highlighting[a].end; if (s == undefined || s == '' || s == 'transparent') s = [255, 255, 255]; return jQuery.highlightFade.getRGB(s); }; jQuery.highlightFade.checkColorName = function (c) { if (!c) return null; switch (c.replace(/^\s*|\s*$/g, '').toLowerCase()) { case 'aqua': return [0, 255, 255]; case 'black': return [0, 0, 0]; case 'blue': return [0, 0, 255]; case 'fuchsia': return [255, 0, 255]; case 'gray': return [128, 128, 128]; case 'green': return [0, 128, 0]; case 'lime': return [0, 255, 0]; case 'maroon': return [128, 0, 0]; case 'navy': return [0, 0, 128]; case 'olive': return [128, 128, 0]; case 'purple': return [128, 0, 128]; case 'red': return [255, 0, 0]; case 'silver': return [192, 192, 192]; case 'teal': return [0, 128, 128]; case 'white': return [255, 255, 255]; case 'yellow': return [255, 255, 0]; } }; var Animation2 = function (canvasId) { this.canvas = document.getElementById(canvasId); this.context = this.canvas.getContext("2d"); this.t = 0; this.timeInterval = 0; this.startTime = 0; this.lastTime = 0; this.frame = 0; this.animating = false; // provided by Paul Irish window.requestAnimFrame = (function (callback) { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) { window.setTimeout(callback, 1000 / 60); }; })(); }; Animation2.prototype.getContext = function () { return this.context; }; Animation2.prototype.getCanvas = function () { return this.canvas; }; Animation2.prototype.clear = function () { this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); }; Animation2.prototype.setStage = function (func) { this.stage = func; }; Animation2.prototype.isAnimating = function () { return this.animating; }; Animation2.prototype.getFrame = function () { return this.frame; }; Animation2.prototype.start = function () { this.animating = true; var date = new Date(); this.startTime = date.getTime(); this.lastTime = this.startTime; if (this.stage !== undefined) { this.stage(); } this.animationLoop(); }; Animation2.prototype.stop = function () { this.animating = false; }; Animation2.prototype.getTimeInterval = function () { return this.timeInterval; }; Animation2.prototype.getTime = function () { return this.t; }; Animation2.prototype.getFps = function () { return this.timeInterval > 0 ? 1000 / this.timeInterval : 0; }; Animation2.prototype.animationLoop = function () { var that = this; this.frame++; var date = new Date(); var thisTime = date.getTime(); this.timeInterval = thisTime - this.lastTime; this.t += this.timeInterval; this.lastTime = thisTime; if (this.stage !== undefined) { this.stage(); } if (this.animating) { requestAnimFrame(function () { that.animationLoop(); }); } }; /* iScroll*/ (function () { function j(n, l) { var o = this, m; o.element = typeof n == "object" ? n : document.getElementById(n); o.wrapper = o.element.parentNode; o.element.style.webkitTransitionProperty = "-webkit-transform"; o.element.style.webkitTransitionTimingFunction = "cubic-bezier(0,0,0.25,1)"; o.element.style.webkitTransitionDuration = "0"; o.element.style.webkitTransform = h + "0,0" + b; o.options = { bounce: d, momentum: d, checkDOMChanges: true, topOnDOMChanges: false, hScrollbar: d, vScrollbar: d, fadeScrollbar: g || !a, shrinkScrollbar: g || !a, desktopCompatibility: false, overflow: "auto", snap: false, bounceLock: false, scrollbarColor: "rgba(0,0,0,0.5)", onScrollEnd: function () { } }; if (typeof l == "object") { for (m in l) { o.options[m] = l[m] } } if (o.options.desktopCompatibility) { o.options.overflow = "hidden" } o.onScrollEnd = o.options.onScrollEnd; delete o.options.onScrollEnd; o.wrapper.style.overflow = o.options.overflow; o.refresh(); window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", o, false); if (a || o.options.desktopCompatibility) { o.element.addEventListener(f, o, false); o.element.addEventListener(i, o, false); o.element.addEventListener(e, o, false) } if (o.options.checkDOMChanges) { o.element.addEventListener("DOMSubtreeModified", o, false) } } j.prototype = { x: 0, y: 0, enabled: true, handleEvent: function (m) { var l = this; switch (m.type) { case f: l.touchStart(m); break; case i: l.touchMove(m); break; case e: l.touchEnd(m); break; case "webkitTransitionEnd": l.transitionEnd(); break; case "orientationchange": case "resize": l.refresh(); break; case "DOMSubtreeModified": l.onDOMModified(m); break } }, onDOMModified: function (m) { var l = this; if (m.target.parentNode != l.element) { return } setTimeout(function () { l.refresh() }, 0); if (l.options.topOnDOMChanges && (l.x != 0 || l.y != 0)) { l.scrollTo(0, 0, "0") } }, refresh: function () { var m = this, o = m.x, n = m.y, l; m.scrollWidth = m.wrapper.clientWidth; m.scrollHeight = m.wrapper.clientHeight; m.scrollerWidth = m.element.offsetWidth; m.scrollerHeight = m.element.offsetHeight; m.maxScrollX = m.scrollWidth - m.scrollerWidth; m.maxScrollY = m.scrollHeight - m.scrollerHeight; m.directionX = 0; m.directionY = 0; if (m.scrollX) { if (m.maxScrollX >= 0) { o = 0 } else { if (m.x < m.maxScrollX) { o = m.maxScrollX } } } if (m.scrollY) { if (m.maxScrollY >= 0) { n = 0 } else { if (m.y < m.maxScrollY) { n = m.maxScrollY } } } if (m.options.snap) { m.maxPageX = -Math.floor(m.maxScrollX / m.scrollWidth); m.maxPageY = -Math.floor(m.maxScrollY / m.scrollHeight); l = m.snap(o, n); o = l.x; n = l.y } if (o != m.x || n != m.y) { m.setTransitionTime("0"); m.setPosition(o, n, true) } m.scrollX = m.scrollerWidth > m.scrollWidth; m.scrollY = !m.options.bounceLock && !m.scrollX || m.scrollerHeight > m.scrollHeight; if (m.options.hScrollbar && m.scrollX) { m.scrollBarX = m.scrollBarX || new k("horizontal", m.wrapper, m.options.fadeScrollbar, m.options.shrinkScrollbar, m.options.scrollbarColor); m.scrollBarX.init(m.scrollWidth, m.scrollerWidth) } else { if (m.scrollBarX) { m.scrollBarX = m.scrollBarX.remove() } } if (m.options.vScrollbar && m.scrollY && m.scrollerHeight > m.scrollHeight) { m.scrollBarY = m.scrollBarY || new k("vertical", m.wrapper, m.options.fadeScrollbar, m.options.shrinkScrollbar, m.options.scrollbarColor); m.scrollBarY.init(m.scrollHeight, m.scrollerHeight) } else { if (m.scrollBarY) { m.scrollBarY = m.scrollBarY.remove() } } }, setPosition: function (l, o, n) { var m = this; m.x = l; m.y = o; m.element.style.webkitTransform = h + m.x + "px," + m.y + "px" + b; if (!n) { if (m.scrollBarX) { m.scrollBarX.setPosition(m.x) } if (m.scrollBarY) { m.scrollBarY.setPosition(m.y) } } }, setTransitionTime: function (m) { var l = this; m = m || "0"; l.element.style.webkitTransitionDuration = m; if (l.scrollBarX) { l.scrollBarX.bar.style.webkitTransitionDuration = m; l.scrollBarX.wrapper.style.webkitTransitionDuration = d && l.options.fadeScrollbar ? "300ms" : "0" } if (l.scrollBarY) { l.scrollBarY.bar.style.webkitTransitionDuration = m; l.scrollBarY.wrapper.style.webkitTransitionDuration = d && l.options.fadeScrollbar ? "300ms" : "0" } }, touchStart: function (n) { var m = this, l; if (!m.enabled) { return } n.preventDefault(); n.stopPropagation(); m.scrolling = true; m.moved = false; m.distX = 0; m.distY = 0; m.setTransitionTime("0"); if (m.options.momentum || m.options.snap) { l = new WebKitCSSMatrix(window.getComputedStyle(m.element).webkitTransform); if (l.e != m.x || l.f != m.y) { document.removeEventListener("webkitTransitionEnd", m, false); m.setPosition(l.e, l.f); m.moved = true } } m.touchStartX = a ? n.changedTouches[0].pageX : n.pageX; m.scrollStartX = m.x; m.touchStartY = a ? n.changedTouches[0].pageY : n.pageY; m.scrollStartY = m.y; m.scrollStartTime = n.timeStamp; m.directionX = 0; m.directionY = 0 }, touchMove: function (r) { if (!this.scrolling) { return } var p = this, o = a ? r.changedTouches[0].pageX : r.pageX, n = a ? r.changedTouches[0].pageY : r.pageY, m = p.scrollX ? o - p.touchStartX : 0, l = p.scrollY ? n - p.touchStartY : 0, s = p.x + m, q = p.y + l; r.stopPropagation(); p.touchStartX = o; p.touchStartY = n; if (s >= 0 || s < p.maxScrollX) { s = p.options.bounce ? Math.round(p.x + m / 3) : (s >= 0 || p.maxScrollX >= 0) ? 0 : p.maxScrollX } if (q >= 0 || q < p.maxScrollY) { q = p.options.bounce ? Math.round(p.y + l / 3) : (q >= 0 || p.maxScrollY >= 0) ? 0 : p.maxScrollY } if (p.distX + p.distY > 5) { if (p.distX - 3 > p.distY) { q = p.y; l = 0 } else { if (p.distY - 3 > p.distX) { s = p.x; m = 0 } } p.setPosition(s, q); p.moved = true; p.directionX = m > 0 ? -1 : 1; p.directionY = l > 0 ? -1 : 1 } else { p.distX += Math.abs(m); p.distY += Math.abs(l) } }, touchEnd: function (t) { if (!this.scrolling) { return } var s = this, o = t.timeStamp - s.scrollStartTime, w = a ? t.changedTouches[0] : t, u, v, n, l, m = 0, r = s.x, q = s.y, p; s.scrolling = false; if (!s.moved) { s.resetPosition(); if (a) { u = w.target; while (u.nodeType != 1) { u = u.parentNode } v = document.createEvent("MouseEvents"); v.initMouseEvent("click", true, true, t.view, 1, w.screenX, w.screenY, w.clientX, w.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, 0, null); v._fake = true; u.dispatchEvent(v) } return } if (!s.options.snap && o > 250) { s.resetPosition(); return } if (s.options.momentum) { n = s.scrollX === true ? s.momentum(s.x - s.scrollStartX, o, s.options.bounce ? -s.x + s.scrollWidth / 5 : -s.x, s.options.bounce ? s.x + s.scrollerWidth - s.scrollWidth + s.scrollWidth / 5 : s.x + s.scrollerWidth - s.scrollWidth) : { dist: 0, time: 0 }; l = s.scrollY === true ? s.momentum(s.y - s.scrollStartY, o, s.options.bounce ? -s.y + s.scrollHeight / 5 : -s.y, s.options.bounce ? (s.maxScrollY < 0 ? s.y + s.scrollerHeight - s.scrollHeight : 0) + s.scrollHeight / 5 : s.y + s.scrollerHeight - s.scrollHeight) : { dist: 0, time: 0 }; m = Math.max(Math.max(n.time, l.time), 1); r = s.x + n.dist; q = s.y + l.dist } if (s.options.snap) { p = s.snap(r, q); r = p.x; q = p.y; m = Math.max(p.time, m) } s.scrollTo(r, q, m + "ms") }, transitionEnd: function () { var l = this; document.removeEventListener("webkitTransitionEnd", l, false); l.resetPosition() }, resetPosition: function () { var l = this, n = l.x, m = l.y; if (l.x >= 0) { n = 0 } else { if (l.x < l.maxScrollX) { n = l.maxScrollX } } if (l.y >= 0 || l.maxScrollY > 0) { m = 0 } else { if (l.y < l.maxScrollY) { m = l.maxScrollY } } if (n != l.x || m != l.y) { l.scrollTo(n, m) } else { if (l.moved) { l.onScrollEnd(); l.moved = false } if (l.scrollBarX) { l.scrollBarX.hide() } if (l.scrollBarY) { l.scrollBarY.hide() } } }, snap: function (l, o) { var m = this, n; if (m.directionX > 0) { l = Math.floor(l / m.scrollWidth) } else { if (m.directionX < 0) { l = Math.ceil(l / m.scrollWidth) } else { l = Math.round(l / m.scrollWidth) } } m.pageX = -l; l = l * m.scrollWidth; if (l > 0) { l = m.pageX = 0 } else { if (l < m.maxScrollX) { m.pageX = m.maxPageX; l = m.maxScrollX } } if (m.directionY > 0) { o = Math.floor(o / m.scrollHeight) } else { if (m.directionY < 0) { o = Math.ceil(o / m.scrollHeight) } else { o = Math.round(o / m.scrollHeight) } } m.pageY = -o; o = o * m.scrollHeight; if (o > 0) { o = m.pageY = 0 } else { if (o < m.maxScrollY) { m.pageY = m.maxPageY; o = m.maxScrollY } } n = Math.round(Math.max(Math.abs(m.x - l) / m.scrollWidth * 500, Math.abs(m.y - o) / m.scrollHeight * 500)); return { x: l, y: o, time: n} }, scrollTo: function (m, l, o) { var n = this; if (n.x == m && n.y == l) { n.resetPosition(); return } n.moved = true; n.setTransitionTime(o || "350ms"); n.setPosition(m, l); if (o === "0" || o == "0s" || o == "0ms") { n.resetPosition() } else { document.addEventListener("webkitTransitionEnd", n, false) } }, scrollToPage: function (n, m, p) { var o = this, l; if (!o.options.snap) { o.pageX = -Math.round(o.x / o.scrollWidth); o.pageY = -Math.round(o.y / o.scrollHeight) } if (n == "next") { n = ++o.pageX } else { if (n == "prev") { n = --o.pageX } } if (m == "next") { m = ++o.pageY } else { if (m == "prev") { m = --o.pageY } } n = -n * o.scrollWidth; m = -m * o.scrollHeight; l = o.snap(n, m); n = l.x; m = l.y; o.scrollTo(n, m, p || "500ms") }, scrollToElement: function (m, o) { m = typeof m == "object" ? m : this.element.querySelector(m); if (!m) { return } var n = this, l = n.scrollX ? -m.offsetLeft : 0, p = n.scrollY ? -m.offsetTop : 0; if (l >= 0) { l = 0 } else { if (l < n.maxScrollX) { l = n.maxScrollX } } if (p >= 0) { p = 0 } else { if (p < n.maxScrollY) { p = n.maxScrollY } } n.scrollTo(l, p, o) }, momentum: function (s, m, q, l) { var p = 2.5, r = 1.2, n = Math.abs(s) / m * 1000, o = n * n / p / 1000, t = 0; if (s > 0 && o > q) { n = n * q / o / p; o = q } else { if (s < 0 && o > l) { n = n * l / o / p; o = l } } o = o * (s < 0 ? -1 : 1); t = n / r; return { dist: Math.round(o), time: Math.round(t)} }, destroy: function (l) { var m = this; window.removeEventListener("onorientationchange" in window ? "orientationchange" : "resize", m, false); m.element.removeEventListener(f, m, false); m.element.removeEventListener(i, m, false); m.element.removeEventListener(e, m, false); document.removeEventListener("webkitTransitionEnd", m, false); if (m.options.checkDOMChanges) { m.element.removeEventListener("DOMSubtreeModified", m, false) } if (m.scrollBarX) { m.scrollBarX = m.scrollBarX.remove() } if (m.scrollBarY) { m.scrollBarY = m.scrollBarY.remove() } if (l) { m.wrapper.parentNode.removeChild(m.wrapper) } return null } }; function k(m, r, q, n, l) { var o = this, p = document; o.dir = m; o.fade = q; o.shrink = n; o.uid = ++c; o.bar = p.createElement("div"); o.bar.style.cssText = "position:absolute;top:0;left:0;-webkit-transition-timing-function:cubic-bezier(0,0,0.25,1);pointer-events:none;-webkit-transition-duration:0;-webkit-transition-delay:0;-webkit-transition-property:-webkit-transform;z-index:10;background:" + l + ";-webkit-transform:" + h + "0,0" + b + ";" + (m == "horizontal" ? "-webkit-border-radius:3px 2px;min-width:6px;min-height:5px" : "-webkit-border-radius:2px 3px;min-width:5px;min-height:6px"); o.wrapper = p.createElement("div"); o.wrapper.style.cssText = "-webkit-mask:-webkit-canvas(scrollbar" + o.uid + o.dir + ");position:absolute;z-index:10;pointer-events:none;overflow:hidden;opacity:0;-webkit-transition-duration:" + (q ? "300ms" : "0") + ";-webkit-transition-delay:0;-webkit-transition-property:opacity;" + (o.dir == "horizontal" ? "bottom:2px;left:2px;right:7px;height:5px" : "top:2px;right:2px;bottom:7px;width:5px;"); o.wrapper.appendChild(o.bar); r.appendChild(o.wrapper) } k.prototype = { init: function (l, n) { var o = this, q = document, p = Math.PI, m; if (o.dir == "horizontal") { if (o.maxSize != o.wrapper.offsetWidth) { o.maxSize = o.wrapper.offsetWidth; m = q.getCSSCanvasContext("2d", "scrollbar" + o.uid + o.dir, o.maxSize, 5); m.fillStyle = "rgb(0,0,0)"; m.beginPath(); m.arc(2.5, 2.5, 2.5, p / 2, -p / 2, false); m.lineTo(o.maxSize - 2.5, 0); m.arc(o.maxSize - 2.5, 2.5, 2.5, -p / 2, p / 2, false); m.closePath(); m.fill() } } else { if (o.maxSize != o.wrapper.offsetHeight) { o.maxSize = o.wrapper.offsetHeight; m = q.getCSSCanvasContext("2d", "scrollbar" + o.uid + o.dir, 5, o.maxSize); m.fillStyle = "rgb(0,0,0)"; m.beginPath(); m.arc(2.5, 2.5, 2.5, p, 0, false); m.lineTo(5, o.maxSize - 2.5); m.arc(2.5, o.maxSize - 2.5, 2.5, 0, p, false); m.closePath(); m.fill() } } o.size = Math.max(Math.round(o.maxSize * o.maxSize / n), 6); o.maxScroll = o.maxSize - o.size; o.toWrapperProp = o.maxScroll / (l - n); o.bar.style[o.dir == "horizontal" ? "width" : "height"] = o.size + "px" }, setPosition: function (m) { var l = this; if (l.wrapper.style.opacity != "1") { l.show() } m = Math.round(l.toWrapperProp * m); if (m < 0) { m = l.shrink ? m + m * 3 : 0; if (l.size + m < 7) { m = -l.size + 6 } } else { if (m > l.maxScroll) { m = l.shrink ? m + (m - l.maxScroll) * 3 : l.maxScroll; if (l.size + l.maxScroll - m < 7) { m = l.size + l.maxScroll - 6 } } } m = l.dir == "horizontal" ? h + m + "px,0" + b : h + "0," + m + "px" + b; l.bar.style.webkitTransform = m }, show: function () { if (d) { this.wrapper.style.webkitTransitionDelay = "0" } this.wrapper.style.opacity = "1" }, hide: function () { if (d) { this.wrapper.style.webkitTransitionDelay = "350ms" } this.wrapper.style.opacity = "0" }, remove: function () { this.wrapper.parentNode.removeChild(this.wrapper); return null } }; var d = ("WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix()), g = (/iphone|ipad/gi).test(navigator.appVersion), a = ("ontouchstart" in window), f = a ? "touchstart" : "mousedown", i = a ? "touchmove" : "mousemove", e = a ? "touchend" : "mouseup", h = "translate" + (d ? "3d(" : "("), b = d ? ",0)" : ")", c = 0; window.iScroll = j })(); $.fn.center = function () { this.css("position", "absolute"); this.css("top", Math.max(0, (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop()) + "px"); this.css("left", Math.max(0, (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft()) + "px"); return this; }; var form2js = (function () { "use strict"; function form2js(rootNode, delimiter, skipEmpty, nodeCallback, useIdIfEmptyName) { if (typeof skipEmpty == 'undefined' || skipEmpty == null) skipEmpty = true; if (typeof delimiter == 'undefined' || delimiter == null) delimiter = '.'; if (arguments.length < 5) useIdIfEmptyName = false; rootNode = typeof rootNode == 'string' ? document.getElementById(rootNode) : rootNode; var formValues = [], currNode, i = 0; /* If rootNode is array - combine values */ if (rootNode.constructor == Array || (typeof NodeList != "undefined" && rootNode.constructor == NodeList)) { while (currNode = rootNode[i++]) { formValues = formValues.concat(getFormValues(currNode, nodeCallback, useIdIfEmptyName)); } } else { formValues = getFormValues(rootNode, nodeCallback, useIdIfEmptyName); } return processNameValues(formValues, skipEmpty, delimiter); } function processNameValues(nameValues, skipEmpty, delimiter) { var result = {}, arrays = {}, i, j, k, l, value, nameParts, currResult, arrNameFull, arrName, arrIdx, namePart, name, _nameParts; for (i = 0; i < nameValues.length; i++) { value = nameValues[i].value; if (skipEmpty && (value === '' || value === null)) continue; name = nameValues[i].name; _nameParts = name.split(delimiter); nameParts = []; currResult = result; arrNameFull = ''; for (j = 0; j < _nameParts.length; j++) { namePart = _nameParts[j].split(']['); if (namePart.length > 1) { for (k = 0; k < namePart.length; k++) { if (k == 0) { namePart[k] = namePart[k] + ']'; } else if (k == namePart.length - 1) { namePart[k] = '[' + namePart[k]; } else { namePart[k] = '[' + namePart[k] + ']'; } arrIdx = namePart[k].match(/([a-z_]+)?\[([a-z_][a-z0-9_]+?)\]/i); if (arrIdx) { for (l = 1; l < arrIdx.length; l++) { if (arrIdx[l]) nameParts.push(arrIdx[l]); } } else { nameParts.push(namePart[k]); } } } else nameParts = nameParts.concat(namePart); } for (j = 0; j < nameParts.length; j++) { namePart = nameParts[j]; if (namePart.indexOf('[]') > -1 && j == nameParts.length - 1) { arrName = namePart.substr(0, namePart.indexOf('[')); arrNameFull += arrName; if (!currResult[arrName]) currResult[arrName] = []; currResult[arrName].push(value); } else if (namePart.indexOf('[') > -1) { arrName = namePart.substr(0, namePart.indexOf('[')); arrIdx = namePart.replace(/(^([a-z_]+)?\[)|(\]$)/gi, ''); arrNameFull += '_' + arrName + '_' + arrIdx; if (!arrays[arrNameFull]) arrays[arrNameFull] = {}; if (arrName != '' && !currResult[arrName]) currResult[arrName] = []; if (j == nameParts.length - 1) { if (arrName == '') { currResult.push(value); arrays[arrNameFull][arrIdx] = currResult[currResult.length - 1]; } else { currResult[arrName].push(value); arrays[arrNameFull][arrIdx] = currResult[arrName][currResult[arrName].length - 1]; } } else { if (!arrays[arrNameFull][arrIdx]) { if ((/^[a-z_]+\[?/i).test(nameParts[j + 1])) currResult[arrName].push({}); else currResult[arrName].push([]); arrays[arrNameFull][arrIdx] = currResult[arrName][currResult[arrName].length - 1]; } } currResult = arrays[arrNameFull][arrIdx]; } else { arrNameFull += namePart; if (j < nameParts.length - 1) /* Not the last part of name - means object */ { if (!currResult[namePart]) currResult[namePart] = {}; currResult = currResult[namePart]; } else { currResult[namePart] = value; } } } } return result; } function getFormValues(rootNode, nodeCallback, useIdIfEmptyName) { var result = extractNodeValues(rootNode, nodeCallback, useIdIfEmptyName); return result.length > 0 ? result : getSubFormValues(rootNode, nodeCallback, useIdIfEmptyName); } function getSubFormValues(rootNode, nodeCallback, useIdIfEmptyName) { var result = [], currentNode = rootNode.firstChild; while (currentNode) { result = result.concat(extractNodeValues(currentNode, nodeCallback, useIdIfEmptyName)); currentNode = currentNode.nextSibling; } return result; } function extractNodeValues(node, nodeCallback, useIdIfEmptyName) { var callbackResult, fieldValue, result, fieldName = getFieldName(node, useIdIfEmptyName); callbackResult = nodeCallback && nodeCallback(node); if (callbackResult && callbackResult.name) { result = [callbackResult]; } else if (fieldName != '' && node.nodeName.match(/INPUT|TEXTAREA/i)) { fieldValue = getFieldValue(node); result = [{ name: fieldName, value: fieldValue}]; } else if (fieldName != '' && node.nodeName.match(/SELECT/i)) { fieldValue = getFieldValue(node); result = [{ name: fieldName.replace(/\[\]$/, ''), value: fieldValue}]; } else { result = getSubFormValues(node, nodeCallback, useIdIfEmptyName); } return result; } function getFieldName(node, useIdIfEmptyName) { if (node.name && node.name != '') return node.name; else if (useIdIfEmptyName && node.id && node.id != '') return node.id; else return ''; } function getFieldValue(fieldNode) { if (fieldNode.disabled) return null; switch (fieldNode.nodeName) { case 'INPUT': case 'TEXTAREA': switch (fieldNode.type.toLowerCase()) { case 'radio': case 'checkbox': if (fieldNode.checked && fieldNode.value === "true") return true; if (!fieldNode.checked && fieldNode.value === "true") return false; if (fieldNode.checked) return fieldNode.value; break; case 'button': case 'reset': case 'submit': case 'image': return ''; break; default: return fieldNode.value; break; } break; case 'SELECT': return getSelectedOptionValue(fieldNode); break; default: break; } return null; } function getSelectedOptionValue(selectNode) { var multiple = selectNode.multiple, result = [], options, i, l; if (!multiple) return selectNode.value; for (options = selectNode.getElementsByTagName("option"), i = 0, l = options.length; i < l; i++) { if (options[i].selected) result.push(options[i].value); } return result; } return form2js; })(); (function ($) { $.fn.toObject = function (options) { var result = [], settings = { mode: 'first', // what to convert: 'all' or 'first' matched node delimiter: ".", skipEmpty: true, nodeCallback: null, useIdIfEmptyName: false }; if (options) { $.extend(settings, options); } switch (settings.mode) { case 'first': return form2js(this.get(0), settings.delimiter, settings.skipEmpty, settings.nodeCallback, settings.useIdIfEmptyName); break; case 'all': this.each(function () { result.push(form2js(this, settings.delimiter, settings.skipEmpty, settings.nodeCallback, settings.useIdIfEmptyName)); }); return result; break; case 'combine': return form2js(Array.prototype.slice.call(this), settings.delimiter, settings.skipEmpty, settings.nodeCallback, settings.useIdIfEmptyName); break; } } })(jQuery); (function ($) { $.fn.extend({ //plugin name - rotaterator rotaterator: function (options) { var defaults = { fadeSpeed: 600, pauseSpeed: 100, child: null }; var options = $.extend(defaults, options); return this.each(function () { var o = options; var obj = $(this); var items = $(obj.children(), obj); items.each(function () { $(this).hide(); }) if (!o.child) { var next = $(obj).children(':first'); } else { var next = o.child; } $(next).fadeIn(o.fadeSpeed, function () { $(next).delay(o.pauseSpeed).fadeOut(o.fadeSpeed, function () { var next = $(this).next(); if (next.length == 0) { next = $(obj).children(':first'); } $(obj).rotaterator({ child: next, fadeSpeed: o.fadeSpeed, pauseSpeed: o.pauseSpeed }); }) }); }); } }); })(jQuery); var js2form = (function () { "use strict"; var _subArrayRegexp = /^\[\d+?\]/, _subObjectRegexp = /^[a-zA-Z_][a-zA-Z_0-9]+/, _arrayItemRegexp = /\[[0-9]+?\]$/, _lastIndexedArrayRegexp = /(.*)(\[)([0-9]*)(\])$/, _arrayOfArraysRegexp = /\[([0-9]+)\]\[([0-9]+)\]/g, _inputOrTextareaRegexp = /INPUT|TEXTAREA/i; function js2form(rootNode, data, delimiter, nodeCallback, useIdIfEmptyName) { if (arguments.length < 3) delimiter = '.'; if (arguments.length < 4) nodeCallback = null; if (arguments.length < 5) useIdIfEmptyName = false; var fieldValues, formFieldsByName; fieldValues = object2array(data); formFieldsByName = getFields(rootNode, useIdIfEmptyName, delimiter, {}, true); for (var i = 0; i < fieldValues.length; i++) { var fieldName = fieldValues[i].name, fieldValue = fieldValues[i].value; if (typeof formFieldsByName[fieldName] != 'undefined') { setValue(formFieldsByName[fieldName], fieldValue); } else if (typeof formFieldsByName[fieldName.replace(_arrayItemRegexp, '[]')] != 'undefined') { setValue(formFieldsByName[fieldName.replace(_arrayItemRegexp, '[]')], fieldValue); } } } function setValue(field, value) { var children, i, l; if (field instanceof Array) { for (i = 0; i < field.length; i++) { if (field[i].value == value) field[i].checked = true; } } else if (_inputOrTextareaRegexp.test(field.nodeName)) { field.value = value; } else if (/SELECT/i.test(field.nodeName)) { children = field.getElementsByTagName('option'); for (i = 0, l = children.length; i < l; i++) { if (children[i].value == value) { children[i].selected = true; if (field.multiple) break; } else if (!field.multiple) { children[i].selected = false; } } } } function getFields(rootNode, useIdIfEmptyName, delimiter, arrayIndexes, shouldClean) { if (arguments.length < 4) arrayIndexes = {}; var result = {}, currNode = rootNode.firstChild, name, nameNormalized, subFieldName, i, j, l, options; while (currNode) { name = ''; if (currNode.name && currNode.name != '') { name = currNode.name; } else if (useIdIfEmptyName && currNode.id && currNode.id != '') { name = currNode.id; } if (name == '') { var subFields = getFields(currNode, useIdIfEmptyName, delimiter, arrayIndexes, shouldClean); for (subFieldName in subFields) { if (typeof result[subFieldName] == 'undefined') { result[subFieldName] = subFields[subFieldName]; } else { for (i = 0; i < subFields[subFieldName].length; i++) { result[subFieldName].push(subFields[subFieldName][i]); } } } } else { if (/SELECT/i.test(currNode.nodeName)) { for (j = 0, options = currNode.getElementsByTagName('option'), l = options.length; j < l; j++) { if (shouldClean) { options[j].selected = false; } nameNormalized = normalizeName(name, delimiter, arrayIndexes); result[nameNormalized] = currNode; } } else if (/INPUT/i.test(currNode.nodeName) && /CHECKBOX|RADIO/i.test(currNode.type)) { if (shouldClean) { currNode.checked = false; } nameNormalized = normalizeName(name, delimiter, arrayIndexes); nameNormalized = nameNormalized.replace(_arrayItemRegexp, '[]'); if (!result[nameNormalized]) result[nameNormalized] = []; result[nameNormalized].push(currNode); } else { if (shouldClean) { currNode.value = ''; } nameNormalized = normalizeName(name, delimiter, arrayIndexes); result[nameNormalized] = currNode; } } currNode = currNode.nextSibling; } return result; } function normalizeName(name, delimiter, arrayIndexes) { var nameChunksNormalized = [], nameChunks = name.split(delimiter), currChunk, nameMatches, nameNormalized, currIndex, newIndex, i; name = name.replace(_arrayOfArraysRegexp, '[$1].[$2]'); for (i = 0; i < nameChunks.length; i++) { currChunk = nameChunks[i]; nameChunksNormalized.push(currChunk); nameMatches = currChunk.match(_lastIndexedArrayRegexp); if (nameMatches != null) { nameNormalized = nameChunksNormalized.join(delimiter); currIndex = nameNormalized.replace(_lastIndexedArrayRegexp, '$3'); nameNormalized = nameNormalized.replace(_lastIndexedArrayRegexp, '$1'); if (typeof (arrayIndexes[nameNormalized]) == 'undefined') { arrayIndexes[nameNormalized] = { lastIndex: -1, indexes: {} }; } if (currIndex == '' || typeof arrayIndexes[nameNormalized].indexes[currIndex] == 'undefined') { arrayIndexes[nameNormalized].lastIndex++; arrayIndexes[nameNormalized].indexes[currIndex] = arrayIndexes[nameNormalized].lastIndex; } newIndex = arrayIndexes[nameNormalized].indexes[currIndex]; nameChunksNormalized[nameChunksNormalized.length - 1] = currChunk.replace(_lastIndexedArrayRegexp, '$1$2' + newIndex + '$4'); } } nameNormalized = nameChunksNormalized.join(delimiter); nameNormalized = nameNormalized.replace('].[', ']['); return nameNormalized; } function object2array(obj, lvl) { var result = [], i, name; if (arguments.length == 1) lvl = 0; if (obj == null) { result = [{ name: "", value: null}]; } else if (typeof obj == 'string' || typeof obj == 'number' || typeof obj == 'date' || typeof obj == 'boolean') { result = [ { name: "", value: obj } ]; } else if (obj instanceof Array) { for (i = 0; i < obj.length; i++) { name = "[" + i + "]"; result = result.concat(getSubValues(obj[i], name, lvl + 1)); } } else { for (i in obj) { name = i; result = result.concat(getSubValues(obj[i], name, lvl + 1)); } } return result; } function getSubValues(subObj, name, lvl) { var itemName; var result = [], tempResult = object2array(subObj, lvl + 1), i, tempItem; for (i = 0; i < tempResult.length; i++) { itemName = name; if (_subArrayRegexp.test(tempResult[i].name)) { itemName += tempResult[i].name; } else if (_subObjectRegexp.test(tempResult[i].name)) { itemName += '.' + tempResult[i].name; } tempItem = { name: itemName, value: tempResult[i].value }; result.push(tempItem); } return result; } return js2form; })();; /* Comment Generated by Combres - Resource '~/Resources/Scripts/jquery-ui-1.8.16.custom.min.js' (Mode: Static) */ /*! * jQuery UI 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI */ (function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16", keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d= this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this, "overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart": "mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight, outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a, "tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&& a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); ;/* * jQuery UI Position 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Position */ (function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); ;/* * jQuery UI Draggable 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Draggables * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js */ (function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== "original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options; this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, _mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, 10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| !d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), 10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), 10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, (a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= "hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), 10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& !(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a= false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"}); this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= {width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis]; if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false}, _mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f, {top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight: Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(cb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left= null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+ c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]); b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(), 10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top- f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType? e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a= e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing, step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset; var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left: a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top- d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition, f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b= e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height= d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); ;/* * jQuery UI Selectable 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Selectables * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js */ (function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable"); this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a=== "disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&& !b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b= this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f= d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")|| 0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out", a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h- f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g- this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this, this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop", a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a= this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"); this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(), e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight|| e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false", "aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.16", animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/); f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide", paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); ;/* * jQuery UI Autocomplete 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Autocomplete * * Depends: * jquery.ui.core.js * jquery.ui.widget.js * jquery.ui.position.js */ (function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g= false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!= a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)}; this.menu=d("
    ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&& a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"); d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&& b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source= this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); (function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", -1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b, this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("");e.secondary&&a.append("");if(!this.options.text){d.push(f?"ui-button-icons-only": "ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")=== "ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); b.Widget.prototype.destroy.call(this)}})})(jQuery); ;/* * jQuery UI Dialog 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog * * Depends: * jquery.ui.core.js * jquery.ui.widget.js * jquery.ui.button.js * jquery.ui.draggable.js * jquery.ui.mouse.js * jquery.ui.position.js * jquery.ui.resizable.js */ (function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.maxZ+=1; d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
    ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): [a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&& c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j"); this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle", g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length? (h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i- m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false; this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b= this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b= this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b); c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e- g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"}, b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery); ;/* * jQuery UI Tabs 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Tabs * * Depends: * jquery.ui.core.js * jquery.ui.widget.js */ (function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| (q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= -1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, "cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k'))}function N(a){return a.bind("mouseout", function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv}, setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g, "\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('
    '))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c== "focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f==""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker(): d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a, b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+= 1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/ 2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b= d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e= a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a, "datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f== a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input", a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value= "";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b); c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+9999)/*1 - Bry edited*/;d.datepicker._datepickerShowing= true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}); a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&& !a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(), h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b= this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b); this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, _checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): 0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"? "Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a); this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField"); if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"? b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd", COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames: null)||this._defaults.monthNames;var i=function(o){(o=k+1 12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&& a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a)); n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m, g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+s+"":f?"":''+s+"";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&& a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
    '+(c?h:"")+(this._isInRange(a,s)?'":"")+(c?"":h)+"
    ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesShort" /*charles: replaced dayNamesMin*/),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='
    '+(/all|left/.test(t)&& x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'
    ';var z=j?'":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="=5?' class="ui-datepicker-week-end"':"")+'>'+q[r]+""}y+=z+"";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q";var R=!j?"":'";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&ro;R+='";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+""}g++;if(g>11){g=0;m++}y+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(r)+""+(F&&!D?" ":L?''+ r.getDate()+"":''+r.getDate()+"")+"
    "+(l?""+(i[0]>0&&G==i[1]-1?'
    ':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': "");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
    ',o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b, e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
    ";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+ (c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input? a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c, e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a, "dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this; if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a== "string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery); ;/* * jQuery UI Progressbar 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Progressbar * * Depends: * jquery.ui.core.js * jquery.ui.widget.js */ (function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
    ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery); ;/* * jQuery UI Effects 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/ */ jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], 16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", "borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, 0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, 211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})}; f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this, [{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}), d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement; if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)}); return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this, arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/ 2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b, d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c, a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b, d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); ;/* * jQuery UI Effects Fade 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Fade * * Depends: * jquery.effects.core.js */ (function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Fold 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Fold * * Depends: * jquery.effects.core.js */ (function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], 10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); ;/* * jQuery UI Effects Highlight 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Highlight * * Depends: * jquery.effects.core.js */ (function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Pulsate 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Pulsate * * Depends: * jquery.effects.core.js */ (function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); b.dequeue()})})}})(jQuery); ;; /* Comment Generated by Combres - Resource '~/Resources/Scripts/venus.json.debug.js' (Mode: Static) */ /* json2.js 2011-10-19 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. See http://www.JSON.org/js.html This code should be minified before deployment. See http://javascript.crockford.com/jsmin.html USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO NOT CONTROL. This file creates a global JSON object containing two methods: stringify and parse. JSON.stringify(value, replacer, space) value any JavaScript value, usually an object or array. replacer an optional parameter that determines how object values are stringified for objects. It can be a function or an array of strings. space an optional parameter that specifies the indentation of nested structures. If it is omitted, the text will be packed without extra whitespace. If it is a number, it will specify the number of spaces to indent at each level. If it is a string (such as '\t' or ' '), it contains the characters used to indent at each level. This method produces a JSON text from a JavaScript value. When an object value is found, if the object contains a toJSON method, its toJSON method will be called and the result will be stringified. A toJSON method does not serialize: it returns the value represented by the name/value pair that should be serialized, or undefined if nothing should be serialized. The toJSON method will be passed the key associated with the value, and this will be bound to the value For example, this would serialize Dates as ISO strings. Date.prototype.toJSON = function (key) { function f(n) { // Format integers to have at least two digits. return n < 10 ? '0' + n : n; } return this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z'; }; You can provide an optional replacer method. It will be passed the key and value of each member, with this bound to the containing object. The value that is returned from your method will be serialized. If your method returns undefined, then the member will be excluded from the serialization. If the replacer parameter is an array of strings, then it will be used to select the members to be serialized. It filters the results such that only members with keys listed in the replacer array are stringified. Values that do not have JSON representations, such as undefined or functions, will not be serialized. Such values in objects will be dropped; in arrays they will be replaced with null. You can use a replacer function to replace those with JSON values. JSON.stringify(undefined) returns undefined. The optional space parameter produces a stringification of the value that is filled with line breaks and indentation to make it easier to read. If the space parameter is a non-empty string, then that string will be used for indentation. If the space parameter is a number, then the indentation will be that many spaces. Example: text = JSON.stringify(['e', {pluribus: 'unum'}]); // text is '["e",{"pluribus":"unum"}]' text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' text = JSON.stringify([new Date()], function (key, value) { return this[key] instanceof Date ? 'Date(' + this[key] + ')' : value; }); // text is '["Date(---current time---)"]' JSON.parse(text, reviver) This method parses a JSON text to produce an object or array. It can throw a SyntaxError exception. The optional reviver parameter is a function that can filter and transform the results. It receives each of the keys and values, and its return value is used instead of the original value. If it returns what it received, then the structure is not modified. If it returns undefined then the member is deleted. Example: // Parse the text. Values that look like ISO date strings will // be converted to Date objects. myData = JSON.parse(text, function (key, value) { var a; if (typeof value === 'string') { a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); if (a) { return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6])); } } return value; }); myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { var d; if (typeof value === 'string' && value.slice(0, 5) === 'Date(' && value.slice(-1) === ')') { d = new Date(value.slice(5, -1)); if (d) { return d; } } return value; }); This is a reference implementation. You are free to copy, modify, or redistribute. */ /*jslint evil: true, regexp: true */ /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, lastIndex, length, parse, prototype, push, replace, slice, stringify, test, toJSON, toString, valueOf */ // Create a JSON object only if one does not already exist. We create the // methods in a closure to avoid creating global variables. var JSON; if (!JSON) { JSON = {}; } (function () { 'use strict'; function f(n) { // Format integers to have at least two digits. return n < 10 ? '0' + n : n; } if (typeof Date.prototype.toJSON !== 'function') { Date.prototype.toJSON = function (key) { return isFinite(this.valueOf()) ? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z' : null; }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (key) { return this.valueOf(); }; } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { // table of character substitutions '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' }, rep; function quote(string) { // If the string contains no control characters, no quote characters, and no // backslash characters, then we can safely slap some quotes around it. // Otherwise we must also replace the offending characters with safe escape // sequences. escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function (a) { var c = meta[a]; return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }) + '"' : '"' + string + '"'; } function str(key, holder) { // Produce a string from holder[key]. var i, // The loop counter. k, // The member key. v, // The member value. length, mind = gap, partial, value = holder[key]; // If the value has a toJSON method, call it to obtain a replacement value. if (value && typeof value === 'object' && typeof value.toJSON === 'function') { value = value.toJSON(key); } // If we were called with a replacer function, then call the replacer to // obtain a replacement value. if (typeof rep === 'function') { value = rep.call(holder, key, value); } // What happens next depends on the value's type. switch (typeof value) { case 'string': return quote(value); case 'number': // JSON numbers must be finite. Encode non-finite numbers as null. return isFinite(value) ? String(value) : 'null'; case 'boolean': case 'null': // If the value is a boolean or null, convert it to a string. Note: // typeof null does not produce 'null'. The case is included here in // the remote chance that this gets fixed someday. return String(value); // If the type is 'object', we might be dealing with an object or an array or // null. case 'object': // Due to a specification blunder in ECMAScript, typeof null is 'object', // so watch out for that case. if (!value) { return 'null'; } // Make an array to hold the partial results of stringifying this object value. gap += indent; partial = []; // Is the value an array? if (Object.prototype.toString.apply(value) === '[object Array]') { // The value is an array. Stringify every element. Use null as a placeholder // for non-JSON values. length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || 'null'; } // Join all of the elements together, separated with commas, and wrap them in // brackets. v = partial.length === 0 ? '[]' : gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']'; gap = mind; return v; } // If the replacer is an array, use it to select the members to be stringified. if (rep && typeof rep === 'object') { length = rep.length; for (i = 0; i < length; i += 1) { if (typeof rep[i] === 'string') { k = rep[i]; v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } } } } else { // Otherwise, iterate through all of the keys in the object. for (k in value) { if (Object.prototype.hasOwnProperty.call(value, k)) { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } } } } // Join all of the member texts together, separated with commas, // and wrap them in braces. v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}'; gap = mind; return v; } } // If the JSON object does not yet have a stringify method, give it one. if (typeof JSON.stringify !== 'function') { JSON.stringify = function (value, replacer, space) { // The stringify method takes a value and an optional replacer, and an optional // space parameter, and returns a JSON text. The replacer can be a function // that can replace values, or an array of strings that will select the keys. // A default replacer method can be provided. Use of the space parameter can // produce text that is more easily readable. var i; gap = ''; indent = ''; // If the space parameter is a number, make an indent string containing that // many spaces. if (typeof space === 'number') { for (i = 0; i < space; i += 1) { indent += ' '; } // If the space parameter is a string, it will be used as the indent string. } else if (typeof space === 'string') { indent = space; } // If there is a replacer, it must be a function or an array. // Otherwise, throw an error. rep = replacer; if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { throw new Error('JSON.stringify'); } // Make a fake root object containing our value under the key of ''. // Return the result of stringifying the value. return str('', { '': value }); }; } // If the JSON object does not yet have a parse method, give it one. if (typeof JSON.parse !== 'function') { JSON.parse = function (text, reviver) { // The parse method takes a text and an optional reviver function, and returns // a JavaScript value if the text is a valid JSON text. var j; function walk(holder, key) { // The walk method is used to recursively walk the resulting structure so // that modifications can be made. var k, v, value = holder[key]; if (value && typeof value === 'object') { for (k in value) { if (Object.prototype.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } } } } return reviver.call(holder, key, value); } // Parsing happens in four stages. In the first stage, we replace certain // Unicode characters with escape sequences. JavaScript handles many characters // incorrectly, either silently deleting them, or treating them as line endings. text = String(text); cx.lastIndex = 0; if (cx.test(text)) { text = text.replace(cx, function (a) { return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } // In the second stage, we run the text against regular expressions that look // for non-JSON patterns. We are especially concerned with '()' and 'new' // because they can cause invocation, and '=' because it can cause mutation. // But just to be safe, we want to reject all unexpected forms. // We split the second stage into 4 regexp operations in order to work around // crippling inefficiencies in IE's and Safari's regexp engines. First we // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we // replace all simple value tokens with ']' characters. Third, we delete all // open brackets that follow a colon or comma or that begin the text. Finally, // we look to see that the remaining characters are only whitespace or ']' or // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. if (/^[\],:{}\s]*$/ .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { // In the third stage we use the eval function to compile the text into a // JavaScript structure. The '{' operator is subject to a syntactic ambiguity // in JavaScript: it can begin a block or an object literal. We wrap the text // in parens to eliminate the ambiguity. j = eval('(' + text + ')'); // In the optional fourth stage, we recursively walk the new structure, passing // each name/value pair to a reviver function for possible transformation. return typeof reviver === 'function' ? walk({ '': j }, '') : j; } // If the text is not JSON parseable, then a SyntaxError is thrown. throw new SyntaxError('JSON.parse'); }; } } ());; /* Comment Generated by Combres - Resource '~/Resources/Scripts/venus.common.debug.js' (Mode: Static) */ if (typeof ($.venus) == 'undefined') { $.venus = {}; } (function ($) { $.venus.query = { keys: { brand: 'brand', type: 'type', search: 'search', origin: 'origin', destination: 'destination', paging: 'paging', start: 'start', end: 'end', mode: 'mode', data: 'data', plus: 'plus', did: 'did' } }; $.venus.variable = { queryString: null }; $.venus.ajax = { getSync: function (params) { $.ajax({ url: params.path, type: 'get', async: false, success: function (data) { params.after(data); } }); } }; $.venus.events = { _events: [], register: function (event) { this._events.push(event); }, notify: function (event, params) { $.each(this._events, function (index, callee) { if (callee.name == event) { callee.listen(event, params); } }); } }; $.venus.breadcrumb = { loader: function () { $('.nb-link-text').live({ click: function (sender) { $.venus.common.wait({ type: 1, sender: $(this).parents('.nb-item') }); //position is not working in IE8, no need for css manipulation for ie8 if ($('#inline-loader').position() != null) { var left = ($('#inline-loader').position().left + $(this).parents('.nb-item').width()) - 14; $('#inline-loader').css('left', left); } } }); } }; $.venus.mask = { id: '.mask-container', _mask: '
    ', insert: function (callback) { var me = $.venus.mask; var mask = me._mask; $('body').append(mask); if (typeof (callback) === 'function') { callback(); } }, appendMask: function () { var me = $.venus.mask; $(me.id).append('
    '); }, remove: function () { var me = $.venus.mask; $(me.id).remove(); } /* _id: '.deals-layers-mask', _mask: '
     
    ', show: function (callback) { var me = $.venus.mask; var mask = me._mask; if ($(me._id).length > 0) { // Do nothing proceed with the show up. } else { $('body').append(mask); } var maskHeight = $(document).height(); $(me._id).css({ 'height': maskHeight }); $(me._id).fadeTo(200, 0.65, function () { // Execute the call back from the caller callback(); }); }, hide: function (callback) { var me = $.venus.mask; $(me._id).fadeOut("slow", function () { callback(); }); } */ }; $.venus.animation = { check: function () { var checkCanvas = document.createElement('canvas'); if (checkCanvas != null) { if (typeof (checkCanvas.getContext) == 'undefined') { return false; } return (checkCanvas.getContext); } else { return false; } }, loader: function (canvas) { // instantiate new animation object var anim = new Animation2(canvas); var context = anim.getContext('2d'); var canvas = anim.getCanvas(); var start = .08; var backward = .0030, forward = .01; var speedFast = false; anim.setStage(function () { // clear this.clear(); //draw context.beginPath(); context.save(); context.translate(26 / 2, 26 / 2); context.scale(start, start); context.arc(0, 0, 55, 0, 2 * Math.PI, false); context.restore(); context.shadowColor = '#828081'; context.shadowBlur = 5; context.shadowOffsetX = .85; context.shadowOffsetY = .85; context.lineWidth = 4; context.strokeStyle = "#04A6E9"; context.stroke(); context.fillStyle = "#FF7E0C"; context.fill(); if (start >= 0.18) { speedFast = true; } if (start <= 0.08) { speedFast = false; } if (speedFast) { start -= backward; } else { start += forward; } }); anim.start(); }, showText: function (canvas, text) { var c6 = document.getElementById("vl-line-0"); var c6_context = c6.getContext("2d"); c6_context.fillStyle = '#676767'; c6_context.font = '12px DaxRegular'; c6_context.textBaseline = 'bottom'; c6_context.fillText(text, 130, 12); } }; $.venus.pageLoader = { _mask: '.venus-loader-mask', _loader: '.venus-loader', show: function (town, hotel, duration, callback, type) { var me = $.venus.pageLoader; var mask = me._mask; var loader = me._loader; if (type != 4) { $(loader).addClass('accom'); $(loader + ' .vl-line-1').remove(); $(loader + ' .vl-line-2').remove(); } else { $(loader + ' .loader-text').text('Exclusive Package Discounts....'); $(loader + ' .vl-line-1').html('' + town + '' + duration); if (hotel != null) { if (hotel.length > 0) { $(loader + ' .vl-line-2').text(hotel.toLowerCase()); } else { $(loader + ' .vl-line-2').remove(); } } else { $(loader + ' .vl-line-2').remove(); } } $(loader).css('top', ($(window).height() / 2) - $(loader).height() / 2 + 'px'); $(loader).css('left', ($('body').width() / 2) - $(loader).width() / 2 + 'px'); var maskHeight = $(document).height(); $(mask).css({ 'height': maskHeight }); $(mask).fadeIn('slow'); $(loader).fadeIn('slow'); if ($.venus.animation.check()) { $.venus.animation.loader('vl-loader-graphic'); } else { $('#vl-loader-graphic').remove(); $('.vl-loader-text').prepend(''); } callback(); } }; $.venus.alerts = { vars: { // html: '
    #ICON#
    #MSG#
    ' html: '

    !

    ', htmlCalendar: '

    !

    ', htmlInfo: '' }, eventReg: function () { $('.ok').live({ click: function () { $(this).parents('.venus-alert-info').remove(); } }); }, showInfo: function (sender, pos, msg, showButton, fadeOut) { this.removeInfo(sender); var alertItem = $($.venus.alerts.vars.htmlInfo); $(sender).append(alertItem); if (pos != null) alertItem.css({ 'top': pos.top - 57, 'left': pos.left + 178 }); if (typeof (showButton) != 'undefined') $('.ok').hide() alertItem.fadeIn('slow'); $('.confirmation-text', sender).text(msg); if (typeof (fadeOut) != 'undefined') { setTimeout(function () { alertItem.fadeOut('slow'); }, 2500); } }, removeInfo: function (sender) { var alertBox = $('.venus-alert-info', sender); alertBox.remove(); }, show: function (sender, pos, msg) { var me = this; var alertBox = $('.venus-alert-box', sender); if (alertBox.length == 0) { var alertItem = $($.venus.alerts.vars.html).fadeIn('slow'); $('.sd-data-margin', sender).append(alertItem); alertItem.css({ 'top': pos.top - 41, 'left': pos.left + 2 }); $('.va-b-message .not-selected', sender).text('Not Selected.'); $('.va-b-message .msg-text', sender).text(msg); } var container = null; }, showCalendar: function (pos, msg) { var alertItem = $($.venus.alerts.vars.htmlCalendar).fadeIn('slow'); $('.s-when-dates').append(alertItem); $('.venus-alert-box-calendar').css({ 'top': pos.top - 22, 'left': pos.left + 230 }); $('.vac-b-message .not-selected').text('Select Dates.'); $('.vac-b-message .msg-text').text(msg); }, removeAlert: function (sender) { var alertBox = $('.venus-alert-box', sender); if (alertBox.length > 0) { alertBox.remove(); } }, removeCalendarAlert: function () { $('.venus-alert-box-calendar').remove(); } }; $.venus.track = { limit: 201, getPageCategory: function () { var eventCategory = 'Static'; if (window.location.pathname.toLowerCase().indexOf('deals/listing') >= 0) { eventCategory = 'Listing'; } if (window.location.pathname.toLowerCase().indexOf('deals/booking') >= 0) { eventCategory = 'Booking'; } if (window.location.pathname.toLowerCase().indexOf('deals/finalise') >= 0) { eventCategory = 'Finalise'; } if (window.location.pathname.toLowerCase().indexOf('deals/confirmation') >= 0) { eventCategory = 'Confirmation'; } if (window.location.pathname.toLowerCase().indexOf('busy/error') >= 0) { eventCategory = 'Error'; } return eventCategory; }, enabled: function () { var enabled = $('#vtt-state').val(); if (enabled != null) { if (enabled.toLowerCase() == 'true') { return true; } } return false; }, getRedirectUrl: function (url) { //var me = this; //if (me.enabled()) { // return KalhavenGroup.Tracking.RedirectUserURL(url); //} else { // return url; //} return url; }, redirect: function (sender, url) { var me = this; if (me.enabled()) { // KalhavenGroup.Tracking.RedirectUser(url); window.location.href = url; sender.preventDefault(); } }, event: function (sender, callback) { var me = this; var category = $(sender).attr('data-eventcategory'); var action = $(sender).attr('data-eventaction'); var label = $(sender).attr('data-eventlabel'); me.eventLabel(category, action, label, callback); }, eventLabelAsync: function (category, action, label) { var me = this; if (me.enabled()) { var count = $.venus.session.updateValue({ type: 1 }); if (count <= me.limit) { ga('send', 'event', category, action, label); } } }, eventLabel: function (category, action, label, callback) { var me = this; if (me.enabled()) { var count = $.venus.session.updateValue({ type: 1 }); if (count <= me.limit) { ga('send', 'event', category, action, label); setTimeout(function () { if (typeof (callback) != 'undefined') { callback(); } }, 500); } else { if (typeof (callback) != 'undefined') { callback(); } } } else { if (typeof (callback) != 'undefined') { callback(); } } }, link: function (sender, url) { var me = this; if (me.enabled()) { var count = $.venus.session.updateValue({ type: 1 }); if (count <= me.limit) { var adw = $('#vtt-adw-link').attr('href'); ga('send', 'pageView', url); $.get(adw, function (data) { $(sender).append(data); }); } } } }; $.venus.common = { getFareRules: function (elem, elemContainer) { if (typeof (elem.attr('data-fare-url')) != 'undefined') { $.ajax({ type: 'GET', url: elem.attr('data-fare-url'), success: function (data) { setTimeout(function () { elemContainer.find('.fic-rule').empty(); elemContainer.find('.fic-rule').append(data); }, 600) }, beforeSend: function (jqXHR, settings) { elemContainer.find('.fic-rule').empty(); elemContainer.find('.fic-rule').append('

    Loading please wait...

    '); } }); } }, keys: { watermark: '.venus-watermark', watermarkClass: 'venus-watermark', closeSmall: '.close-image-small', closeMedium: '.close-image-medium', closeLarge: '.close-image-large' }, bookmark: function () { $('#bookmark-venus').bind({ click: function (sender) { sender.preventDefault(); $.browser.chrome = $.browser.webkit && !!window.chrome; var bookmarkUrl = this.href; var bookmarkTitle = document.title; if (window.sidebar) { // For Mozilla Firefox Bookmark alert('Your browser does not support this bookmark action'); return false; } else if (window.external && !$.browser.chrome) { // For IE Favorite // note: window.external.AddFavorite is not a function in Firefox window.external.AddFavorite(bookmarkUrl, bookmarkTitle); } else if (window.opera) { // For Opera Browsers $(this).attr("href", bookmarkUrl); $(this).attr("title", bookmarkTitle); $(this).attr("rel", "sidebar"); } else { // Not Supported alert('Your browser does not support this bookmark action'); return false; } } }); }, events: { proceed: 'proceed', cufon: 'cufon', content: 'content', crossc: 'cross-content' }, execute: function (params) { params.after(); }, nowait: function () { if (!$.venus.animation.check()) { $('.graphic-loader').remove(); } else { $('#inline-loader').remove(); } }, subtractDates: function (start, end) { var startDate = start.setMinutes(start.getMinutes() - start.getTimezoneOffset()); var endDate = end.setMinutes(start.getMinutes() - end.getTimezoneOffset()); var millisecondsPerDay = 24 * 60 * 60 * 1000; return (endDate - startDate) / millisecondsPerDay; }, selectRange: function (input, selectionStart, selectionEnd) { if (input.setSelectionRange) { input.focus(); input.setSelectionRange(selectionStart, selectionEnd); } else if (input.createTextRange) { var range = input.createTextRange(); range.collapse(true); range.moveEnd('character', selectionEnd); range.moveStart('character', selectionStart); range.select(); } }, setCaret: function (input, pos) { $.venus.common.selectRange(input, pos, pos); }, popupWindowCenter: function (URL, title, w, h) { var left = (screen.width / 2) - (w / 2); var top = (screen.height / 2) - (h / 2); var newWin = window.open(URL, title, 'toolbar=no, location=no,directories=no, status=no, menubar=no, scrollbars=no, resizable=no,copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); }, wait: function (params) { // Loader shows up when call. // This params should contain type, and supporting values for each param. // eg: type 1 is float, then it needs to have the top and left coordinates to show. // eg: type 2 is inline, then it needs to have the loading... text with it. // eg: type 3 is page, then it needs to have the whole page block and show the graphic with loading... text with it. switch (params.type) { case 1: if (!$.venus.animation.check()) { var graphic = '
    '; $('body').append(graphic); var pos = $(params.sender).offset(); $('.graphic-loader').css('top', pos.top + 'px'); $('.graphic-loader').css('left', pos.left + 'px'); } else { $('#inline-loader').remove(); $('body').append(''); var pos = $(params.sender).offset(); $('#inline-loader').css('top', pos.top + 'px'); $('#inline-loader').css('left', pos.left + 'px'); $.venus.animation.loader("inline-loader"); } break; case 2: // inline needs to have the container simulation inside each layer, paging, loading the partial. break; case 3: // page view needs to identity algo behind show up // the whole page before loading the whole page and resources. break; default: throw "Loader type param is not supported."; } }, addLoader: function (params) { var elem = typeof (params.sender) == 'object' ? params.sender : $(params.sender); if ($.venus.animation.check()) { var id = 'inline-loader-' + new Date().getTime(); $('body').append(''); $('#' + id).css({ 'left': elem.offset().left + 'px', 'top': elem.offset().top + 'px', 'position': 'absolute', 'z-index': '1' }); elem.attr('loader-id', id); $.venus.animation.loader(id); } else { var graphic = '
    '; elem.prepend(graphic); } }, removeLoader: function (params) { var elem = typeof (params.sender) == 'object' ? params.sender : $(params.sender); elem.remove(); }, __initialise: function () { var me = this; $.venus.events.register({ listen: me.cufon, name: me.events.cufon }); $.venus.events.register({ listen: me.crossc, name: me.events.crossc }); $.venus.events.register({ listen: me.content, name: me.events.content }); $.venus.events.register({ listen: me.proceed, name: me.events.proceed }); me.watermark(); me.screenViewPort(); me.bookmark(); $.venus.alerts.eventReg(); }, screenViewPort: function () { // To support the over flow background of the footer, this adjustment is needed. // Browser view port is less than 1024 and uses the 1024px in rendering. // So to make sure everything is shown in the view port. // This script will force to have the fixed width. // Initial load adjustments. var width = $(window).width() if (width < 1024) { width = 1024; } $('.deals-page-layout .dpl-overflow').css('width', width + 'px'); $('.finalise-page-layout .fpl-overflow').css('width', width + 'px'); $('.thank-you-page-layout .typ-overflow').css('width', width + 'px'); $('.main-layout .ml-overflow').css('width', width + 'px'); // Resize event adjustments. $(window).resize(function (sender) { var width = $(window).width() if (width < 1024) { width = 1024; } $('.deals-page-layout .dpl-overflow').css('width', width + 'px'); $('.finalise-page-layout .fpl-overflow').css('width', width + 'px'); $('.thank-you-page-layout .typ-overflow').css('width', width + 'px'); $('.main-layout .ml-overflow').css('width', width + 'px'); }); }, watermark: function () { var me = this; $(me.keys.watermark).each(function (index, value) { $(value).attr('data-watermark', $(value).val()); }); $(me.keys.watermark).bind({ focus: function (sender) { var attr = $(sender.target).attr('data-watermark'); if (attr.toLowerCase() == sender.target.value.toLowerCase()) { $(sender.target).removeClass(me.keys.watermarkClass); sender.target.value = ''; } }, focusout: function (sender) { var attr = $(sender.target).attr('data-watermark'); if (sender.target.value.length <= 0) { $(sender.target).addClass(me.keys.watermarkClass); sender.target.value = attr; } else { if (attr.toLowerCase() == sender.target.value.toLowerCase()) { $(sender.target).addClass(me.keys.watermarkClass); sender.target.value = attr; } } } }); }, proceed: function (event, params) { if (params.full) { $.venus.common.redirectFull(params.url); } else { $.venus.common.redirectQs(params.url); } }, content: function (event, params) { $.get(params.link, function (data) { //object: assigned a valid jquery selector, string: assigned a class name var id = (typeof (params.id) == 'object') ? params.id : $(params.id); if (params.replace) { id.replaceWith(data); } else { id.html(data); } if (typeof (params.after) != 'undefined') { params.after(); } }); }, crossCall: function (params) { $.ajax({ url: params.link, dataType: 'json', type: 'POST', success: function (data) { if (typeof (params.after) != 'undefined') { params.after(data); } } }); }, crossc: function (event, params) { $.ajax({ url: params.link, dataType: 'json', type: 'POST', success: function (data) { //object: assigned a valid jquery selector, string: assigned a class name var id = (typeof (params.id) == 'object') ? params.id : $(params.id); if (params.replace) { id.replaceWith(data); } else { id.html(data); } if (typeof (params.after) != 'undefined') { params.after(); } } }); }, scrollDown: function (offset, speed) { $('html,body').animate({ scrollTop: offset }, speed); }, cufon: function (event, params) { }, datePicker: function (id, beforeShow, beforeShowDay, onSelect, onClose) { var date = new Date(); var y = date.getFullYear(); var m = date.getMonth(); var d = date.getDate(); $(id).datepicker({ dateFormat: "D d M y", minDate: new Date(y, m, d), maxDate: new Date(y, m + 12, d), changeMonth: false, numberOfMonths: 3, changeYear: false, createButton: false, beforeShow: beforeShow, beforeShowDay: beforeShowDay, onSelect: onSelect, onClose: onClose }); }, appendQs: function (value) { var url = location.href; var url_parts = url.split('?'); var main_url = url_parts[0]; return main_url + '?' + value; }, getQs: function (key) { var query = window.location.search.substring(1); var vars = query.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); if (pair[0] == key) { return pair[1]; } } return null; }, getFullQs: function (key) { var query = window.location.search.substring(1); var vars = query.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); if (pair[0] == key) { return pair[0] + '=' + pair[1]; } } return null; }, dateEqual: function (start, end) { if (start >= end) return true; else return false; }, updateQs: function (key, value, query) { var vars = query.split('&'); var result = ''; var found = false; for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); if (pair[0] == key) { found = true; pair[1] = value; } result += pair[0] + '=' + pair[1] + ((i == vars.length - 1) ? '' : '&'); } if (found) { return result; } else { return (result.length <= 0 ? '' : result + '&') + key + '=' + value; } }, // Replace query values and append all the query string values. overrideQs: function (key, value) { var query = window.location.search.substring(1); return this.updateQs(key, value, query); }, redirectQs: function (qs) { var url = window.location.pathname + '?' + qs; window.location = url; }, redirectFull: function (url) { window.location = url; }, isiPhone: function () { return ( //Detect iPhone //var isiPad = navigator.userAgent.match(/iPad/i) != null; (navigator.platform.indexOf("iPhone") != -1) || //Detect iPod (navigator.platform.indexOf("iPad") != -1) ); } }; })(jQuery); $(document).ready(function () { $.venus.common.__initialise(); if ($('.word-balloon').length > 0) { $('.word-balloon').rotaterator({ fadeSpeed: 500, pauseSpeed: 3000 }); } }); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/plugin.searchBox.debug.js' (Mode: Static) */ (function ($) { // Object representation and defaults. function searchBox(orientation) { var $orientation = 'port'; if (typeof value != 'undefined') { $orientation = orientation; } this._defaults = { mode: 1, type: 0, brand: 'dah', orientation: $orientation, origin: 'perth', destination: 'melbourne', active: false, hold: false, change: false, isOrigin: false, searchDownId: null }; } // Functions for the plugins. $.extend(searchBox.prototype, { __keys: { whereLink: ' .content-where-link ', whenLink: ' .content-when-link', whoLink: ' .content-who-link', originText: ' .s-where-origin .search-down .sd-data-text ', destinationText: ' .s-where-destination .search-down .sd-data-text ', originDisplay: ' .s-where-origin .search-down .sd-input-display ', destinationDisplay: ' .s-where-destination .search-down .sd-input-display ', where: ' .search-where ', searchDown: ' .search-down', when: ' .search-when ', who: ' .search-who ', datePicker: ' .when-date-picker', header: ' .qs-b-margin .qs-b-header', calendarMonth: ' .ui-datepicker-month', calendarYear: ' .ui-datepicker-year', pkg: '.sp-package', packageCheck: '.sp-checkbox', dateOption: '.s-when-date-options', flexibleDate: '.s-when-date-options-checkbox', proceedLink: ' .proceed-button-link' }, __events: { cufon: $.venus.common.events.cufon, content: $.venus.common.events.content, proceed: $.venus.common.events.proceed, crossc: $.venus.common.events.crossc }, __vars: { url: { where: null, when: null, who: null, whatwherewhen: null }, partial: { event: null }, change: false, errorData: null, matchData: null, logMatch: false, titleData: null, writeData: null, isCheckOutDateSelected: false }, __initialise: function (name, target, settings) { var me = this; // Force id setter. target.id = name + (++this.uuid); // Get the default settings from the quick search attr of the html tags. // Extract and override accordingly. // $(target).attr('quick-search'); // 1. Append the settings found on the caller // 2. Override then implement // 3. If mode = 0 , then call partial first to load on the container. // 4. Then proceed with the rest of it. var attr = $(target).attr('quick-search'); if (attr != null) { if (attr.length > 0) { var updates = attr.split(':'); for (var i = 0; i < updates.length; i++) { switch (i) { case 0: this._defaults.mode = updates[i]; break; case 1: this._defaults.brand = updates[i]; break; case 2: this._defaults.type = updates[i]; break; case 3: this._defaults.origin = updates[i]; break; case 4: this._defaults.destination = updates[i]; break; } } } } var inst = this.__newPlugin($(target)); inst.settings = $.extend({}, settings, this._defaults, settings); this.__getSearch(inst, function () { me.__eventsReg(inst); me.__cufon(inst); me.__renderQuickSearch(inst); me.__initSetCheckBox(inst); me.__dealsTypeState(inst); if (window.location.pathname.toLowerCase().indexOf('deals/confirmation') < 0) { setTimeout(function () { me.__trackSearch(inst); }, 1500); } }); }, __updateState: function (inst, add) { var me = this; if (inst.settings.active) { $(inst.id).removeClass('quick-search-box'); $(inst.id).addClass('quick-search-box-hover'); $.venus.events.notify(me.__events.cufon, { name: 'widget-heading-text', id: inst.id + me.__keys.header }); if (add) { $(inst.id).addClass('active'); } } else { if (!inst.settings.hold) { $(inst.id).removeClass('quick-search-box-hover'); $(inst.id).addClass('quick-search-box'); $.venus.events.notify(me.__events.cufon, { name: 'widget-heading-text', id: inst.id + me.__keys.header }); } } }, __dealsTypeState: function (inst) { var escapedColon = "%3A"; var search = decodeURI($.venus.common.getQs('search')); var value = search != 'null' ? search.substr(0, 1) : $('#What_CurrentDeals').attr("value") == 'FlightAccomodation' ? 4 : 0; var roomQS = (search.split(';')[search.split(';').length - 1]); var roomCount = 1; if (roomQS.indexOf(escapedColon) != -1) { roomCount = roomQS.split(escapedColon).length; } else { roomCount = roomQS.split(':').length; } switch (value * 1) { case 0: $(inst.id + ' input[id="Accommodation"]').prop('checked', true); $(inst.id + ' select[name="RoomCount"]').val(roomCount) break; case 4: $(inst.id + ' input[id="save-package"]').prop('checked', true); $(inst.id + ' select[name="RoomCount"]').val(roomCount) break; default: $(inst.id + ' input[id="Accommodation"]').prop('checked', true); $(inst.id + ' select[name="RoomCount"]').val(roomCount) break; } }, // quick search box initialization __initSetCheckBox: function (inst) { var me = this; $(me.__keys.pkg, inst.id).children('input[type=checkbox]').each(function () { if ($(this).is(':checked')) { var id = $(this).attr('id'); $(this).siblings(me.__keys.packageCheck).addClass("tick-accom"); $("label[for='" + this.id + "']", inst.id).addClass("ticked"); } $(this).hide(); }); $(me.__keys.dateOption, inst.id).children('input[type=checkbox]').each(function () { if ($(this).is(':checked')) { $(this).siblings(me.__keys.flexibleDate).addClass("tick-accom"); } }); }, __renderQuickSearch: function (inst) { var me = this; if ($(inst.id).hasClass('active')) { inst.settings.active = true; inst.settings.change = true; me.__updateState(inst, true); } }, __getSearch: function (inst, start) { var me = this; // mode = 0, is outside venus call. if (inst.settings.mode * 1 == 0) { // Set all the variables here to avoid calling from time to time. me.__vars.url.where = $.venus.url.where + '?' + $.venus.query.keys.brand + '=' + inst.settings.brand; me.__vars.url.when = $.venus.url.when + '?' + $.venus.query.keys.brand + '=' + inst.settings.brand; me.__vars.url.who = $.venus.url.who + '?' + $.venus.query.keys.brand + '=' + inst.settings.brand; me.__vars.partial.event = me.__events.crossc; $.venus.events.notify(me.__events.crossc, { id: inst.id, replace: true, link: $.venus.url.search + '?id=' + inst.id.replace('#', '') + '&brand=dah&mode=0&origin=per&destination=mel', after: function () { // TEMP: for now. $(inst.id + ' .search-who').css('display', 'none'); $(inst.id + ' .search-when .s-when-content .s-when-date-options').css('display', 'none'); // Revert back to default / current. legacy request. $(inst.id + me.__keys.datePicker).val(new Date().toString('ddd dd MMM yy')); start(); } }); } else { me.__vars.url.where = $(inst.id + me.__keys.whereLink).attr('href'); me.__vars.url.when = $(inst.id + me.__keys.whenLink).attr('href'); me.__vars.url.who = $(inst.id + me.__keys.whoLink).attr('href'); me.__vars.partial.event = me.__events.crossc; start(); } }, __cufon: function (inst) { }, __calendarCufon: function (inst) { var me = this; var temp = $(inst.id + ' .s-when-dates').attr('data-start-date'); $(inst.id + ' #StartDate').val(temp); temp = $(inst.id + ' .s-when-dates').attr('data-end-date'); $(inst.id + ' #EndDate').val(temp); $.venus.common.datePicker(inst.id + me.__keys.datePicker, function (date, dp) { inst.settings.hold = true; if ($('.ab-test').length > 0) { dp.dpDiv.addClass('quick-search-box-calendar').css({ marginLeft: (-date.offsetWidth) - 180 + 'px' }); } else { dp.dpDiv.addClass('quick-search-box-calendar'); } }, function (date) { var date1 = $('#StartDate').datepicker('getDate'); var date2 = $('#EndDate').datepicker('getDate'); return [true, (me.__vars.isCheckOutDateSelected) ? date1 && ((date.getTime() == date1.getTime()) || (date2 && date >= date1 && date <= date2)) ? 'day-highlight' : '' : '']; }, function (date, dp) { inst.settings.change = true; inst.settings.active = true; me.__updateState(inst, true); var checkInDay = $(inst.id + ' #StartDate').datepicker("getDate").toString("yyyy-MM-dd"); var checkOutDay = $(inst.id + ' #EndDate').datepicker("getDate").toString("yyyy-MM-dd"); if (dp.id == 'StartDate') { if (checkInDay >= checkOutDay) { $(inst.id + ' #EndDate').datepicker('setDate', $(inst.id + ' #StartDate').datepicker('getDate').addDays(1)); } setTimeout(function () { $(inst.id + ' #EndDate').datepicker('show') }, 50); } else { if (checkOutDay < checkInDay) { var dateYesterday = Date.now().addDays(-1).toString("yyyy-MM-dd"); if (checkOutDay == dateYesterday) { $(inst.id + ' #StartDate').datepicker('setDate', Date.now().addDays(-1)); } else { $(inst.id + ' #StartDate').datepicker('setDate', $(inst.id + ' #EndDate').datepicker('getDate').addDays(-1)); } } else { me.__vars.isCheckOutDateSelected = true; } } $.venus.alerts.removeCalendarAlert(); }, function (date, dp) { if (!inst.settings.active) { inst.settings.hold = false; me.__updateState(inst, false); } }); $(inst.id + me.__keys.datePicker).focus(function () { if ($('.ab-test').length > 0) { $(this).addClass('date-picker-selected'); } $.venus.events.notify(me.__events.cufon, { name: 'calendar-heading-text', id: me.__keys.calendarMonth }); $.venus.events.notify(me.__events.cufon, { name: 'calendar-heading-text', id: me.__keys.calendarYear }); }); $(inst.id + me.__keys.datePicker).blur(function () { $(this).removeClass('date-picker-selected'); }); }, //region: warning events method __warningAlert: function (inst, sender, dealType) { var me = this; var inputElem = $('.sd-data-text', sender); if (inputElem.hasClass('watermark') || inputElem.val() == '') { inputElem.removeClass('watermark'); inputElem.val(inputElem[0].defaultValue); $.venus.alerts.removeAlert(sender); } else { var elemPos = $(sender).position(); var alertText = ''; if (inputElem[0].defaultValue != inputElem.val()) { //check input value to prevent showing of warning message even input elem has the correct selected town if (inst.settings.isOrigin) { //check if input element clicked is origin section var alertText = 'Please select your location'; } else { var alertText = 'Please select your destination'; } switch (dealType) { //0: accomodation //1: flight package case 0: $.venus.alerts.show(sender, elemPos, alertText); break; case 1: $.venus.alerts.show(sender, elemPos, alertText); break; } } } }, __trackSearch: function (inst) { $.venus.common.crossCall({ link: $('.path-tracks').attr('href'), after: function (data) { if (typeof (data) != 'undefined') { if (data != null) { if (data.length > 0) { for (var i = 0; i < data.length; i++) { $.venus.track.eventLabelAsync( data[i].EventCategory, data[i].EventAction, data[i].EventLabel ); } } } } } }); }, __getSearchDownId: function (inst, elem) { var sid = '#searchDown-'; if (inst.settings.searchDownId == null) { inst.settings.searchDownId = sid + elem.attr('data-warningid'); } else { inst.settings.searchDownId = ''; inst.settings.searchDownId = sid + elem.attr('data-warningid'); } }, //end region: warning events method __eventsReg: function (inst) { var me = this; var query = $.venus.query; me.__calendarCufon(inst); // A/B testing removed events for the rooms, adults, child //if ($('.ab-test').length <= 0) { // me.__roomEvents(inst); //} me.__roomEvents(inst); me.__stateEvents(inst); $(inst.id).on('mouseenter', '.who-tool-tip', function () { var elem = $(this); var pos = elem.position(); var addTop = 0; var addLeft = 99; if ($('.ab-test').length > 0) { addTop = 15; addLeft = 120; if (elem.hasClass('who-tt-infant')) { addLeft = 65; } } else { if (elem.hasClass('who-tt-infant')) { addLeft = 54; } } $('.who-tool-tip-popup', inst.id).show().css({ 'top': (pos.top - 17) + addTop, 'left': pos.left + addLeft }).addClass('who-animate'); }); $(inst.id).on('mouseleave', '.who-tool-tip', function () { $('.who-tool-tip-popup', inst.id).removeClass('who-animate').removeAttr('style'); $('.who-tool-tip-popup', inst.id).hide(); }); $(inst.id + ' input.when-date-picker').live({ focus: function (sender) { $(this).addClass('highlight'); }, focusout: function (sender) { $(this).removeClass('highlight'); } }); // quick search checkboxes toggle $(inst.id + ' ' + me.__keys.packageCheck).bind({ click: function (sender) { var searchType = $(inst.id + ' input[name="what-radio"]:checked').val(); if ($(this).is('.tick-accom') || $(this).is('.tick-package')) { $(this).removeClass('tick-accom').removeClass('tick-package'); $("label[for='" + $(this).next().attr('id') + "']", inst.id).removeClass("ticked").removeClass("ticked2"); } else { if ((searchType * 1) == 4) { $(this).addClass('tick-package'); $("label[for='" + $(this).next().attr('id') + "']", inst.id).addClass("ticked2"); } else { //$('.s-where-destination').hide(); $(this).addClass('tick-accom'); $("label[for='" + $(this).next().attr('id') + "']", inst.id).addClass("ticked"); } } inst.settings.change = true; me.__updateState(inst, true); sender.preventDefault(); } }); // quick search checkboxes hover style for package mode $('.save-package', inst.id).hover(function () { var searchType = $(inst.id + ' input[name="what-radio"]:checked').val(); $('.save-package', inst.id).find('img').each(function () { var nextElementID = $(this).next().attr('id'); if ($(this).is('.tick-accom') || $(this).is('.tick-package')) { if ((searchType * 1) == 4) { $(this).addClass("ticked2"); $("label[for='" + nextElementID + "']", inst.id).addClass("ticked2"); } else { $(this).removeClass("ticked2"); $("label[for='" + nextElementID + "']", inst.id).removeClass("ticked2"); } } }); }, function () { $('.save-package', inst.id).find('img').each(function () { var nextElementID = $(this).next().attr('id'); $(this).removeClass("ticked2"); $("label[for='" + nextElementID + "']", inst.id).removeClass("ticked2"); }); }); // quick search checkboxes style for input box selection $('.qs-b-content input:radio', inst.id).change(function () { var searchType = $(inst.id + ' input[name="what-radio"]:checked').val(); $('.save-package', inst.id).find('img').each(function () { var nextElementID = $(this).next().attr('id'); if ($(this).is('.tick-accom') || $(this).is('.tick-package')) { if ((searchType * 1) == 4) { if ($(this).is('.tick-accom')) $(this).addClass('tick-package').removeClass('tick-accom'); else $(this).addClass('tick-accom').removeClass('tick-package'); $("label[for='" + nextElementID + "']", inst.id).addClass("ticked2"); } else { if ($(this).is('.tick-accom')) $(this).removeClass('tick-accom').addClass("tick-package"); else $(this).removeClass('tick-package').addClass("tick-accom"); $("label[for='" + nextElementID + "']", inst.id).removeClass("ticked2"); } } }); inst.settings.change = true; me.__updateState(inst, true); }); $(inst.id + ' ' + me.__keys.flexibleDate).live({ click: function (sender) { if ($(this).hasClass('ticked')) { $(this).next().attr('checked', false); $(this).removeClass('ticked'); } else { $(this).next().attr('checked', true); $(this).addClass('ticked'); } sender.preventDefault(); } }); //region: warning alert event $(inst.id + me.__keys.originText).die(); $(inst.id + me.__keys.originText).live({ // to get unique searchDownId click: function () { inst.settings.isOrigin = true; me.__getSearchDownId(inst, $(this)); }, focus: function () { me.__vars.change = true; } }); $(inst.id + me.__keys.destinationText).die(); $(inst.id + me.__keys.destinationText).live({ // to get unique searchDownId click: function () { inst.settings.isOrigin = false; me.__getSearchDownId(inst, $(this)); }, focus: function () { me.__vars.change = false; } }); $(inst.id + me.__keys.searchDown).searchDown({ // perform event interaction noMatch: function (data) { // log the data here // when proceed link click then add to GA me.__vars.errorData = data; }, logMatch: function (data) { // log the data that have the match me.__vars.matchData = data; }, getMatch: function (data) { // log that the search match before has been selected. me.__vars.logMatch = true; me.__vars.titleData = data; }, onShow: function () { inst.settings.hold = true; }, onClose: function (selected) { var searchDownId = inst.settings.searchDownId; if (selected) { inst.settings.hold = false; me.__updateState(inst, false); } else { me.__warningAlert(inst, searchDownId, 0); } }, onSelect: function (data) { me.__vars.titleData = data; me.__vars.logMatch = true; inst.settings.change = true; me.__updateState(inst, true); $.venus.alerts.removeAlert(inst.settings.searchDownId); me.__updateSearchDown(inst); }, onWrite: function (data) { me.__vars.writeData = data; } }); //end region: warning alert event $(inst.id + ' input[name="what-radio"]').on({ click: function (sender) { $.venus.track.event($(sender.target)); var origin = -1; var link = me.__vars.url.where; var destination = $(inst.id + me.__keys.destinationText).attr('data-load-id'); if ($(inst.id + me.__keys.originText).length > 0) { origin = $(inst.id + me.__keys.originText).attr('data-load-id'); } var searchType = $(inst.id + ' input[name="what-radio"]:checked').val(); var searchQs = '&' + query.keys.type + '=' + searchType + '&' + query.keys.origin + '=' + origin + '&' + query.keys.destination + '=' + destination; $.venus.common.wait({ type: 1, sender: sender.target }); $.venus.events.notify(me.__vars.partial.event, { id: inst.id + me.__keys.where, link: link + searchQs, replace: true, after: function () { $.venus.common.nowait(); // This code block is related only to Horizontal QS if (searchType == 0) { $(inst.id).removeClass('package').addClass('hotel'); } else { $(inst.id).removeClass('hotel').addClass('package'); } var whenLink = me.__vars.url.when; var start = new Date($(inst.id + ' #StartDate').datepicker("getDate")).toString('yyyy-MM-dd'); var end = new Date($(inst.id + ' #EndDate').datepicker("getDate")).toString('yyyy-MM-dd'); var searchQs = '&' + query.keys.type + '=' + searchType + '&' + query.keys.start + '=' + start + '&' + query.keys.end + '=' + end; $.venus.events.notify(me.__vars.partial.event, { id: inst.id + me.__keys.when, link: whenLink + searchQs, replace: true, after: function () { me.__calendarCufon(inst); $(inst.id + me.__keys.originText).live({ click: function () { inst.settings.destination = false; me.__getSearchDownId(inst, $(this)); } }); $(inst.id + me.__keys.destinationText).live({ click: function () { me.__getSearchDownId(inst, $(this)); } }); $(inst.id + me.__keys.searchDown).searchDown({ noMatch: function (data) { // log the data here // when proceed link click then add to GA me.__vars.errorData = data; }, logMatch: function (data) { // log the data that have the match me.__vars.matchData = data; }, getMatch: function (data) { // log that the search match before has been selected. me.__vars.logMatch = true; me.__vars.titleData = data; }, onShow: function () { inst.settings.hold = true; }, onClose: function (selected) { var searchDownId = inst.settings.searchDownId; if (selected) { inst.settings.hold = false; me.__updateState(inst, false); } else { me.__warningAlert(inst, searchDownId, 1); } }, onSelect: function (data) { me.__vars.titleData = data; me.__vars.logMatch = true; inst.settings.change = true; me.__updateState(inst, true); $.venus.alerts.removeAlert(inst.settings.searchDownId); me.__updateSearchDown(inst); }, onWrite: function (data) { me.__vars.writeData = data; } }); if (inst.settings.mode * 1 == 0) { $(inst.id + ' .search-when .s-when-content .s-when-date-options').css('display', 'none'); } } }); } }); } }); if ($('.qs-noform').length > 0) { $(inst.id + me.__keys.proceedLink).on('click', function (event) { me.__search(event,inst); return false; }); } else { $(document).on('submit', 'form#quicksearch-form', function (event) { me.__search(event, inst); return false; }); } }, __updateSearchDown: function (inst) { var me = this; var query = $.venus.query; var origin = -1; var link = me.__vars.url.where; var destination = $(inst.id + me.__keys.destinationText).attr('data-load-id'); if ($(inst.id + me.__keys.originText).length > 0) { origin = $(inst.id + me.__keys.originText).attr('data-load-id'); } var searchType = $(inst.id + ' input[name="what-radio"]:checked').val(); if (searchType * 1 == 4 && me.__vars.change) { var searchQs = '&' + query.keys.type + '=' + searchType + '&' + query.keys.origin + '=' + origin + '&' + query.keys.destination + '=' + destination; $.venus.events.notify(me.__vars.partial.event, { id: inst.id + me.__keys.where, link: link + searchQs, replace: true, after: function () { $(inst.id + me.__keys.searchDown).searchDown({ noMatch: function (data) { // log the data here // when proceed link click then add to GA me.__vars.errorData = data; }, logMatch: function (data) { // log the data that have the match me.__vars.matchData = data; }, getMatch: function (data) { // log that the search match before has been selected. me.__vars.logMatch = true; me.__vars.titleData = data; }, onShow: function () { inst.settings.hold = true; }, onClose: function (selected) { var searchDownId = inst.settings.searchDownId; if (selected) { inst.settings.hold = false; me.__updateState(inst, false); } else { me.__warningAlert(inst, searchDownId, 1); } }, onSelect: function (data) { me.__vars.titleData = data; me.__vars.logMatch = true; inst.settings.change = true; me.__updateState(inst, true); $.venus.alerts.removeAlert(inst.settings.searchDownId); me.__updateSearchDown(inst); }, onWrite: function (data) { me.__vars.writeData = data; } }); } }); } }, __roomPartial: function (url, inst) { var me = this; $.venus.events.notify(me.__vars.partial.event, { id: inst.id + me.__keys.who, link: url, replace: false, after: function () { $.venus.common.nowait(); me.__roomEvents(inst); inst.settings.change = true; me.__updateState(inst, true); $(inst.id + ' select').fixlist(); } }); }, __stateEvents: function (inst) { var me = this; var timeoutID = null; $(inst.id + ' select').focus(function () { inst.settings.hold = true; }).focusout(function () { if (!inst.settings.active) { inst.settings.hold = false; me.__updateState(inst, false); } }); $(inst.id).hover(function () { inst.settings.active = true; me.__updateState(inst, false); }, function () { if (!inst.settings.change) { inst.settings.active = false; me.__updateState(inst, false); } }); $(inst.id).mousedown(function (sender) { inst.settings.hold = false; inst.settings.active = true; }); }, __roomEvents: function (inst) { var me = this; var query = $.venus.query; $(inst.id + ' select[name="RoomCount"]').on({ change: function (sender) { $.venus.common.wait({ type: 1, sender: $('#' + $(sender.target).attr('fixlistid')) }); var searchType = $(inst.id + ' input[name="what-radio"]:checked').val(); var url = me.__vars.url.who; var roomCount = $(this).val(); var searchQs = ''; for (var i = 1; i <= roomCount; i++) { var adultCount = !($(inst.id + ' select[id=' + 'AdultCount-' + i + ']').val()) ? 2 : $(inst.id + ' select[id=' + 'AdultCount-' + i + ']').val(); var childCount = !($(inst.id + ' select[id=' + 'ChildCount-' + i + ']').val()) ? 0 : $(inst.id + ' select[id=' + 'ChildCount-' + i + ']').val(); var infantCount = !($(inst.id + ' select[id=' + 'InfantCount-' + i + ']').val()) ? 0 : $(inst.id + ' select[id=' + 'InfantCount-' + i + ']').val(); var roomBed = !($("input[name='RoomBed-" + i + "']:checked").val()) ? 0 : $("input[name='RoomBed-" + i + "']:checked").val(); searchQs += '0-' + i + '|'; searchQs += '1-' + adultCount + '|'; searchQs += '2-' + childCount + '|'; searchQs += '3-' + infantCount + '|'; searchQs += i == roomCount ? '4-' + roomBed : '4-' + roomBed + ':'; } url += '?' + query.keys.type + '=' + searchType + '&whoQuery=' + searchQs + '&abtest=1'; me.__roomPartial(url, inst); } }); $(inst.id + ' select[name="RoomAdultCount"]').on({ change: function (sender) { $.venus.common.wait({ type: 1, sender: $('#' + $(sender.target).attr('fixlistid')) }); var id = $(this).attr("id").split('-')[1]; var searchType = $(inst.id + ' input[name="what-radio"]:checked').val(); var url = me.__vars.url.who; var roomCount = $(inst.id + ' select[name="RoomCount"]').val(); var checkMaxCount = parseInt($(inst.id + ' select[id="AdultCount-' + id + '"]').val()) + parseInt($(inst.id + ' select[id="ChildCount-' + id + '"]').val()); var resetRoomBed = false; var who = ''; if (checkMaxCount > 10) { resetRoomBed = true; $(inst.id + ' select[id="AdultCount-' + id + '"]').val() == 0 ? $(inst.id + ' select[id="AdultCount-' + id + '"]').val(2) : $(inst.id + ' select[id="AdultCount-' + id + '"]').val(0); alert('Total number of passengers (Adult + Children) should not exceed 10. \n Contact us for group bookings of more than 10 people.'); } else if (checkMaxCount == 0) { resetRoomBed = true; $(inst.id + ' select[id="AdultCount-' + id + '"]').val() == 0 ? $(inst.id + ' select[id="AdultCount-' + id + '"]').val(2) : $(inst.id + ' select[id="AdultCount-' + id + '"]').val(0); alert('Total number of passengers (Adult + Child) should not be 0.'); } for (var i = 1; i <= roomCount; i++) { var adultCount = !($(inst.id + ' select[id=' + 'AdultCount-' + i + ']').val()) ? 2 : $(inst.id + ' select[id=' + 'AdultCount-' + i + ']').val(); var childCount = !($(inst.id + ' select[id=' + 'ChildCount-' + i + ']').val()) ? 0 : $(inst.id + ' select[id=' + 'ChildCount-' + i + ']').val(); var infantCount = !($(inst.id + ' select[id=' + 'InfantCount-' + i + ']').val()) ? 0 : $(inst.id + ' select[id=' + 'InfantCount-' + i + ']').val(); var roomBed = !($("input[name='RoomBed-" + i + "']:checked").val()) ? 0 : $("input[name='RoomBed-" + i + "']:checked").val(); who += '0-' + i + '|'; who += '1-' + adultCount + '|'; who += '2-' + childCount + '|'; who += '3-' + infantCount + '|'; who += (i == roomCount) ? '4-' + (resetRoomBed = true && i == id ? 0 : roomBed) : '4-' + (resetRoomBed = true && i == id ? 0 : roomBed) + ':'; } url += '?' + query.keys.type + '=' + searchType + '&whoQuery=' + who; me.__roomPartial(url, inst); } }); $(inst.id + ' select[name="RoomChildCount"]').on({ change: function (sender) { $.venus.common.wait({ type: 1, sender: $('#' + $(sender.target).attr('fixlistid')) }); var id = $(this).attr("id").split('-')[1]; var searchType = $(inst.id + ' input[name="what-radio"]:checked').val(); var url = me.__vars.url.who; var roomCount = $(inst.id + ' select[name="RoomCount"]').val(); var checkMaxCount = parseInt($(inst.id + ' select[id="AdultCount-' + id + '"]').val()) + parseInt($(inst.id + ' select[id="ChildCount-' + id + '"]').val()); var resetRoomBed = false; var who = ''; if (checkMaxCount > 10) { resetRoomBed = true; $(inst.id + ' select[id="ChildCount-' + id + '"]').val() == 0 ? $(inst.id + ' select[id="ChildCount-' + id + '"]').val(2) : $(inst.id + ' select[id="ChildCount-' + id + '"]').val(0); alert('Total number of passengers (Adult + Children) should not exceed 10. \n Contact us for group bookings of more than 10 people.'); } else if (checkMaxCount == 0) { resetRoomBed = true; $(inst.id + ' select[id="ChildCount-' + id + '"]').val() == 0 ? $(inst.id + ' select[id="ChildCount-' + id + '"]').val(2) : $(inst.id + ' select[id="ChildCount-' + id + '"]').val(0); alert('Total number of passengers (Adult + Child) should not be 0.'); } for (var i = 1; i <= roomCount; i++) { var adultCount = !($(inst.id + ' select[id=' + 'AdultCount-' + i + ']').val()) ? 2 : $(inst.id + ' select[id=' + 'AdultCount-' + i + ']').val(); var childCount = !($(inst.id + ' select[id=' + 'ChildCount-' + i + ']').val()) ? 0 : $(inst.id + ' select[id=' + 'ChildCount-' + i + ']').val(); var infantCount = !($(inst.id + ' select[id=' + 'InfantCount-' + i + ']').val()) ? 0 : $(inst.id + ' select[id=' + 'InfantCount-' + i + ']').val(); var roomBed = !($("input[name='RoomBed-" + i + "']:checked").val()) ? 0 : $("input[name='RoomBed-" + i + "']:checked").val(); who += '0-' + i + '|'; who += '1-' + adultCount + '|'; who += '2-' + childCount + '|'; who += '3-' + infantCount + '|'; who += (i == roomCount) ? '4-' + (resetRoomBed = true && i == id ? 0 : roomBed) : '4-' + (resetRoomBed = true && i == id ? 0 : roomBed) + ':'; } url += '?' + query.keys.type + '=' + searchType + '&whoQuery=' + who; me.__roomPartial(url, inst); } }); $(inst.id + ' select[name="RoomInfantCount"]').on({ change: function () { } }); }, __search: function (event,inst) { var me = this; var query = $.venus.query; var url = null; var didQs = $.venus.common.getFullQs(query.keys.did); var path = $('.path-listing').attr('href'); var nights = null; var searchType = $(inst.id + ' input[name="what-radio"]:checked').val(); var target = typeof ($('.proceed-button-link', event.target).attr('class')) != 'undefined' ? $('.proceed-button-link', event.target) : event.target; if (searchType * 1 != 4) { $.venus.common.wait({ type: 1, sender: target }); } var searchQs = query.keys.search + '=' + searchType + ';'; //what var selectedDid = $.venus.common.getQs(query.keys.did); var updatedDid = null; var townText = ''; var hotelText = ''; switch (searchType * 1) { case 0: case 4: if ($(inst.id + me.__keys.originText).attr('data-townname') == '') { var orig = $(inst.id + me.__keys.originText).parents('.search-down'); $.venus.alerts.show(orig, orig.position(), "Invalid origin") return false; } if ($(inst.id + me.__keys.destinationText).attr('data-townname') == '') { var dest = $(inst.id + me.__keys.destinationText).parents('.search-down'); $.venus.alerts.show(dest, dest.position(), "Invalid destination") return false; } if ($(".venus-alert-box").is(':visible')) { $.venus.common.nowait(); return false; } var checkName = typeof ($(inst.id + me.__keys.destinationDisplay).attr('name')) == 'undefined'; //variables for checking the values of primary town information var isPrimary = $(inst.id + me.__keys.destinationText).attr('data-isPrimary'); var primaryTownName = $(inst.id + me.__keys.destinationText).attr('data-primaryTownName'); if (isPrimary == 0) { if (primaryTownName == null || primaryTownName.length <= 0) { primaryTownName = ((!checkName) ? $(inst.id + me.__keys.destinationText).attr('name') : $(inst.id + me.__keys.destinationText).attr('data-townname')); } townText = $(inst.id + me.__keys.originDisplay).attr('title') + ' to ' + primaryTownName; if ($(inst.id + me.__keys.destinationText).attr('data-hotelname')) { hotelText = $(inst.id + me.__keys.destinationText).attr('data-hotelname'); } else { hotelText = $(inst.id + me.__keys.destinationDisplay + ' .sd-search').text(); } } else { townText = $(inst.id + me.__keys.originDisplay).attr('title') + ' to ' + ((!checkName) ? $(inst.id + me.__keys.destinationText).attr('name') : $(inst.id + me.__keys.destinationText).attr('data-townname')); hotelText = $(inst.id + me.__keys.destinationText).attr('data-hotelname'); } // Variable that holds the current date; used for date comparison var checkInDay = $(inst.id + ' #StartDate').datepicker("getDate"); // Check if Check-in and Check-out dates are not equal and check-in date is on or after today if (!(checkInDay.toString("yyyy-MM-dd") < Date.now().toString("yyyy-MM-dd")) && (!$.venus.common.dateEqual($(inst.id + ' #StartDate').datepicker("getDate"), $(inst.id + ' #EndDate').datepicker("getDate")))) { if (searchType == 0) { searchQs += $(inst.id + me.__keys.destinationText).attr('data-load-id') + '-'; searchQs += !$(inst.id + me.__keys.destinationText).attr('data-hotelid') ? '0' : $(inst.id + me.__keys.destinationText).attr('data-hotelid') + ';'; } else if (searchType == 4) { searchQs += $(inst.id + me.__keys.originText).attr('data-load-id') + '-'; searchQs += $(inst.id + me.__keys.destinationText).attr('data-load-id') + '-'; searchQs += !$(inst.id + me.__keys.destinationText).attr('data-hotelid') ? '0' : $(inst.id + me.__keys.destinationText).attr('data-hotelid') + ';'; } // Update the selected did. updatedDid = !$(inst.id + me.__keys.destinationText).attr('data-hotelid') ? '0' : $(inst.id + me.__keys.destinationText).attr('data-hotelid'); //when searchQs += '3-' + new Date($(inst.id + ' #StartDate').datepicker("getDate")).toString('yyyy-MM-dd') + '|'; searchQs += '4-' + new Date($(inst.id + ' #EndDate').datepicker("getDate")).toString('yyyy-MM-dd') + '|'; searchQs += '7-' + ($(inst.id + ' input:checkbox[name="FlexibleDate"]:checked').val() == "true" ? "1" : "0") + ';'; var dpart = new Date($(inst.id + ' #EndDate').datepicker("getDate")); var retrn = new Date($(inst.id + ' #StartDate').datepicker("getDate")); var diff_date = $.venus.common.subtractDates(dpart, retrn) * -1; var duration = (diff_date == 1) ? ' Flights + 1 Night' : ' Flights + ' + diff_date + ' Nights'; //Update/Search Clicked var eventCategory = 'Quick Search - ' + $.venus.track.getPageCategory(); $(inst.id + ' .proceed-button-link').attr('data-eventcategory', eventCategory); $.venus.track.event($(inst.id + ' .proceed-button-link')); //who var roomCount = $(inst.id + ' select[name="RoomCount"]').val(); for (var i = 1; i <= roomCount; i++) { var adultCount = !($(inst.id + ' select[id=' + 'AdultCount-' + i + ']').val()) ? 2 : $(inst.id + ' select[id=' + 'AdultCount-' + i + ']').val(); var childCount = !($(inst.id + ' select[id=' + 'ChildCount-' + i + ']').val()) ? 0 : $(inst.id + ' select[id=' + 'ChildCount-' + i + ']').val(); var infantCount = !($(inst.id + ' select[id=' + 'InfantCount-' + i + ']').val()) ? 0 : $(inst.id + ' select[id=' + 'InfantCount-' + i + ']').val(); var roomBed = !($("input[name='RoomBed-" + i + "']:checked").val()) ? 0 : $("input[name='RoomBed-" + i + "']:checked").val(); searchQs += '0-' + i + '|'; searchQs += '1-' + adultCount + '|'; searchQs += '2-' + childCount + '|'; searchQs += '3-' + infantCount + '|'; searchQs += i == roomCount ? '4-' + roomBed : '4-' + roomBed + ':'; } } else { //alert((checkInDay.toString("yyyy-MM-dd") < Date.now().toString("yyyy-MM-dd")) ? 'Check-In date must be on or after today.' : 'Please check your Check-Out date.'); var checkOutDay = $(inst.id + ' #EndDate').datepicker("getDate"); var msg = (checkInDay.toString("yyyy-MM-dd") < Date.now().toString("yyyy-MM-dd")) ? 'Check-In date must be on or after today' : ((checkOutDay.toString("yyyy-MM-dd") < checkInDay.toString("yyyy-MM-dd")) ? 'Check-out date error' : 'Check-in and Check-out dates cannot be the same'); $.venus.alerts.showCalendar($('.s-when-dates').position(), msg); $.venus.common.nowait(); return false; } break; case 1: searchQs += $(inst.id + ' #DestinationTown').val() + ';'; searchQs += '0-' + $(inst.id + ' input[name="when-radio"]:checked').val() + '|'; searchQs += '1-' + new Date($(inst.id + ' #PickupDate').datepicker("getDate")).toString('yyyy-MM-dd') + $(inst.id + ' #PickupTime_Value').val() + '|'; searchQs += '2-' + new Date($(inst.id + ' #DropOffDate').datepicker("getDate")).toString('yyyy-MM-dd') + $(inst.id + ' #DropOffTime_Value').val(); break; } var destinationSuburb = $(inst.id + me.__keys.destinationText).attr('data-suburb'); if (typeof (destinationSuburb) != 'undefined') { if (destinationSuburb.length > 0) { searchQs += "&filters=loc:" + destinationSuburb; } } url = searchQs; if (updatedDid * 1 > 0 && didQs != null) { didQs = 'did=' + updatedDid; } if (didQs != null) { url = searchQs + '&' + didQs } var __url = path + '&' + url.toLowerCase(); if (window.location.pathname.toLowerCase().indexOf('index-68.html') < 0) { if (window.location.pathname.toLowerCase().indexOf('index-69.html') < 0) { if (typeof (KalhavenGroup) != 'undefined' && typeof (KalhavenGroup.Tracking) != 'undefined' && typeof (KalhavenGroup.Tracking.RedirectUser) == 'function') { // __url = KalhavenGroup.Tracking.RedirectUserURL(__url); } } } // Check if origin and destination towns are the same if ($(inst.id + me.__keys.originText).attr('data-load-id') == $(inst.id + me.__keys.destinationText).attr('data-load-id')) { $.venus.common.nowait(); alert('Cannot accept same town.'); } else { if (window.location.pathname.toLowerCase().indexOf('busy/error') < 0) { //path = window.location.pathname; } var trackers = function (callback) { //GA Tracker var eventCategory = 'Quick Search - ' + $.venus.track.getPageCategory(); if (me.__vars.writeData != '') { if (me.__vars.logMatch) { $.venus.track.eventLabelAsync(eventCategory, 'Search Value Typed (matched)', me.__vars.titleData); } } callback(); }; if (searchType * 1 == 4) { $.venus.pageLoader.show(townText, hotelText, duration, function () { trackers(function () { $.venus.events.notify(me.__events.proceed, { full: true, url: __url }); if ($.venus.animation.check()) { setTimeout(function () { $.venus.animation.showText('#vl-line-0', 'Almost done, thanks for your patience.'); }, 6000); } else { setTimeout(function () { $('.venus-loader .vl-line-0').text('Almost done, thanks for your patience.'); }, 6000); } }) }, searchType); } else { trackers(function () { $.venus.common.execute({ url: __url + '&loader=yes', after: function (data) { $.venus.events.notify(me.__events.proceed, { full: true, url: __url }); } }); }); } } }, __newPlugin: function (target) { var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); return { id: '#' + id, container: target, data: null }; } }); // Variables and instance. $.searchBox = new searchBox(); $.searchBox.uuid = new Date().getTime(); $.searchBox.version = "1.0.0"; // Plugin call and initialisation. $.fn.searchBox = function (options) { var $caller = $(this); return $caller.each(function () { var calle = this; $.searchBox.__initialise('searchBox-', calle, options); }); return $caller; }; })(jQuery); $(document).ready(function () { $('.quick-search-box, .quick-search-box-hover.active').searchBox(); }); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/plugin.searchDown.debug.js' (Mode: Static) */ (function ($) { // Object representation and defaults. function searchDown() { this._defaults = { mode: 1, onShow: function () { return; }, onClose: function () { return; }, onSelect: function (data) { return; }, noMatch: function (data) { return; }, logMatch: function (data) { return; }, getMatch: function (data) { return; }, onWrite: function (data) { return; } }; } // Functions for the plugins. $.extend(searchDown.prototype, { __vars: { hold: false, clicked: false, data: null, min: 3, timeOut: null, useTimeOut: false, selected: true, onType: false }, __keys: { text: ' .sd-data-text', textDisplay: ' .sd-input-display', content: ' .sd-mode-content ', item: ' .sd-item ', exactMatchItem: ' .sd-item-exact-match', title: ' .sd-title ', see: ' .sd-see-all p ', link: ' .sd-data .sd-data-link ', searchData: ' .sd-data', searchDataHoverClass: ' sd-data-hover', searchOriginClass: '.s-where-origin', searchOriginClassName: 's-where-origin' }, __events: { cufon: $.venus.common.events.cufon, content: $.venus.common.events.content }, __initialise: function (name, target, settings) { if (!target.id) { target.id = name + (++this.uuid); } var inst = this.__newPlugin($(target)); inst.settings = $.extend({}, settings, this._defaults, settings); this.__eventsReg(inst); var me = this; $(inst.id + me.__keys.text).attr('data-warningid', target.id.replace('searchDown-', '')); //add attribute to input element for warning alert used in plugin.searchBox this.__cufon(me); // White background for Filter Search Down var section = $(inst.id + me.__keys.searchData).parents('.search-down').attr('data-section'); if (section == 2) { $(inst.id + me.__keys.searchData).css({ 'background': 'white' }); } }, __eventsReg: function (inst) { var me = this; me.__boxes(inst); me.__items(inst); }, __items: function (inst) { var me = this; $(inst.id + ' .holiday-max-promotion').die(); $(inst.id + ' .holiday-max-promotion').live({ click: function (sender) { /*var k = window.location.toString().indexOf('search='); var l = window.location.toString().split('?')[1].split('&')[0]; alert(l); */ $.venus.common.wait({ type: 1, sender: sender.target }); $.venus.common.redirectFull($(this).attr('data-url')); } }); $(inst.id + me.__keys.item).die(); $(inst.id + me.__keys.item).live({ click: function (sender) { var sdItem = $(this); me.__vars.clicked = true; $(inst.id + me.__keys.content).hide(); var townId = sdItem.attr('data-load-id'); var townIata = sdItem.attr('data-iata'); var townName = sdItem.attr('data-name'); var state = sdItem.attr('data-state'); var suburb = sdItem.attr('data-suburb'); var country = sdItem.attr('data-country'); var hotelid = !sdItem.attr('data-hotelid') ? '' : sdItem.attr('data-hotelid'); var hotelname = !sdItem.attr('data-hotelname') ? '' : sdItem.attr('data-hotelname'); var mode = sdItem.parents('.search-down').attr('data-mode'); var textDisplay = $(inst.id + me.__keys.textDisplay); var sdDataText = $(inst.id + me.__keys.text); // set input textbox attributes sdDataText.attr({ 'data-load-id': sdItem.attr('data-load-id'), 'data-iata': sdItem.attr('data-iata'), 'name': sdItem.attr('data-name'), 'data-suburb': sdItem.attr('data-suburb'), 'data-state': sdItem.attr('data-state'), 'data-country': sdItem.attr('data-country'), 'data-hotelid': !sdItem.attr('data-hotelid') ? '' : sdItem.attr('data-hotelid'), 'data-hotelname': !sdItem.attr('data-hotelname') ? '' : sdItem.attr('data-hotelname'), 'title': sdItem.attr('title'), 'data-isPrimary': sdItem.attr('data-isPrimary'), 'data-primaryTownName': sdItem.attr('data-primaryTownName'), 'data-townname': sdItem.attr('data-townname'), 'data-eventcategory': 'Quick Search - Listing / Booking / Static', 'data-eventaction': 'Search Value Typed (matched)', 'data-eventlabel': sdItem.attr('title'), match: true }); // set display text attributes textDisplay.attr({ 'data-load-id': sdItem.attr('data-load-id'), 'data-iata': sdItem.attr('data-iata'), 'data-name': sdItem.attr('data-name'), 'data-suburb': sdItem.attr('data-suburb'), 'data-state': sdItem.attr('data-state'), 'data-country': sdItem.attr('data-country'), 'data-hotelid': !sdItem.attr('data-hotelid') ? '' : sdItem.attr('data-hotelid'), 'data-hotelname': !sdItem.attr('data-hotelname') ? '' : sdItem.attr('data-hotelname'), 'title': sdItem.attr('title'), 'data-isPrimary': sdItem.attr('data-isPrimary'), 'data-primaryTownName': sdItem.attr('data-primaryTownName'), 'data-townname': sdItem.attr('data-townname') }); var isStateMissing = state.length < 1; state = isStateMissing ? ', ' : ' ' + state + ', '; var townDisplayFormat = townName + state + country; var townSuburbDisplayFormat = ''; if (isStateMissing) { townSuburbDisplayFormat = townName + ' (' + suburb + '), ' + country; } else { townSuburbDisplayFormat = townName + ' (' + suburb + ')' + state + country; } townDisplayFormat = sdItem.attr('data-suburb') ? townSuburbDisplayFormat : townDisplayFormat; var hotelDisplayFormat = townName + ' (' + hotelname + ')' + state + country; var maxStringLength = 36; if (sdItem.attr('data-hotelname')) { // input display formatting sdDataText.val(hotelDisplayFormat.length > maxStringLength ? hotelDisplayFormat.substring(0, maxStringLength) + '..' : hotelDisplayFormat); // text display formatting textDisplay.find('.sd-search').html(hotelDisplayFormat.length > maxStringLength ? hotelDisplayFormat.substring(0, maxStringLength) + '..' : hotelname); textDisplay.find('.sd-state').html(hotelDisplayFormat.length > maxStringLength ? '' : state + ', '); textDisplay.find('.sd-country').html(hotelDisplayFormat.length > maxStringLength ? '' : country); } else { // input display formatting sdDataText.val(townDisplayFormat.length > maxStringLength ? townDisplayFormat.substring(0, maxStringLength) + '..' : townDisplayFormat); // text display formatting textDisplay.find('.sd-search').html(townDisplayFormat.length > maxStringLength ? townDisplayFormat.substring(0, maxStringLength) + '..' : (sdItem.attr('data-suburb') ? townName + ' (' + suburb + ') ' : townName)); textDisplay.find('.sd-state').html(townDisplayFormat.length > maxStringLength ? '' : state); textDisplay.find('.sd-country').html(townDisplayFormat.length > maxStringLength ? '' : country); } sdDataText.attr('value', sdDataText.val()); sdDataText.removeClass('watermark'); textDisplay.removeClass('watermark'); me.__vars.selected = true; inst.settings.onSelect(textDisplay.attr('title')); if (mode == 1) { $.venus.common.wait({ type: 1, sender: $(inst.id) }); me.__redirectUpdatedSupplierTop(hotelid); } } }); $(inst.id + me.__keys.exactMatchItem).die(); $(inst.id + me.__keys.exactMatchItem).live({ click: function (sender) { var sdItem = $(this); me.__vars.clicked = true; $(inst.id + me.__keys.content).hide(); var townId = sdItem.attr('data-load-id'); var townIata = sdItem.attr('data-iata'); var townName = sdItem.attr('data-name'); var state = sdItem.attr('data-state'); var suburb = sdItem.attr('data-suburb'); var country = sdItem.attr('data-country'); var hotelid = !sdItem.attr('data-hotelid') ? '' : sdItem.attr('data-hotelid'); var hotelname = !sdItem.attr('data-hotelname') ? '' : sdItem.attr('data-hotelname'); var mode = sdItem.parents('.search-down').attr('data-mode'); var textDisplay = $(inst.id + me.__keys.textDisplay); var sdDataText = $(inst.id + me.__keys.text); // set input textbox attributes sdDataText.attr({ 'data-load-id': sdItem.attr('data-load-id'), 'data-iata': sdItem.attr('data-iata'), 'name': sdItem.attr('data-name'), 'data-suburb': sdItem.attr('data-suburb'), 'data-state': sdItem.attr('data-state'), 'data-country': sdItem.attr('data-country'), 'data-hotelid': !sdItem.attr('data-hotelid') ? '' : sdItem.attr('data-hotelid'), 'data-hotelname': !sdItem.attr('data-hotelname') ? '' : sdItem.attr('data-hotelname'), 'title': sdItem.attr('title'), 'data-townname': sdItem.attr('data-townname'), 'data-eventcategory': 'Quick Search - Listing / Booking / Static', 'data-eventaction': 'Search Value Typed (matched)', 'data-eventlabel': sdItem.attr('title'), match: true }); // set display text attributes textDisplay.attr({ 'data-load-id': sdItem.attr('data-load-id'), 'data-iata': sdItem.attr('data-iata'), 'data-name': sdItem.attr('data-name'), 'data-suburb': sdItem.attr('data-suburb'), 'data-state': sdItem.attr('data-state'), 'data-country': sdItem.attr('data-country'), 'data-hotelid': !sdItem.attr('data-hotelid') ? '' : sdItem.attr('data-hotelid'), 'data-hotelname': !sdItem.attr('data-hotelname') ? '' : sdItem.attr('data-hotelname'), 'title': sdItem.attr('title'), 'data-townname': sdItem.attr('data-townname') }); var townDisplayFormat = townName + ' ' + state + ', ' + country; var townSuburbDisplayFormat = townName + ' (' + suburb + ') ' + state + ', ' + country; townDisplayFormat = sdItem.attr('data-suburb') ? townSuburbDisplayFormat : townDisplayFormat; var hotelDisplayFormat = townName + ' (' + hotelname + ')' + (state.length > 0 ? ' ' + state + ', ' : ', ') + country; var maxStringLength = 36; if (sdItem.attr('data-hotelname')) { // input display formatting sdDataText.val(hotelDisplayFormat.length > maxStringLength ? hotelDisplayFormat.substring(0, maxStringLength) + '..' : hotelDisplayFormat); // text display formatting textDisplay.find('.sd-search').html(hotelDisplayFormat.length > maxStringLength ? hotelDisplayFormat.substring(0, maxStringLength) + '..' : hotelname); textDisplay.find('.sd-state').html(hotelDisplayFormat.length > maxStringLength ? '' : state + ', '); textDisplay.find('.sd-country').html(hotelDisplayFormat.length > maxStringLength ? '' : country); } else { // input display formatting sdDataText.val(townDisplayFormat.length > maxStringLength ? townDisplayFormat.substring(0, maxStringLength) + ' ..' : townDisplayFormat); // text display formatting textDisplay.find('.sd-search').html(townDisplayFormat.length > maxStringLength ? townDisplayFormat.substring(0, maxStringLength) + '..' : (sdItem.attr('data-suburb') ? townName + ' (' + suburb + ') ' : townName)); textDisplay.find('.sd-state').html(townDisplayFormat.length > maxStringLength ? '' : state + ', '); textDisplay.find('.sd-country').html(townDisplayFormat.length > maxStringLength ? '' : country); } sdDataText.attr('value', sdDataText.val()); //GA Tracker me.__vars.selected = true; if ($(inst.id + ' .search-down-list').length > 0) { inst.settings.getMatch(textDisplay.attr('title')); } if ($(inst.id + ' .search-down-hotels').length > 0) { inst.settings.getMatch(textDisplay.attr('title')); } inst.settings.onSelect(textDisplay.attr('title')); if (mode == 1) { $.venus.common.wait({ type: 1, sender: $(inst.id) }); me.__redirectUpdatedSupplierTop(hotelid); } } }); }, __keyTimeOut: null, // Update supplier top and redirect __redirectUpdatedSupplierTop: function (selectedSupplierTop) { var searchQS = $.venus.common.getQs('search'); var searchQSArray = searchQS.split(';'); var cityPairSupplierTopArray = searchQSArray[1].split('-'); cityPairSupplierTopArray[cityPairSupplierTopArray.length - 1] = selectedSupplierTop; var cityPairSupplierTop = cityPairSupplierTopArray.join('-'); searchQSArray[1] = cityPairSupplierTop; var updatedSearchQS = searchQSArray.join(';'); var url = $.venus.common.overrideQs('search', updatedSearchQS); $.venus.common.redirectQs(url); }, __boxes: function (inst) { var me = this; var query = $.venus.query; var errorTimeOut = 0; $(inst.id + me.__keys.text).die(); $(inst.id + me.__keys.text).live({ click: function (sender) { me.__clearTextDisplay(inst); }, keydown: function (sender) { if (sender.which == 13) { //$(this).parents(inst.id + me.__keys.text).find('sd-mode-content').click(); } if (me.__vars.onType) { $(inst.id + me.__keys.text).val(''); $(inst.id + me.__keys.text).removeClass('watermark'); me.__vars.onType = false; } }, keyup: function (sender) { var searchDown = $(this).parents('.search-down'); var keyCodes = '[40] [39] [37] [38] [27] [13] [16] [17] [18]'; var keyCode = '[40]'; if (typeof (sender.keyCode) != 'undefined') { keyCode = '[' + sender.keyCode.toString() + ']'; } /* 40 Down Right 39 Left 37 Up 38 Esc 27 Enter 13 Shift 16 Ctrl 17 Space 32 Alt 18 */ if (keyCodes.indexOf(keyCode) < 0) { if (me.__keyTimeOut != null) { clearTimeout(me.__keyTimeOut); me.__keyTimeOut = null; } var data = $.trim(sender.target.value); //var mode = $(sender.target).attr(query.keys.mode) * 1; var mode = $(sender.target).attr('data-mode') * 1; var link = $(me.__keys.link, searchDown).attr('href'); var town = ''; if (data.length >= me.__vars.min) { switch (mode) { case 3: mode = 0; break; case 4: mode = 1; town = $('.sd-data-text:first').attr('data-load-id'); break; } } else { switch (mode) { case 0: mode = 3; break; case 1: mode = 4; town = $('.sd-data-text:first').attr('data-load-id'); break; case 4: town = $('.sd-data-text:first').attr('data-load-id'); break; } } // For Filter Hotel Search var section = $(this).parents('.search-down').attr('data-section'); mode = section == 2 ? $(this).parents('.search-down').attr('data-mode') : mode; //check the hotel filter section search down ( quick search OR filter hotels ) to get town id if (section == 2) {//hotel filter town = $('.filter-section').find('.search-down').attr('data-townId'); } else {// quick search filter if (town.length <= 0) { town = $(this).parents('.search-down').attr('data-townId'); } } link = link + '&' + query.keys.mode + '=' + mode + '&' + query.keys.data + '=' + data + '&town=' + town + '§ion=' + section; me.__keyTimeOut = setTimeout(function () { $.venus.events.notify($.venus.common.events.crossc, { id: inst.id + me.__keys.content, replace: false, link: link, after: function () { me.__cufon(); me.__items(inst); if ($(inst.id + ' .sd-data-not-match').length > 0) { inst.settings.noMatch(data); } if ($(inst.id + ' .search-down-list').length > 0) { inst.settings.logMatch(data); } if ($(inst.id + ' .search-down-hotels').length > 0) { inst.settings.logMatch(data); } } }); inst.settings.onWrite(data); }, 500); } }, blur: function (sender) { me.__vars.timeOut = setTimeout(function () { if (me.__vars.selected) { me.__switchArrow(inst, true); $(inst.id + me.__keys.searchData).removeClass(me.__keys.searchDataHoverClass); $(inst.id + me.__keys.text).hide(); $(inst.id + me.__keys.textDisplay).show(); } if (!me.__vars.hold) { $(inst.id + me.__keys.content).fadeOut(); inst.settings.onClose(me.__vars.selected); } }, me.__vars.useTimeOut ? 1000 : 0); }, focus: function (sender) { me.__vars.hold = false; me.__vars.clicked = false; $(inst.id + me.__keys.searchData).addClass(me.__keys.searchDataHoverClass); $('.search-down').not(inst.id).children('.sd-mode-content:visible').fadeOut(); $(inst.id + me.__keys.content).fadeIn(); inst.settings.onShow(); }, focusout: function (sender) { $(inst.id + me.__keys.searchData).removeClass(me.__keys.searchDataHoverClass); } }); $(inst.id + me.__keys.content).hover( function () { me.__vars.hold = true; }, function () { if (!me.__vars.clicked) { $(inst.id + me.__keys.text).focus(); me.__vars.hold = false; } } ); // switch to search data input text, hide display text $(inst.id + me.__keys.textDisplay).live({ mouseenter: function () { me.__switchArrow(inst, false); $(inst.id + me.__keys.text).show(); $(inst.id + me.__keys.textDisplay).hide(); }, click: function () { me.__switchArrow(inst, false); $(inst.id + me.__keys.textDisplay).hide(); $(inst.id + me.__keys.text).show(); $(inst.id + me.__keys.text).focus(); } }); $(inst.id + ' .sd-arrow-box .sd-dropdown-delete').live({ click: function (sender) { me.__clearTextDisplay(inst); } }); $(inst.id + ' .sd-arrow-box').hover(function () { me.__vars.useTimeOut = true; me.__switchArrow(inst, false); }, function () { me.__vars.useTimeOut = false; if (!$(inst.id + me.__keys.content).is(':visible')) { if (me.__vars.selected) { me.__switchArrow(inst, true); } } }); // switch to search data display text, hide input text $(inst.id + me.__keys.text).live({ mouseleave: function () { if ($(inst.id + me.__keys.content).is(':visible')) { $(inst.id + me.__keys.textDisplay).hide(); $(inst.id + me.__keys.text).show(); } else { if (me.__vars.selected) { me.__switchArrow(inst, true); $(inst.id + me.__keys.text).hide(); $(inst.id + me.__keys.textDisplay).show(); } } } }); }, __clearTextDisplay: function (inst) { var me = this; me.__vars.selected = false; me.__vars.onType = true; var mode = $(inst.id + me.__keys.text).parents('.search-down').attr('data-mode'); clearTimeout(me.__vars.timeOut); $(inst.id + me.__keys.text).addClass('watermark'); $(inst.id + me.__keys.textDisplay).hide(); $(inst.id + me.__keys.text).show(); $(inst.id + me.__keys.text).selectRange(0, 0); if ($(inst.id + me.__keys.text).is(':focus')) { $(inst.id + me.__keys.text).val('').keyup(); } if ($(inst.id + me.__keys.text).parents(me.__keys.searchOriginClass).hasClass(me.__keys.searchOriginClassName)) { $(inst.id + me.__keys.text).val('Type Your Location'); // Flying From } else { if (mode == 1) { $(inst.id + me.__keys.text).val('Search by Hotel Name'); // Filter Hotel Search } else { $(inst.id + me.__keys.text).val('Type Place or Hotel Name'); // Flying To } } $(inst.id + me.__keys.text).selectRange(0, 0); }, __switchArrow: function (inst, arrow) { if (arrow) { $(inst.id + ' .sd-dropdown-delete').addClass('sd-dropdown-arrow'); $(inst.id + ' .sd-dropdown-arrow').removeClass('sd-dropdown-delete'); } else { $(inst.id + ' .sd-dropdown-arrow').addClass('sd-dropdown-delete'); $(inst.id + ' .sd-dropdown-delete').removeClass('sd-dropdown-arrow'); } }, __newPlugin: function (target) { var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); return { id: '#' + id, container: target, data: null }; }, __cufon: function () { var me = this; //Cufon.replace(me.__keys.title, { "fontFamily": "Dax-Medium" }); $.venus.events.notify(me.__events.cufon, { name: 'widget-list-see-all-text', id: me.__keys.see }); $.venus.events.notify(me.__events.cufon, { name: 'widget-list-see-all-text-bold', id: me.__keys.see + ' .sd-all-count' }); $.venus.events.notify(me.__events.cufon, { name: 'widget-list-see-all-text', id: '.sd-see-all-australia' }); $.venus.events.notify(me.__events.cufon, { name: 'widget-list-see-all-text-bold', id: '.sd-see-all-australia' + ' .sd-all-count' }); } }); // Variables and instance. $.searchDown = new searchDown(); $.searchDown.uuid = new Date().getTime(); $.searchDown.version = "1.0.0"; // Plugin call and initialisation. $.fn.searchDown = function (options) { var $caller = $(this); return $caller.each(function () { var calle = this; $.searchDown.__initialise('searchDown-', calle, options); }); return $caller; }; })(jQuery); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/plugin.map.debug.js' (Mode: Static) */ (function ($) { // Object representation and defaults. function dealsMap() { this._defaults = { map: { zoom: 15, center: '', mapTypeId: null }, zoomLink: null }; } // Functions for the plugins. $.extend(dealsMap.prototype, { __keys: { canvas: ' .deals-map-canvas', lat: ' .dm-lat', lng: ' .dm-lng', location: ' .dm-location', bigMapIcon: '.map-pin', smallMapIcon: '.map-pin-small', smallerMapIcon: '.map-pin-smaller', mapMarkersSprite: '.map-markers-sprite' }, __geocoder: null, __events: { cufon: $.venus.common.events.cufon, content: $.venus.common.events.content, proceed: $.venus.common.events.proceed }, __initialise: function (name, target, settings) { this.__geocoder = new google.maps.Geocoder; this._defaults.map.mapTypeId = google.maps.MapTypeId.ROADMAP; if (!target.id) { target.id = name + (++this.uuid); } var inst = this.__newPlugin($(target)); inst.settings = $.extend({}, settings, this._defaults, settings); this.__setup(inst); this.__loadMaps(inst, inst.id); }, __setup: function (inst) { var me = this; $(inst.settings.zoomLink).bind({ click: function (sender) { $(this).dealsLayer({ after: function (id, nowait) { $(id + ' .deals-layer .dl-content').append('
    '); me.__loadMaps(inst, '.deals-layer .dl-content'); nowait(); } }); sender.preventDefault(); } }); }, __infoBox: null, __loadMaps: function (inst, id) { var me = this; var locations = []; $(inst.id + me.__keys.location).each(function () { var lng = $('.hd-lng',this).val() * 1; var lat = $('.hd-lat',this).val() * 1; var location = new google.maps.LatLng(lat, lng); locations.push(location); }); me._defaults.map.center = locations[0]; var map = new google.maps.Map($(id + me.__keys.canvas)[0], me._defaults.map); if (locations.length == 1) { var $image = new google.maps.MarkerImage($(me.__keys.mapMarkersSprite).attr('src'), new google.maps.Size(48, 58), new google.maps.Point(6, 163), new google.maps.Point(23, 58) ); var $imageHover = new google.maps.MarkerImage($(me.__keys.mapMarkersSprite).attr('src'), new google.maps.Size(60.0, 61.0), new google.maps.Point(55.0, 160.0), new google.maps.Point(32.0, 61.0) ); var $infoBox = new InfoBox({ alignBottom: true, boxStyle: { overflow: 'visible' // must apply to display box-shadow properly, but can't override at the moment }, closeBoxURL: '', content: $('.map-info-window').html(), infoBoxClearance: new google.maps.Size(1, 1), pixelOffset: new google.maps.Size(-79, -64) }); var marker = new google.maps.Marker({ map: map, draggable: false, position: me._defaults.map.center, icon: $image }); google.maps.event.addListener(marker, 'click', function () { window.location.href = $('.info-window').find('.iw-link').attr('href'); }); google.maps.event.addListener(marker, 'mouseover', function () { this.setIcon($imageHover); $infoBox.open(map, this); me.__infoBox = $infoBox; }); google.maps.event.addListener(marker, 'mouseout', function () { //window.location.href = marker.url; this.setIcon($image); me.__infoBox.close(); }); } else { for (var i = 0; i < locations.length - 1; i++) { if (i <= 0) { var marker1 = new google.maps.Marker({ map: map, draggable: false, position: locations[i], icon: $(me.__keys.smallMapIcon).attr('src') }); i++; } var marker = new google.maps.Marker({ map: map, draggable: false, position: locations[i], icon: $(me.__keys.smallerMapIcon).attr('src') }); } } }, __cufon: function (inst) { }, __eventsReg: function (inst) { }, __newPlugin: function (target) { var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); return { id: '#' + id, container: target, data: null }; } }); // Variables and instance. $.dealsMap = new dealsMap(); $.dealsMap.uuid = new Date().getTime(); $.dealsMap.version = "1.0.0"; // Plugin call and initialisation. $.fn.dealsMap = function (options) { if (typeof (google) != 'undefined') { var $caller = $(this); return $caller.each(function () { var calle = this; $.dealsMap.__initialise('dealsMap-', calle, options); }); return $caller; } }; })(jQuery); $(document).ready(function () { }); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/plugin.contactUs.debug.js' (Mode: Static) */ (function ($) { // Object representation and defaults. function contactUs() { this._defaults = { mode: 1 }; } // Functions for the plugins. $.extend(contactUs.prototype, { __vars: { }, __keys: { title: '.contact-us .cu-margin .cu-head .cu-title', close: '.contact-us .close-box-medium-blue', send: '.contact-us .cu-button .proceed-button-link', contactUs: '.contact-us', textBox: '.contact-us .text-long', name: '.contact-us #cu-field-name', nameWatermark: 'Enter your name', email: '.contact-us #cu-field-email', emailWatermark: 'Enter your email address', message: '.contact-us #cu-field-message', messageWatermark: 'How can we help? Please enter all relevant details.', dealsAlert: '.cu-alert-checkbox', refresh: '.contact-us .hidden-link', thanks: '.contact-us-thank-you .cu-ty-margin .cu-ty-text', rawUrl: '#current-url', borderGlowClass: 'border-glow', contactUsButton: '.contact-us-button', cUChkBox: '.cu-checkbox' }, __events: { cufon: 'cufon', content: 'content', crossc: 'cross-content' }, __initialise: function (name, target, settings) { if (!target.id) { target.id = name + (++this.uuid); } var inst = this.__newPlugin($(target)); inst.settings = $.extend({}, settings, this._defaults, settings, this.__keys); this.__eventsReg(inst); this.__cufon(inst); }, __setPosition: function () { var me = this; var windowWidth = $(window); }, __eventsReg: function (inst) { var me = this; $(inst.id).bind({ click: function (sender) { //added features from sir Nathan email : check if live chat is online, else render the contact us window if (typeof (bLHNOnline) == 'undefined') { bLHNOnline = 0; } if (bLHNOnline != 0) { OpenLHNChat(); } else { $(me.__keys.contactUsButton).slideUp(200); me.__setPosition(); $(me.__keys.contactUs).slideDown(200); } } }); $(inst.settings.cUChkBox).bind({ click: function (sender) { chk = $(this); var tick = 'tick-accom'; var noTick = 'no-tick-accom'; if (chk.hasClass(tick)) { chk.removeClass(tick); chk.addClass(noTick); } else { chk.removeClass(noTick); chk.addClass(tick); } if (bLHNOnline != 0) {// check if live chat is online, else render the contact us window OpenLHNChat(); } else { me.__setPosition(); $(me.__keys.contactUs).slideDown(200); } } }); $(inst.settings.close).bind({ click: function (sender) { $(me.__keys.contactUs).slideUp(200); $(me.__keys.contactUsButton).slideDown(1000); sender.preventDefault(); } }); $(inst.settings.textBox).die(); $(inst.settings.textBox).live({ focusin: function (sender) { var input = $(this); if (!input.hasClass(inst.settings.borderGlowClass)) { input.addClass(inst.settings.borderGlowClass); } if (input.parent().is(':last-child')) { $(inst.settings.send).addClass('button-gradient'); } }, focusout: function (sender) { var input = $(this); if (!input.hasClass('venus-watermark')) { input.removeClass(inst.settings.borderGlowClass); } } }); $(inst.settings.send).off(); $(inst.settings.send).on({ click: function (sender) { var link = $(sender.target).closest('a').attr('href'); var refresh = $(me.__keys.refresh).attr('href'); var name = $(me.__keys.name).val() != me.__keys.nameWatermark ? $(me.__keys.name).val() : ''; var email = $(me.__keys.email).val() != me.__keys.emailWatermark ? $(me.__keys.email).val() : ''; var message = $(me.__keys.message).val() != me.__keys.messageWatermark ? $(me.__keys.message).val() : ''; var dealsAlert = $(me.__keys.dealsAlert).is(":checked") ? true : false; var $brand = $(this).attr('data-brand'); var url = encodeURIComponent(document.URL); var emailpattern = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; if (name.length == 0 || email.length == 0 || message.length == 0) { if (name.length == 0) { alert("Please enter your name before sending."); return false; } if (email.length == 0) { alert("Please enter your email before sending."); return false; } if (message.length == 0) { alert("Please enter your message before sending."); return false; } } else { if (emailpattern.test(email)) { var pkgDetails = '&details=none'; if ($('#content-details').length > 0) { pkgDetails = '&details=' + $('#content-details').val(); } link += '&name=' + name + '&email=' + email + '&message=' + message + '&dealsAlert=' + dealsAlert + '&url=' + url + '&brand=' + $brand + pkgDetails; $.venus.events.notify(me.__events.crossc, { id: me.__keys.contactUs, replace: false, link: link, after: function () { //tracker var eventLabel = $('.db-label', '.deals-banner').text() + ' ' + $('.db-duration', '.deals-banner').text(); if ($('#Accommodation').is(':checked')) { var roomText = parseInt($('#RoomCount').val()) > 1 ? ' Rooms' : ' Room'; eventLabel += ', ' + $('#RoomCount').val() + roomText } $(this).attr({ 'data-eventcategory': 'Need Help - Listing / Booking / Finalise' , 'data-eventaction': 'Contact Us' , 'data-eventlabel': eventLabel }); $.venus.track.event($(this), function () { $(me.__keys.contactUs).animate({ height: "85px" }, 600, function () { setTimeout(function () { $(me.__keys.contactUs).slideUp(200); $.venus.events.notify(me.__events.crossc, { id: me.__keys.contactUs, replace: true, link: refresh, after: function () { me.__eventsReg(inst); me.__cufon(inst); $.venus.common.watermark(); $(me.__keys.contactUsButton).slideDown(200); } }); }, 3000); }); }); } }); sender.preventDefault(); } else { alert("Please enter a valid email address."); return false; } } } }); }, __newPlugin: function (target) { var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); return { id: '#' + id, container: target, data: null }; }, __cufon: function (inst) { var me = this; //Cufon.replace(me.__keys.title, { "fontFamily": "Dax-Black", "fontSize": "18px" }); //Cufon.replace(me.__keys.close, { "fontFamily": "Dax-Black", "fontSize": "22px" }); //Cufon.replace('.proceed-button-link', { "fontFamily": "Dax-Black" }); } }); // Variables and instance. $.contactUs = new contactUs(); $.contactUs.uuid = new Date().getTime(); $.contactUs.version = "1.0.0"; // Plugin call and initialisation. $.fn.contactUs = function (options) { var $caller = $(this); return $caller.each(function () { var calle = this; $.contactUs.__initialise('contactUs-', calle, options); }); return $caller; }; })(jQuery); $(document).ready(function () { $('.contact-us-button').contactUs(); }); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/plugin.fixlist.debug.js' (Mode: Static) */ //Title: Custom DropDown plugin by PC //Documentation: http://designwithpc.com/Plugins/ddslick //Author: PC //Website: http://designwithpc.com //Twitter: http://twitter.com/chaudharyp (function ($) { $.fn.fixlist = function (method) { //if(typeof($(this).attr('fixlistid')) === 'undefined'){ if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { return methods.init.apply(this, arguments); } else { $.error('Method ' + method + ' does not exists.'); } //} }; var methods = {}, //Set defauls for the control defaults = { data: [], keepJSONItemsOnTop: false, width: 260, height: null, background: "#eee", selectText: "", defaultSelectedIndex: null, truncateDescription: true, imagePosition: "left", showSelectedHTML: true, clickOffToClose: true, onSelected: function () { } }, ddSelectHtml = '
    ', ddOptionsHtml = '
      ', ddHoverClass = 'dd-hover', event = { onBlur: false } //Public methods methods.init = function (options) { //Apply on all selected elements return this.each(function () { //check if the select element is already converted to plugin and a select html control if (typeof ($(this).attr('fixlistid')) === 'undefined' && $(this).is('select')) { //Preserve the original defaults by passing an empty object as the target var options = $.extend({}, defaults, options, event); var obj = $(this); data = obj.data('ddslick'); objClass = typeof (obj.attr('class')) != 'undefined' ? obj.attr('class') : null; objName = typeof (obj.attr('name')) != 'undefined' ? obj.attr('name') : null; //If the plugin has not been initialized yet if (!data) { var ddSelect = [], ddJson = options.data; //Get data from HTML select options obj.find('option').each(function () { var $this = $(this), thisData = $this.data(); ddSelect.push({ text: $.trim($this.text()), value: $this.val(), selected: $this.is(':selected'), description: thisData.description, imageSrc: thisData.imagesrc //keep it lowercase for HTML5 data-attributes }); }); //Update Plugin data merging both HTML select data and JSON data for the dropdown if (options.keepJSONItemsOnTop) { $.merge(options.data, ddSelect); } else { options.data = ddSelect; //$.merge(ddSelect, options.data); } var id = 'fixlist-' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); //Replace HTML select with empty placeholder, keep the original var original = obj, placeholder = $('
      '); placeholder.insertBefore(original); original.hide(); //add class and attribute fixlist id for unique selection control original.addClass(id + ' fix-list').attr('fixlistid', id); obj = placeholder; //Add classes and append ddSelectHtml & ddOptionsHtml to the container obj.addClass('fix-list ' + objClass).append(ddSelectHtml).append(ddOptionsHtml); //add name for serialization if (objName != null) obj.find('.dd-selected-value').attr('name', objName); //Get newly created ddOptions and ddSelect to manipulate var ddSelect = obj.find('.dd-select'), ddOptions = obj.find('.dd-options'); //Set height if (options.height != null) ddOptions.css({ height: options.height, overflow: 'auto' }); //Add ddOptions to the container. Replace with template engine later. $.each(options.data, function (index, item) { if (item.selected) options.defaultSelectedIndex = index; ddOptions.append('
    • ' + '' + (item.value ? ' ' : '') + (item.imageSrc ? ' ' : '') + (item.text ? ' ' + item.text + '' : '') + (item.description ? ' ' + item.description + '' : '') + '' + '
    • '); }); //Save plugin data. var pluginData = { id: id, settings: options, original: original, selectedIndex: -1, selectedItem: null, selectedData: null } obj.data('ddslick', pluginData); //Check if needs to show the select text, otherwise show selected or default selection if (options.selectText.length > 0 && options.defaultSelectedIndex == null) { obj.find('.dd-selected').html(options.selectText); } else { var index = (options.defaultSelectedIndex != null && options.defaultSelectedIndex >= 0 && options.defaultSelectedIndex < options.data.length) ? options.defaultSelectedIndex : 0; selectIndex(obj, index); } //EVENTS //Displaying options obj.find('.dd-select').on('click.ddslick', function () { open(obj); }); //Selecting an option obj.find('.dd-option').on('click.ddslick', function () { selectIndex(obj, $(this).closest('li').index()); }); //hover event for option optionHover(obj); //adjust option width if needed adjustOptionAndDisplayWidth(obj); //Event for dropdown events(obj); //Adjust separator height adjustHeight(obj); //Click anywhere to close if (options.clickOffToClose) { ddOptions.addClass('dd-click-off-close'); obj.on('click.ddslick', function (e) { e.stopPropagation(); }); $('body').on('click', function () { $('.dd-click-off-close').slideUp(50).siblings('.dd-select').find('.dd-pointer').removeClass('dd-pointer-up'); //remove hover color and add color to the first option element var optionElem = obj.find('.dd-option'); optionElem.removeClass(ddHoverClass); optionElem.eq(pluginData.selectedIndex).addClass('dd-option-selected'); var getId = pluginData.id; //trigger blur event of select element if (pluginData.settings.onBlur) { $('.' + getId).trigger('blur'); } }); } } } }); }; //Public method to select an option by its index methods.select = function (options) { return this.each(function () { if (options.index >= 0) { selectIndex($(this), options.index); } }); } //Public method to open drop down methods.open = function () { return this.each(function () { var $this = $(this), pluginData = $this.data('ddslick'); //Check if plugin is initialized if (pluginData) open($this); }); }; //Public method to close drop down methods.close = function () { return this.each(function () { var $this = $(this), pluginData = $this.data('ddslick'); //Check if plugin is initialized if (pluginData) close($this); }); }; //Public method to destroy. Unbind all events and restore the original Html select/options methods.destroy = function () { return this.each(function () { var $this = $(this), pluginData = $this.data('ddslick'); //Check if already destroyed if (pluginData) { var originalElement = pluginData.original; $this.removeData('ddslick').unbind('.ddslick').replaceWith(originalElement); } }); } //Private: adjust height separator function adjustHeight(obj) { var ht = obj.height() obj.find('.dd-separator').css('height', ht - 9); } //Private: Event for dropdown function events(obj) { obj.find('.dd-option').on('click', function () { var $this = obj, pluginData = $this.data('ddslick'); if (pluginData) { var id = pluginData.id; $('.' + id).trigger('focus'); $('.' + id).trigger('change'); } }); obj.on({ 'keypress': function (e) { if (e.keyCode == 40) { //down arrow open(obj); } }, 'focusout': function () { setTimeout(function () { close(obj); }, 1000); } }); } //Private: Select index function selectIndex(obj, index) { //Get plugin data var pluginData = obj.data('ddslick'); //Get required elements var ddSelected = obj.find('.dd-selected'), ddSelectedValue = ddSelected.siblings('.dd-selected-value'), ddOptions = obj.find('.dd-options'), ddPointer = ddSelected.siblings('.dd-pointer'), selectedOption = obj.find('.dd-option').eq(index), selectedLiItem = selectedOption.closest('li'), settings = pluginData.settings, selectedData = pluginData.settings.data[index]; //Highlight selected option obj.find('.dd-option').removeClass('dd-option-selected'); selectedOption.addClass('dd-option-selected'); //Update or Set plugin data with new selection pluginData.selectedIndex = index; pluginData.selectedItem = selectedLiItem; pluginData.selectedData = selectedData; //If set to display to full html, add html if (settings.showSelectedHTML) { ddSelected.html( (selectedData.imageSrc ? '' : '') + (selectedData.text ? '' + selectedData.text + '' : '') + (selectedData.description ? '' + selectedData.description + '' : '') ); } //Else only display text as selection else ddSelected.html(selectedData.text); //Updating selected option value ddSelectedValue.val(selectedData.value); //BONUS! Update the original element attribute with the new selection pluginData.original.val(selectedData.value); obj.data('ddslick', pluginData); //Close options on selection close(obj); //Adjust appearence for selected option adjustSelectedHeight(obj); //Callback function on selection if (typeof settings.onSelected == 'function') { settings.onSelected(); settings.onSelected.call(this, pluginData); } } //Private: Close the drop down options function open(obj) { var $this = obj.find('.dd-select'), ddOptions = $this.siblings('.dd-options'), ddPointer = $this.find('.dd-pointer'), wasOpen = ddOptions.is(':visible'); //Close all open options (multiple plugins) on the page $('.dd-click-off-close').not(ddOptions).slideUp(50); var pluginData = obj.data('ddslick'); if (wasOpen) { ddOptions.slideUp('fast'); } else { pluginData.settings.onBlur = true; ddOptions.slideDown('fast'); } //Fix text height (i.e. display title in center), if there is no description adjustOptionsHeight(obj); } //Private: Close the drop down options function close(obj) { //Close drop down and adjust pointer direction obj.find('.dd-options').slideUp(50); obj.find('.dd-pointer').removeClass('dd-pointer-up').removeClass('dd-pointer-up'); } //Private: Adjust appearence for selected option (move title to middle), when no desripction function adjustSelectedHeight(obj) { //Get height of dd-selected var lSHeight = obj.find('.dd-select').css('height'); //Check if there is selected description var descriptionSelected = obj.find('.dd-selected-description'); var imgSelected = obj.find('.dd-selected-image'); if (descriptionSelected.length <= 0 && imgSelected.length > 0) { obj.find('.dd-selected-text').css('lineHeight', lSHeight); } } //Private: Adjust appearence for drop down options (move title to middle), when no desripction function adjustOptionsHeight(obj) { obj.find('.dd-option').each(function () { var $this = $(this); var lOHeight = $this.css('height'); var descriptionOption = $this.find('.dd-option-description'); var imgOption = obj.find('.dd-option-image'); if (descriptionOption.length <= 0 && imgOption.length > 0) { $this.find('.dd-option-text').css('lineHeight', lOHeight); } }); } //Private: hover Effect for options function optionHover(obj) { var option = obj.find('.dd-option'); var options = obj.find('.dd-options'); option.on({ mouseenter: function (sender) { var $this = $(this); $this.addClass(ddHoverClass); option.not($this).removeClass('dd-option-selected ' + ddHoverClass); }, mouseleave: function (sender) { var $this = $(this); if (!options.is(':visible')) $this.removeClass(ddHoverClass); } }); } //Private: Adjust option width function adjustOptionAndDisplayWidth(obj) { //adjust Option width if (obj.find('.dd-options').width() < obj.width()) { obj.find('.dd-options').css('width', obj.width() - 1); } //adjust display text Html element width obj.find('.dd-selected').css('width', obj.width() - 40); if (obj.find('.dd-selected').width() == 0) obj.find('.dd-selected').css('width', 'auto'); } })(jQuery);; /* Comment Generated by Combres - Resource '~/Resources/Scripts/venus.topDeals.debug.js' (Mode: Static) */ (function ($) { $.venus.topDeals = { __keys: { confirmDialogContainer: '.confirm-dialog-container', confirmDialogChangeButton: '.confirm-dialog .cd-change', confirmDialogCancelButton: '.confirm-dialog .cd-cancel', contactUs: '.contact-us', contactUsClose: '.contact-us .close-box-medium-blue', dealsContainer: '.top-deals-main .top-deals', deals: '.top-deals', deal: '.top-deals .td-deal', dealHover: '.top-deals .hotel-hover', needHelp: '.need-help', pricingCalendar: '.top-deals-main .pricing-calendar-popup', pricingCalendarCloseButton: '.pricing-calendar .close-button', supplierLogo: '.b-supplier-logo', topDealsDetailsNormal: '.top-deals', topDealsSearchNormal: '.top-deals-search', originText: '.top-deals-search .search-down .sd-data-text', destinationText: '.top-deals-search .search-down .sd-data-text', /*product static variables*/ imageHover: '.deals-images .di-content .di-image-list .di-img-small', imageLarge: '.deals-images .di-image-large .di-img-large', imageText: '.di-text', imageNavLink: '.deals-images .di-nav-link-next, .deals-images .di-nav-link-prev', facilitySmallImg: '.df-small-logo', facilityBigImg: '.df-sub-big-img', classFacilityImgBorder: 'add-border', showMapLink: '.show-map-link', accomBonusContent: '.deals-overview .de-bonuses-content', showMoreLink: '.de-bonuses-margin-show-more', dealsBonusPopup: '.deals-bonus-popup', querystring: '.querystring' }, __events: { content: $.venus.common.events.content, crossc: $.venus.common.events.crossc, proceed: $.venus.common.events.proceed }, townText: null, hotelText: null, durationText: null, dealType: null, __initialise: function () { var me = $.venus.topDeals; me.__initSearchDown('.top-deals-main'); $('select').fixlist(); me.__eventReg(me); me.__lazyLoadTopDeal(me); //used for static product page me.__initProductContent(me); me.__rotateImages(); $(me.__keys.needHelp).contactUs(); }, __lazyLoadTopDeal: function (me) { if (typeof ($('.lazy-load-detail')) != 'undefined') { $('.lazy-load-detail').each(function () { var parentElem = $(this); var qs = $(me.__keys.querystring, parentElem); /*loader*/ $('.confirm-dialog .cd-container', parentElem).hide(); $(me.__keys.confirmDialogContainer, parentElem).show(); $('.confirm-dialog', parentElem).addClass('confirm-loader'); $('.confirm-dialog', parentElem).show(); $('.confirm-dialog .cd-loader-container', parentElem).show(); $.venus.common.addLoader({ sender: $('.confirm-dialog .cdl-loader-graphic', parentElem) }); var dealsType = qs.val().split(';')[0]; var citPairDeal = qs.val().split(';')[1].split('-'); var duration = qs.val().split(';')[2]; var $brand = qs.val().split(';')[5]; var version = parentElem.hasClass('nm') ? 'nm' : 'sm'; var filters = $('.filter-text', parentElem).val() == '' ? '' : '&filters=' + $('.filter-text', parentElem).val(); var updatedUrl = dealsType == 4 ? $('.settings-getpricingcalendar-path').attr('href') + "/_get/deals;" + version + "/package/" + citPairDeal[1] + "/" + citPairDeal[0] + "/" + duration + "n?" + "details=on" + filters + '&brand=' + $brand : $('.settings-getpricingcalendar-path').attr('href') + "/_get/deals;" + version + "/hotel/" + citPairDeal[0] + "/" + duration + "n?" + "details=on" + filters + '&brand=' + $brand; var loader = $('.confirm-dialog .cdl-loader-graphic', parentElem).attr('loader-id'); $.ajax({ type: 'POST', url: updatedUrl, dataType: 'json', success: function (data) { $.venus.common.removeLoader({ sender: $('#' + loader) }); parentElem.replaceWith(data); me.__reInitialise(me); }, beforeSend: function (jqXHR, settings) { } }); }); } }, __rotateImages: function () { var $imageList = $('.rotating-images > li'); if ($imageList.length > 1) { var i = 1; var timer = setInterval(function () { var $prevImage = $($imageList.eq(i - 1)); var $newImage = $($imageList.eq(i)); if (i < 1) { $newImage.show(); $($imageList.eq(-1)).fadeOut(1000); } else { $newImage.fadeIn(1000, function () { $prevImage.fadeOut('fast'); }) } i++; if (i >= $imageList.length) i = 0; }, 5000); } else if ($imageList.length == 1) { $imageList.show(); } }, __TrackingUrl: function (linkPath) { linkPath += ''; //if (typeof (KalhavenGroup) != 'undefined' && typeof (KalhavenGroup.Tracking) != 'undefined' && typeof (KalhavenGroup.Tracking.RedirectUser) == 'function') { // linkPath = KalhavenGroup.Tracking.RedirectUserURL(linkPath); //} return linkPath; }, __maskLayer: function (sender, me) { if ($('.top-deals-main').length > 0) { var topDealsMain = $(sender.target).parents('.top-deals-main'); var qs = $(me.__keys.querystring, topDealsMain); me.townText = $('.from .sd-input-display', topDealsMain).attr('title') + ' to ' + $('.to .sd-input-display', topDealsMain).attr('data-townname'); me.hotelText = (me.hotelText != null) ? me.hotelText : null; me.dealsType = qs.val().split(';')[0]; me.durationText = (qs.val().split(';')[2] == 1) ? ' Flights + 1 Night' : ' Flights + ' + qs.val().split(';')[2] + ' Nights'; var linkPath = me.__TrackingUrl($(sender.target).closest('a').attr('href')); $.venus.pageLoader.show(me.townText, me.hotelText, me.durationText, function () { $.venus.events.notify(me.__events.proceed, { full: true, url: linkPath }); if ($.venus.animation.check()) { setTimeout(function () { $.venus.animation.showText('#vl-line-0', 'Almost done, thanks for your patience.'); }, 6000); } else { setTimeout(function () { $('.venus-loader .vl-line-0').text('Almost done, thanks for your patience.'); }, 6000); } }, me.dealsType); } else { $.venus.common.wait({ type: 1, sender: sender.target }); var linkPath = me.__TrackingUrl($(sender.target).closest('a').attr('href')); $.venus.common.redirectFull(linkPath) } }, __initProductContent: function (me) { if ($('.top-deals').length == 0 && $('.product-pricing-calendar').length > 0) { var pricingProduct = $('.product-pricing-calendar'); var qs = $('#qs-calendar-search', pricingProduct); var citPairDeal = qs.val().split(';')[1].split('-'); if (qs.val().split(';')[0] == 4) { var originSelect = $('#' + $('select.select-origin-flight', pricingProduct).attr('fixlistid')); var selectedIndex = $('select.select-origin-flight option[data-orig-townid=' + citPairDeal[0] + ']', pricingProduct).index(); originSelect.fixlist('select', { index: selectedIndex }); } var duration = qs.val().split(';')[2]; var $brand = qs.val().split(';')[5]; var supplierTop = $('#supplier-top').val(); var updatedUrl = qs.val().split(';')[0] == 4 ? $('.settings-getproductdealssetting-path').attr('href') + '/_get/pcp/package/' + citPairDeal[1] + "/" + citPairDeal[0] + "/" + duration + "n/" + supplierTop + '?brand=' + $brand : $('.settings-getproductdealssetting-path').attr('href') + '/_get/pcp/hotel/' + citPairDeal[0] + '/' + duration + 'n/' + supplierTop + '?brand=' + $brand; //lazy load request for PC product template $.ajax({ type: 'POST', url: updatedUrl, dataType: 'json', success: function (data) { setTimeout(function () { $('.pricing-calendar-search').after(data); me.addedScrollValue = -10; me.__selectedDateScroll($('.pricing-calendar-content')); me.__pricingCalendarEvent(); me.__eventReg(me); }, 1000); }, beforeSend: function (jqXHR, settings) { } }); } }, __reInitialise: function (me) { me.__eventReg(me); me.__pricingCalendarEvent(); }, __initSearchDown: function (element) { $('.top-deals-search .search-down', element).searchDown(); }, addedScrollValue: -10, _mobileDevice: (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)), __selectedDateScroll: function (pricingCalendar) { var me = $.venus.topDeals; var selIndex = parseInt($('.selected-start-date', pricingCalendar).attr('data-scroll-value')) - me.addedScrollValue; if (selIndex > $('.bgc-item', pricingCalendar).scrollLeft()) { $('.bgc-item', pricingCalendar).scrollLeft(selIndex); } }, __getSelectedGraph: function (day, bar, pricingCalendar) { var scrollElem = $('.bgc-item', pricingCalendar); $('.day', pricingCalendar).removeClass('selected-day sold-day-selected'); $('.bar-graph', pricingCalendar).removeClass('day-graph-selected sold-graph-selected price-check-selected'); if (bar.hasClass('sold-day')) { day.addClass('sold-day-selected'); bar.addClass('sold-graph-selected'); } else if (bar.hasClass('price-check')) { day.addClass('selected-day'); bar.addClass('price-check-selected'); } else { day.addClass('selected-day'); bar.addClass('day-graph-selected'); } $('.bcd-start-date', pricingCalendar).text(day.attr('data-start-date')); $('.bcd-end-date', pricingCalendar).text(day.attr('data-end-date')); if (bar.hasClass('price-check')) { var priceLink = $('.price-click-text', pricingCalendar).attr('href').toString(); var url = priceLink.substring(0, priceLink.indexOf('?')); $('.price-click-text', pricingCalendar).attr('href', url + '?search=' + day.attr('data-price-link') + '&brand=' + $('.hdn-brand', pricingCalendar).val() + '&kbci=' + $('.hdn-kbci', pricingCalendar).val()); $('.book-container', pricingCalendar).addClass('book-price-check').removeClass('book-sold'); $('.price-check-container', pricingCalendar).show(); $('.bc-amount', pricingCalendar).hide(); $('.bc-currency', pricingCalendar).hide(); } else { var bcAmount = $('.bc-amount', pricingCalendar); var rateAmount = day.attr('data-deal-rate'); var size = rateAmount.toLowerCase() == 'sold' ? '3' : rateAmount.length; bcAmount.text(rateAmount); bcAmount.removeClass(function (index, css) { return (css.match(/\brate-size-\S+/g) || []).join(' '); }).addClass('rate-size-' + size); bcAmount.show(); if (typeof (day.attr('data-duration')) != 'undefined' && typeof (day.attr('data-night-cost')) != 'undefined') { $('.duration', pricingCalendar).text(day.attr('data-duration')); $('.choose-departure', pricingCalendar).text(day.attr('data-night-cost')); } var bookContainer = $('.book-container', pricingCalendar); if (day.attr('data-deal-rate') == 'SOLD') { $('.bc-currency', pricingCalendar).hide(); if (bookContainer.hasClass('book-price-check')) { bookContainer.removeClass('book-price-check'); $('.price-check-container', pricingCalendar).hide(); } bookContainer.addClass('book-sold'); } else { $('.bc-currency', pricingCalendar).show(); bookContainer.removeClass('book-sold'); if (bookContainer.hasClass('book-price-check')) { bookContainer.removeClass('book-price-check'); $('.price-check-container', pricingCalendar).hide(); } } } var bookLink = $('.bc-book-button', pricingCalendar).attr('href').toString(); var url = bookLink.substring(0, bookLink.indexOf('?')); $('.bc-book-button', pricingCalendar).attr('href', url + '?search=' + day.attr('data-search-link') + '&brand=' + $('.hdn-brand', pricingCalendar).val() + '&kbci=' + $('.hdn-kbci', pricingCalendar).val()); }, __getSelectedSearchKeys: function (elements) { var keys = []; elements.each(function (e) { keys.push($('.sd-input-display', this).attr('data-load-id')); }); return keys; }, __fixList: function (elements) { $('select', elements).fixlist(); }, __pricingCalendarEvent: function () { var me = $.venus.topDeals; var timeOut = null; $('.bgc-item').on({ scroll: function () { var scrollElem = $(this); var pricingCalendar = scrollElem.parents('.pricing-calendar-content'); var initScrollVal = parseInt($('.start-date', scrollElem).attr('data-scroll-value')) - me.addedScrollValue; var endScrollVal = parseInt($('.last-date', scrollElem).attr('data-scroll-value')) - me.addedScrollValue; var day; var bar; if (scrollElem.scrollLeft() <= initScrollVal) { // fix for tablet day = $('li#day-id-16'); bar = $('.bar-graph', day); me.__getSelectedGraph(day, bar, pricingCalendar); scrollElem.scrollLeft(initScrollVal); } else if (scrollElem.scrollLeft() > endScrollVal) { scrollElem.scrollLeft(endScrollVal); } else { if (me._mobileDevice) { // Do nothing for now? } else { // var x = (y + 156 + 22) / 22; // where y is the current scroll left var id = Math.ceil((scrollElem.scrollLeft() + 156 + 24) / 24); var selectedDay = $('li#day-id-' + id.toString()); var val = parseInt($(selectedDay).attr('data-scroll-value')); bar = $('.bar-graph', selectedDay); me.__getSelectedGraph(selectedDay, bar, pricingCalendar); } clearTimeout(timeOut); timeOut = setTimeout(function () { // var x = (y + 156 + 22) / 22; var id = Math.ceil((scrollElem.scrollLeft() + 156 + 24) / 24); var selectedDay = $('li#day-id-' + id.toString()); var val = parseInt($(selectedDay).attr('data-scroll-value')); scrollElem.scrollLeft(val - me.addedScrollValue); if (me._mobileDevice) { bar = $('.bar-graph', selectedDay); me.__getSelectedGraph(selectedDay, bar, pricingCalendar); } }, 150); } } }); $('.bc-book-button').off(); $('.bc-book-button').on({ click: function (sender) { if ($(this).parents('.book-container').hasClass('book-sold')) { return false; } else { me.__maskLayer(sender, me); sender.preventDefault(); } } }); $('.bgc-item-selected').on({ click: function (sender) { if ($('.book-container').hasClass('book-sold')) { return false; } else { me.__maskLayer(sender, me); var linkPath = me.__TrackingUrl($('.bc-book-button', $(this).parents('.pricing-calendar-content')).attr('href')); $.venus.common.redirectFull(linkPath); } } }); $('.day').on({ click: function (sender) { var day = $(this); var bar = $('.bar-graph'); var pricingCalendar = bar.parents('.pricing-calendar-content'); if (!day.hasClass('pad-date')) { var scrollVal = parseInt(day.attr('data-scroll-value')) - me.addedScrollValue; $('.bgc-item', pricingCalendar).animate({ scrollLeft: scrollVal }, 800); } } }); $(me.__keys.pricingCalendarCloseButton).off(); $(me.__keys.pricingCalendarCloseButton).on({ click: function (e) { $(e.currentTarget).parents('.pricing-calendar-popup').hide(); $(e.currentTarget).parent().children().remove(); $.venus.mask.remove(); } }); $('body').off(); $('body').on({ click: function (sender) { if (!$(sender.target).parents('.pricing-calendar-popup').hasClass('pricing-calendar-popup')) { $('.pricing-calendar-popup .pricing-calendar', this).filter(':visible').children().remove(); $('.pricing-calendar-popup', this).filter(':visible').hide(); $.venus.mask.remove(); } } }); }, searchDownId: null, __loader: function (parentElem) { var topDealsMain = parentElem; $('.confirm-dialog .cd-container', topDealsMain).hide(); $('.confirm-dialog', topDealsMain).addClass('confirm-loader'); $('.confirm-dialog', topDealsMain).show(); $('.confirm-dialog .cd-loader-container', topDealsMain).show(); $.venus.common.addLoader({ sender: $('.confirm-dialog .cdl-loader-graphic', topDealsMain) }); }, __eventReg: function (me) { $(me.__keys.needHelp).on({ click: function (sender) { $(me.__keys.contactUs).slideDown(200); } }); $(me.__keys.contactUsClose).on({ click: function (sender) { /* $(me.__keys.contactUs).slideUp(200); */ } }); $('.ml-link a').off(); $('.ml-link a').on({ click: function (sender) { var link = $(sender.currentTarget); var linkDetails = $('.more-links .ml-details .ml-detail[data-link-id=' + link.attr('data-detail-id') + ']'); $('.minus').hide(); $('.default-hr').show(); if (linkDetails.length > 0) { var parentElem = $(sender.target).parents('.ml-link'); var ico = $('.minus', parentElem); var hr = $('.default-hr', parentElem); if (link.hasClass('clicked')) { linkDetails.animate({ height: 0 }, 300, 'swing', function () { linkDetails.css('height', '').hide(); ico.fadeOut(); hr.fadeIn(); link.removeClass('clicked'); }); } else { var displayedDetails = $('.ml-detail', '.more-links').filter(':visible'); ico.fadeIn(); hr.fadeOut(); if (displayedDetails.length > 0) { displayedDetails.hide(); linkDetails.show(); $('a.clicked').removeClass('clicked'); link.addClass('clicked'); } else { var curHeight = linkDetails.height(); linkDetails.css('height', 0).show().animate({ height: curHeight }, 300, 'swing', function () { link.addClass('clicked'); }); } } } return false; } }); $('.see-all').live({ // to get unique searchDownId click: function (sender) { me.__maskLayer(sender, me); sender.preventDefault(); } }); $(me.__keys.originText + ', ' + me.__keys.destinationText).live({ // to get unique searchDownId click: function () { me.searchDownId = $(this).parents('.search-down'); } }); $('.top-deals-search .search-down, .pricing-calendar-search .search-down').searchDown({ onClose: function (selected) { if (!selected) { var inputElem = $('.sd-data-text', me.searchDownId); if (inputElem.hasClass('watermark') || inputElem.val() == '') { inputElem.removeClass('watermark'); inputElem.val(inputElem[0].defaultValue); } } } }); $(me.__keys.dealsContainer).bind("mousewheel DOMMouseScroll", function (e) { $('.pricing-calendar-popup .pricing-calendar', this).filter(':visible').children().remove(); $('.pricing-calendar-popup', this).filter(':visible').hide(); }); $(me.__keys.deal).off(); $(me.__keys.deal).on({ click: function (sender) { var deal = $(this); me.hotelText = $('.hotel-name', deal).text(); //used in maskLayer function //check if detail anchor element is click if ($(sender.target).get(0).tagName.toLowerCase() != 'a') { $(me.__keys.dealHover).hide(); var deals = $(me.__keys.deals); $('.active', '.top-deals-main').removeClass('active'); deal.addClass('active'); deal.find('.details').addClass('active'); deal.find('.details-active').removeClass('active'); var topDealsMain = $(this).parents('.top-deals-main'); var qs = $(me.__keys.querystring, topDealsMain); //0;187-1941;2;12;18;dah = dealstype,citypair,duration,12 months,deal count, brand var citPairDeal = qs.val().split(';')[1].split('-'); var duration = qs.val().split(';')[2]; var $brand = qs.val().split(';')[5]; var updatedUrl = citPairDeal.length == 3 ? $('.settings-getpricingcalendar-path').attr('href') + "/_get/pc/package/" + citPairDeal[1] + "/" + citPairDeal[0] + "/" + duration + "n/" + deal.attr('data-hotel-id') + '?brand=' + $brand : $('.settings-getpricingcalendar-path').attr('href') + "/_get/pc/hotel/" + citPairDeal[0] + "/" + duration + "n/" + deal.attr('data-hotel-id') + '?brand=' + $brand; var topDeals = deal.parents('.top-deals'); $.ajax({ type: 'POST', dataType: 'json', url: updatedUrl, success: function (data) { $.venus.common.nowait(); $.venus.mask.insert(function () { $('.pricing-calendar-popup .pricing-calendar', topDeals).css('z-index', '999999'); $($.venus.mask.id + ', ' + $.venus.mask.id + ' > div').css({ 'z-index': '0', 'background-color': '#000000', 'opacity': '0.15' }); }); $('.pricing-calendar-popup .pricing-calendar', topDeals).replaceWith(data); var pricingCalendar = $('.pricing-calendar-popup', topDeals); pricingCalendar.css({ top: ((deal.position().top + 9) - pricingCalendar.height()) + 'px' }); me.__pricingCalendarEvent(); pricingCalendar.show(); me.__selectedDateScroll(pricingCalendar); }, error: function (jqXHR) { }, beforeSend: function (jqXHR, settings) { $.venus.common.wait({ type: 1, sender: sender.target }); } }); } else { me.__maskLayer(sender, me); sender.preventDefault(); } }, mouseover: function () { if (!me._mobileDevice) { var deal = $(this); var topDealsMain = deal.parents('.top-deals-main'); var dealHover = $('.hotel-hover', topDealsMain); dealHover.css({ top: (deal.position().top + 15) + 'px' }); dealHover.show(); } }, mouseleave: function () { if (!me._mobileDevice) { $(me.__keys.dealHover).hide(); } } }); // Top Deals Search For Both Normal And Small Version - DROPDOWN CHANGE $('.top-deals-search select').off(); $('.top-deals-search select').on({ change: function (sender) { var select = $(this); var topDealsMain = select.parents('.top-deals-main'); var container = $(me.__keys.confirmDialogContainer, topDealsMain); var stay = (select.val() == 1) ? select.val() + ' Night' : select.val() + ' Nights'; $('.stay-text', topDealsMain).text(stay); if (!container.is(':visible')) { $.venus.common.wait({ type: 1, sender: $(sender.currentTarget).siblings().find('.dd-select') }); if (select.hasClass('duration')) { $(me.__keys.confirmDialogContainer, topDealsMain).show(); $.venus.common.nowait(); } } } }); $('.top-deals-search .sd-item-exact-match, .top-deals-search .sd-item').die(); $('.top-deals-search .sd-item-exact-match, .top-deals-search .sd-item').live({ click: function (sender) { var searchDown = $(this); var topDealsMain = searchDown.parents('.top-deals-main'); $.venus.common.wait({ type: 1, sender: searchDown.parents('.search-down') }); /*$(me.__keys.confirmDialogContainer, topDealsMain).show(); $.venus.common.nowait();*/ if (searchDown.parents('.gradient').hasClass('ac')) { $(me.__keys.confirmDialogContainer, topDealsMain).show(); $.venus.common.nowait(); } else { if (searchDown.parents('.search-down').attr('data-mode') != 4) { var qs = $(me.__keys.querystring, topDealsMain); var version = topDealsMain.hasClass('nm') ? 'nm' : 'sm'; setTimeout(function () { var keys = me.__getSelectedSearchKeys($('.search-down', topDealsMain)); var stay = $('select', topDealsMain).val(); var citPairDeal = qs.val().split(';')[1].split('-'); var duration = qs.val().split(';')[2]; var months = qs.val().split(';')[3]; var maxDeals = qs.val().split(';')[4]; var brand = qs.val().split(';')[5]; var updatedUrl = $('.settings-getupdatedtopdealssearch-path').attr('href') + "?params=4;" + keys[0] + "-" + keys[1] + "-0;" + stay + ';' + months + ';' + maxDeals + ';' + brand + ';' + version; $.venus.events.notify(me.__events.crossc, { id: $(me.__keys.topDealsSearchNormal, topDealsMain), replace: true, link: updatedUrl, after: function () { me.__fixList(topDealsMain); me.__initSearchDown(topDealsMain); $(me.__keys.confirmDialogContainer, topDealsMain).show(); $.venus.common.nowait(); me.__eventReg(me); } }); }, 50); } else { $(me.__keys.confirmDialogContainer, topDealsMain).show(); $.venus.common.nowait(); } } } }); // Confirm Dialog For Both Normal And Small Version - CHANGE $(me.__keys.confirmDialogChangeButton).off(); $(me.__keys.confirmDialogChangeButton).on({ click: function (sender) { sender.preventDefault(); var topDealsMain = $(this).parents('.top-deals-main'); var qs = $(me.__keys.querystring, topDealsMain); var version = topDealsMain.hasClass('nm') ? 'nm' : 'sm'; me.__loader(topDealsMain); var keys = me.__getSelectedSearchKeys($('.search-down', topDealsMain)); var supplierTop = 0; $('.search-down .sd-data-text', topDealsMain).each(function () { if (typeof ($(this).attr('data-hotelid')) != 'undefined') { supplierTop = $(this).attr('data-hotelid'); } }); var stay = $('select', topDealsMain).val(); var citPairDeal = qs.val().split(';')[1].split('-'); var duration = qs.val().split(';')[2]; var months = qs.val().split(';')[3]; var maxDeals = qs.val().split(';')[4]; var brand = qs.val().split(';')[5]; var sort = qs.val().split(';')[1].split('-')[0] != keys[0] ? 0 : $('.sort-type', topDealsMain).val(); var updatedUrl = citPairDeal.length == 3 ? $('.settings-getupdatedtopdeals-path').attr('href') + "?params=4;" + keys[0] + "-" + keys[1] + "-" + supplierTop + ";" + stay + ";" + months + ';' + maxDeals + ';' + brand + ';' + version + ';' + sort : $('.settings-getupdatedtopdeals-path').attr('href') + "?params=0;" + keys[0] + "-" + supplierTop + ";" + stay + ";" + months + ';' + maxDeals + ';' + brand + ';' + version + ';' + sort; //should be the same element for adding loader. var loader = $('.confirm-dialog .cdl-loader-graphic', topDealsMain).attr('loader-id'); $.venus.events.notify(me.__events.crossc, { id: $(me.__keys.topDealsDetailsNormal, topDealsMain), replace: true, link: updatedUrl, after: function () { $(me.__keys.confirmDialogContainer, topDealsMain).hide(); $.venus.common.removeLoader({ sender: $('#' + loader) }); me.__initSearchDown(topDealsMain); me.__reInitialise(me); } }); } }); // Confirm Dialog For Both Normal And Small Version - CANCEL $(me.__keys.confirmDialogCancelButton).off(); $(me.__keys.confirmDialogCancelButton).on({ click: function () { var topDealsMain = $(this).parents('.top-deals-main'); var version = topDealsMain.hasClass('nm') ? 'nm' : 'sm'; $(me.__keys.confirmDialogContainer, topDealsMain).hide(); $.venus.events.notify(me.__events.crossc, { id: $(me.__keys.topDealsSearchNormal, topDealsMain), replace: true, link: $('.settings-getupdatedtopdealssearch-path').attr('href') + '?params=' + $(me.__keys.querystring, topDealsMain).val() + ';' + version, after: function () { me.__fixList(topDealsMain); me.__initSearchDown(topDealsMain); me.__eventReg(me); var stay = ($('select', topDealsMain).val() == 1) ? $('select', topDealsMain).val() + ' Night' : $('select', topDealsMain).val() + ' Nights'; $('.stay-text', topDealsMain).text(stay); } }); } }); /*product static events: same code in venus.booking.js*/ $(me.__keys.accomBonusContent).on({ mouseenter: function () { var position = $(this).position(); var height = $(this).height(); var leftPos; var topPos; leftPos = position.left - 41; /*check for the last deal to adjust the hover display of the div */ if (height <= 84) { topPos = position.top + height + 15; } else { // Hidden or shown if ($(this).parent().parent().find(me.__keys.showMoreLink).css('display') == 'none') { topPos = position.top + height + 15; } else { topPos = position.top + 101 + 15; } } $(this).parent().parent().children(me.__keys.dealsBonusPopup).show().css({ 'left': leftPos, 'top': topPos }); }, mouseleave: function () { $(this).parent().parent().children(me.__keys.dealsBonusPopup).hide(); } }); $(me.__keys.showMapLink).live({ click: function (sender) { if ($('.deals-booking-layers').length > 0) { $.venus.dealsLayer.activateMapTab($(me.__keys.mapTabLink), 'maps'); } else { var offSet = $('.deals-map-big').offset(); $.venus.common.scrollDown(offSet.top, 1000); } } }); $(me.__keys.facilitySmallImg).live({ click: function () { var src = $(this).attr('src'); $(this).parents().next(me.__keys.facilityBigImg).children().attr('src', src); $(this).addClass(me.__keys.classFacilityImgBorder); $(this).parent().siblings().children().filter('.' + me.__keys.classFacilityImgBorder).removeClass(me.__keys.classFacilityImgBorder); } }); $(me.__keys.imageHover).live({ click: function (e) { $(me.__keys.imageLarge).attr('src', $(e.target).attr('src')); $(me.__keys.imageHover).removeClass('img-selected').addClass('img-unselected'); $(e.target).removeClass('img-unselected').addClass('img-selected'); $(me.__keys.imageHover).next().removeClass('img-selected-font'); $(e.target).next().addClass('img-selected-font'); var imgText = $(e.target).next().text(); $(me.__keys.imageText).text(imgText); } }); $(me.__keys.imageNavLink).on({ mouseenter: function (e) { $(e.target).closest('a').addClass('solid-opacity'); }, mouseleave: function (e) { $(e.target).closest('a').removeClass('solid-opacity'); }, click: function (e) { var goToIndex = 0; //if the navigation previous is clicked. if ($(e.target).closest('div').hasClass('di-img-prev')) { $(me.__keys.imageHover).each(function (index) { if ($(this).attr('src') == $(me.__keys.imageLarge).attr('src')) { if (index == 0) { goToIndex = $(me.__keys.imageHover).length - 1; } else { goToIndex = index - 1; } return; } }); } else { //if the navigation next is clicked. $(me.__keys.imageHover).each(function (index) { if ($(this).attr('src') == $(me.__keys.imageLarge).attr('src')) { if ((index + 1) == $(me.__keys.imageHover).length) { goToIndex = 0; } else { goToIndex = index + 1; } return; } }); } $($(me.__keys.imageHover)[goToIndex]).click(); } }); /*pricing calendar search*/ $('.pricing-calendar-search input[type="radio"]').off(); $('.pricing-calendar-search input[type="radio"]').on({ change: function (sender) { var radioElem = $(this); var pricingProduct = radioElem.parents('.product-pricing-calendar'); $('input[type="radio"]', pricingProduct).attr('checked', false); $(this, pricingProduct).attr('checked', true); if (radioElem.val() == 4) { $('.ps-flight-mode', pricingProduct).css('display', 'table-cell'); var originSelect = $('#' + $('select.select-origin-flight', pricingProduct).attr('fixlistid')); originSelect.fixlist('select', { index: 0 }); } else { $('.ps-flight-mode', pricingProduct).hide(); } $(me.__keys.confirmDialogContainer, pricingProduct).show(); } }); $(me.__keys.confirmDialogChangeButton, '.product-pricing-calendar').off(); $(me.__keys.confirmDialogChangeButton, '.product-pricing-calendar').on({ click: function (sender) { sender.preventDefault(); var pricingProduct = $(this).parents('.product-pricing-calendar'); me.__loader(pricingProduct); var qs = $('#qs-calendar-search', pricingProduct); var stay = $('select.duration', pricingProduct).val(); var supplierTop = $('#supplier-top').val(); var citPairDeal = qs.val().split(';')[1].split('-'); var origin = (qs.val().split(';')[0] == 0) ? citPairDeal[0] : citPairDeal[1]; var $brand = qs.val().split(';')[5]; var updatedUrl = $('input[type="radio"]:checked', pricingProduct).val() == 4 ? $('.settings-getproductdealssetting-path').attr('href') + '/_get/pcp/package/' + origin + "/" + $('select.select-origin-flight', pricingProduct).val() + "/" + stay + "n/" + supplierTop + '?brand=' + $brand : $('.settings-getproductdealssetting-path').attr('href') + '/_get/pcp/hotel/' + origin + '/' + stay + 'n/' + supplierTop + '?brand=' + $brand; var loader = $('.confirm-dialog .cdl-loader-graphic', pricingProduct).attr('loader-id'); $.venus.events.notify(me.__events.crossc, { id: '.product-pricing-graph', replace: true, link: updatedUrl, after: function () { $.venus.common.nowait(); me.addedScrollValue = -10; me.__selectedDateScroll($('.pricing-calendar-content')); me.__pricingCalendarEvent(); $(me.__keys.confirmDialogContainer, pricingProduct).hide(); $.venus.common.removeLoader({ sender: $('#' + loader) }); $('select', '.pricing-calendar-search').fixlist(); me.__eventReg(me); } }); } }); $(me.__keys.confirmDialogCancelButton, '.product-pricing-calendar').off(); $(me.__keys.confirmDialogCancelButton, '.product-pricing-calendar').on({ click: function (sender) { var pricingProduct = $(this).parents('.product-pricing-calendar'); var qs = $('#qs-calendar-graph', pricingProduct); var dealsType = qs.val().split(';')[0]; var citPairDeal = qs.val().split(';')[1].split('-'); var duration = qs.val().split(';')[2]; if ($('input[type="radio"]:checked', pricingProduct).val() == 4) { if (dealsType == 0) { $.venus.common.wait({ type: 1, sender: sender.target }); $('.ps-flight-mode', pricingProduct).hide(); $('input[type="radio"]', pricingProduct).attr('checked', false); $('.pricing-accom-radio', pricingProduct).attr('checked', true); var durationSelect = $('#' + $('select.duration', pricingProduct).attr('fixlistid')); selectedIndex = $('select.duration option[value=' + duration + ']', pricingProduct).index(); durationSelect.fixlist('select', { index: selectedIndex }); $.venus.common.nowait(); $(me.__keys.confirmDialogContainer, pricingProduct).hide(); } else if (citPairDeal[0] != $('select.select-origin-flight', pricingProduct).val() || citPairDeal[0] == $('select.select-origin-flight', pricingProduct).val()) { var originSelect = $('#' + $('select.select-origin-flight', pricingProduct).attr('fixlistid')); var selectedIndex = $('select.select-origin-flight option[data-orig-townid=' + citPairDeal[0] + ']', pricingProduct).index(); originSelect.fixlist('select', { index: selectedIndex }); var durationSelect = $('#' + $('select.duration', pricingProduct).attr('fixlistid')); selectedIndex = $('select.duration option[value=' + duration + ']', pricingProduct).index(); durationSelect.fixlist('select', { index: selectedIndex }); $('.dd-option', durationSelect).removeClass('dd-hover'); $(me.__keys.confirmDialogContainer, pricingProduct).hide(); } } else { if (dealsType == 4) { $.venus.common.wait({ type: 1, sender: sender.target }); $('.ps-flight-mode', pricingProduct).css('display', 'table-cell'); $('input[type="radio"]', pricingProduct).attr('checked', false); $('.pricing-package-radio', pricingProduct).attr('checked', true); var durationSelect = $('#' + $('select.duration', pricingProduct).attr('fixlistid')); selectedIndex = $('select.duration option[value=' + duration + ']', pricingProduct).index(); durationSelect.fixlist('select', { index: selectedIndex }); $.venus.common.nowait(); $(me.__keys.confirmDialogContainer, pricingProduct).hide(); } else if (duration != $('#supplier-top').val()) { var durationSelect = $('#' + $('select.duration', pricingProduct).attr('fixlistid')); var selectedIndex = $('select.duration option[value=' + duration + ']', pricingProduct).index(); durationSelect.fixlist('select', { index: selectedIndex }); $('.dd-option', durationSelect).removeClass('dd-hover'); $(me.__keys.confirmDialogContainer, pricingProduct).hide(); } } } }); $('.product-pricing-calendar select').off(); $('.product-pricing-calendar select').on({ change: function (sender) { var select = $(this); var pricingProduct = select.parents('.product-pricing-calendar'); var container = $(me.__keys.confirmDialogContainer, pricingProduct); if (!container.is(':visible')) { $.venus.common.wait({ type: 1, sender: $(sender.currentTarget).siblings().find('.dd-select') }); $(me.__keys.confirmDialogContainer, pricingProduct).show(); $.venus.common.nowait(); } } }); $('.flight-package-box').off(); $('.flight-package-box').on({ click: function (sender) { if ($('.pricing-accom-radio').is(':checked') && $('#is-valid-for-package').val() == 'True') { $('.pricing-calendar-search input[type="radio"]').change(); } } }); } } })(jQuery); $(document).ready(function () { $.venus.topDeals.__initialise(); setTimeout(function () { $('.deals-map-big').dealsMap(); }, 3000); }); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/venus.toolbar.debug.js' (Mode: Static) */ (function ($) { $.venus.toolbar = { __initialise: function () { var me = this; this.__eventReg(me); this.__hideRecentDetails(me); this.__cartEvent(me); this.__recentlyEvent(me); }, __keys: { bar: '.bar', barContent: '.bar-content', cartBonus: '.tb-cart-flight-container .cart-bonus-detail', cartVoucher: '.tb-cart-flight-container .cart-voucher-detail', cartContainer: '.tb-cart-flight-container', cartButton: '.tb-shopping-cart', cartMargin: '.tb-cart-flight-margin', confirmationBox: '.tool-bar .tb-content .tb-recently-content .clear-all-recently-viewed', recentlyViewedItemsBox: '.tool-bar .tb-content .tb-recently-content .tb-recently-viewed', recentlyViewedItemsContent: '.recently-view .rc-container .rc-margin', recentlyViewedMargin: '.tool-bar .tb-content .tb-recently-container .tb-recently .tb-recently-margin', tabButtonRecentlyViewed: '.tool-bar .tb-content .tb-recently-content .tb-recently-button', printButton: '.tb-print', cartBookButton: '.cib-button-text' }, cartHeight: 0, __cartEvent: function (me) { //adjust bar height setTimeout(function () { me.__renderCartItemVerticalBars(me); }, 200); //place cart content to the outer top portion of the browser var height = $(me.__keys.cartContainer).height() + 1000; var containerTop = '-' + height + 'px'; $(me.__keys.cartMargin).css('top', containerTop) me.cartHeight = containerTop; var cartContainer = $(me.__keys.cartContainer); var cartWt = cartContainer.outerWidth() + 4; cartContainer.css({ 'overflow': 'hidden' }); }, __renderCartItemVerticalBars: function (me) { var bar = $(me.__keys.bar); $.each(bar, function () { var parent = $(this).parent(); var bContent = $(me.__keys.barContent, parent); $(this).css('height', bContent.height() + 24); }); }, __recentlyEvent: function (me) { var detail = $('.rc-margin'); var height = -1 - detail.height(); detail.css({ 'top': height + 'px' }); }, __hideRecentDetails: function (me) { if ($('.rc-item').length >= 10) { $('.rc-show-container').show(); $('.rc-item:nth-child(10)') .addClass('border-last-child') .nextAll('.rc-item').hide(); } }, __eventReg: function (me) { var RecentlyTimeOut = null; $(me.__keys.cartBookButton).live({ click: function (sender) { $(this).css("opacity", "0.50"); $(this).die(); $.venus.common.wait({ type: 1, sender: sender.target }); } }); $(me.__keys.printButton).live({ click: function (sender) { window.print(); } }); $(me.__keys.tabButtonRecentlyViewed).live({ click: function (sender) { //if ($(me.__keys.cartMargin).attr('data-displayed') == 'displayed') { // $(me.__keys.cartButton).trigger('click'); //} sender.stopPropagation(); var rv = $('.recently-view'); var rContainer = $('.recently-view .rc-container'); var rMargin = $(me.__keys.recentlyViewedItemsContent); var rContent = $('.tool-bar .tb-content .tb-recently-content'); var height = 0; if (!rContent.is('.tb-recently-content-clicked')) { rContent.addClass('tb-recently-content-clicked'); //rMargin.attr("data-displayed", "displayed"); } if (rMargin.offset().top < 0) { height = rMargin.height(); if (height > 0) { rContainer.animate({ top: height + 'px' }); rv.animate({ height: height + 'px' }); } } else { height = (-1 - rMargin.height()); rContainer.animate({ top: height + 'px' }); rv.animate({ height: height + 'px' }); } } }); //now set up an event listener so that clicking anywhere outside will close the menu $(document).click(function (event) { //check up the tree of the click target to check whether user has clicked outside of menu if ($(event.target).parents('.recently-view').length == 0) { // your code to hide menu var rv = $('.recently-view'); var rContainer = $('.recently-view .rc-container'); var rMargin = $(me.__keys.recentlyViewedItemsContent); var height = 0; height = (-1 - rMargin.height()); rContainer.animate({ top: height + 'px' }); rv.animate({ height: height + 'px' }); } }); $(me.__keys.cartButton).live({ click: function (sender) { if ($(me.__keys.recentlyViewedItemsContent).attr('data-displayed') == 'displayed') { $(me.__keys.tabButtonRecentlyViewed).trigger('click'); } var cartMargin = $(me.__keys.cartMargin); if (cartMargin.position().top < 0) { cartMargin.animate({ top: 0 }); $(me.__keys.cartContainer).css('top', 1); cartMargin.attr("displayed", "displayed"); } else { cartMargin.animate({ top: me.cartHeight }, function () { $(me.__keys.cartContainer).css('top', me.cartHeight); }); cartMargin.attr("displayed", "hidden"); } } }); $('.rc-show-text').live({ click: function (sender) { $('.rc-show-container').hide() .prev().addClass('border-last-child'); $('.rc-item:nth-child(10)') .removeClass('border-last-child') .nextAll('.rc-item').show(); } }); $('.rc-view-button').live({ click: function (sender) { $.venus.common.wait({ type: 1, sender: $(sender.target) }); var now = new Date(); var time = now.getTime(); time += 3600 * 1000; now.setTime(time); document.cookie = 'vns_ck=' + escape($(this).attr('href').substr($(this).attr('href').indexOf('search'))) + '; expires=' + now.toGMTString(); } }); $('.tool-bar .tb-content .tb-recently-content .tb-recently-clear').bind({ click: function (sender) { var confirmationBox = $(me.__keys.confirmationBox); if (confirmationBox.is(':visible')) { confirmationBox.hide(); } else { confirmationBox.show(); } } }); $('.confirm-button.yes').bind({ click: function (sender) { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; if (cookie.indexOf('vns_rc_ck') != -1 || cookie.indexOf('vns_ck') != -1) { var eqPos = cookie.indexOf("="); var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; } } $(me.__keys.confirmationBox).hide(); } }); $('.confirm-button.no').bind({ click: function (sender) { $(me.__keys.confirmationBox).hide(); } }); } }; })(jQuery); $(document).ready(function () { $.venus.toolbar.__initialise(); }); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/venus.session.debug.js' (Mode: Static) */ (function ($) { $.venus.session = { __controller: function () { return $('.settings-session-path').attr('href'); }, id: function () { var me = this; var result = null; $.venus.ajax.getSync({ path: me.__controller() + '/get', after: function (data) { result = data; } }); return result; }, getValue: function (params) { var result = null; var action = null; var me = this; switch (params.type) { case 0: action = '/getvisit'; break; case 1: action = '/getlimit'; break; } $.venus.ajax.getSync({ path: me.__controller() + action, after: function (data) { result = data; } }); return result; }, updateValue: function (params) { var result = null; var me = this; var action = null; switch (params.type) { case 0: action = '/updatevisit?type=' + params.mode; break; case 1: action = '/updatelimit'; break; case 2: action = '/updatevisitlapsetime?type=' + params.mode + '&resetkey=' + 'false'; break; case 3: action = '/updatevisitlapsetime?type=' + params.mode + '&resetkey=' + 'true'; break; } //Validator for session controller settings : check if settings on session path controller is not configured properly and return zero value for result if (typeof (me.__controller()) == 'undefined') { result = 0; } else { $.venus.ajax.getSync({ path: me.__controller() + action, after: function (data) { result = data; } }); } return result; }, getVisitTime: function () { var result = null; var me = this; //Validator for session controller settings : check if settings on session path controller is not configured properly and return zero value for result if (typeof (me.__controller()) == 'undefined') { result = 0; } else { $.venus.ajax.getSync({ path: me.__controller() + '/getvisittime', after: function (data) { result = data; } }); } return result; } }; })(jQuery);; /* Comment Generated by Combres - Resource '~/Resources/Scripts/venus.dateLibrary.debug.js' (Mode: Static) */ Date.CultureInfo = { name: "en-US", englishName: "English (United States)", nativeName: "English (United States)", dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], abbreviatedDayNames: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], shortestDayNames: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], firstLetterDayNames: ["S", "M", "T", "W", "T", "F", "S"], monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], abbreviatedMonthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], amDesignator: "AM", pmDesignator: "PM", firstDayOfWeek: 0, twoDigitYearMax: 2029, dateElementOrder: "mdy", formatPatterns: { shortDate: "M/d/yyyy", longDate: "dddd, MMMM dd, yyyy", shortTime: "h:mm tt", longTime: "h:mm:ss tt", fullDateTime: "dddd, MMMM dd, yyyy h:mm:ss tt", sortableDateTime: "yyyy-MM-ddTHH:mm:ss", universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", monthDay: "MMMM dd", yearMonth: "MMMM, yyyy" }, regexPatterns: { jan: /^jan(uary)?/i, feb: /^feb(ruary)?/i, mar: /^mar(ch)?/i, apr: /^apr(il)?/i, may: /^may/i, jun: /^jun(e)?/i, jul: /^jul(y)?/i, aug: /^aug(ust)?/i, sep: /^sep(t(ember)?)?/i, oct: /^oct(ober)?/i, nov: /^nov(ember)?/i, dec: /^dec(ember)?/i, sun: /^su(n(day)?)?/i, mon: /^mo(n(day)?)?/i, tue: /^tu(e(s(day)?)?)?/i, wed: /^we(d(nesday)?)?/i, thu: /^th(u(r(s(day)?)?)?)?/i, fri: /^fr(i(day)?)?/i, sat: /^sa(t(urday)?)?/i, future: /^next/i, past: /^last|past|prev(ious)?/i, add: /^(\+|after|from)/i, subtract: /^(\-|before|ago)/i, yesterday: /^yesterday/i, today: /^t(oday)?/i, tomorrow: /^tomorrow/i, now: /^n(ow)?/i, millisecond: /^ms|milli(second)?s?/i, second: /^sec(ond)?s?/i, minute: /^min(ute)?s?/i, hour: /^h(ou)?rs?/i, week: /^w(ee)?k/i, month: /^m(o(nth)?s?)?/i, day: /^d(ays?)?/i, year: /^y((ea)?rs?)?/i, shortMeridian: /^(a|p)/i, longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i, ordinalSuffix: /^\s*(st|nd|rd|th)/i, timeContext: /^\s*(\:|a|p)/i }, abbreviatedTimeZoneStandard: { GMT: "-000", EST: "-0400", CST: "-0500", MST: "-0600", PST: "-0700" }, abbreviatedTimeZoneDST: { GMT: "-000", EDT: "-0500", CDT: "-0600", MDT: "-0700", PDT: "-0800"} }; Date.getMonthNumberFromName = function (name) { var n = Date.CultureInfo.monthNames, m = Date.CultureInfo.abbreviatedMonthNames, s = name.toLowerCase(); for (var i = 0; i < n.length; i++) { if (n[i].toLowerCase() == s || m[i].toLowerCase() == s) { return i; } } return -1; }; Date.getDayNumberFromName = function (name) { var n = Date.CultureInfo.dayNames, m = Date.CultureInfo.abbreviatedDayNames, o = Date.CultureInfo.shortestDayNames, s = name.toLowerCase(); for (var i = 0; i < n.length; i++) { if (n[i].toLowerCase() == s || m[i].toLowerCase() == s) { return i; } } return -1; }; Date.isLeapYear = function (year) { return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)); }; Date.getDaysInMonth = function (year, month) { return [31, (Date.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; }; Date.getTimezoneOffset = function (s, dst) { return (dst || false) ? Date.CultureInfo.abbreviatedTimeZoneDST[s.toUpperCase()] : Date.CultureInfo.abbreviatedTimeZoneStandard[s.toUpperCase()]; }; Date.getTimezoneAbbreviation = function (offset, dst) { var n = (dst || false) ? Date.CultureInfo.abbreviatedTimeZoneDST : Date.CultureInfo.abbreviatedTimeZoneStandard, p; for (p in n) { if (n[p] === offset) { return p; } } return null; }; Date.prototype.clone = function () { return new Date(this.getTime()); }; Date.prototype.compareTo = function (date) { if (isNaN(this)) { throw new Error(this); } if (date instanceof Date && !isNaN(date)) { return (this > date) ? 1 : (this < date) ? -1 : 0; } else { throw new TypeError(date); } }; Date.prototype.equals = function (date) { return (this.compareTo(date) === 0); }; Date.prototype.between = function (start, end) { var t = this.getTime(); return t >= start.getTime() && t <= end.getTime(); }; Date.prototype.addMilliseconds = function (value) { this.setMilliseconds(this.getMilliseconds() + value); return this; }; Date.prototype.addSeconds = function (value) { return this.addMilliseconds(value * 1000); }; Date.prototype.addMinutes = function (value) { return this.addMilliseconds(value * 60000); }; Date.prototype.addHours = function (value) { return this.addMilliseconds(value * 3600000); }; Date.prototype.addDays = function (value) { return this.addMilliseconds(value * 86400000); }; Date.prototype.addWeeks = function (value) { return this.addMilliseconds(value * 604800000); }; Date.prototype.addMonths = function (value) { var n = this.getDate(); this.setDate(1); this.setMonth(this.getMonth() + value); this.setDate(Math.min(n, this.getDaysInMonth())); return this; }; Date.prototype.addYears = function (value) { return this.addMonths(value * 12); }; Date.prototype.add = function (config) { if (typeof config == "number") { this._orient = config; return this; } var x = config; if (x.millisecond || x.milliseconds) { this.addMilliseconds(x.millisecond || x.milliseconds); } if (x.second || x.seconds) { this.addSeconds(x.second || x.seconds); } if (x.minute || x.minutes) { this.addMinutes(x.minute || x.minutes); } if (x.hour || x.hours) { this.addHours(x.hour || x.hours); } if (x.month || x.months) { this.addMonths(x.month || x.months); } if (x.year || x.years) { this.addYears(x.year || x.years); } if (x.day || x.days) { this.addDays(x.day || x.days); } return this; }; Date._validate = function (value, min, max, name) { if (typeof value != "number") { throw new TypeError(value + " is not a Number."); } else if (value < min || value > max) { throw new RangeError(value + " is not a valid value for " + name + "."); } return true; }; Date.validateMillisecond = function (n) { return Date._validate(n, 0, 999, "milliseconds"); }; Date.validateSecond = function (n) { return Date._validate(n, 0, 59, "seconds"); }; Date.validateMinute = function (n) { return Date._validate(n, 0, 59, "minutes"); }; Date.validateHour = function (n) { return Date._validate(n, 0, 23, "hours"); }; Date.validateDay = function (n, year, month) { return Date._validate(n, 1, Date.getDaysInMonth(year, month), "days"); }; Date.validateMonth = function (n) { return Date._validate(n, 0, 11, "months"); }; Date.validateYear = function (n) { return Date._validate(n, 1, 9999, "seconds"); }; Date.prototype.set = function (config) { var x = config; if (!x.millisecond && x.millisecond !== 0) { x.millisecond = -1; } if (!x.second && x.second !== 0) { x.second = -1; } if (!x.minute && x.minute !== 0) { x.minute = -1; } if (!x.hour && x.hour !== 0) { x.hour = -1; } if (!x.day && x.day !== 0) { x.day = -1; } if (!x.month && x.month !== 0) { x.month = -1; } if (!x.year && x.year !== 0) { x.year = -1; } if (x.millisecond != -1 && Date.validateMillisecond(x.millisecond)) { this.addMilliseconds(x.millisecond - this.getMilliseconds()); } if (x.second != -1 && Date.validateSecond(x.second)) { this.addSeconds(x.second - this.getSeconds()); } if (x.minute != -1 && Date.validateMinute(x.minute)) { this.addMinutes(x.minute - this.getMinutes()); } if (x.hour != -1 && Date.validateHour(x.hour)) { this.addHours(x.hour - this.getHours()); } if (x.month !== -1 && Date.validateMonth(x.month)) { this.addMonths(x.month - this.getMonth()); } if (x.year != -1 && Date.validateYear(x.year)) { this.addYears(x.year - this.getFullYear()); } if (x.day != -1 && Date.validateDay(x.day, this.getFullYear(), this.getMonth())) { this.addDays(x.day - this.getDate()); } if (x.timezone) { this.setTimezone(x.timezone); } if (x.timezoneOffset) { this.setTimezoneOffset(x.timezoneOffset); } return this; }; Date.prototype.clearTime = function () { this.setHours(0); this.setMinutes(0); this.setSeconds(0); this.setMilliseconds(0); return this; }; Date.prototype.isLeapYear = function () { var y = this.getFullYear(); return (((y % 4 === 0) && (y % 100 !== 0)) || (y % 400 === 0)); }; Date.prototype.isWeekday = function () { return !(this.is().sat() || this.is().sun()); }; Date.prototype.getDaysInMonth = function () { return Date.getDaysInMonth(this.getFullYear(), this.getMonth()); }; Date.prototype.moveToFirstDayOfMonth = function () { return this.set({ day: 1 }); }; Date.prototype.moveToLastDayOfMonth = function () { return this.set({ day: this.getDaysInMonth() }); }; Date.prototype.moveToDayOfWeek = function (day, orient) { var diff = (day - this.getDay() + 7 * (orient || +1)) % 7; return this.addDays((diff === 0) ? diff += 7 * (orient || +1) : diff); }; Date.prototype.moveToMonth = function (month, orient) { var diff = (month - this.getMonth() + 12 * (orient || +1)) % 12; return this.addMonths((diff === 0) ? diff += 12 * (orient || +1) : diff); }; Date.prototype.getDayOfYear = function () { return Math.floor((this - new Date(this.getFullYear(), 0, 1)) / 86400000); }; Date.prototype.getWeekOfYear = function (firstDayOfWeek) { var y = this.getFullYear(), m = this.getMonth(), d = this.getDate(); var dow = firstDayOfWeek || Date.CultureInfo.firstDayOfWeek; var offset = 7 + 1 - new Date(y, 0, 1).getDay(); if (offset == 8) { offset = 1; } var daynum = ((Date.UTC(y, m, d, 0, 0, 0) - Date.UTC(y, 0, 1, 0, 0, 0)) / 86400000) + 1; var w = Math.floor((daynum - offset + 7) / 7); if (w === dow) { y--; var prevOffset = 7 + 1 - new Date(y, 0, 1).getDay(); if (prevOffset == 2 || prevOffset == 8) { w = 53; } else { w = 52; } } return w; }; Date.prototype.isDST = function () { console.log('isDST'); return this.toString().match(/(E|C|M|P)(S|D)T/)[2] == "D"; }; Date.prototype.getTimezone = function () { return Date.getTimezoneAbbreviation(this.getUTCOffset, this.isDST()); }; Date.prototype.setTimezoneOffset = function (s) { var here = this.getTimezoneOffset(), there = Number(s) * -6 / 10; this.addMinutes(there - here); return this; }; Date.prototype.setTimezone = function (s) { return this.setTimezoneOffset(Date.getTimezoneOffset(s)); }; Date.prototype.getUTCOffset = function () { var n = this.getTimezoneOffset() * -10 / 6, r; if (n < 0) { r = (n - 10000).toString(); return r[0] + r.substr(2); } else { r = (n + 10000).toString(); return "+" + r.substr(1); } }; Date.prototype.getDayName = function (abbrev) { return abbrev ? Date.CultureInfo.abbreviatedDayNames[this.getDay()] : Date.CultureInfo.dayNames[this.getDay()]; }; Date.prototype.getMonthName = function (abbrev) { return abbrev ? Date.CultureInfo.abbreviatedMonthNames[this.getMonth()] : Date.CultureInfo.monthNames[this.getMonth()]; }; Date.prototype._toString = Date.prototype.toString; Date.prototype.toString = function (format) { var self = this; var p = function p(s) { return (s.toString().length == 1) ? "0" + s : s; }; return format ? format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g, function (format) { switch (format) { case "hh": return p(self.getHours() < 13 ? self.getHours() : (self.getHours() - 12)); case "h": return self.getHours() < 13 ? self.getHours() : (self.getHours() - 12); case "HH": return p(self.getHours()); case "H": return self.getHours(); case "mm": return p(self.getMinutes()); case "m": return self.getMinutes(); case "ss": return p(self.getSeconds()); case "s": return self.getSeconds(); case "yyyy": return self.getFullYear(); case "yy": return self.getFullYear().toString().substring(2, 4); case "dddd": return self.getDayName(); case "ddd": return self.getDayName(true); case "dd": return p(self.getDate()); case "d": return self.getDate().toString(); case "MMMM": return self.getMonthName(); case "MMM": return self.getMonthName(true); case "MM": return p((self.getMonth() + 1)); case "M": return self.getMonth() + 1; case "t": return self.getHours() < 12 ? Date.CultureInfo.amDesignator.substring(0, 1) : Date.CultureInfo.pmDesignator.substring(0, 1); case "tt": return self.getHours() < 12 ? Date.CultureInfo.amDesignator : Date.CultureInfo.pmDesignator; case "zzz": case "zz": case "z": return ""; } }) : this._toString(); }; Date.now = function () { return new Date(); }; Date.today = function () { return Date.now().clearTime(); }; Date.prototype._orient = +1; Date.prototype.next = function () { this._orient = +1; return this; }; Date.prototype.last = Date.prototype.prev = Date.prototype.previous = function () { this._orient = -1; return this; }; Date.prototype._is = false; Date.prototype.is = function () { this._is = true; return this; }; Number.prototype._dateElement = "day"; Number.prototype.fromNow = function () { var c = {}; c[this._dateElement] = this; return Date.now().add(c); }; Number.prototype.ago = function () { var c = {}; c[this._dateElement] = this * -1; return Date.now().add(c); }; (function () { var $D = Date.prototype, $N = Number.prototype; var dx = ("sunday monday tuesday wednesday thursday friday saturday").split(/\s/), mx = ("january february march april may june july august september october november december").split(/\s/), px = ("Millisecond Second Minute Hour Day Week Month Year").split(/\s/), de; var df = function (n) { return function () { if (this._is) { this._is = false; return this.getDay() == n; } return this.moveToDayOfWeek(n, this._orient); }; }; for (var i = 0; i < dx.length; i++) { $D[dx[i]] = $D[dx[i].substring(0, 3)] = df(i); } var mf = function (n) { return function () { if (this._is) { this._is = false; return this.getMonth() === n; } return this.moveToMonth(n, this._orient); }; }; for (var j = 0; j < mx.length; j++) { $D[mx[j]] = $D[mx[j].substring(0, 3)] = mf(j); } var ef = function (j) { return function () { if (j.substring(j.length - 1) != "s") { j += "s"; } return this["add" + j](this._orient); }; }; var nf = function (n) { return function () { this._dateElement = n; return this; }; }; for (var k = 0; k < px.length; k++) { de = px[k].toLowerCase(); $D[de] = $D[de + "s"] = ef(px[k]); $N[de] = $N[de + "s"] = nf(de); } } ()); Date.prototype.toJSONString = function () { return this.toString("yyyy-MM-ddThh:mm:ssZ"); }; Date.prototype.toShortDateString = function () { return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern); }; Date.prototype.toLongDateString = function () { return this.toString(Date.CultureInfo.formatPatterns.longDatePattern); }; Date.prototype.toShortTimeString = function () { return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern); }; Date.prototype.toLongTimeString = function () { return this.toString(Date.CultureInfo.formatPatterns.longTimePattern); }; Date.prototype.getOrdinal = function () { switch (this.getDate()) { case 1: case 21: case 31: return "st"; case 2: case 22: return "nd"; case 3: case 23: return "rd"; default: return "th"; } }; (function () { Date.Parsing = { Exception: function (s) { this.message = "Parse error at '" + s.substring(0, 10) + " ...'"; } }; var $P = Date.Parsing; var _ = $P.Operators = { rtoken: function (r) { return function (s) { var mx = s.match(r); if (mx) { return ([mx[0], s.substring(mx[0].length)]); } else { throw new $P.Exception(s); } }; }, token: function (s) { return function (s) { return _.rtoken(new RegExp("^\s*" + s + "\s*"))(s); }; }, stoken: function (s) { return _.rtoken(new RegExp("^" + s)); }, until: function (p) { return function (s) { var qx = [], rx = null; while (s.length) { try { rx = p.call(this, s); } catch (e) { qx.push(rx[0]); s = rx[1]; continue; } break; } return [qx, s]; }; }, many: function (p) { return function (s) { var rx = [], r = null; while (s.length) { try { r = p.call(this, s); } catch (e) { return [rx, s]; } rx.push(r[0]); s = r[1]; } return [rx, s]; }; }, optional: function (p) { return function (s) { var r = null; try { r = p.call(this, s); } catch (e) { return [null, s]; } return [r[0], r[1]]; }; }, not: function (p) { return function (s) { try { p.call(this, s); } catch (e) { return [null, s]; } throw new $P.Exception(s); }; }, ignore: function (p) { return p ? function (s) { var r = null; r = p.call(this, s); return [null, r[1]]; } : null; }, product: function () { var px = arguments[0], qx = Array.prototype.slice.call(arguments, 1), rx = []; for (var i = 0; i < px.length; i++) { rx.push(_.each(px[i], qx)); } return rx; }, cache: function (rule) { var cache = {}, r = null; return function (s) { try { r = cache[s] = (cache[s] || rule.call(this, s)); } catch (e) { r = cache[s] = e; } if (r instanceof $P.Exception) { throw r; } else { return r; } }; }, any: function () { var px = arguments; return function (s) { var r = null; for (var i = 0; i < px.length; i++) { if (px[i] == null) { continue; } try { r = (px[i].call(this, s)); } catch (e) { r = null; } if (r) { return r; } } throw new $P.Exception(s); }; }, each: function () { var px = arguments; return function (s) { var rx = [], r = null; for (var i = 0; i < px.length; i++) { if (px[i] == null) { continue; } try { r = (px[i].call(this, s)); } catch (e) { throw new $P.Exception(s); } rx.push(r[0]); s = r[1]; } return [rx, s]; }; }, all: function () { var px = arguments, _ = _; return _.each(_.optional(px)); }, sequence: function (px, d, c) { d = d || _.rtoken(/^\s*/); c = c || null; if (px.length == 1) { return px[0]; } return function (s) { var r = null, q = null; var rx = []; for (var i = 0; i < px.length; i++) { try { r = px[i].call(this, s); } catch (e) { break; } rx.push(r[0]); try { q = d.call(this, r[1]); } catch (ex) { q = null; break; } s = q[1]; } if (!r) { throw new $P.Exception(s); } if (q) { throw new $P.Exception(q[1]); } if (c) { try { r = c.call(this, r[1]); } catch (ey) { throw new $P.Exception(r[1]); } } return [rx, (r ? r[1] : s)]; }; }, between: function (d1, p, d2) { d2 = d2 || d1; var _fn = _.each(_.ignore(d1), p, _.ignore(d2)); return function (s) { var rx = _fn.call(this, s); return [[rx[0][0], r[0][2]], rx[1]]; }; }, list: function (p, d, c) { d = d || _.rtoken(/^\s*/); c = c || null; return (p instanceof Array ? _.each(_.product(p.slice(0, -1), _.ignore(d)), p.slice(-1), _.ignore(c)) : _.each(_.many(_.each(p, _.ignore(d))), px, _.ignore(c))); }, set: function (px, d, c) { d = d || _.rtoken(/^\s*/); c = c || null; return function (s) { var r = null, p = null, q = null, rx = null, best = [[], s], last = false; for (var i = 0; i < px.length; i++) { q = null; p = null; r = null; last = (px.length == 1); try { r = px[i].call(this, s); } catch (e) { continue; } rx = [[r[0]], r[1]]; if (r[1].length > 0 && !last) { try { q = d.call(this, r[1]); } catch (ex) { last = true; } } else { last = true; } if (!last && q[1].length === 0) { last = true; } if (!last) { var qx = []; for (var j = 0; j < px.length; j++) { if (i != j) { qx.push(px[j]); } } p = _.set(qx, d).call(this, q[1]); if (p[0].length > 0) { rx[0] = rx[0].concat(p[0]); rx[1] = p[1]; } } if (rx[1].length < best[1].length) { best = rx; } if (best[1].length === 0) { break; } } if (best[0].length === 0) { return best; } if (c) { try { q = c.call(this, best[1]); } catch (ey) { throw new $P.Exception(best[1]); } best[1] = q[1]; } return best; }; }, forward: function (gr, fname) { return function (s) { return gr[fname].call(this, s); }; }, replace: function (rule, repl) { return function (s) { var r = rule.call(this, s); return [repl, r[1]]; }; }, process: function (rule, fn) { return function (s) { var r = rule.call(this, s); return [fn.call(this, r[0]), r[1]]; }; }, min: function (min, rule) { return function (s) { var rx = rule.call(this, s); if (rx[0].length < min) { throw new $P.Exception(s); } return rx; }; } }; var _generator = function (op) { return function () { var args = null, rx = []; if (arguments.length > 1) { args = Array.prototype.slice.call(arguments); } else if (arguments[0] instanceof Array) { args = arguments[0]; } if (args) { for (var i = 0, px = args.shift(); i < px.length; i++) { args.unshift(px[i]); rx.push(op.apply(null, args)); args.shift(); return rx; } } else { return op.apply(null, arguments); } }; }; var gx = "optional not ignore cache".split(/\s/); for (var i = 0; i < gx.length; i++) { _[gx[i]] = _generator(_[gx[i]]); } var _vector = function (op) { return function () { if (arguments[0] instanceof Array) { return op.apply(null, arguments[0]); } else { return op.apply(null, arguments); } }; }; var vx = "each any all".split(/\s/); for (var j = 0; j < vx.length; j++) { _[vx[j]] = _vector(_[vx[j]]); } } ()); (function () { var flattenAndCompact = function (ax) { var rx = []; for (var i = 0; i < ax.length; i++) { if (ax[i] instanceof Array) { rx = rx.concat(flattenAndCompact(ax[i])); } else { if (ax[i]) { rx.push(ax[i]); } } } return rx; }; Date.Grammar = {}; Date.Translator = { hour: function (s) { return function () { this.hour = Number(s); }; }, minute: function (s) { return function () { this.minute = Number(s); }; }, second: function (s) { return function () { this.second = Number(s); }; }, meridian: function (s) { return function () { this.meridian = s.slice(0, 1).toLowerCase(); }; }, timezone: function (s) { return function () { var n = s.replace(/[^\d\+\-]/g, ""); if (n.length) { this.timezoneOffset = Number(n); } else { this.timezone = s.toLowerCase(); } }; }, day: function (x) { var s = x[0]; return function () { this.day = Number(s.match(/\d+/)[0]); }; }, month: function (s) { return function () { this.month = ((s.length == 3) ? Date.getMonthNumberFromName(s) : (Number(s) - 1)); }; }, year: function (s) { return function () { var n = Number(s); this.year = ((s.length > 2) ? n : (n + (((n + 2000) < Date.CultureInfo.twoDigitYearMax) ? 2000 : 1900))); }; }, rday: function (s) { return function () { switch (s) { case "yesterday": this.days = -1; break; case "tomorrow": this.days = 1; break; case "today": this.days = 0; break; case "now": this.days = 0; this.now = true; break; } }; }, finishExact: function (x) { x = (x instanceof Array) ? x : [x]; var now = new Date(); this.year = now.getFullYear(); this.month = now.getMonth(); this.day = 1; this.hour = 0; this.minute = 0; this.second = 0; for (var i = 0; i < x.length; i++) { if (x[i]) { x[i].call(this); } } this.hour = (this.meridian == "p" && this.hour < 13) ? this.hour + 12 : this.hour; if (this.day > Date.getDaysInMonth(this.year, this.month)) { throw new RangeError(this.day + " is not a valid value for days."); } var r = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second); if (this.timezone) { r.set({ timezone: this.timezone }); } else if (this.timezoneOffset) { r.set({ timezoneOffset: this.timezoneOffset }); } return r; }, finish: function (x) { x = (x instanceof Array) ? flattenAndCompact(x) : [x]; if (x.length === 0) { return null; } for (var i = 0; i < x.length; i++) { if (typeof x[i] == "function") { x[i].call(this); } } if (this.now) { return new Date(); } var today = Date.today(); var method = null; var expression = !!(this.days != null || this.orient || this.operator); if (expression) { var gap, mod, orient; orient = ((this.orient == "past" || this.operator == "subtract") ? -1 : 1); if (this.weekday) { this.unit = "day"; gap = (Date.getDayNumberFromName(this.weekday) - today.getDay()); mod = 7; this.days = gap ? ((gap + (orient * mod)) % mod) : (orient * mod); } if (this.month) { this.unit = "month"; gap = (this.month - today.getMonth()); mod = 12; this.months = gap ? ((gap + (orient * mod)) % mod) : (orient * mod); this.month = null; } if (!this.unit) { this.unit = "day"; } if (this[this.unit + "s"] == null || this.operator != null) { if (!this.value) { this.value = 1; } if (this.unit == "week") { this.unit = "day"; this.value = this.value * 7; } this[this.unit + "s"] = this.value * orient; } return today.add(this); } else { if (this.meridian && this.hour) { this.hour = (this.hour < 13 && this.meridian == "p") ? this.hour + 12 : this.hour; } if (this.weekday && !this.day) { this.day = (today.addDays((Date.getDayNumberFromName(this.weekday) - today.getDay()))).getDate(); } if (this.month && !this.day) { this.day = 1; } return today.set(this); } } }; var _ = Date.Parsing.Operators, g = Date.Grammar, t = Date.Translator, _fn; g.datePartDelimiter = _.rtoken(/^([\s\-\.\,\/\x27]+)/); g.timePartDelimiter = _.stoken(":"); g.whiteSpace = _.rtoken(/^\s*/); g.generalDelimiter = _.rtoken(/^(([\s\,]|at|on)+)/); var _C = {}; g.ctoken = function (keys) { var fn = _C[keys]; if (!fn) { var c = Date.CultureInfo.regexPatterns; var kx = keys.split(/\s+/), px = []; for (var i = 0; i < kx.length; i++) { px.push(_.replace(_.rtoken(c[kx[i]]), kx[i])); } fn = _C[keys] = _.any.apply(null, px); } return fn; }; g.ctoken2 = function (key) { return _.rtoken(Date.CultureInfo.regexPatterns[key]); }; g.h = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/), t.hour)); g.hh = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/), t.hour)); g.H = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/), t.hour)); g.HH = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/), t.hour)); g.m = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.minute)); g.mm = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.minute)); g.s = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.second)); g.ss = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.second)); g.hms = _.cache(_.sequence([g.H, g.mm, g.ss], g.timePartDelimiter)); g.t = _.cache(_.process(g.ctoken2("shortMeridian"), t.meridian)); g.tt = _.cache(_.process(g.ctoken2("longMeridian"), t.meridian)); g.z = _.cache(_.process(_.rtoken(/^(\+|\-)?\s*\d\d\d\d?/), t.timezone)); g.zz = _.cache(_.process(_.rtoken(/^(\+|\-)\s*\d\d\d\d/), t.timezone)); g.zzz = _.cache(_.process(g.ctoken2("timezone"), t.timezone)); g.timeSuffix = _.each(_.ignore(g.whiteSpace), _.set([g.tt, g.zzz])); g.time = _.each(_.optional(_.ignore(_.stoken("T"))), g.hms, g.timeSuffix); g.d = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/), _.optional(g.ctoken2("ordinalSuffix"))), t.day)); g.dd = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/), _.optional(g.ctoken2("ordinalSuffix"))), t.day)); g.ddd = g.dddd = _.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"), function (s) { return function () { this.weekday = s; }; })); g.M = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/), t.month)); g.MM = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/), t.month)); g.MMM = g.MMMM = _.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"), t.month)); g.y = _.cache(_.process(_.rtoken(/^(\d\d?)/), t.year)); g.yy = _.cache(_.process(_.rtoken(/^(\d\d)/), t.year)); g.yyy = _.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/), t.year)); g.yyyy = _.cache(_.process(_.rtoken(/^(\d\d\d\d)/), t.year)); _fn = function () { return _.each(_.any.apply(null, arguments), _.not(g.ctoken2("timeContext"))); }; g.day = _fn(g.d, g.dd); g.month = _fn(g.M, g.MMM); g.year = _fn(g.yyyy, g.yy); g.orientation = _.process(g.ctoken("past future"), function (s) { return function () { this.orient = s; }; }); g.operator = _.process(g.ctoken("add subtract"), function (s) { return function () { this.operator = s; }; }); g.rday = _.process(g.ctoken("yesterday tomorrow today now"), t.rday); g.unit = _.process(g.ctoken("minute hour day week month year"), function (s) { return function () { this.unit = s; }; }); g.value = _.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/), function (s) { return function () { this.value = s.replace(/\D/g, ""); }; }); g.expression = _.set([g.rday, g.operator, g.value, g.unit, g.orientation, g.ddd, g.MMM]); _fn = function () { return _.set(arguments, g.datePartDelimiter); }; g.mdy = _fn(g.ddd, g.month, g.day, g.year); g.ymd = _fn(g.ddd, g.year, g.month, g.day); g.dmy = _fn(g.ddd, g.day, g.month, g.year); g.date = function (s) { return ((g[Date.CultureInfo.dateElementOrder] || g.mdy).call(this, s)); }; g.format = _.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/), function (fmt) { if (g[fmt]) { return g[fmt]; } else { throw Date.Parsing.Exception(fmt); } }), _.process(_.rtoken(/^[^dMyhHmstz]+/), function (s) { return _.ignore(_.stoken(s)); }))), function (rules) { return _.process(_.each.apply(null, rules), t.finishExact); }); var _F = {}; var _get = function (f) { return _F[f] = (_F[f] || g.format(f)[0]); }; g.formats = function (fx) { if (fx instanceof Array) { var rx = []; for (var i = 0; i < fx.length; i++) { rx.push(_get(fx[i])); } return _.any.apply(null, rx); } else { return _get(fx); } }; g._formats = g.formats(["yyyy-MM-ddTHH:mm:ss", "ddd, MMM dd, yyyy H:mm:ss tt", "ddd MMM d yyyy HH:mm:ss zzz", "d"]); g._start = _.process(_.set([g.date, g.time, g.expression], g.generalDelimiter, g.whiteSpace), t.finish); g.start = function (s) { try { var r = g._formats.call({}, s); if (r[1].length === 0) { return r; } } catch (e) { } return g._start.call({}, s); }; } ()); Date._parse = Date.parse; Date.parse = function (s) { var r = null; if (!s) { return null; } try { r = Date.Grammar.start.call({}, s); } catch (e) { return null; } return ((r[1].length === 0) ? r[0] : null); }; Date.getParseFunction = function (fx) { var fn = Date.Grammar.formats(fx); return function (s) { var r = null; try { r = fn.call({}, s); } catch (e) { return null; } return ((r[1].length === 0) ? r[0] : null); }; }; Date.parseExact = function (s, fx) { return Date.getParseFunction(fx)(s); };; /* Comment Generated by Combres - Resource '~/Resources/Scripts/plugin.feedBack.debug.js' (Mode: Static) */ (function ($) { // Object representation and defaults. function feedBack() { this._defaults = { mode: 1 }; } // Functions for the plugins. $.extend(feedBack.prototype, { __vars: { }, __keys: { close: '.feed-back .close-box-medium-blue', send: '.feed-back .fb-button .proceed-button-link', feedBack: '.feed-back', contactUs: '.contact-us', message: '#fb-field-message', messageWatermark: 'Enter your feedback', borderGlowClass: 'border-glow', feedBackButton: '.feed-back-button', refresh: '.feed-back .hidden-link', contactUsButton: '.contact-us-button', }, __events: { content: 'content', crossc: 'cross-content' }, __initialise: function (name, target, settings) { if (!target.id) { target.id = name + (++this.uuid); } var inst = this.__newPlugin($(target)); inst.settings = $.extend({}, settings, this._defaults, settings, this.__keys); this.__eventsReg(inst); }, __setPosition: function () { var me = this; var windowWidth = $(window); var $contactUs = $(me.__keys.contactUs); if ($contactUs.is(':visible')) { $(me.__keys.contactUsButton).slideDown(200); $contactUs.hide(); } }, __eventsReg: function (inst) { var me = this; $(inst.id).bind({ click: function (sender) { $(inst.id).slideUp(200); me.__setPosition(); $(me.__keys.feedBack).slideDown(200); } }); $(inst.settings.close).bind({ click: function (sender) { $(me.__keys.feedBack).slideUp(200); $(inst.id).slideDown(1000); sender.preventDefault(); } }); $(inst.settings.send).die('click'); $(inst.settings.send).live({ click: function (sender) { var link = $(this).attr('href'); var refresh = $(me.__keys.refresh).attr('href'); var message = $(me.__keys.message).val() != me.__keys.messageWatermark ? $(me.__keys.message).val() : ''; if (message.length == 0) { alert("Please enter your message before sending."); return false; } else{ var url = encodeURIComponent(document.URL); link += '&message=' + message + '&url=' + url; $.venus.events.notify(me.__events.crossc, { id: me.__keys.feedBack, replace: false, link: link, after: function () { $(me.__keys.feedBack).animate({ height: "65px" }, 600, function () { setTimeout(function () { $(me.__keys.feedBack).slideUp(200); $.venus.events.notify(me.__events.crossc, { id: me.__keys.feedBack, replace: true, link: refresh, after: function () { me.__eventsReg(inst); $.venus.common.watermark(); $(me.__keys.feedBackButton).slideDown(200); } }); }, 3000); }); } }); sender.preventDefault(); } } }); }, __newPlugin: function (target) { var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); return { id: '#' + id, container: target, data: null }; }, }); // Variables and instance. $.feedBack = new feedBack(); $.feedBack.uuid = new Date().getTime(); $.feedBack.version = "1.0.0"; // Plugin call and initialisation. $.fn.feedBack = function (options) { var $caller = $(this); return $caller.each(function () { var calle = this; $.feedBack.__initialise('feedBack-', calle, options); }); return $caller; }; })(jQuery); $(document).ready(function () { $('.feed-back-button').feedBack(); }); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/plugin.retailNotify.debug.js' (Mode: Static) */ (function ($) { // Object representation and defaults. function retailNotify() { this._defaults = { mode: 0 // 0 Same Domain, 2 Cross Domain }; } // Functions for the plugins. $.extend(retailNotify.prototype, { __initialise: function (name, target, settings) { if (!target.id) { target.id = name + (++this.uuid); } var inst = this.__newPlugin($(target)); inst.settings = $.extend({}, settings, this._defaults, settings); this.__notify(inst, 10000); this.__events(inst); }, __events: function (inst) { $('.notify-icon-close').live({ click: function () { $(this).parents('.retail-notify').slideUp('2000'); } }); }, __retailInterval: null, __retailTick: true, __notify: function (inst, timed) { var me = this; me.__retailInterval = setTimeout(function () { var retailElem = $('.retail-notify'); var link = (retailElem.length > 0) ? retailElem.attr('data-url') : $('.settings-retail-notify-path').attr('href') + '?' + (new Date().getTime()); $.ajax({ type: 'POST', url: link, dataType: 'json', success: function (data) { if (data != null) { if (retailElem.length >= 1) { var newRetailElem = $(data); if (newRetailElem.attr('data-response-display') == "True") { retailElem.slideUp('2000', function () { $(this).remove(); $('body').append(data); setTimeout(function () { $('.retail-notify').slideDown('2000', function () { me.__bounce($(this)); }); }, 1000); }); me.__retailTick = true; } else { retailElem.attr('data-response-display', newRetailElem.attr('data-response-display')); setTimeout(function () { retailElem.slideUp('2000'); }, 10000); me.__retailTick = false; } } else { $('body').append(data); $('.retail-notify').slideDown('2000', function () { me.__bounce($(this)); }); } } clearTimeout(me.__retailInterval); me.__notify(inst, me.__retailTick ? 10000 : 180000); }, beforeSend: function (jqXHR, settings) { } }); }, timed); }, __bounce: function (e) { for (var i = 0; i <= 2; i++) { $(e).animate({ height: '+=3px' }, 'fast', 'linear') .animate({ height: '-=3px' }, 'fast', 'linear') } }, __newPlugin: function (target) { var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); return { id: '#' + id, container: target, data: null }; } }); // Variables and instance. $.retailNotify = new retailNotify(); $.retailNotify.uuid = new Date().getTime(); $.retailNotify.version = "1.0.0"; // Plugin call and initialisation. $.fn.retailNotify = function (options) { var $caller = $(this); return $caller.each(function () { var calle = this; $.retailNotify.__initialise('retailNotify-', calle, options); }); return $caller; }; })(jQuery); $(document).ready(function () { $('body').retailNotify(); });; /* Comment Generated by Combres - Resource '~/Resources/Scripts/venus.livechat.debug.js' (Mode: Static) */ (function ($) { $.venus.livechat = { __initialise: function () { var me = this; this.__eventReg(me); }, __eventReg: function (me) { $('.contact-us-link-deals').live({ click: function (event) { me.__openLiveChat(); } }); $('.contact-us-link-booking').live({ click: function (event) { me.__openLiveChat(); } }); $('.lhi-chat-link').live({ click: function (event) { me.__openLiveChat(); } }); }, __openLiveChat: function () { if (bLHNOnline != 0) { //check for live help online OpenLHNChat(); } return false; }, loadChatInvite: function (interval) { if (typeof (WriteLHNMessage) != 'undefined') { setTimeout("WriteLHNMessage('',0);", interval); //update/reset the session value of 'VisitLapseTime' for counting limit if the chat invite is loaded var overrideVisitValue = $.venus.session.updateValue({ type: 2 , mode: 0 }); } else { //remove the session variable VisitLapseTime because Live help is offline, var overrideVisitValue = $.venus.session.updateValue({ type: 3 , mode: 0 }); } } }; })(jQuery); $(document).ready(function () { $.venus.livechat.__initialise(); });; /* Comment Generated by Combres - Resource '~/Resources/Scripts/plugin.imageViewer.debug.js' (Mode: Static) */ (function () { function imageViewer() { } // Functions for the plugins. $.extend(imageViewer.prototype, { __var: { imageURL: '/media/image/', imageLoader: new Image(), mainImage: null, mainImageSrc: '', roomFigCaption: '' }, __keys: { zoom: '.ig-zoom', previous: '.ig-chevron-left', next: '.ig-chevron-right', moreImagesLink: '.ig-more-images-link', hotelImage: '.hotel-image' }, __initialise: function (name, target, settings) { var $me = this; if (!target.id) { target.id = name + (++this.uuid); } var $inst = this.__newPlugin($(target)); $inst.settings = $.extend({}, this.__keys); this.__eventsReg($me, $inst); }, __eventsReg: function (me, inst) { $(inst.id).on('click', inst.settings.zoom, function () { var $inst = $(inst.id); var $targetImage = $($inst.attr('data-main-image-target')); if ($targetImage.length > 0) { $('html').addClass('overlay'); var $activePopup = $('#image-gallery-popup'); $activePopup.addClass('visible'); $activePopup.attr('data-thumbnails-target', $inst.attr('data-thumbnails-target')); var $popupMainImage = $('#gallery-popup-main-image'); me.__var.mainImage = $popupMainImage; var src = $targetImage.attr('src').split('?'); src = src.length == 1 ? $targetImage.attr('src') : src[0]; me.__var.mainImageSrc = src; me.__var.mainImage.attr('src', me.__var.mainImageSrc).load(function () { }); //me.__var.imageLoader.src = me.__var.mainImageSrc; $activePopup.find('.gp-desc').text($targetImage.attr('data-details')); if ($(this).parents('.image-control').find('.ig-chevron-directions').is(':visible')) { $activePopup.find('.image-control-background-container').css('visibility', 'visible'); $activePopup.find('.gp-chevron-directions').css('visibility', 'visible'); } else { $activePopup.find('.image-control-background-container').css('visibility', 'hidden'); $activePopup.find('.gp-chevron-directions').css('visibility', 'hidden'); } } }); $(inst.id).on('click', inst.settings.previous, function (e) { var $inst = $(inst.id); var $thumbnails = $($inst.attr('data-thumbnails-target')).find('img'); var $selectedThumbnail = $.grep($thumbnails, function (item) { return $(item).hasClass('selected'); }); if ($selectedThumbnail.length > 0) { var $s = $($selectedThumbnail); var $prev = $.grep($thumbnails, function (item) { return item.attributes['data-index'].value == parseInt($s.attr('data-index'), 10) - 1; }); if ($prev.length > 0) { $s.removeClass('selected'); $p = $($prev); $p.addClass('selected'); $.venus.common.wait({ type: 1, sender: $(e.target).parent() }); me.__var.mainImage = $($inst.attr('data-main-image-target')); // me.__var.mainImageSrc = me.__var.imageURL + '?id=' + $p.attr('data-media-id'); me.__var.mainImageSrc = me.__var.imageURL + $p.attr('data-system-url'); me.__var.mainImage.attr('src', me.__var.mainImageSrc).load(function () { $.venus.common.nowait(); }); //me.__var.imageLoader.src = me.__var.mainImageSrc; // This block is for "more images link" in // Deals Booking page's Image Gallery section if (parseInt($p.attr('data-index'), 10) > $inst.attr('data-reveal-more-images-after-index')) { var $moreImagesLink = $($inst.attr('data-more-images-link-target')); if ($moreImagesLink.attr('data-collapsed') == 'true') { $moreImagesLink.trigger('click'); } } if ($p.attr('data-details') != undefined) { var $details = $p.attr('data-details').split(';'); if ($details[0] !== '') { var $desc = $($inst.attr('data-desc-target')); $desc.text($details[0]); me.__var.mainImage.attr('data-details', $details[0]); if (!$desc.is(':visible')) { $desc.show(); } } } } } }); $(inst.id).on('click', inst.settings.next, function (e) { var $inst = $(inst.id); var $thumbnails = $($inst.attr('data-thumbnails-target')).find('img'); var $selectedThumbnail = $.grep($thumbnails, function (item) { return $(item).hasClass('selected'); }); if ($selectedThumbnail.length > 0) { var $s = $($selectedThumbnail); var $next = $.grep($thumbnails, function (item) { return item.attributes['data-index'].value == parseInt($s.attr('data-index'), 10) + 1; }); if ($next.length > 0) { $s.removeClass('selected'); $n = $($next); $n.addClass('selected'); $.venus.common.wait({ type: 1, sender: $(e.target).parent() }); me.__var.mainImage = $($inst.attr('data-main-image-target')); me.__var.mainImageSrc = me.__var.imageURL + $n.attr('data-system-url'); me.__var.mainImage.attr('src', me.__var.mainImageSrc).load(function () { $.venus.common.nowait(); }); //me.__var.imageLoader.src = me.__var.mainImageSrc; // This block is for "more images link" in // Deals Booking page's Image Gallery section if (parseInt($n.attr('data-index'), 10) > $inst.attr('data-reveal-more-images-after-index')) { var $moreImagesLink = $($inst.attr('data-more-images-link-target')); if ($moreImagesLink.attr('data-collapsed') == 'true') { $moreImagesLink.trigger('click'); } } if ($n.attr('data-details') != undefined) { var $details = $n.attr('data-details').split(';'); if ($details[0] !== '') { var $desc = $($inst.attr('data-desc-target')); $desc.text($details[0]); me.__var.mainImage.attr('data-details', $details[0]); if (!$desc.is(':visible')) { $desc.show(); } } } } } }); // Code block for Thumbnail selection var $hotelImages = $($(inst.id).attr('data-thumbnails-target')).find('.hotel-image'); $hotelImages.on('click touchend', function (e) { var $inst = $(inst.id); var $imageGallery = $($inst.attr('data-thumbnails-target')); var $old = $imageGallery.find('.selected'); $old.removeClass('selected'); var $this = $(this); $this.addClass('selected'); $.venus.common.wait({ type: 1, sender: $(e.target).parent() }); me.__var.mainImage = $($inst.attr('data-main-image-target')); me.__var.mainImageSrc = me.__var.imageURL + $this.attr('data-system-url'); me.__var.mainImage.attr('src', me.__var.mainImageSrc).load(function () { $.venus.common.nowait(); }); //me.__var.imageLoader.src = me.__var.mainImageSrc; if ($this.attr('data-details') != undefined) { var $details = $this.attr('data-details').split(';'); if ($details[0] !== '') { var $desc = $($inst.attr('data-desc-target')); $desc.text($details[0]); me.__var.mainImage.attr('data-details', $details[0]); if (!$desc.is(':visible')) { $desc.show(); } } } }); $hotelImages.hover(function () { var $this = $(this); me.__var.roomFigCaption = $('
      ', { 'class': 'room-image-description', 'text': $this.attr('data-details'), 'css': { 'top': $this.offset().top + $this.height() + 5, 'left': $this.offset().left + ($this.width() / 2) } }); $(document.body).append(me.__var.roomFigCaption); me.__var.roomFigCaption.css('left', ($this.offset().left + ($this.width() / 2)) - (me.__var.roomFigCaption.width() / 2) - 7); }, function () { me.__var.roomFigCaption.remove(); }); //$(me.__var.imageLoader).load(function () { // $.venus.common.nowait(); // me.__var.mainImage.attr('src', 'dummy.jpg'); // me.__var.mainImage.attr('src', me.__var.mainImageSrc); //}); }, __newPlugin: function (target) { var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); return { id: '#' + id, container: target, data: null }; } }); // Variables and instance. $.imageViewer = new imageViewer(); $.imageViewer.uuid = new Date().getTime(); $.imageViewer.version = "1.0.0"; // Plugin call and initialisation. $.fn.imageViewer = function (options) { var $caller = $(this); return $caller.each(function () { var calle = this; $.imageViewer.__initialise('imageViewer-', calle, options); }); }; })(jQuery);; /* Comment Generated by Combres - Resource '~/Resources/Scripts/venus.preset.debug.js' (Mode: Static) */ (function ($) { $.venus.preset = { __initialise: function () { var me = this; this.__eventReg(me); $('.image-control-container').imageViewer(); this.__checkDescriptionHeight(); $('.tabs:first-child .tab-item:first-child').addClass('item-selected'); $('.quick-contact-us').contactUs(); this.__tabsForIE8(); this.__newEnquiryValidation(); jQuery.validator.setDefaults({ debug: true, success: "valid" }); }, __var: { imageLoader: new Image(), mainImage: null, mainImageSrc: '' }, __onLoad: true, __upgradesAdjustment: function () { $('.upg', '.upgrade-on').each(function (i, obj) { var elem = $(obj); if (elem.width() > 244) { elem.siblings('.extra-space').remove(); } }); if ($('.upg', '.upgrade-on').length > 3) { $('.extra-space', '.enquire-upgrade-content:nth-child(2)').remove(); } }, __toggleEnquireDetailsCountrySelection: function () { var selectedCountry = $('.select-country').find(":selected").val(); var stateSelect = $('select.select-state'); var stateFixList = $('#' + stateSelect.attr('fixlistid')); var stateInput = $('.state-input'); if (selectedCountry == 'Australia') { stateSelect.attr('disabled', false); stateFixList.show(); stateInput.hide(); $('.state-contact span.error').show(); } else { stateSelect.attr('disabled', true); stateFixList.hide(); stateInput.show(); $('.state-contact span.error').hide(); } if (stateInput.val() != '') { stateInput.val(''); } }, __toggleEnquireDetailsStateSelection: function (me) { var selectedCountry = $('select.select-country').find(":selected").val(); var stateSelect = $('select.select-state'); var stateFixList = $('#' + stateSelect.attr('fixlistid')); var stateText = $('input.state-input'); if (selectedCountry == 'Australia') { stateSelect.attr('disabled', false); stateText.attr('disabled', false); stateFixList.show(); stateText.hide(); } else { stateSelect.attr('disabled', true); stateText.attr('disabled', false); stateFixList.hide(); stateText.show(); } if (stateText.val() != '') { stateText.val(''); } }, __newEnquiryValidation: function () { var form = typeof (theForm) != 'undefined' ? $(theForm) : $('#' + $('body').find('form').attr('id')); form.validate({ excluded: [':disabled, :hidden, :not(:visible)'], rules: { "Enquire.ContactInformation.Email": { required: true, email: true }, "Enquire.SpecificTravelDates": { required: function () { return $('.brochure-version').length > 0 ? false : true } }, "Enquire.PassengersCount": { required: function () { return $('.brochure-version').length > 0 ? false : true } }, "Enquire.ContactInformation.FirstName": "required", "Enquire.ContactInformation.LastName": "required", "Enquire.ContactInformation.PhoneNo": "required", "Enquire.HowDidYouFirstHearAbout": "required" }, messages: { "Enquire.ContactInformation.Email": "Invalid Email Address", "Enquire.SpecificTravelDates": "Required Field - Tell us as much as you can", "Enquire.PassengersCount": "Required Field - Tell us as much as you can", "Enquire.ContactInformation.FirstName": "First Name Required", "Enquire.ContactInformation.LastName": "Last Name Required", "Enquire.ContactInformation.PhoneNo": "Telephone Number Required", "Enquire.HowDidYouFirstHearAbout": "Required Field - Tell us as much as you can" }, errorPlacement: function (error, element) { $(element).closest('div').removeClass('has-success').addClass('has-error'); if ($(element).closest('div').find('p').length > 0) { error.appendTo($(element).closest('div').find('p')); } else { error.appendTo($(element).closest('div')); } }, success: function (error, element) { $(element).closest('div').addClass('has-success').removeClass('has-error'); }, errorElement: 'span', }); $.data(form[0], 'validator').settings.ignore = "select.select-state:hidden"; $.data(form[0], 'validator').settings.ignore = ".dd-selected-value"; $('select.select-state:hidden').rules("add", { required: true, messages: { required: "State Required" } }); }, __tabsForIE8: function () { if ($('html').hasClass('ie8')) { $('.tabs').each(function (i, obj) { var tab = $(obj).children(); var len = tab.length; var lenClass = ''; switch (len) { case 1: lenClass = 'tab-1'; break; case 2: lenClass = 'tab-2'; break; case 3: lenClass = 'tab-3'; break; case 4: lenClass = 'tab-4'; break; default: break; } tab.addClass(lenClass); }); } }, __checkDescriptionHeight: function () { if ($('.extra-desc').length > 0) { $('.extra-desc').each(function (i, obj) { var elem = $(obj); var ht = elem.height(); if (ht > 100) { elem.css({ 'height': '65px', 'overflow': 'hidden' }); $('.extra-show-more', elem).show(); } }); } if ($('.package-marketing-tours p').length > 0) { var obj = $('.package-marketing-tours p'); if (obj.height() > 40) { obj.css({ 'height': '40px', 'overflow': 'hidden' }); $('.tour-show-more',obj).show(); } } if ($('.banner-price').length > 0) { var obj = $('.banner-price'); if (obj.height() > 45) { var width = (obj.height() - 45) + 25; $('.banner-price-name').css('width', $('.banner-price-name').width() + width); //recheck height if (obj.height() > 45) { $('.banner-price-name').css('width', $('.banner-price-name').width() + 20); } for (var i = 0; i < 20; i++) { if (obj.height() > 45) { $('.banner-price-name').css('width', $('.banner-price-name').width() + 10); } else { break; } } } } }, __eventReg: function (me) { $('.tour-show-more').on('click', function (sender) { var elem = $('.package-marketing-tours p'); var less = $(this).attr('data-less'); if (typeof (less) == 'undefined') { elem.removeAttr('style'); $(this).text('- See less'); $(this).attr('data-less',true); } else { elem.css({ 'height': '40px', 'overflow': 'hidden' }); $(this).text('+ Show more'); $(this).removeAttr('data-less'); } }); $('.similar-package').on('click', function (sender) { window.location = $(this).attr('data-url'); }); $('.package-descriptions').on('click', '.tabs .tab-item', function (sender) { var elem = $(this); var parent = $(this).parents('.menu-description-content'); var url = parent.attr('data-url') + '?id=' + parent.attr('data-id') + '&sid=' + elem.attr('data-section-id') + '&did=' + parent.attr('data-detail-id'); $.ajax({ url: url, dataType: 'json', success: function (result) { var desc = $(result); var name = parent.attr('data-sc-id'); var clone = desc.find('.menu-description-content[data-sc-id=' + name + ']' + ' .replace').clone(); console.log(name); console.log(clone.html()); $('.replace',parent).children().remove(); $('.replace',parent).append(clone.html()); $('.image-control-container',parent).imageViewer(); $.venus.common.nowait() $('.tabs .tab-item', parent).removeClass('item-selected'); elem.addClass('item-selected'); }, error: function (xhr) { alert(xhr.responseText); }, beforeSend: function (xhr) { $.venus.common.wait({ type: 1, sender: sender.target }); } }); }); $('.package-descriptions').on('click', '.menu-tags div', function (sender) { var elem = $(this); var parent = $(this).parents('.menu-description-content'); var url = parent.attr('data-url') + '?id=' + parent.attr('data-id') + '&sid=' + elem.attr('data-selected-section-id') + '&ssid=' + elem.attr('data-sub-section-id') + '&did=' + parent.attr('data-detail-id'); $.ajax({ url: url, dataType: 'json', success: function (result) { var desc = $(result); var name = parent.attr('data-sc-id'); var clone = desc.find('.menu-description-content[data-sc-id=' + name + ']' + ' .clone-sub-section').clone(); $('.clone-sub-section',parent).children().remove(); $('.clone-sub-section',parent).append(clone.html()); $('.image-control-container',parent).imageViewer(); $.venus.common.nowait() $('.menu-tags div',parent).removeClass('tag-selected'); $('.menu-tags div[data-sub-section-id=' + elem.attr('data-sub-section-id') + ']',parent).addClass('tag-selected'); }, error: function (xhr) { alert(xhr.responseText); }, beforeSend: function (xhr) { $.venus.common.wait({ type: 1, sender: sender.target }); } }); }); $('.gallery-popup-close, .common-popup-close').click(function () { clearPopup(); }); $('.gallery-popup-overlay, .common-popup-overlay').click(function () { clearPopup(); }); function clearPopup() { $('.gallery-popup.visible, .common-popup.visible').removeClass('visible'); $('html').removeClass('overlay'); } $('.image-gallery').find('.ig-more-images-link').on('click', function () { var $this = $(this); if ($this.attr('data-collapsed') == 'true') { var $maxHeight = '182px'; var $secondRow = $('#image-gallery-thumbnails').find('.thumbnails.scroll'); if ($secondRow.length > 0) { if ($secondRow.find('.image-row-item').length < 9) { $maxHeight = '180px'; } } $('.package-images').find('.ig-sub').css({ maxHeight: $maxHeight }); $this.attr('data-collapsed', false).html('- see less'); } else { $('.package-images').find('.ig-sub').css({ maxHeight: '64px' }); $this.attr('data-collapsed', true).html('+ ' + $this.attr('data-remaining-media') + '
      more'); } }); $('.menu-description-content').on('click','.ig-more-images-link', function () { var $this = $(this); var parent = $this.parents('.menu-description-content'); if ($this.attr('data-collapsed') == 'true') { $('.image-gallery', '.clone-sub-section').show(); var $maxHeight = '182px'; var $secondRow = $('#image-gallery-thumbnails', parent).find('.thumbnails.scroll'); if ($secondRow.length > 0) { if ($secondRow.find('.image-row-item').length < 9) { $maxHeight = '180px'; } } $('.image-gallery', parent).find('.ig-sub').css({ maxHeight: $maxHeight }); $this.attr('data-collapsed', false).html('- see less'); } else { $('.image-gallery', parent).find('.ig-sub').css({ maxHeight: '0px' }); $('.image-gallery', '.clone-sub-section').hide(); $this.attr('data-collapsed', true).html('+ ' + $this.attr('data-remaining-media') + '
      more images'); } }); $('.gallery-popup').on('click', '.gp-chevron-left', function (e) { var $popup = $('.gallery-popup'); var $currentImage = $('#gallery-popup-main-image'); var $thumbnailsCollection = $($popup.attr('data-thumbnails-target')); var $thumbnails = $thumbnailsCollection.find('img'); if ($thumbnails.length > 0) { // Get current selected image from thumbnails var $currentThumbnail = $($.grep($thumbnails, function (item) { //return item.src.contains($currentImage.attr('src')); not supported in chrome var src = $currentImage.attr('src').split('?'); src = src.length == 1 ? $currentImage.attr('src') : src[0]; var img = window.location.protocol + '//' + window.location.host + src; var itemSrc = item.src.split('?').length == 1 ? item.src : item.src.split('?')[0]; return itemSrc === img; })); // Get the index var $index = parseInt($currentThumbnail.attr('data-index'), 10); // Subtract one to index since we are looking for the next image $index--; if ($index > -1) { $.venus.common.wait({ type: 1, sender: $(e.target).parent() }) // Get the next image according to the new index var $new = $thumbnailsCollection.find('[data-index="' + $index + '"]'); me.__var.mainImage = $currentImage; var srcNew = $new.attr('src').split('?'); srcNew = srcNew.length == 1 ? $new.attr('src') : srcNew[0]; me.__var.mainImageSrc = srcNew; me.__var.mainImage.attr('src', me.__var.mainImageSrc).load(function () { $.venus.common.nowait(); }); $popup.find('.gp-desc').text($new.attr('data-details').split(';')[0]); } } }); $('.gallery-popup').on('click', '.gp-chevron-right', function (e) { var $popup = $('.gallery-popup'); var $currentImage = $('#gallery-popup-main-image'); var $thumbnailsCollection = $($popup.attr('data-thumbnails-target')); var $thumbnails = $thumbnailsCollection.find('img[data-index]').length > 0 ? $thumbnailsCollection.find('img[data-index]') : $thumbnailsCollection.find('img'); if ($thumbnails.length > 0) { // Get current selected image from thumbnails var $currentThumbnail = $($.grep($thumbnails, function (item) { //return item.src.contains($currentImage.attr('src')); not supported in chrome var src = $currentImage.attr('src').split('?'); src = src.length == 1 ? $currentImage.attr('src') : src[0]; var img = window.location.protocol + '//' + window.location.host + src; var itemSrc = item.src.split('?').length == 1 ? item.src : item.src.split('?')[0]; return itemSrc === img })); // Get the index var $index = parseInt($currentThumbnail.attr('data-index'), 10); // Add one to index since we are looking for the next image $index++; if ($index < $thumbnails.length) { $.venus.common.wait({ type: 1, sender: $(e.target).parent() }) // Get the next image according to the new index var $new = $thumbnailsCollection.find('[data-index="' + $index + '"]'); me.__var.mainImage = $currentImage; var srcNew = $new.attr('src').split('?'); srcNew = srcNew.length == 1 ? $new.attr('src') : srcNew[0]; me.__var.mainImageSrc = srcNew; me.__var.mainImage.attr('src', me.__var.mainImageSrc).load(function () { $.venus.common.nowait(); }); $popup.find('.gp-desc').text($new.attr('data-details').split(';')[0]); } } }); $('.package-descriptions').on('click', '.ig-chevron-right', function (sender) { var ht = parseInt($('.ig-sub', '.package-descriptions').css('max-height').replace('px', '')); if (ht === 0) { $('.ig-more-images-link', '.menu-description-content').trigger('click'); } }); $(me.__var.imageLoader).load(function () { $.venus.common.nowait(); me.__var.mainImage.attr('src', me.__var.mainImageSrc); }); $('.package-book, .side-menu-group').on('click', '.book-button, .brochure-button, .help-button', function (sender) { sender.preventDefault(); var bookSlide = '.book-slide'; var details = $('.enquire-details'); var btn = $('button', '.enquire-button'); var offSet = $('.package-book').offset(); if ($(this).hasClass('brochure-button')) { $(bookSlide).addClass('brochure-version'); $('span', '.brochure-qs').text('Open'); $('p', '.brochure-qs').hide(); $('> li:nth-last-child(n+6)', '.enquire-items').hide(); btn.text('Send Request'); if (offSet != null) { $.venus.common.scrollDown((offSet.top + 190), 1000); if (!$(bookSlide).is(':visible')) { $(bookSlide).slideDown('1000'); details.prop('open', 'true'); } } } else if ($(this).hasClass('book-button')) { $(bookSlide).removeClass('brochure-version'); $('> li:hidden', '.enquire-items').show(); btn.text('Send Booking Request'); if ($(bookSlide).is(':visible')) { $(bookSlide).slideUp('1000'); details.prop('open', 'false'); } else { $(bookSlide).slideDown('1000'); details.prop('open', 'true'); } } else if ($(this).hasClass('help-button')) { $(bookSlide).removeClass('brochure-version'); $('> li:hidden', '.enquire-items').show(); btn.text('Send Booking Request'); if (offSet != null) { $.venus.common.scrollDown(offSet.top, 1000); if (!$(bookSlide).is(':visible')) { $(bookSlide).slideDown('1000'); details.prop('open', 'true'); } } } if (me.__onLoad == true) { me.__upgradesAdjustment(); me.__onLoad = false; } }); $('.enquire-items').on('click', 'button', function (sender) { sender.preventDefault(); var form = typeof (theForm) != 'undefined' ? $(theForm) : $('#' + $('body').find('form').attr('id')); if (form.valid()) { var upgrades = ''; var strUpgrades = [] $('.chk-upgrade:checked').each(function (i, obj) { upgrades += $(obj).attr('data-text') + ' Upgrade ++ '; var upg = { 'Id': $(obj).attr('data-id'), 'Heading': $(obj).attr('data-text'), 'Description': $(obj).attr('data-desc'), 'Price': $(obj).attr('data-price') } strUpgrades.push(upg); }); var addons = ''; var strAddOns = []; $('.chk-addon:checked').each(function (i, obj) { addons += $(obj).attr('data-text') + ' Add-On ++ '; var add = { 'Id': $(obj).attr('data-id'), 'Heading': $(obj).attr('data-text'), 'Description': $(obj).attr('data-desc'), 'Price': $(obj).attr('data-price') } strAddOns.push(add); }); var state = $('input.state-input').is(':visible') ? $('input.state-input').val() : $('select.select-state').val(); var req = $('.special-request').val() != '' ? $('.special-request').val() + ' ++ ' : ''; var request = req + upgrades + addons; var data = { "Upgrades": strUpgrades, "AddOns": strAddOns, "PackageLink": document.URL, "Inclusion": JSON.parse($('#Inclusion').val()), "ImageUrl": $('#ImageUrl').val(), "PackageId": $('#PackageId').val(), "Duration": $('#Duration').val(), "Package": $('#Package').val(), "PackagePrice": $('#PackagePrice').val(), "PackageTypes": $('#PackageTypes').val(), "Destinations": $('#Destinations').val(), "PassengersCount": $('.passenger-count').val(), "SpecificTravelDates": $('.specific-date').val(), "UnableTravelDate": $('.unable-date').val(), "HowDidYouFirstHearAbout": $('.hear-about').val(), "Website": "", "SpecialRequests": request, "ContactInformation": { "Title": $('select.select-title').val(), "FirstName": $('.first-name').val(), "LastName": $('.last-name').val(), "Email": $('.email').val(), "PhoneNo": $('.telephone').val(), "MailMembership": $('.chk-deals-alert').prop('checked'), "Address": { "AddressLine1": $('.address1').val(), "AddressLine2": $('.address2').val(), "Suburb": { "Name": $('.suburb').val(), "PostalCode": $('.postal-code').val() }, "State": { "Name": state }, "Country": { "Name": $('select.select-country').val() } } } }; $('.book-slide').addClass('enquire-animate'); $.venus.animation.loader('enquire-loader-graphic'); $('#enquire-loader-graphic').show(); $.venus.common.scrollDown(($('.package-book').offset().top + 190), 1000); $.ajax({ url: $('.enquire-content').attr('data-url'), data: JSON.stringify(data), type: 'POST', contentType: "application/json", success: function (result) { setTimeout(function () { $('#enquire-loader-graphic').hide(); $('.book-slide').addClass('enquire-ty'); }, 3000); setTimeout(function () { $('.book-slide').slideUp('slow', function () { clearPopup(); $('.book-slide').removeClass('enquire-ty'); $('.book-slide').removeClass('enquire-animate'); $('.book-slide').removeAttr('style'); }); }, 5000); }, error: function (xhr) { alert(xhr.responseText); }, beforeSend: function (xhr) { } }); } }); $('.link-upgrade').hover(function () { var parent = $(this).parents('.enquire-preset-item'); $('.item-popup', parent).fadeIn(100); }, function () { var parent = $(this).parents('.enquire-preset-item'); $('.item-popup', parent).fadeOut(100); } ); $('.package-book-extras').on('click', '.extra-show-more', function () { $(this).hide(); $(this).parent('.extra-desc').removeAttr('style'); }); $('.quick-jump p').on('click', function () { var $this = $(this); var content = $this.attr('data-content'); var offSet; switch(content){ case 'price': offSet = $('.package-price').offset(); break; case 'depart': offSet = $('.package-price').offset(); break; case 'book': offSet = $('.package-book').offset(); break; default: } if (offSet != null) $.venus.common.scrollDown(offSet.top, 1000); }); $('.upgrade-on').on('click', '.chk-img', function () { var parent = $(this).parents('.enquire-preset-text'); if (!$('input[type="checkbox"]', parent).is(':checked')) { $('input[type="checkbox"]', parent).prop('checked', true); $(this).addClass('check-box-selected-disabled'); } else { $('input[type="checkbox"]', parent).prop('checked', false); $(this).removeClass('check-box-selected-disabled'); } }); $('.discover').on('click', '.chk-alert', function () { var parent = $(this).parent(); if (!$('input[type="checkbox"]', parent).is(':checked')) { $('input[type="checkbox"]', parent).prop('checked', true); $(this).addClass('check-box-selected-disabled'); } else { $('input[type="checkbox"]', parent).prop('checked', false); $(this).removeClass('check-box-selected-disabled'); } }); $('.brochure-qs').on('click', 'span', function () { var elem = $(this); if (elem.text() === 'Open') { $('p', '.brochure-qs').show(); $('> li:hidden', '.enquire-items').show(); elem.text('Close'); } else { $('p', '.brochure-qs').hide(); $('> li:nth-last-child(n+6)', '.enquire-items').hide(); elem.text('Open'); } }); $('.enquire-contact').on('change', '.select-country', function () { me.__toggleEnquireDetailsCountrySelection(); }); $('.enquire-contact').on('change', '.select-state', function () { me.__toggleEnquireDetailsStateSelection(); }); } }; })(jQuery); $(document).ready(function () { $.venus.preset.__initialise(); }); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/jquery.validate.js' (Mode: Static) */ /*! jQuery Validation Plugin - v1.10.0 - 9/7/2012 * https://github.com/jzaefferer/jquery-validation * Copyright (c) 2012 Jörn Zaefferer; Licensed MIT, GPL */ (function($) { $.extend($.fn, { // http://docs.jquery.com/Plugins/Validation/validate validate: function( options ) { // if nothing is selected, return nothing; can't chain anyway if (!this.length) { if (options && options.debug && window.console) { console.warn( "nothing selected, can't validate, returning nothing" ); } return; } // check if a validator for this form was already created var validator = $.data(this[0], 'validator'); if ( validator ) { return validator; } // Add novalidate tag if HTML5. this.attr('novalidate', 'novalidate'); validator = new $.validator( options, this[0] ); $.data(this[0], 'validator', validator); if ( validator.settings.onsubmit ) { this.validateDelegate( ":submit", "click", function(ev) { if ( validator.settings.submitHandler ) { validator.submitButton = ev.target; } // allow suppressing validation by adding a cancel class to the submit button if ( $(ev.target).hasClass('cancel') ) { validator.cancelSubmit = true; } }); // validate the form on submit this.submit( function( event ) { if ( validator.settings.debug ) { // prevent form submit to be able to see console output event.preventDefault(); } function handle() { var hidden; if ( validator.settings.submitHandler ) { if (validator.submitButton) { // insert a hidden input as a replacement for the missing submit button hidden = $("").attr("name", validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm); } validator.settings.submitHandler.call( validator, validator.currentForm, event ); if (validator.submitButton) { // and clean up afterwards; thanks to no-block-scope, hidden can be referenced hidden.remove(); } return false; } return true; } // prevent submit for invalid forms or custom submit handlers if ( validator.cancelSubmit ) { validator.cancelSubmit = false; return handle(); } if ( validator.form() ) { if ( validator.pendingRequest ) { validator.formSubmitted = true; return false; } return handle(); } else { validator.focusInvalid(); return false; } }); } return validator; }, // http://docs.jquery.com/Plugins/Validation/valid valid: function() { if ( $(this[0]).is('form')) { return this.validate().form(); } else { var valid = true; var validator = $(this[0].form).validate(); this.each(function() { valid &= validator.element(this); }); return valid; } }, // attributes: space seperated list of attributes to retrieve and remove removeAttrs: function(attributes) { var result = {}, $element = this; $.each(attributes.split(/\s/), function(index, value) { result[value] = $element.attr(value); $element.removeAttr(value); }); return result; }, // http://docs.jquery.com/Plugins/Validation/rules rules: function(command, argument) { var element = this[0]; if (command) { var settings = $.data(element.form, 'validator').settings; var staticRules = settings.rules; var existingRules = $.validator.staticRules(element); switch(command) { case "add": $.extend(existingRules, $.validator.normalizeRule(argument)); staticRules[element.name] = existingRules; if (argument.messages) { settings.messages[element.name] = $.extend( settings.messages[element.name], argument.messages ); } break; case "remove": if (!argument) { delete staticRules[element.name]; return existingRules; } var filtered = {}; $.each(argument.split(/\s/), function(index, method) { filtered[method] = existingRules[method]; delete existingRules[method]; }); return filtered; } } var data = $.validator.normalizeRules( $.extend( {}, $.validator.metadataRules(element), $.validator.classRules(element), $.validator.attributeRules(element), $.validator.staticRules(element) ), element); // make sure required is at front if (data.required) { var param = data.required; delete data.required; data = $.extend({required: param}, data); } return data; } }); // Custom selectors $.extend($.expr[":"], { // http://docs.jquery.com/Plugins/Validation/blank blank: function(a) {return !$.trim("" + a.value);}, // http://docs.jquery.com/Plugins/Validation/filled filled: function(a) {return !!$.trim("" + a.value);}, // http://docs.jquery.com/Plugins/Validation/unchecked unchecked: function(a) {return !a.checked;} }); // constructor for validator $.validator = function( options, form ) { this.settings = $.extend( true, {}, $.validator.defaults, options ); this.currentForm = form; this.init(); }; $.validator.format = function(source, params) { if ( arguments.length === 1 ) { return function() { var args = $.makeArray(arguments); args.unshift(source); return $.validator.format.apply( this, args ); }; } if ( arguments.length > 2 && params.constructor !== Array ) { params = $.makeArray(arguments).slice(1); } if ( params.constructor !== Array ) { params = [ params ]; } $.each(params, function(i, n) { source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n); }); return source; }; $.extend($.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusInvalid: true, errorContainer: $( [] ), errorLabelContainer: $( [] ), onsubmit: true, ignore: ":hidden", ignoreTitle: false, onfocusin: function(element, event) { this.lastActive = element; // hide error label and remove error class on focus if enabled if ( this.settings.focusCleanup && !this.blockFocusCleanup ) { if ( this.settings.unhighlight ) { this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); } this.addWrapper(this.errorsFor(element)).hide(); } }, onfocusout: function(element, event) { if ( !this.checkable(element) && (element.name in this.submitted || !this.optional(element)) ) { this.element(element); } }, onkeyup: function(element, event) { if ( event.which === 9 && this.elementValue(element) === '' ) { return; } else if ( element.name in this.submitted || element === this.lastActive ) { this.element(element); } }, onclick: function(element, event) { // click on selects, radiobuttons and checkboxes if ( element.name in this.submitted ) { this.element(element); } // or option elements, check parent select in that case else if (element.parentNode.name in this.submitted) { this.element(element.parentNode); } }, highlight: function(element, errorClass, validClass) { if (element.type === 'radio') { this.findByName(element.name).addClass(errorClass).removeClass(validClass); } else { $(element).addClass(errorClass).removeClass(validClass); } }, unhighlight: function(element, errorClass, validClass) { if (element.type === 'radio') { this.findByName(element.name).removeClass(errorClass).addClass(validClass); } else { $(element).removeClass(errorClass).addClass(validClass); } } }, // http://docs.jquery.com/Plugins/Validation/Validator/setDefaults setDefaults: function(settings) { $.extend( $.validator.defaults, settings ); }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date (ISO).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", maxlength: $.validator.format("Please enter no more than {0} characters."), minlength: $.validator.format("Please enter at least {0} characters."), rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), range: $.validator.format("Please enter a value between {0} and {1}."), max: $.validator.format("Please enter a value less than or equal to {0}."), min: $.validator.format("Please enter a value greater than or equal to {0}.") }, autoCreateRanges: false, prototype: { init: function() { this.labelContainer = $(this.settings.errorLabelContainer); this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm); this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer ); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var groups = (this.groups = {}); $.each(this.settings.groups, function(key, value) { $.each(value.split(/\s/), function(index, name) { groups[name] = key; }); }); var rules = this.settings.rules; $.each(rules, function(key, value) { rules[key] = $.validator.normalizeRule(value); }); function delegate(event) { var validator = $.data(this[0].form, "validator"), eventType = "on" + event.type.replace(/^validate/, ""); if (validator.settings[eventType]) { validator.settings[eventType].call(validator, this[0], event); } } $(this.currentForm) .validateDelegate(":text, [type='password'], [type='file'], select, textarea, " + "[type='number'], [type='search'] ,[type='tel'], [type='url'], " + "[type='email'], [type='datetime'], [type='date'], [type='month'], " + "[type='week'], [type='time'], [type='datetime-local'], " + "[type='range'], [type='color'] ", "focusin focusout keyup", delegate) .validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", delegate); if (this.settings.invalidHandler) { $(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler); } }, // http://docs.jquery.com/Plugins/Validation/Validator/form form: function() { this.checkForm(); $.extend(this.submitted, this.errorMap); this.invalid = $.extend({}, this.errorMap); if (!this.valid()) { $(this.currentForm).triggerHandler("invalid-form", [this]); } this.showErrors(); return this.valid(); }, checkForm: function() { this.prepareForm(); for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) { this.check( elements[i] ); } return this.valid(); }, // http://docs.jquery.com/Plugins/Validation/Validator/element element: function( element ) { element = this.validationTargetFor( this.clean( element ) ); this.lastElement = element; this.prepareElement( element ); this.currentElements = $(element); var result = this.check( element ) !== false; if (result) { delete this.invalid[element.name]; } else { this.invalid[element.name] = true; } if ( !this.numberOfInvalids() ) { // Hide error containers on last error this.toHide = this.toHide.add( this.containers ); } this.showErrors(); return result; }, // http://docs.jquery.com/Plugins/Validation/Validator/showErrors showErrors: function(errors) { if(errors) { // add items to error list and map $.extend( this.errorMap, errors ); this.errorList = []; for ( var name in errors ) { this.errorList.push({ message: errors[name], element: this.findByName(name)[0] }); } // remove items from success list this.successList = $.grep( this.successList, function(element) { return !(element.name in errors); }); } if (this.settings.showErrors) { this.settings.showErrors.call( this, this.errorMap, this.errorList ); } else { this.defaultShowErrors(); } }, // http://docs.jquery.com/Plugins/Validation/Validator/resetForm resetForm: function() { if ( $.fn.resetForm ) { $( this.currentForm ).resetForm(); } this.submitted = {}; this.lastElement = null; this.prepareForm(); this.hideErrors(); this.elements().removeClass( this.settings.errorClass ).removeData( "previousValue" ); }, numberOfInvalids: function() { return this.objectLength(this.invalid); }, objectLength: function( obj ) { var count = 0; for ( var i in obj ) { count++; } return count; }, hideErrors: function() { this.addWrapper( this.toHide ).hide(); }, valid: function() { return this.size() === 0; }, size: function() { return this.errorList.length; }, focusInvalid: function() { if( this.settings.focusInvalid ) { try { $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []) .filter(":visible") .focus() // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find .trigger("focusin"); } catch(e) { // ignore IE throwing errors when focusing hidden elements } } }, findLastActive: function() { var lastActive = this.lastActive; return lastActive && $.grep(this.errorList, function(n) { return n.element.name === lastActive.name; }).length === 1 && lastActive; }, elements: function() { var validator = this, rulesCache = {}; // select all valid inputs inside the form (no submit or reset buttons) return $(this.currentForm) .find("input, select, textarea") .not(":submit, :reset, :image, [disabled]") .not( this.settings.ignore ) .filter(function() { if ( !this.name && validator.settings.debug && window.console ) { console.error( "%o has no name assigned", this); } // select only the first element for each name, and only those with rules specified if ( this.name in rulesCache || !validator.objectLength($(this).rules()) ) { return false; } rulesCache[this.name] = true; return true; }); }, clean: function( selector ) { return $( selector )[0]; }, errors: function() { var errorClass = this.settings.errorClass.replace(' ', '.'); return $( this.settings.errorElement + "." + errorClass, this.errorContext ); }, reset: function() { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = $([]); this.toHide = $([]); this.currentElements = $([]); }, prepareForm: function() { this.reset(); this.toHide = this.errors().add( this.containers ); }, prepareElement: function( element ) { this.reset(); this.toHide = this.errorsFor(element); }, elementValue: function( element ) { var type = $(element).attr('type'), val = $(element).val(); if ( type === 'radio' || type === 'checkbox' ) { return $('input[name="' + $(element).attr('name') + '"]:checked').val(); } if ( typeof val === 'string' ) { return val.replace(/\r/g, ""); } return val; }, check: function( element ) { element = this.validationTargetFor( this.clean( element ) ); var rules = $(element).rules(); var dependencyMismatch = false; var val = this.elementValue(element); var result; for (var method in rules ) { var rule = { method: method, parameters: rules[method] }; try { result = $.validator.methods[method].call( this, val, element, rule.parameters ); // if a method indicates that the field is optional and therefore valid, // don't mark it as valid when there are no other rules if ( result === "dependency-mismatch" ) { dependencyMismatch = true; continue; } dependencyMismatch = false; if ( result === "pending" ) { this.toHide = this.toHide.not( this.errorsFor(element) ); return; } if( !result ) { this.formatAndAdd( element, rule ); return false; } } catch(e) { if ( this.settings.debug && window.console ) { console.log("exception occured when checking element " + element.id + ", check the '" + rule.method + "' method", e); } throw e; } } if (dependencyMismatch) { return; } if ( this.objectLength(rules) ) { this.successList.push(element); } return true; }, // return the custom message for the given element and validation method // specified in the element's "messages" metadata customMetaMessage: function(element, method) { if (!$.metadata) { return; } var meta = this.settings.meta ? $(element).metadata()[this.settings.meta] : $(element).metadata(); return meta && meta.messages && meta.messages[method]; }, // return the custom message for the given element and validation method // specified in the element's HTML5 data attribute customDataMessage: function(element, method) { return $(element).data('msg-' + method.toLowerCase()) || (element.attributes && $(element).attr('data-msg-' + method.toLowerCase())); }, // return the custom message for the given element name and validation method customMessage: function( name, method ) { var m = this.settings.messages[name]; return m && (m.constructor === String ? m : m[method]); }, // return the first defined argument, allowing empty strings findDefined: function() { for(var i = 0; i < arguments.length; i++) { if (arguments[i] !== undefined) { return arguments[i]; } } return undefined; }, defaultMessage: function( element, method) { return this.findDefined( this.customMessage( element.name, method ), this.customDataMessage( element, method ), this.customMetaMessage( element, method ), // title is never undefined, so handle empty string as undefined !this.settings.ignoreTitle && element.title || undefined, $.validator.messages[method], "Warning: No message defined for " + element.name + "" ); }, formatAndAdd: function( element, rule ) { var message = this.defaultMessage( element, rule.method ), theregex = /\$?\{(\d+)\}/g; if ( typeof message === "function" ) { message = message.call(this, rule.parameters, element); } else if (theregex.test(message)) { message = $.validator.format(message.replace(theregex, '{$1}'), rule.parameters); } this.errorList.push({ message: message, element: element }); this.errorMap[element.name] = message; this.submitted[element.name] = message; }, addWrapper: function(toToggle) { if ( this.settings.wrapper ) { toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); } return toToggle; }, defaultShowErrors: function() { var i, elements; for ( i = 0; this.errorList[i]; i++ ) { var error = this.errorList[i]; if ( this.settings.highlight ) { this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); } this.showLabel( error.element, error.message ); } if( this.errorList.length ) { this.toShow = this.toShow.add( this.containers ); } if (this.settings.success) { for ( i = 0; this.successList[i]; i++ ) { this.showLabel( this.successList[i] ); } } if (this.settings.unhighlight) { for ( i = 0, elements = this.validElements(); elements[i]; i++ ) { this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass ); } } this.toHide = this.toHide.not( this.toShow ); this.hideErrors(); this.addWrapper( this.toShow ).show(); }, validElements: function() { return this.currentElements.not(this.invalidElements()); }, invalidElements: function() { return $(this.errorList).map(function() { return this.element; }); }, showLabel: function(element, message) { var label = this.errorsFor( element ); if ( label.length ) { // refresh error/success class label.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); // check if we have a generated label, replace the message then if ( label.attr("generated") ) { label.html(message); } } else { // create label label = $("<" + this.settings.errorElement + "/>") .attr({"for": this.idOrName(element), generated: true}) .addClass(this.settings.errorClass) .html(message || ""); if ( this.settings.wrapper ) { // make sure the element is visible, even in IE // actually showing the wrapped element is handled elsewhere label = label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); } if ( !this.labelContainer.append(label).length ) { if ( this.settings.errorPlacement ) { this.settings.errorPlacement(label, $(element) ); } else { label.insertAfter(element); } } } if ( !message && this.settings.success ) { label.text(""); if ( typeof this.settings.success === "string" ) { label.addClass( this.settings.success ); } else { this.settings.success( label, element ); } } this.toShow = this.toShow.add(label); }, errorsFor: function(element) { var name = this.idOrName(element); return this.errors().filter(function() { return $(this).attr('for') === name; }); }, idOrName: function(element) { return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); }, validationTargetFor: function(element) { // if radio/checkbox, validate first element in group instead if (this.checkable(element)) { element = this.findByName( element.name ).not(this.settings.ignore)[0]; } return element; }, checkable: function( element ) { return (/radio|checkbox/i).test(element.type); }, findByName: function( name ) { return $(this.currentForm).find('[name="' + name + '"]'); }, getLength: function(value, element) { switch( element.nodeName.toLowerCase() ) { case 'select': return $("option:selected", element).length; case 'input': if( this.checkable( element) ) { return this.findByName(element.name).filter(':checked').length; } } return value.length; }, depend: function(param, element) { return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true; }, dependTypes: { "boolean": function(param, element) { return param; }, "string": function(param, element) { return !!$(param, element.form).length; }, "function": function(param, element) { return param(element); } }, optional: function(element) { var val = this.elementValue(element); return !$.validator.methods.required.call(this, val, element) && "dependency-mismatch"; }, startRequest: function(element) { if (!this.pending[element.name]) { this.pendingRequest++; this.pending[element.name] = true; } }, stopRequest: function(element, valid) { this.pendingRequest--; // sometimes synchronization fails, make sure pendingRequest is never < 0 if (this.pendingRequest < 0) { this.pendingRequest = 0; } delete this.pending[element.name]; if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { $(this.currentForm).submit(); this.formSubmitted = false; } else if (!valid && this.pendingRequest === 0 && this.formSubmitted) { $(this.currentForm).triggerHandler("invalid-form", [this]); this.formSubmitted = false; } }, previousValue: function(element) { return $.data(element, "previousValue") || $.data(element, "previousValue", { old: null, valid: true, message: this.defaultMessage( element, "remote" ) }); } }, classRuleSettings: { required: {required: true}, email: {email: true}, url: {url: true}, date: {date: true}, dateISO: {dateISO: true}, number: {number: true}, digits: {digits: true}, creditcard: {creditcard: true} }, addClassRules: function(className, rules) { if ( className.constructor === String ) { this.classRuleSettings[className] = rules; } else { $.extend(this.classRuleSettings, className); } }, classRules: function(element) { var rules = {}; var classes = $(element).attr('class'); if ( classes ) { $.each(classes.split(' '), function() { if (this in $.validator.classRuleSettings) { $.extend(rules, $.validator.classRuleSettings[this]); } }); } return rules; }, attributeRules: function(element) { var rules = {}; var $element = $(element); for (var method in $.validator.methods) { var value; // support for in both html5 and older browsers if (method === 'required') { value = $element.get(0).getAttribute(method); // Some browsers return an empty string for the required attribute // and non-HTML5 browsers might have required="" markup if (value === "") { value = true; } // force non-HTML5 browsers to return bool value = !!value; } else { value = $element.attr(method); } if (value) { rules[method] = value; } else if ($element[0].getAttribute("type") === method) { rules[method] = true; } } // maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) { delete rules.maxlength; } return rules; }, metadataRules: function(element) { if (!$.metadata) { return {}; } var meta = $.data(element.form, 'validator').settings.meta; return meta ? $(element).metadata()[meta] : $(element).metadata(); }, staticRules: function(element) { var rules = {}; var validator = $.data(element.form, 'validator'); if (validator.settings.rules) { rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}; } return rules; }, normalizeRules: function(rules, element) { // handle dependency check $.each(rules, function(prop, val) { // ignore rule when param is explicitly false, eg. required:false if (val === false) { delete rules[prop]; return; } if (val.param || val.depends) { var keepRule = true; switch (typeof val.depends) { case "string": keepRule = !!$(val.depends, element.form).length; break; case "function": keepRule = val.depends.call(element, element); break; } if (keepRule) { rules[prop] = val.param !== undefined ? val.param : true; } else { delete rules[prop]; } } }); // evaluate parameters $.each(rules, function(rule, parameter) { rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter; }); // clean number parameters $.each(['minlength', 'maxlength', 'min', 'max'], function() { if (rules[this]) { rules[this] = Number(rules[this]); } }); $.each(['rangelength', 'range'], function() { if (rules[this]) { rules[this] = [Number(rules[this][0]), Number(rules[this][1])]; } }); if ($.validator.autoCreateRanges) { // auto-create ranges if (rules.min && rules.max) { rules.range = [rules.min, rules.max]; delete rules.min; delete rules.max; } if (rules.minlength && rules.maxlength) { rules.rangelength = [rules.minlength, rules.maxlength]; delete rules.minlength; delete rules.maxlength; } } // To support custom messages in metadata ignore rule methods titled "messages" if (rules.messages) { delete rules.messages; } return rules; }, // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} normalizeRule: function(data) { if( typeof data === "string" ) { var transformed = {}; $.each(data.split(/\s/), function() { transformed[this] = true; }); data = transformed; } return data; }, // http://docs.jquery.com/Plugins/Validation/Validator/addMethod addMethod: function(name, method, message) { $.validator.methods[name] = method; $.validator.messages[name] = message !== undefined ? message : $.validator.messages[name]; if (method.length < 3) { $.validator.addClassRules(name, $.validator.normalizeRule(name)); } }, methods: { // http://docs.jquery.com/Plugins/Validation/Methods/required required: function(value, element, param) { // check if dependency is met if ( !this.depend(param, element) ) { return "dependency-mismatch"; } if ( element.nodeName.toLowerCase() === "select" ) { // could be an array for select-multiple or a string, both are fine this way var val = $(element).val(); return val && val.length > 0; } if ( this.checkable(element) ) { return this.getLength(value, element) > 0; } return $.trim(value).length > 0; }, // http://docs.jquery.com/Plugins/Validation/Methods/remote remote: function(value, element, param) { if ( this.optional(element) ) { return "dependency-mismatch"; } var previous = this.previousValue(element); if (!this.settings.messages[element.name] ) { this.settings.messages[element.name] = {}; } previous.originalMessage = this.settings.messages[element.name].remote; this.settings.messages[element.name].remote = previous.message; param = typeof param === "string" && {url:param} || param; if ( this.pending[element.name] ) { return "pending"; } if ( previous.old === value ) { return previous.valid; } previous.old = value; var validator = this; this.startRequest(element); var data = {}; data[element.name] = value; $.ajax($.extend(true, { url: param, mode: "abort", port: "validate" + element.name, dataType: "json", data: data, success: function(response) { validator.settings.messages[element.name].remote = previous.originalMessage; var valid = response === true || response === "true"; if ( valid ) { var submitted = validator.formSubmitted; validator.prepareElement(element); validator.formSubmitted = submitted; validator.successList.push(element); delete validator.invalid[element.name]; validator.showErrors(); } else { var errors = {}; var message = response || validator.defaultMessage( element, "remote" ); errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message; validator.invalid[element.name] = true; validator.showErrors(errors); } previous.valid = valid; validator.stopRequest(element, valid); } }, param)); return "pending"; }, // http://docs.jquery.com/Plugins/Validation/Methods/minlength minlength: function(value, element, param) { var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element); return this.optional(element) || length >= param; }, // http://docs.jquery.com/Plugins/Validation/Methods/maxlength maxlength: function(value, element, param) { var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element); return this.optional(element) || length <= param; }, // http://docs.jquery.com/Plugins/Validation/Methods/rangelength rangelength: function(value, element, param) { var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element); return this.optional(element) || ( length >= param[0] && length <= param[1] ); }, // http://docs.jquery.com/Plugins/Validation/Methods/min min: function( value, element, param ) { return this.optional(element) || value >= param; }, // http://docs.jquery.com/Plugins/Validation/Methods/max max: function( value, element, param ) { return this.optional(element) || value <= param; }, // http://docs.jquery.com/Plugins/Validation/Methods/range range: function( value, element, param ) { return this.optional(element) || ( value >= param[0] && value <= param[1] ); }, // http://docs.jquery.com/Plugins/Validation/Methods/email email: function(value, element) { // contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/ return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/url url: function(value, element) { // contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/ return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/date date: function(value, element) { return this.optional(element) || !/Invalid|NaN/.test(new Date(value)); }, // http://docs.jquery.com/Plugins/Validation/Methods/dateISO dateISO: function(value, element) { return this.optional(element) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/number number: function(value, element) { return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/digits digits: function(value, element) { return this.optional(element) || /^\d+$/.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/creditcard // based on http://en.wikipedia.org/wiki/Luhn creditcard: function(value, element) { if ( this.optional(element) ) { return "dependency-mismatch"; } // accept only spaces, digits and dashes if (/[^0-9 \-]+/.test(value)) { return false; } var nCheck = 0, nDigit = 0, bEven = false; value = value.replace(/\D/g, ""); for (var n = value.length - 1; n >= 0; n--) { var cDigit = value.charAt(n); nDigit = parseInt(cDigit, 10); if (bEven) { if ((nDigit *= 2) > 9) { nDigit -= 9; } } nCheck += nDigit; bEven = !bEven; } return (nCheck % 10) === 0; }, // http://docs.jquery.com/Plugins/Validation/Methods/equalTo equalTo: function(value, element, param) { // bind to the blur event of the target in order to revalidate whenever the target field is updated // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead var target = $(param); if (this.settings.onfocusout) { target.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() { $(element).valid(); }); } return value === target.val(); } } }); // deprecated, use $.validator.format instead $.format = $.validator.format; }(jQuery)); // ajax mode: abort // usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); // if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() (function($) { var pendingRequests = {}; // Use a prefilter if available (1.5+) if ( $.ajaxPrefilter ) { $.ajaxPrefilter(function(settings, _, xhr) { var port = settings.port; if (settings.mode === "abort") { if ( pendingRequests[port] ) { pendingRequests[port].abort(); } pendingRequests[port] = xhr; } }); } else { // Proxy ajax var ajax = $.ajax; $.ajax = function(settings) { var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, port = ( "port" in settings ? settings : $.ajaxSettings ).port; if (mode === "abort") { if ( pendingRequests[port] ) { pendingRequests[port].abort(); } return (pendingRequests[port] = ajax.apply(this, arguments)); } return ajax.apply(this, arguments); }; } }(jQuery)); // provides cross-browser focusin and focusout events // IE has native support, in other browsers, use event caputuring (neither bubbles) // provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation // handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target (function($) { // only implement if not provided by jQuery core (since 1.4) // TODO verify if jQuery 1.4's implementation is compatible with older jQuery special-event APIs if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) { $.each({ focus: 'focusin', blur: 'focusout' }, function( original, fix ){ $.event.special[fix] = { setup:function() { this.addEventListener( original, handler, true ); }, teardown:function() { this.removeEventListener( original, handler, true ); }, handler: function(e) { var args = arguments; args[0] = $.event.fix(e); args[0].type = fix; return $.event.handle.apply(this, args); } }; function handler(e) { e = $.event.fix(e); e.type = fix; return $.event.handle.call(this, e); } }); } $.extend($.fn, { validateDelegate: function(delegate, type, handler) { return this.bind(type, function(event) { var target = $(event.target); if (target.is(delegate)) { return handler.apply(target, arguments); } }); } }); }(jQuery)); ; /* Comment Generated by Combres - Resource '~/Resources/Scripts/jquery.validate.unobtrusive.min.js' (Mode: Static) */ /* ** Unobtrusive validation support library for jQuery and jQuery Validate ** Copyright (C) Microsoft Corporation. All rights reserved. */ (function(a){var d=a.validator,b,f="unobtrusiveValidation";function c(a,b,c){a.rules[b]=c;if(a.message)a.messages[b]=a.message}function i(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function g(a){return a.substr(0,a.lastIndexOf(".")+1)}function e(a,b){if(a.indexOf("*.")===0)a=a.replace("*.",b);return a}function l(c,d){var b=a(this).find("[data-valmsg-for='"+d[0].name+"']"),e=a.parseJSON(b.attr("data-valmsg-replace"))!==false;b.removeClass("field-validation-valid").addClass("field-validation-error");c.data("unobtrusiveContainer",b);if(e){b.empty();c.removeClass("input-validation-error").appendTo(b)}else c.hide()}function k(e,d){var c=a(this).find("[data-valmsg-summary=true]"),b=c.find("ul");if(b&&b.length&&d.errorList.length){b.empty();c.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(d.errorList,function(){a("
    • ").html(this.message).appendTo(b)})}}function j(c){var b=c.data("unobtrusiveContainer"),d=a.parseJSON(b.attr("data-valmsg-replace"));if(b){b.addClass("field-validation-valid").removeClass("field-validation-error");c.removeData("unobtrusiveContainer");d&&b.empty()}}function h(d){var b=a(d),c=b.data(f);if(!c){c={options:{errorClass:"input-validation-error",errorElement:"span",errorPlacement:a.proxy(l,d),invalidHandler:a.proxy(k,d),messages:{},rules:{},success:a.proxy(j,d)},attachValidation:function(){b.validate(this.options)},validate:function(){b.validate();return b.valid()}};b.data(f,c)}return c}d.unobtrusive={adapters:[],parseElement:function(b,i){var d=a(b),f=d.parents("form")[0],c,e,g;if(!f)return;c=h(f);c.options.rules[b.name]=e={};c.options.messages[b.name]=g={};a.each(this.adapters,function(){var c="data-val-"+this.name,i=d.attr(c),h={};if(i!==undefined){c+="-";a.each(this.params,function(){h[this]=d.attr(c+this)});this.adapt({element:b,form:f,message:i,params:h,rules:e,messages:g})}});jQuery.extend(e,{__dummy__:true});!i&&c.attachValidation()},parse:function(b){a(b).find(":input[data-val=true]").each(function(){d.unobtrusive.parseElement(this,true)});a("form").each(function(){var a=h(this);a&&a.attachValidation()})}};b=d.unobtrusive.adapters;b.add=function(c,a,b){if(!b){b=a;a=[]}this.push({name:c,params:a,adapt:b});return this};b.addBool=function(a,b){return this.add(a,function(d){c(d,b||a,true)})};b.addMinMax=function(e,g,f,a,d,b){return this.add(e,[d||"min",b||"max"],function(b){var e=b.params.min,d=b.params.max;if(e&&d)c(b,a,[e,d]);else if(e)c(b,g,e);else d&&c(b,f,d)})};b.addSingleVal=function(a,b,d){return this.add(a,[b||"val"],function(e){c(e,d||a,e.params[b])})};d.addMethod("__dummy__",function(){return true});d.addMethod("regex",function(b,c,d){var a;if(this.optional(c))return true;a=(new RegExp(d)).exec(b);return a&&a.index===0&&a[0].length===b.length});b.addSingleVal("accept","exts").addSingleVal("regex","pattern");b.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");b.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");b.add("equalto",["other"],function(b){var h=g(b.element.name),i=b.params.other,d=e(i,h),f=a(b.form).find(":input[name="+d+"]")[0];c(b,"equalTo",f)});b.add("required",function(a){(a.element.tagName.toUpperCase()!=="INPUT"||a.element.type.toUpperCase()!=="CHECKBOX")&&c(a,"required",true)});b.add("remote",["url","type","additionalfields"],function(b){var d={url:b.params.url,type:b.params.type||"GET",data:{}},f=g(b.element.name);a.each(i(b.params.additionalfields||b.element.name),function(h,g){var c=e(g,f);d.data[c]=function(){return a(b.form).find(":input[name='"+c+"']").val()}});c(b,"remote",d)});a(function(){d.unobtrusive.parse(document)})})(jQuery);