(function() { var S = this, ac, E = S.jQuery, G = S.$, V = S.jQuery = S.$ = function(a, b) { return new V.fn.init(a, b); }, ag = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, ab = /^.[^:#\[\.,]*$/; V.fn = V.prototype = { init: function(d, b) { d = d || document; if (d.nodeType) { this[0] = d; this.length = 1; this.context = d; return this; } if (typeof d === "string") { var a = ag.exec(d); if (a && (a[1] || !b)) { if (a[1]) { d = V.clean([a[1]], b); } else { var c = document.getElementById(a[3]); if (c && c.id != a[3]) { return V().find(d); } var e = V(c || []); e.context = document; e.selector = d; return e; } } else { return V(b).find(d); } } else { if (V.isFunction(d)) { return V(document).ready(d); } } if (d.selector && d.context) { this.selector = d.selector; this.context = d.context; } return this.setArray(V.isArray(d) ? d : V.makeArray(d)); }, selector: "", jquery: "1.3.2", size: function() { return this.length; }, get: function(a) { return a === ac ? Array.prototype.slice.call(this) : this[a]; }, pushStack: function(d, b, c) { var a = V(d); a.prevObject = this; a.context = this.context; if (b === "find") { a.selector = this.selector + (this.selector ? " " : "") + c; } else { if (b) { a.selector = this.selector + "." + b + "(" + c + ")"; } } return a; }, setArray: function(a) { this.length = 0; Array.prototype.push.apply(this, a); return this; }, each: function(b, a) { return V.each(this, b, a); }, index: function(a) { return V.inArray(a && a.jquery ? a[0] : a, this); }, attr: function(d, b, a) { var c = d; if (typeof d === "string") { if (b === ac) { return this[0] && V[a || "attr"](this[0], d); } else { c = {}; c[d] = b; } } return this.each(function(e) { for (d in c) { V.attr(a ? this.style : this, d, V.prop(this, c[d], a, e, d)); } }); }, css: function(a, b) { if ((a == "width" || a == "height") && parseFloat(b) < 0) { b = ac; } return this.attr(a, b, "curCSS"); }, text: function(b) { if (typeof b !== "object" && b != null) { return this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(b)); } var a = ""; V.each(b || this, function() { V.each(this.childNodes, function() { if (this.nodeType != 8) { a += this.nodeType != 1 ? this.nodeValue : V.fn.text([this]); } }); }); return a; }, wrapAll: function(a) { if (this[0]) { var b = V(a, this[0].ownerDocument).clone(); if (this[0].parentNode) { b.insertBefore(this[0]); } b.map(function() { var c = this; while (c.firstChild) { c = c.firstChild; } return c; }).append(this); } return this; }, wrapInner: function(a) { return this.each(function() { V(this).contents().wrapAll(a); }); }, wrap: function(a) { return this.each(function() { V(this).wrapAll(a); }); }, append: function() { return this.domManip(arguments, true, function(a) { if (this.nodeType == 1) { this.appendChild(a); } }); }, prepend: function() { return this.domManip(arguments, true, function(a) { if (this.nodeType == 1) { this.insertBefore(a, this.firstChild); } }); }, before: function() { return this.domManip(arguments, false, function(a) { this.parentNode.insertBefore(a, this); }); }, after: function() { return this.domManip(arguments, false, function(a) { this.parentNode.insertBefore(a, this.nextSibling); }); }, end: function() { return this.prevObject || V([]); }, push: [].push, sort: [].sort, splice: [].splice, find: function(a) { if (this.length === 1) { var b = this.pushStack([], "find", a); b.length = 0; V.find(a, this[0], b); return b; } else { return this.pushStack(V.unique(V.map(this, function(c) { return V.find(a, c); })), "find", a); } }, clone: function(a) { var c = this.map(function() { if (!V.support.noCloneEvent && !V.isXMLDoc(this)) { var e = this.outerHTML; if (!e) { var f = this.ownerDocument.createElement("div"); f.appendChild(this.cloneNode(true)); e = f.innerHTML; } return V.clean([e.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0]; } else { return this.cloneNode(true); } }); if (a === true) { var b = this.find("*").andSelf(), d = 0; c.find("*").andSelf().each(function() { if (this.nodeName !== b[d].nodeName) { return; } var e = V.data(b[d], "events"); for (var g in e) { for (var f in e[g]) { V.event.add(this, g, e[g][f], e[g][f].data); } } d++; }); } return c; }, filter: function(a) { return this.pushStack(V.isFunction(a) && V.grep(this, function(b, c) { return a.call(b, c); }) || V.multiFilter(a, V.grep(this, function(b) { return b.nodeType === 1; })), "filter", a); }, closest: function(b) { var a = V.expr.match.POS.test(b) ? V(b) : null, c = 0; return this.map(function() { var d = this; while (d && d.ownerDocument) { if (a ? a.index(d) > -1 : V(d).is(b)) { V.data(d, "closest", c); return d; } d = d.parentNode; c++; } }); }, not: function(a) { if (typeof a === "string") { if (ab.test(a)) { return this.pushStack(V.multiFilter(a, this, true), "not", a); } else { a = V.multiFilter(a, this); } } var b = a.length && a[a.length - 1] !== ac && !a.nodeType; return this.filter(function() { return b ? V.inArray(this, a) < 0 : this != a; }); }, add: function(a) { return this.pushStack(V.unique(V.merge(this.get(), typeof a === "string" ? V(a) : V.makeArray(a)))); }, is: function(a) { return !!a && V.multiFilter(a, this).length > 0; }, hasClass: function(a) { return !!a && this.is("." + a); }, val: function(g) { if (g === ac) { var a = this[0]; if (a) { if (V.nodeName(a, "option")) { return (a.attributes.value || {}).specified ? a.value : a.text; } if (V.nodeName(a, "select")) { var e = a.selectedIndex, h = [], i = a.options, d = a.type == "select-one"; if (e < 0) { return null; } for (var b = d ? e : 0, f = d ? e + 1 : i.length; b < f; b++) { var c = i[b]; if (c.selected) { g = V(c).val(); if (d) { return g; } h.push(g); } } return h; } return (a.value || "").replace(/\r/g, ""); } return ac; } if (typeof g === "number") { g += ""; } return this.each(function() { if (this.nodeType != 1) { return; } if (V.isArray(g) && /radio|checkbox/.test(this.type)) { this.checked = (V.inArray(this.value, g) >= 0 || V.inArray(this.name, g) >= 0); } else { if (V.nodeName(this, "select")) { var j = V.makeArray(g); V("option", this).each(function() { this.selected = (V.inArray(this.value, j) >= 0 || V.inArray(this.text, j) >= 0); }); if (!j.length) { this.selectedIndex = -1; } } else { this.value = g; } } }); }, html: function(a) { return a === ac ? (this[0] ? this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : null) : this.empty().append(a); }, replaceWith: function(a) { return this.after(a).remove(); }, eq: function(a) { return this.slice(a, +a + 1); }, slice: function() { return this.pushStack(Array.prototype.slice.apply(this, arguments), "slice", Array.prototype.slice.call(arguments).join(",")); }, map: function(a) { return this.pushStack(V.map(this, function(b, c) { return a.call(b, c, b); })); }, andSelf: function() { return this.add(this.prevObject); }, domManip: function(f, i, h) { if (this[0]) { var e = (this[0].ownerDocument || this[0]).createDocumentFragment(), b = V.clean(f, (this[0].ownerDocument || this[0]), e), d = e.firstChild; if (d) { for (var c = 0, a = this.length; c < a; c++) { h.call(g(this[c], d), this.length > 1 || c > 0 ? e.cloneNode(true) : e); } } if (b) { V.each(b, F); } } return this; function g(j, k) { return i && V.nodeName(j, "table") && V.nodeName(k, "tr") ? (j.getElementsByTagName("tbody")[0] || j.appendChild(j.ownerDocument.createElement("tbody"))) : j; } } }; V.fn.init.prototype = V.fn; function F(a, b) { if (b.src) { V.ajax({ url: b.src, async: false, dataType: "script" }); } else { V.globalEval(b.text || b.textContent || b.innerHTML || ""); } if (b.parentNode) { b.parentNode.removeChild(b); } } function aa() { return +new Date; } V.extend = V.fn.extend = function() { var f = arguments[0] || {}, d = 1, e = arguments.length, a = false, c; if (typeof f === "boolean") { a = f; f = arguments[1] || {}; d = 2; } if (typeof f !== "object" && !V.isFunction(f)) { f = {}; } if (e == d) { f = this; --d; } for (; d < e; d++) { if ((c = arguments[d]) != null) { for (var b in c) { var g = f[b], h = c[b]; if (f === h) { continue; } if (a && h && typeof h === "object" && !h.nodeType) { f[b] = V.extend(a, g || (h.length != null ? [] : {}), h); } else { if (h !== ac) { f[b] = h; } } } } } return f; }; var X = /z-?index|font-?weight|opacity|zoom|line-?height/i, H = document.defaultView || {}, J = Object.prototype.toString; V.extend({ noConflict: function(a) { S.$ = G; if (a) { S.jQuery = E; } return V; }, isFunction: function(a) { return J.call(a) === "[object Function]"; }, isArray: function(a) { return J.call(a) === "[object Array]"; }, isXMLDoc: function(a) { return a.nodeType === 9 && a.documentElement.nodeName !== "HTML" || !!a.ownerDocument && V.isXMLDoc(a.ownerDocument); }, globalEval: function(a) { if (a && /\S/.test(a)) { var c = document.getElementsByTagName("head")[0] || document.documentElement, b = document.createElement("script"); b.type = "text/javascript"; if (V.support.scriptEval) { b.appendChild(document.createTextNode(a)); } else { b.text = a; } c.insertBefore(b, c.firstChild); c.removeChild(b); } }, nodeName: function(b, a) { return b.nodeName && b.nodeName.toUpperCase() == a.toUpperCase(); }, each: function(a, g, c) { var f, d = 0, e = a.length; if (c) { if (e === ac) { for (f in a) { if (g.apply(a[f], c) === false) { break; } } } else { for (; d < e; ) { if (g.apply(a[d++], c) === false) { break; } } } } else { if (e === ac) { for (f in a) { if (g.call(a[f], f, a[f]) === false) { break; } } } else { for (var b = a[0]; d < e && g.call(b, d, b) !== false; b = a[++d]) { } } } return a; }, prop: function(b, c, a, e, d) { if (V.isFunction(c)) { c = c.call(b, e); } return typeof c === "number" && a == "curCSS" && !X.test(d) ? c + "px" : c; }, className: { add: function(a, b) { V.each((b || "").split(/\s+/), function(c, d) { if (a.nodeType == 1 && !V.className.has(a.className, d)) { a.className += (a.className ? " " : "") + d; } }); }, remove: function(a, b) { if (a.nodeType == 1) { a.className = b !== ac ? V.grep(a.className.split(/\s+/), function(c) { return !V.className.has(b, c); }).join(" ") : ""; } }, has: function(b, a) { return b && V.inArray(a, (b.className || b).toString().split(/\s+/)) > -1; } }, swap: function(b, a, c) { var d = {}; for (var e in a) { d[e] = b.style[e]; b.style[e] = a[e]; } c.call(b); for (var e in a) { b.style[e] = d[e]; } }, css: function(d, b, f, a) { if (b == "width" || b == "height") { var h, c = { position: "absolute", visibility: "hidden", display: "block" }, g = b == "width" ? ["Left", "Right"] : ["Top", "Bottom"]; function e() { h = b == "width" ? d.offsetWidth : d.offsetHeight; if (a === "border") { return; } V.each(g, function() { if (!a) { h -= parseFloat(V.curCSS(d, "padding" + this, true)) || 0; } if (a === "margin") { h += parseFloat(V.curCSS(d, "margin" + this, true)) || 0; } else { h -= parseFloat(V.curCSS(d, "border" + this + "Width", true)) || 0; } }); } if (d.offsetWidth !== 0) { e(); } else { V.swap(d, c, e); } return Math.max(0, Math.round(h)); } return V.curCSS(d, b, f); }, curCSS: function(e, b, c) { var h, a = e.style; if (b == "opacity" && !V.support.opacity) { h = V.attr(a, "opacity"); return h == "" ? "1" : h; } if (b.match(/float/i)) { b = N; } if (!c && a && a[b]) { h = a[b]; } else { if (H.getComputedStyle) { if (b.match(/float/i)) { b = "float"; } b = b.replace(/([A-Z])/g, "-$1").toLowerCase(); var i = H.getComputedStyle(e, null); if (i) { h = i.getPropertyValue(b); } if (b == "opacity" && h == "") { h = "1"; } } else { if (e.currentStyle) { var f = b.replace(/\-(\w)/g, function(j, k) { return k.toUpperCase(); }); h = e.currentStyle[b] || e.currentStyle[f]; if (!/^\d+(px)?$/i.test(h) && /^\d/.test(h)) { var d = a.left, g = e.runtimeStyle.left; e.runtimeStyle.left = e.currentStyle.left; a.left = h || 0; h = a.pixelLeft + "px"; a.left = d; e.runtimeStyle.left = g; } } } } return h; }, clean: function(b, g, e) { g = g || document; if (typeof g.createElement === "undefined") { g = g.ownerDocument || g[0] && g[0].ownerDocument || document; } if (!e && b.length === 1 && typeof b[0] === "string") { var d = /^<(\w+)\s*\/?>$/.exec(b[0]); if (d) { return [g.createElement(d[1])]; } } var c = [], a = [], h = g.createElement("div"); V.each(b, function(o, k) { if (typeof k === "number") { k += ""; } if (!k) { return; } if (typeof k === "string") { k = k.replace(/(<(\w+)[^>]*?)\/>/g, function(q, r, p) { return p.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? q : r + "></" + p + ">"; }); var l = k.replace(/^\s+/, "").substring(0, 10).toLowerCase(); var i = !l.indexOf("<opt") && [1, "<select multiple='multiple'>", "</select>"] || !l.indexOf("<leg") && [1, "<fieldset>", "</fieldset>"] || l.match(/^<(thead|tbody|tfoot|colg|cap)/) && [1, "<table>", "</table>"] || !l.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!l.indexOf("<td") || !l.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || !l.indexOf("<col") && [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || !V.support.htmlSerialize && [1, "div<div>", "</div>"] || [0, "", ""]; h.innerHTML = i[1] + k + i[2]; while (i[0]--) { h = h.lastChild; } if (!V.support.tbody) { var j = /<tbody/i.test(k), n = !l.indexOf("<table") && !j ? h.firstChild && h.firstChild.childNodes : i[1] == "<table>" && !j ? h.childNodes : []; for (var m = n.length - 1; m >= 0; --m) { if (V.nodeName(n[m], "tbody") && !n[m].childNodes.length) { n[m].parentNode.removeChild(n[m]); } } } if (!V.support.leadingWhitespace && /^\s/.test(k)) { h.insertBefore(g.createTextNode(k.match(/^\s*/)[0]), h.firstChild); } k = V.makeArray(h.childNodes); } if (k.nodeType) { c.push(k); } else { c = V.merge(c, k); } }); if (e) { for (var f = 0; c[f]; f++) { if (V.nodeName(c[f], "script") && (!c[f].type || c[f].type.toLowerCase() === "text/javascript")) { a.push(c[f].parentNode ? c[f].parentNode.removeChild(c[f]) : c[f]); } else { if (c[f].nodeType === 1) { c.splice.apply(c, [f + 1, 0].concat(V.makeArray(c[f].getElementsByTagName("script")))); } e.appendChild(c[f]); } } return a; } return c; }, attr: function(f, c, g) { if (!f || f.nodeType == 3 || f.nodeType == 8) { return ac; } var d = !V.isXMLDoc(f), h = g !== ac; c = d && V.props[c] || c; if (f.tagName) { var b = /href|src|style/.test(c); if (c == "selected" && f.parentNode) { f.parentNode.selectedIndex; } if (c in f && d && !b) { if (h) { if (c == "type" && V.nodeName(f, "input") && f.parentNode) { throw "type property can't be changed"; } f[c] = g; } if (V.nodeName(f, "form") && f.getAttributeNode(c)) { return f.getAttributeNode(c).nodeValue; } if (c == "tabIndex") { var e = f.getAttributeNode("tabIndex"); return e && e.specified ? e.value : f.nodeName.match(/(button|input|object|select|textarea)/i) ? 0 : f.nodeName.match(/^(a|area)$/i) && f.href ? 0 : ac; } return f[c]; } if (!V.support.style && d && c == "style") { return V.attr(f.style, "cssText", g); } if (h) { f.setAttribute(c, "" + g); } var a = !V.support.hrefNormalized && d && b ? f.getAttribute(c, 2) : f.getAttribute(c); return a === null ? ac : a; } if (!V.support.opacity && c == "opacity") { if (h) { f.zoom = 1; f.filter = (f.filter || "").replace(/alpha\([^)]*\)/, "") + (parseInt(g) + "" == "NaN" ? "" : "alpha(opacity=" + g * 100 + ")"); } return f.filter && f.filter.indexOf("opacity=") >= 0 ? (parseFloat(f.filter.match(/opacity=([^)]*)/)[1]) / 100) + "" : ""; } c = c.replace(/-([a-z])/ig, function(i, j) { return j.toUpperCase(); }); if (h) { f[c] = g; } return f[c]; }, trim: function(a) { return (a || "").replace(/^\s+|\s+$/g, ""); }, makeArray: function(a) { var b = []; if (a != null) { var c = a.length; if (c == null || typeof a === "string" || V.isFunction(a) || a.setInterval) { b[0] = a; } else { while (c) { b[--c] = a[c]; } } } return b; }, inArray: function(a, b) { for (var c = 0, d = b.length; c < d; c++) { if (b[c] === a) { return c; } } return -1; }, merge: function(b, d) { var e = 0, a, c = b.length; if (!V.support.getAll) { while ((a = d[e++]) != null) { if (a.nodeType != 8) { b[c++] = a; } } } else { while ((a = d[e++]) != null) { b[c++] = a; } } return b; }, unique: function(g) { var c = [], f = {}; try { for (var a = 0, d = g.length; a < d; a++) { var b = V.data(g[a]); if (!f[b]) { f[b] = true; c.push(g[a]); } } } catch (e) { c = g; } return c; }, grep: function(f, e, b) { var a = []; for (var c = 0, d = f.length; c < d; c++) { if (!b != !e(f[c], c)) { a.push(f[c]); } } return a; }, map: function(e, b) { var f = []; for (var a = 0, c = e.length; a < c; a++) { var d = b(e[a], a); if (d != null) { f[f.length] = d; } } return f.concat.apply([], f); } }); var af = navigator.userAgent.toLowerCase(); V.browser = { version: (af.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, "0"])[1], safari: /webkit/.test(af), opera: /opera/.test(af), msie: /msie/.test(af) && !/opera/.test(af), mozilla: /mozilla/.test(af) && !/(compatible|webkit)/.test(af) }; V.each({ parent: function(a) { return a.parentNode; }, parents: function(a) { return V.dir(a, "parentNode"); }, next: function(a) { return V.nth(a, 2, "nextSibling"); }, prev: function(a) { return V.nth(a, 2, "previousSibling"); }, nextAll: function(a) { return V.dir(a, "nextSibling"); }, prevAll: function(a) { return V.dir(a, "previousSibling"); }, siblings: function(a) { return V.sibling(a.parentNode.firstChild, a); }, children: function(a) { return V.sibling(a.firstChild); }, contents: function(a) { return V.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : V.makeArray(a.childNodes); } }, function(a, b) { V.fn[a] = function(c) { var d = V.map(this, b); if (c && typeof c == "string") { d = V.multiFilter(c, d); } return this.pushStack(V.unique(d), a, c); }; }); V.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function(a, b) { V.fn[a] = function(c) { var g = [], d = V(c); for (var h = 0, e = d.length; h < e; h++) { var f = (h > 0 ? this.clone(true) : this).get(); V.fn[b].apply(V(d[h]), f); g = g.concat(f); } return this.pushStack(g, a, c); }; }); V.each({ removeAttr: function(a) { V.attr(this, a, ""); if (this.nodeType == 1) { this.removeAttribute(a); } }, addClass: function(a) { V.className.add(this, a); }, removeClass: function(a) { V.className.remove(this, a); }, toggleClass: function(b, a) { if (typeof a !== "boolean") { a = !V.className.has(this, b); } V.className[a ? "add" : "remove"](this, b); }, remove: function(a) { if (!a || V.filter(a, [this]).length) { V("*", this).add([this]).each(function() { V.event.remove(this); V.removeData(this); }); if (this.parentNode) { this.parentNode.removeChild(this); } } }, empty: function() { V(this).children().remove(); while (this.firstChild) { this.removeChild(this.firstChild); } } }, function(a, b) { V.fn[a] = function() { return this.each(b, arguments); }; }); function Q(a, b) { return a[0] && parseInt(V.curCSS(a[0], b, true), 10) || 0; } var O = "jQuery" + aa(), M = 0, ad = {}; V.extend({ cache: {}, data: function(d, c, a) { d = d == S ? ad : d; var b = d[O]; if (!b) { b = d[O] = ++M; } if (c && !V.cache[b]) { V.cache[b] = {}; } if (a !== ac) { V.cache[b][c] = a; } return c ? V.cache[b][c] : b; }, removeData: function(d, c) { d = d == S ? ad : d; var b = d[O]; if (c) { if (V.cache[b]) { delete V.cache[b][c]; c = ""; for (c in V.cache[b]) { break; } if (!c) { V.removeData(d); } } } else { try { delete d[O]; } catch (a) { if (d.removeAttribute) { d.removeAttribute(O); } } delete V.cache[b]; } }, queue: function(d, c, b) { if (d) { c = (c || "fx") + "queue"; var a = V.data(d, c); if (!a || V.isArray(b)) { a = V.data(d, c, V.makeArray(b)); } else { if (b) { a.push(b); } } } return a; }, dequeue: function(b, a) { var c = V.queue(b, a), d = c.shift(); if (!a || a === "fx") { d = c[0]; } if (d !== ac) { d.call(b); } } }); V.fn.extend({ data: function(c, a) { var b = c.split("."); b[1] = b[1] ? "." + b[1] : ""; if (a === ac) { var d = this.triggerHandler("getData" + b[1] + "!", [b[0]]); if (d === ac && this.length) { d = V.data(this[0], c); } return d === ac && b[1] ? this.data(b[0]) : d; } else { return this.trigger("setData" + b[1] + "!", [b[0], a]).each(function() { V.data(this, c, a); }); } }, removeData: function(a) { return this.each(function() { V.removeData(this, a); }); }, queue: function(a, b) { if (typeof a !== "string") { b = a; a = "fx"; } if (b === ac) { return V.queue(this[0], a); } return this.each(function() { var c = V.queue(this, a, b); if (a == "fx" && c.length == 1) { c[0].call(this); } }); }, dequeue: function(a) { return this.each(function() { V.dequeue(this, a); }); } }); (function() { var e = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g, k = 0, g = Object.prototype.toString; var b = function(D, u, y, p) { y = y || []; u = u || document; if (u.nodeType !== 1 && u.nodeType !== 9) { return []; } if (!D || typeof D !== "string") { return y; } var ai = [], w, r, q, t, z, v, C = true; e.lastIndex = 0; while ((w = e.exec(D)) !== null) { ai.push(w[1]); if (w[2]) { v = RegExp.rightContext; break; } } if (ai.length > 1 && l.exec(D)) { if (ai.length === 2 && h.relative[ai[0]]) { r = i(ai[0] + ai[1], u); } else { r = h.relative[ai[0]] ? [u] : b(ai.shift(), u); while (ai.length) { D = ai.shift(); if (h.relative[D]) { D += ai.shift(); } r = i(D, r); } } } else { var B = p ? { expr: ai.pop(), set: a(p)} : b.find(ai.pop(), ai.length === 1 && u.parentNode ? u.parentNode : u, d(u)); r = b.filter(B.expr, B.set); if (ai.length > 0) { q = a(r); } else { C = false; } while (ai.length) { var A = ai.pop(), x = A; if (!h.relative[A]) { A = ""; } else { x = ai.pop(); } if (x == null) { x = u; } h.relative[A](q, x, d(u)); } } if (!q) { q = r; } if (!q) { throw "Syntax error, unrecognized expression: " + (A || D); } if (g.call(q) === "[object Array]") { if (!C) { y.push.apply(y, q); } else { if (u.nodeType === 1) { for (var s = 0; q[s] != null; s++) { if (q[s] && (q[s] === true || q[s].nodeType === 1 && j(u, q[s]))) { y.push(r[s]); } } } else { for (var s = 0; q[s] != null; s++) { if (q[s] && q[s].nodeType === 1) { y.push(r[s]); } } } } } else { a(q, y); } if (v) { b(v, u, y, p); if (c) { hasDuplicate = false; y.sort(c); if (hasDuplicate) { for (var s = 1; s < y.length; s++) { if (y[s] === y[s - 1]) { y.splice(s--, 1); } } } } } return y; }; b.matches = function(p, q) { return b(p, null, null, q); }; b.find = function(p, q, u) { var x, v; if (!p) { return []; } for (var t = 0, s = h.order.length; t < s; t++) { var w = h.order[t], v; if ((v = h.match[w].exec(p))) { var r = RegExp.leftContext; if (r.substr(r.length - 1) !== "\\") { v[1] = (v[1] || "").replace(/\\/g, ""); x = h.find[w](v, q, u); if (x != null) { p = p.replace(h.match[w], ""); break; } } } } if (!x) { x = q.getElementsByTagName("*"); } return { set: x, expr: p }; }; b.filter = function(u, p, y, x) { var w = u, q = [], t = p, D, B, ai = p && p[0] && d(p[0]); while (u && p.length) { for (var z in h.filter) { if ((D = h.match[z].exec(u)) != null) { var v = h.filter[z], A, s; B = false; if (t == q) { q = []; } if (h.preFilter[z]) { D = h.preFilter[z](D, t, y, q, x, ai); if (!D) { B = A = true; } else { if (D === true) { continue; } } } if (D) { for (var C = 0; (s = t[C]) != null; C++) { if (s) { A = v(s, D, C, t); var r = x ^ !!A; if (y && A != null) { if (r) { B = true; } else { t[C] = false; } } else { if (r) { q.push(s); B = true; } } } } } if (A !== ac) { if (!y) { t = q; } u = u.replace(h.match[z], ""); if (!B) { return []; } break; } } } if (u == w) { if (B == null) { throw "Syntax error, unrecognized expression: " + u; } else { break; } } w = u; } return t; }; var h = b.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|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ }, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function(p) { return p.getAttribute("href"); } }, relative: { "+": function(p, q, x) { var v = typeof q === "string", u = v && !/\W/.test(q), w = v && !u; if (u && !x) { q = q.toUpperCase(); } for (var t = 0, s = p.length, r; t < s; t++) { if ((r = p[t])) { while ((r = r.previousSibling) && r.nodeType !== 1) { } p[t] = w || r && r.nodeName === q ? r || false : r === q; } } if (w) { b.filter(q, p, true); } }, ">": function(w, r, p) { var u = typeof r === "string"; if (u && !/\W/.test(r)) { r = p ? r : r.toUpperCase(); for (var s = 0, q = w.length; s < q; s++) { var v = w[s]; if (v) { var t = v.parentNode; w[s] = t.nodeName === r ? t : false; } } } else { for (var s = 0, q = w.length; s < q; s++) { var v = w[s]; if (v) { w[s] = u ? v.parentNode : v.parentNode === r; } } if (u) { b.filter(r, w, true); } } }, "": function(t, r, q) { var s = k++, u = f; if (!r.match(/\W/)) { var p = r = q ? r : r.toUpperCase(); u = o; } u("parentNode", r, s, t, p, q); }, "~": function(t, r, q) { var s = k++, u = f; if (typeof r === "string" && !r.match(/\W/)) { var p = r = q ? r : r.toUpperCase(); u = o; } u("previousSibling", r, s, t, p, q); } }, find: { ID: function(q, r, s) { if (typeof r.getElementById !== "undefined" && !s) { var p = r.getElementById(q[1]); return p ? [p] : []; } }, NAME: function(s, q, r) { if (typeof q.getElementsByName !== "undefined") { var v = [], p = q.getElementsByName(s[1]); for (var t = 0, u = p.length; t < u; t++) { if (p[t].getAttribute("name") === s[1]) { v.push(p[t]); } } return v.length === 0 ? null : v; } }, TAG: function(p, q) { return q.getElementsByTagName(p[1]); } }, preFilter: { CLASS: function(t, r, s, q, w, p) { t = " " + t[1].replace(/\\/g, "") + " "; if (p) { return t; } for (var u = 0, v; (v = r[u]) != null; u++) { if (v) { if (w ^ (v.className && (" " + v.className + " ").indexOf(t) >= 0)) { if (!s) { q.push(v); } } else { if (s) { r[u] = false; } } } } return false; }, ID: function(p) { return p[1].replace(/\\/g, ""); }, TAG: function(q, p) { for (var r = 0; p[r] === false; r++) { } return p[r] && d(p[r]) ? q[1] : q[1].toUpperCase(); }, CHILD: function(p) { if (p[1] == "nth") { var q = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(p[2] == "even" && "2n" || p[2] == "odd" && "2n+1" || !/\D/.test(p[2]) && "0n+" + p[2] || p[2]); p[2] = (q[1] + (q[2] || 1)) - 0; p[3] = q[3] - 0; } p[0] = k++; return p; }, ATTR: function(p, r, s, q, u, v) { var t = p[1].replace(/\\/g, ""); if (!v && h.attrMap[t]) { p[1] = h.attrMap[t]; } if (p[2] === "~=") { p[4] = " " + p[4] + " "; } return p; }, PSEUDO: function(p, r, s, q, u) { if (p[1] === "not") { if (p[3].match(e).length > 1 || /^\w/.test(p[3])) { p[3] = b(p[3], null, null, r); } else { var t = b.filter(p[3], r, s, true ^ u); if (!s) { q.push.apply(q, t); } return false; } } else { if (h.match.POS.test(p[0]) || h.match.CHILD.test(p[0])) { return true; } } return p; }, POS: function(p) { p.unshift(true); return p; } }, filters: { enabled: function(p) { return p.disabled === false && p.type !== "hidden"; }, disabled: function(p) { return p.disabled === true; }, checked: function(p) { return p.checked === true; }, selected: function(p) { p.parentNode.selectedIndex; return p.selected === true; }, parent: function(p) { return !!p.firstChild; }, empty: function(p) { return !p.firstChild; }, has: function(r, q, p) { return !!b(p[3], r).length; }, header: function(p) { return /h\d/i.test(p.nodeName); }, text: function(p) { return "text" === p.type; }, radio: function(p) { return "radio" === p.type; }, checkbox: function(p) { return "checkbox" === p.type; }, file: function(p) { return "file" === p.type; }, password: function(p) { return "password" === p.type; }, submit: function(p) { return "submit" === p.type; }, image: function(p) { return "image" === p.type; }, reset: function(p) { return "reset" === p.type; }, button: function(p) { return "button" === p.type || p.nodeName.toUpperCase() === "BUTTON"; }, input: function(p) { return /input|select|textarea|button/i.test(p.nodeName); } }, setFilters: { first: function(q, p) { return p === 0; }, last: function(r, q, p, s) { return q === s.length - 1; }, even: function(q, p) { return p % 2 === 0; }, odd: function(q, p) { return p % 2 === 1; }, lt: function(r, q, p) { return q < p[3] - 0; }, gt: function(r, q, p) { return q > p[3] - 0; }, nth: function(r, q, p) { return p[3] - 0 == q; }, eq: function(r, q, p) { return p[3] - 0 == q; } }, filter: { PSEUDO: function(w, s, t, p) { var r = s[1], u = h.filters[r]; if (u) { return u(w, t, s, p); } else { if (r === "contains") { return (w.textContent || w.innerText || "").indexOf(s[3]) >= 0; } else { if (r === "not") { var v = s[3]; for (var t = 0, q = v.length; t < q; t++) { if (v[t] === w) { return false; } } return true; } } } }, CHILD: function(r, u) { var y = u[1], s = r; switch (y) { case "only": case "first": while (s = s.previousSibling) { if (s.nodeType === 1) { return false; } } if (y == "first") { return true; } s = r; case "last": while (s = s.nextSibling) { if (s.nodeType === 1) { return false; } } return true; case "nth": var t = u[2], p = u[3]; if (t == 1 && p == 0) { return true; } var x = u[0], v = r.parentNode; if (v && (v.sizcache !== x || !r.nodeIndex)) { var w = 0; for (s = v.firstChild; s; s = s.nextSibling) { if (s.nodeType === 1) { s.nodeIndex = ++w; } } v.sizcache = x; } var q = r.nodeIndex - p; if (t == 0) { return q == 0; } else { return (q % t == 0 && q / t >= 0); } } }, ID: function(q, p) { return q.nodeType === 1 && q.getAttribute("id") === p; }, TAG: function(q, p) { return (p === "*" && q.nodeType === 1) || q.nodeName === p; }, CLASS: function(q, p) { return (" " + (q.className || q.getAttribute("class")) + " ").indexOf(p) > -1; }, ATTR: function(q, t) { var s = t[1], u = h.attrHandle[s] ? h.attrHandle[s](q) : q[s] != null ? q[s] : q.getAttribute(s), r = u + "", p = t[2], v = t[4]; return u == null ? p === "!=" : p === "=" ? r === v : p === "*=" ? r.indexOf(v) >= 0 : p === "~=" ? (" " + r + " ").indexOf(v) >= 0 : !v ? r && u !== false : p === "!=" ? r != v : p === "^=" ? r.indexOf(v) === 0 : p === "$=" ? r.substr(r.length - v.length) === v : p === "|=" ? r === v || r.substr(0, v.length + 1) === v + "-" : false; }, POS: function(p, r, s, q) { var u = r[2], t = h.setFilters[u]; if (t) { return t(p, s, r, q); } } } }; var l = h.match.POS; for (var n in h.match) { h.match[n] = RegExp(h.match[n].source + /(?![^\[]*\])(?![^\(]*\))/.source); } var a = function(q, p) { q = Array.prototype.slice.call(q); if (p) { p.push.apply(p, q); return p; } return q; }; try { Array.prototype.slice.call(document.documentElement.childNodes); } catch (m) { a = function(p, t) { var r = t || []; if (g.call(p) === "[object Array]") { Array.prototype.push.apply(r, p); } else { if (typeof p.length === "number") { for (var s = 0, q = p.length; s < q; s++) { r.push(p[s]); } } else { for (var s = 0; p[s]; s++) { r.push(p[s]); } } } return r; }; } var c; if (document.documentElement.compareDocumentPosition) { c = function(q, p) { var r = q.compareDocumentPosition(p) & 4 ? -1 : q === p ? 0 : 1; if (r === 0) { hasDuplicate = true; } return r; }; } else { if ("sourceIndex" in document.documentElement) { c = function(q, p) { var r = q.sourceIndex - p.sourceIndex; if (r === 0) { hasDuplicate = true; } return r; }; } else { if (document.createRange) { c = function(t, r) { var s = t.ownerDocument.createRange(), q = r.ownerDocument.createRange(); s.selectNode(t); s.collapse(true); q.selectNode(r); q.collapse(true); var p = s.compareBoundaryPoints(Range.START_TO_END, q); if (p === 0) { hasDuplicate = true; } return p; }; } } } (function() { var q = document.createElement("form"), r = "script" + (new Date).getTime(); q.innerHTML = "<input name='" + r + "'/>"; var p = document.documentElement; p.insertBefore(q, p.firstChild); if (!!document.getElementById(r)) { h.find.ID = function(s, t, u) { if (typeof t.getElementById !== "undefined" && !u) { var v = t.getElementById(s[1]); return v ? v.id === s[1] || typeof v.getAttributeNode !== "undefined" && v.getAttributeNode("id").nodeValue === s[1] ? [v] : ac : []; } }; h.filter.ID = function(t, u) { var s = typeof t.getAttributeNode !== "undefined" && t.getAttributeNode("id"); return t.nodeType === 1 && s && s.nodeValue === u; }; } p.removeChild(q); })(); (function() { var p = document.createElement("div"); p.appendChild(document.createComment("")); if (p.getElementsByTagName("*").length > 0) { h.find.TAG = function(s, r) { var q = r.getElementsByTagName(s[1]); if (s[1] === "*") { var u = []; for (var t = 0; q[t]; t++) { if (q[t].nodeType === 1) { u.push(q[t]); } } q = u; } return q; }; } p.innerHTML = "<a href='#'></a>"; if (p.firstChild && typeof p.firstChild.getAttribute !== "undefined" && p.firstChild.getAttribute("href") !== "#") { h.attrHandle.href = function(q) { return q.getAttribute("href", 2); }; } })(); if (document.querySelectorAll) { (function() { var p = b, q = document.createElement("div"); q.innerHTML = "<p class='TEST'></p>"; if (q.querySelectorAll && q.querySelectorAll(".TEST").length === 0) { return; } b = function(s, r, u, v) { r = r || document; if (!v && r.nodeType === 9 && !d(r)) { try { return a(r.querySelectorAll(s), u); } catch (t) { } } return p(s, r, u, v); }; b.find = p.find; b.filter = p.filter; b.selectors = p.selectors; b.matches = p.matches; })(); } if (document.getElementsByClassName && document.documentElement.getElementsByClassName) { (function() { var p = document.createElement("div"); p.innerHTML = "<div class='test e'></div><div class='test'></div>"; if (p.getElementsByClassName("e").length === 0) { return; } p.lastChild.className = "e"; if (p.getElementsByClassName("e").length === 1) { return; } h.order.splice(1, 0, "CLASS"); h.find.CLASS = function(q, r, s) { if (typeof r.getElementsByClassName !== "undefined" && !s) { return r.getElementsByClassName(q[1]); } }; })(); } function o(t, z, y, s, r, p) { var w = t == "previousSibling" && !p; for (var v = 0, u = s.length; v < u; v++) { var q = s[v]; if (q) { if (w && q.nodeType === 1) { q.sizcache = y; q.sizset = v; } q = q[t]; var x = false; while (q) { if (q.sizcache === y) { x = s[q.sizset]; break; } if (q.nodeType === 1 && !p) { q.sizcache = y; q.sizset = v; } if (q.nodeName === z) { x = q; break; } q = q[t]; } s[v] = x; } } } function f(t, z, y, s, r, p) { var w = t == "previousSibling" && !p; for (var v = 0, u = s.length; v < u; v++) { var q = s[v]; if (q) { if (w && q.nodeType === 1) { q.sizcache = y; q.sizset = v; } q = q[t]; var x = false; while (q) { if (q.sizcache === y) { x = s[q.sizset]; break; } if (q.nodeType === 1) { if (!p) { q.sizcache = y; q.sizset = v; } if (typeof z !== "string") { if (q === z) { x = true; break; } } else { if (b.filter(z, [q]).length > 0) { x = q; break; } } } q = q[t]; } s[v] = x; } } } var j = document.compareDocumentPosition ? function(q, p) { return q.compareDocumentPosition(p) & 16; } : function(q, p) { return q !== p && (q.contains ? q.contains(p) : true); }; var d = function(p) { return p.nodeType === 9 && p.documentElement.nodeName !== "HTML" || !!p.ownerDocument && d(p.ownerDocument); }; var i = function(q, p) { var t = [], u = "", v, s = p.nodeType ? [p] : p; while ((v = h.match.PSEUDO.exec(q))) { u += v[0]; q = q.replace(h.match.PSEUDO, ""); } q = h.relative[q] ? q + "*" : q; for (var w = 0, r = s.length; w < r; w++) { b(q, s[w], t); } return b.filter(u, t); }; V.find = b; V.filter = b.filter; V.expr = b.selectors; V.expr[":"] = V.expr.filters; b.selectors.filters.hidden = function(p) { return p.offsetWidth === 0 || p.offsetHeight === 0; }; b.selectors.filters.visible = function(p) { return p.offsetWidth > 0 || p.offsetHeight > 0; }; b.selectors.filters.animated = function(p) { return V.grep(V.timers, function(q) { return p === q.elem; }).length; }; V.multiFilter = function(r, p, q) { if (q) { r = ":not(" + r + ")"; } return b.matches(r, p); }; V.dir = function(r, q) { var p = [], s = r[q]; while (s && s != document) { if (s.nodeType == 1) { p.push(s); } s = s[q]; } return p; }; V.nth = function(p, q, s, t) { q = q || 1; var r = 0; for (; p; p = p[s]) { if (p.nodeType == 1 && ++r == q) { break; } } return p; }; V.sibling = function(r, q) { var p = []; for (; r; r = r.nextSibling) { if (r.nodeType == 1 && r != q) { p.push(r); } } return p; }; return; S.Sizzle = b; })(); V.event = { add: function(e, g, d, c) { if (e.nodeType == 3 || e.nodeType == 8) { return; } if (e.setInterval && e != S) { e = S; } if (!d.guid) { d.guid = this.guid++; } if (c !== ac) { var a = d; d = this.proxy(a); d.data = c; } var f = V.data(e, "events") || V.data(e, "events", {}), b = V.data(e, "handle") || V.data(e, "handle", function() { return typeof V !== "undefined" && !V.event.triggered ? V.event.handle.apply(arguments.callee.elem, arguments) : ac; }); b.elem = e; V.each(g.split(/\s+/), function(i, j) { var k = j.split("."); j = k.shift(); d.type = k.slice().sort().join("."); var h = f[j]; if (V.event.specialAll[j]) { V.event.specialAll[j].setup.call(e, c, k); } if (!h) { h = f[j] = {}; if (!V.event.special[j] || V.event.special[j].setup.call(e, c, k) === false) { if (e.addEventListener) { e.addEventListener(j, b, false); } else { if (e.attachEvent) { e.attachEvent("on" + j, b); } } } } h[d.guid] = d; V.event.global[j] = true; }); e = null; }, guid: 1, global: {}, remove: function(g, d, f) { if (g.nodeType == 3 || g.nodeType == 8) { return; } var c = V.data(g, "events"), b, a; if (c) { if (d === ac || (typeof d === "string" && d.charAt(0) == ".")) { for (var e in c) { this.remove(g, e + (d || "")); } } else { if (d.type) { f = d.handler; d = d.type; } V.each(d.split(/\s+/), function(j, l) { var i = l.split("."); l = i.shift(); var k = RegExp("(^|\\.)" + i.slice().sort().join(".*\\.") + "(\\.|$)"); if (c[l]) { if (f) { delete c[l][f.guid]; } else { for (var m in c[l]) { if (k.test(c[l][m].type)) { delete c[l][m]; } } } if (V.event.specialAll[l]) { V.event.specialAll[l].teardown.call(g, i); } for (b in c[l]) { break; } if (!b) { if (!V.event.special[l] || V.event.special[l].teardown.call(g, i) === false) { if (g.removeEventListener) { g.removeEventListener(l, V.data(g, "handle"), false); } else { if (g.detachEvent) { g.detachEvent("on" + l, V.data(g, "handle")); } } } b = null; delete c[l]; } } }); } for (b in c) { break; } if (!b) { var h = V.data(g, "handle"); if (h) { h.elem = null; } V.removeData(g, "events"); V.removeData(g, "handle"); } } }, trigger: function(e, g, d, a) { var c = e.type || e; if (!a) { e = typeof e === "object" ? e[O] ? e : V.extend(V.Event(c), e) : V.Event(c); if (c.indexOf("!") >= 0) { e.type = c = c.slice(0, -1); e.exclusive = true; } if (!d) { e.stopPropagation(); if (this.global[c]) { V.each(V.cache, function() { if (this.events && this.events[c]) { V.event.trigger(e, g, this.handle.elem); } }); } } if (!d || d.nodeType == 3 || d.nodeType == 8) { return ac; } e.result = ac; e.target = d; g = V.makeArray(g); g.unshift(e); } e.currentTarget = d; var f = V.data(d, "handle"); if (f) { f.apply(d, g); } if ((!d[c] || (V.nodeName(d, "a") && c == "click")) && d["on" + c] && d["on" + c].apply(d, g) === false) { e.result = false; } if (!a && d[c] && !e.isDefaultPrevented() && !(V.nodeName(d, "a") && c == "click")) { this.triggered = true; try { d[c](); } catch (h) { } } this.triggered = false; if (!e.isPropagationStopped()) { var b = d.parentNode || d.ownerDocument; if (b) { V.event.trigger(e, g, b, true); } } }, handle: function(g) { var f, a; g = arguments[0] = V.event.fix(g || S.event); g.currentTarget = this; var h = g.type.split("."); g.type = h.shift(); f = !h.length && !g.exclusive; var e = RegExp("(^|\\.)" + h.slice().sort().join(".*\\.") + "(\\.|$)"); a = (V.data(this, "events") || {})[g.type]; for (var c in a) { var d = a[c]; if (f || e.test(d.type)) { g.handler = d; g.data = d.data; var b = d.apply(this, arguments); if (b !== ac) { g.result = b; if (b === false) { g.preventDefault(); g.stopPropagation(); } } if (g.isImmediatePropagationStopped()) { break; } } } }, props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix: function(c) { if (c[O]) { return c; } var f = c; c = V.Event(f); for (var a = this.props.length, e; a; ) { e = this.props[--a]; c[e] = f[e]; } if (!c.target) { c.target = c.srcElement || document; } if (c.target.nodeType == 3) { c.target = c.target.parentNode; } if (!c.relatedTarget && c.fromElement) { c.relatedTarget = c.fromElement == c.target ? c.toElement : c.fromElement; } if (c.pageX == null && c.clientX != null) { var d = document.documentElement, b = document.body; c.pageX = c.clientX + (d && d.scrollLeft || b && b.scrollLeft || 0) - (d.clientLeft || 0); c.pageY = c.clientY + (d && d.scrollTop || b && b.scrollTop || 0) - (d.clientTop || 0); } if (!c.which && ((c.charCode || c.charCode === 0) ? c.charCode : c.keyCode)) { c.which = c.charCode || c.keyCode; } if (!c.metaKey && c.ctrlKey) { c.metaKey = c.ctrlKey; } if (!c.which && c.button) { c.which = (c.button & 1 ? 1 : (c.button & 2 ? 3 : (c.button & 4 ? 2 : 0))); } return c; }, proxy: function(b, a) { a = a || function() { return b.apply(this, arguments); }; a.guid = b.guid = b.guid || a.guid || this.guid++; return a; }, special: { ready: { setup: ae, teardown: function() { } } }, specialAll: { live: { setup: function(a, b) { V.event.add(this, b[0], Y); }, teardown: function(a) { if (a.length) { var b = 0, c = RegExp("(^|\\.)" + a[0] + "(\\.|$)"); V.each((V.data(this, "events").live || {}), function() { if (c.test(this.type)) { b++; } }); if (b < 1) { V.event.remove(this, a[0], Y); } } } }} }; V.Event = function(a) { if (!this.preventDefault) { return new V.Event(a); } if (a && a.type) { this.originalEvent = a; this.type = a.type; } else { this.type = a; } this.timeStamp = aa(); this[O] = true; }; function R() { return false; } function L() { return true; } V.Event.prototype = { preventDefault: function() { this.isDefaultPrevented = L; var a = this.originalEvent; if (!a) { return; } if (a.preventDefault) { a.preventDefault(); } a.returnValue = false; }, stopPropagation: function() { this.isPropagationStopped = L; var a = this.originalEvent; if (!a) { return; } if (a.stopPropagation) { a.stopPropagation(); } a.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = L; this.stopPropagation(); }, isDefaultPrevented: R, isPropagationStopped: R, isImmediatePropagationStopped: R }; var W = function(c) { var b = c.relatedTarget; while (b && b != this) { try { b = b.parentNode; } catch (a) { b = this; } } if (b != this) { c.type = c.data; V.event.handle.apply(this, arguments); } }; V.each({ mouseover: "mouseenter", mouseout: "mouseleave" }, function(b, a) { V.event.special[a] = { setup: function() { V.event.add(this, b, W, a); }, teardown: function() { V.event.remove(this, b, W); } }; }); V.fn.extend({ bind: function(c, a, b) { return c == "unload" ? this.one(c, a, b) : this.each(function() { V.event.add(this, c, b || a, b && a); }); }, one: function(a, b, d) { var c = V.event.proxy(d || b, function(e) { V(this).unbind(e, c); return (d || b).apply(this, arguments); }); return this.each(function() { V.event.add(this, a, c, d && b); }); }, unbind: function(b, a) { return this.each(function() { V.event.remove(this, b, a); }); }, trigger: function(a, b) { return this.each(function() { V.event.trigger(a, b, this); }); }, triggerHandler: function(b, a) { if (this[0]) { var c = V.Event(b); c.preventDefault(); c.stopPropagation(); V.event.trigger(c, a, this[0]); return c.result; } }, toggle: function(a) { var b = arguments, c = 1; while (c < b.length) { V.event.proxy(a, b[c++]); } return this.click(V.event.proxy(a, function(d) { this.lastToggle = (this.lastToggle || 0) % c; d.preventDefault(); return b[this.lastToggle++].apply(this, arguments) || false; })); }, hover: function(a, b) { return this.mouseenter(a).mouseleave(b); }, ready: function(a) { ae(); if (V.isReady) { a.call(document, V); } else { V.readyList.push(a); } return this; }, live: function(a, c) { var b = V.event.proxy(c); b.guid += this.selector + a; V(document).bind(P(a, this.selector), this.selector, b); return this; }, die: function(b, a) { V(document).unbind(P(b, this.selector), a ? { guid: a.guid + this.selector + b} : null); return this; } }); function Y(b) { var c = RegExp("(^|\\.)" + b.type + "(\\.|$)"), a = true, d = []; V.each(V.data(this, "events").live || [], function(e, f) { if (c.test(f.type)) { var g = V(b.target).closest(f.data)[0]; if (g) { d.push({ elem: g, fn: f }); } } }); d.sort(function(f, e) { return V.data(f.elem, "closest") - V.data(e.elem, "closest"); }); V.each(d, function() { if (this.fn.call(this.elem, b, this.fn.data) === false) { return (a = false); } }); return a; } function P(b, a) { return ["live", b, a.replace(/\./g, "`").replace(/ /g, "|")].join("."); } V.extend({ isReady: false, readyList: [], ready: function() { if (!V.isReady) { V.isReady = true; if (V.readyList) { V.each(V.readyList, function() { this.call(document, V); }); V.readyList = null; } V(document).triggerHandler("ready"); } } }); var ah = false; function ae() { if (ah) { return; } ah = true; if (document.addEventListener) { document.addEventListener("DOMContentLoaded", function() { document.removeEventListener("DOMContentLoaded", arguments.callee, false); V.ready(); }, false); } else { if (document.attachEvent) { document.attachEvent("onreadystatechange", function() { if (document.readyState === "complete") { document.detachEvent("onreadystatechange", arguments.callee); V.ready(); } }); if (document.documentElement.doScroll && S == S.top) { (function() { if (V.isReady) { return; } try { document.documentElement.doScroll("left"); } catch (a) { setTimeout(arguments.callee, 0); return; } V.ready(); })(); } } } V.event.add(S, "load", V.ready); } V.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","), function(b, a) { V.fn[a] = function(c) { return c ? this.bind(a, c) : this.trigger(a); }; }); V(S).bind("unload", function() { for (var a in V.cache) { if (a != 1 && V.cache[a].handle) { V.event.remove(V.cache[a].handle.elem); } } }); (function() { V.support = {}; var g = document.documentElement, a = document.createElement("script"), c = document.createElement("div"), f = "script" + (new Date).getTime(); c.style.display = "none"; c.innerHTML = '   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>'; var d = c.getElementsByTagName("*"), b = c.getElementsByTagName("a")[0]; if (!d || !d.length || !b) { return; } V.support = { leadingWhitespace: c.firstChild.nodeType == 3, tbody: !c.getElementsByTagName("tbody").length, objectAll: !!c.getElementsByTagName("object")[0].getElementsByTagName("*").length, htmlSerialize: !!c.getElementsByTagName("link").length, style: /red/.test(b.getAttribute("style")), hrefNormalized: b.getAttribute("href") === "/a", opacity: b.style.opacity === "0.5", cssFloat: !!b.style.cssFloat, scriptEval: false, noCloneEvent: true, boxModel: null }; a.type = "text/javascript"; try { a.appendChild(document.createTextNode("window." + f + "=1;")); } catch (e) { } g.insertBefore(a, g.firstChild); if (S[f]) { V.support.scriptEval = true; delete S[f]; } g.removeChild(a); if (c.attachEvent && c.fireEvent) { c.attachEvent("onclick", function() { V.support.noCloneEvent = false; c.detachEvent("onclick", arguments.callee); }); c.cloneNode(true).fireEvent("onclick"); } V(function() { var h = document.createElement("div"); h.style.width = h.style.paddingLeft = "1px"; document.body.appendChild(h); V.boxModel = V.support.boxModel = h.offsetWidth === 2; document.body.removeChild(h).style.display = "none"; }); })(); var N = V.support.cssFloat ? "cssFloat" : "styleFloat"; V.props = { "for": "htmlFor", "class": "className", "float": N, cssFloat: N, styleFloat: N, readonly: "readOnly", maxlength: "maxLength", cellspacing: "cellSpacing", rowspan: "rowSpan", tabindex: "tabIndex" }; V.fn.extend({ _load: V.fn.load, load: function(a, f, g) { if (typeof a !== "string") { return this._load(a); } var e = a.indexOf(" "); if (e >= 0) { var b = a.slice(e, a.length); a = a.slice(0, e); } var d = "GET"; if (f) { if (V.isFunction(f)) { g = f; f = null; } else { if (typeof f === "object") { f = V.param(f); d = "POST"; } } } var c = this; V.ajax({ url: a, type: d, dataType: "html", data: f, complete: function(i, h) { if (h == "success" || h == "notmodified") { c.html(b ? V("<div/>").append(i.responseText.replace(/<script(.|\s)*?\/script>/g, "")).find(b) : i.responseText); } if (g) { c.each(g, [i.responseText, h, i]); } } }); return this; }, serialize: function() { return V.param(this.serializeArray()); }, serializeArray: function() { return this.map(function() { return this.elements ? V.makeArray(this.elements) : this; }).filter(function() { return this.name && !this.disabled && (this.checked || /select|textarea/i.test(this.nodeName) || /text|hidden|password|search/i.test(this.type)); }).map(function(b, c) { var a = V(this).val(); return a == null ? null : V.isArray(a) ? V.map(a, function(e, d) { return { name: c.name, value: e }; }) : { name: c.name, value: a }; }).get(); } }); V.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(a, b) { V.fn[b] = function(c) { return this.bind(b, c); }; }); var I = aa(); V.extend({ get: function(c, a, b, d) { if (V.isFunction(a)) { b = a; a = null; } return V.ajax({ type: "GET", url: c, data: a, success: b, dataType: d }); }, getScript: function(a, b) { return V.get(a, null, b, "script"); }, getJSON: function(b, c, a) { return V.get(b, c, a, "json"); }, post: function(c, a, b, d) { if (V.isFunction(a)) { b = a; a = {}; } return V.ajax({ type: "POST", url: c, data: a, success: b, dataType: d }); }, ajaxSetup: function(a) { V.extend(V.ajaxSettings, a); }, ajaxSettings: { url: location.href, global: true, type: "GET", contentType: "application/x-www-form-urlencoded", processData: true, async: true, xhr: function() { return S.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); }, accepts: { xml: "application/xml, text/xml", html: "text/html", script: "text/javascript, application/javascript", json: "application/json, text/javascript", text: "text/plain", _default: "*/*"} }, lastModified: {}, ajax: function(n) { n = V.extend(true, n, V.extend(true, {}, V.ajaxSettings, n)); var h, r = /=\?(&|$)/g, c, g, s = n.type.toUpperCase(); if (n.data && n.processData && typeof n.data !== "string") { n.data = V.param(n.data); } if (n.dataType == "jsonp") { if (s == "GET") { if (!n.url.match(r)) { n.url += (n.url.match(/\?/) ? "&" : "?") + (n.jsonp || "callback") + "=?"; } } else { if (!n.data || !n.data.match(r)) { n.data = (n.data ? n.data + "&" : "") + (n.jsonp || "callback") + "=?"; } } n.dataType = "json"; } if (n.dataType == "json" && (n.data && n.data.match(r) || n.url.match(r))) { h = "jsonp" + I++; if (n.data) { n.data = (n.data + "").replace(r, "=" + h + "$1"); } n.url = n.url.replace(r, "=" + h + "$1"); n.dataType = "script"; S[h] = function(t) { g = t; j(); m(); S[h] = ac; try { delete S[h]; } catch (u) { } if (i) { i.removeChild(e); } }; } if (n.dataType == "script" && n.cache == null) { n.cache = false; } if (n.cache === false && s == "GET") { var q = aa(); var f = n.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + q + "$2"); n.url = f + ((f == n.url) ? (n.url.match(/\?/) ? "&" : "?") + "_=" + q : ""); } if (n.data && s == "GET") { n.url += (n.url.match(/\?/) ? "&" : "?") + n.data; n.data = null; } if (n.global && !V.active++) { V.event.trigger("ajaxStart"); } var b = /^(\w+:)?\/\/([^\/?#]+)/.exec(n.url); if (n.dataType == "script" && s == "GET" && b && (b[1] && b[1] != location.protocol || b[2] != location.host)) { var i = document.getElementsByTagName("head")[0]; var e = document.createElement("script"); e.src = n.url; if (n.scriptCharset) { e.charset = n.scriptCharset; } if (!h) { var p = false; e.onload = e.onreadystatechange = function() { if (!p && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { p = true; j(); m(); e.onload = e.onreadystatechange = null; i.removeChild(e); } }; } i.appendChild(e); return ac; } var l = false; var k = n.xhr(); if (n.username) { k.open(s, n.url, n.async, n.username, n.password); } else { k.open(s, n.url, n.async); } try { if (n.data) { k.setRequestHeader("Content-Type", n.contentType); } if (n.ifModified) { k.setRequestHeader("If-Modified-Since", V.lastModified[n.url] || "Thu, 01 Jan 1970 00:00:00 GMT"); } k.setRequestHeader("X-Requested-With", "XMLHttpRequest"); k.setRequestHeader("Accept", n.dataType && n.accepts[n.dataType] ? n.accepts[n.dataType] + ", */*" : n.accepts._default); } catch (d) { } if (n.beforeSend && n.beforeSend(k, n) === false) { if (n.global && ! --V.active) { V.event.trigger("ajaxStop"); } k.abort(); return false; } if (n.global) { V.event.trigger("ajaxSend", [k, n]); } var o = function(t) { if (k.readyState == 0) { if (a) { clearInterval(a); a = null; if (n.global && ! --V.active) { V.event.trigger("ajaxStop"); } } } else { if (!l && k && (k.readyState == 4 || t == "timeout")) { l = true; if (a) { clearInterval(a); a = null; } c = t == "timeout" ? "timeout" : !V.httpSuccess(k) ? "error" : n.ifModified && V.httpNotModified(k, n.url) ? "notmodified" : "success"; if (c == "success") { try { g = V.httpData(k, n.dataType, n); } catch (v) { c = "parsererror"; } } if (c == "success") { var u; try { u = k.getResponseHeader("Last-Modified"); } catch (v) { } if (n.ifModified && u) { V.lastModified[n.url] = u; } if (!h) { j(); } } else { V.handleError(n, k, c); } m(); if (t) { k.abort(); } if (n.async) { k = null; } } } }; if (n.async) { var a = setInterval(o, 13); if (n.timeout > 0) { setTimeout(function() { if (k && !l) { o("timeout"); } }, n.timeout); } } try { k.send(n.data); } catch (d) { V.handleError(n, k, null, d); } if (!n.async) { o(); } function j() { if (n.success) { n.success(g, c); } if (n.global) { V.event.trigger("ajaxSuccess", [k, n]); } } function m() { if (n.complete) { n.complete(k, c); } if (n.global) { V.event.trigger("ajaxComplete", [k, n]); } if (n.global && ! --V.active) { V.event.trigger("ajaxStop"); } } return k; }, handleError: function(d, b, c, a) { if (d.error) { d.error(b, c, a); } if (d.global) { V.event.trigger("ajaxError", [b, d, a]); } }, active: 0, httpSuccess: function(b) { try { return !b.status && location.protocol == "file:" || (b.status >= 200 && b.status < 300) || b.status == 304 || b.status == 1223; } catch (a) { } return false; }, httpNotModified: function(a, c) { try { var b = a.getResponseHeader("Last-Modified"); return a.status == 304 || b == V.lastModified[c]; } catch (d) { } return false; }, httpData: function(e, c, a) { var f = e.getResponseHeader("content-type"), b = c == "xml" || !c && f && f.indexOf("xml") >= 0, d = b ? e.responseXML : e.responseText; if (b && d.documentElement.tagName == "parsererror") { throw "parsererror"; } if (a && a.dataFilter) { d = a.dataFilter(d, c); } if (typeof d === "string") { if (c == "script") { V.globalEval(d); } if (c == "json") { d = S["eval"]("(" + d + ")"); } } return d; }, param: function(c) { var a = []; function b(e, f) { a[a.length] = encodeURIComponent(e) + "=" + encodeURIComponent(f); } if (V.isArray(c) || c.jquery) { V.each(c, function() { b(this.name, this.value); }); } else { for (var d in c) { if (V.isArray(c[d])) { V.each(c[d], function() { b(d, this); }); } else { b(d, V.isFunction(c[d]) ? c[d]() : c[d]); } } } return a.join("&").replace(/%20/g, "+"); } }); var T = {}, U, Z = [["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"], ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"], ["opacity"]]; function K(c, b) { var a = {}; V.each(Z.concat.apply([], Z.slice(0, b)), function() { a[this] = c; }); return a; } V.fn.extend({ show: function(f, h) { if (f) { return this.animate(K("show", 3), f, h); } else { for (var d = 0, b = this.length; d < b; d++) { var a = V.data(this[d], "olddisplay"); this[d].style.display = a || ""; if (V.css(this[d], "display") === "none") { var c = this[d].tagName, g; if (T[c]) { g = T[c]; } else { var e = V("<" + c + " />").appendTo("body"); g = e.css("display"); if (g === "none") { g = "block"; } e.remove(); T[c] = g; } V.data(this[d], "olddisplay", g); } } for (var d = 0, b = this.length; d < b; d++) { this[d].style.display = V.data(this[d], "olddisplay") || ""; } return this; } }, hide: function(b, c) { if (b) { return this.animate(K("hide", 3), b, c); } else { for (var a = 0, e = this.length; a < e; a++) { var d = V.data(this[a], "olddisplay"); if (!d && d !== "none") { V.data(this[a], "olddisplay", V.css(this[a], "display")); } } for (var a = 0, e = this.length; a < e; a++) { this[a].style.display = "none"; } return this; } }, _toggle: V.fn.toggle, toggle: function(a, c) { var b = typeof a === "boolean"; return V.isFunction(a) && V.isFunction(c) ? this._toggle.apply(this, arguments) : a == null || b ? this.each(function() { var d = b ? a : V(this).is(":hidden"); V(this)[d ? "show" : "hide"](); }) : this.animate(K("toggle", 3), a, c); }, fadeTo: function(b, a, c) { return this.animate({ opacity: a }, b, c); }, animate: function(c, e, b, a) { var d = V.speed(e, b, a); return this[d.queue === false ? "each" : "queue"](function() { var i = V.extend({}, d), g, f = this.nodeType == 1 && V(this).is(":hidden"), h = this; for (g in c) { if (c[g] == "hide" && f || c[g] == "show" && !f) { return i.complete.call(this); } if ((g == "height" || g == "width") && this.style) { i.display = V.css(this, "display"); i.overflow = this.style.overflow; } } if (i.overflow != null) { this.style.overflow = "hidden"; } i.curAnim = V.extend({}, c); V.each(c, function(m, l) { var k = new V.fx(h, i, m); if (/toggle|show|hide/.test(l)) { k[l == "toggle" ? f ? "show" : "hide" : l](c); } else { var j = l.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), o = k.cur(true) || 0; if (j) { var n = parseFloat(j[2]), p = j[3] || "px"; if (p != "px") { h.style[m] = (n || 1) + p; o = ((n || 1) / k.cur(true)) * o; h.style[m] = o + p; } if (j[1]) { n = ((j[1] == "-=" ? -1 : 1) * n) + o; } k.custom(o, n, p); } else { k.custom(o, l, ""); } } }); return true; }); }, stop: function(c, b) { var a = V.timers; if (c) { this.queue([]); } this.each(function() { for (var d = a.length - 1; d >= 0; d--) { if (a[d].elem == this) { if (b) { a[d](true); } a.splice(d, 1); } } }); if (!b) { this.dequeue(); } return this; } }); V.each({ slideDown: K("show", 1), slideUp: K("hide", 1), slideToggle: K("toggle", 1), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide"} }, function(a, b) { V.fn[a] = function(c, d) { return this.animate(b, c, d); }; }); V.extend({ speed: function(a, b, d) { var c = typeof a === "object" ? a : { complete: d || !d && b || V.isFunction(a) && a, duration: a, easing: d && b || b && !V.isFunction(b) && b }; c.duration = V.fx.off ? 0 : typeof c.duration === "number" ? c.duration : V.fx.speeds[c.duration] || V.fx.speeds._default; c.old = c.complete; c.complete = function() { if (c.queue !== false) { V(this).dequeue(); } if (V.isFunction(c.old)) { c.old.call(this); } }; return c; }, easing: { linear: function(a, b, c, d) { return c + d * a; }, swing: function(a, b, c, d) { return ((-Math.cos(a * Math.PI) / 2) + 0.5) * d + c; } }, timers: [], fx: function(c, b, a) { this.options = b; this.elem = c; this.prop = a; if (!b.orig) { b.orig = {}; } } }); V.fx.prototype = { update: function() { if (this.options.step) { this.options.step.call(this.elem, this.now, this); } (V.fx.step[this.prop] || V.fx.step._default)(this); if ((this.prop == "height" || this.prop == "width") && this.elem.style) { this.elem.style.display = "block"; } }, cur: function(b) { if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) { return this.elem[this.prop]; } var a = parseFloat(V.css(this.elem, this.prop, b)); return a && a > -10000 ? a : parseFloat(V.curCSS(this.elem, this.prop)) || 0; }, custom: function(c, b, a) { this.startTime = aa(); this.start = c; this.end = b; this.unit = a || this.unit || "px"; this.now = this.start; this.pos = this.state = 0; var d = this; function e(f) { return d.step(f); } e.elem = this.elem; if (e() && V.timers.push(e) && !U) { U = setInterval(function() { var g = V.timers; for (var f = 0; f < g.length; f++) { if (!g[f]()) { g.splice(f--, 1); } } if (!g.length) { clearInterval(U); U = ac; } }, 13); } }, show: function() { this.options.orig[this.prop] = V.attr(this.elem.style, this.prop); this.options.show = true; this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur()); V(this.elem).show(); }, hide: function() { this.options.orig[this.prop] = V.attr(this.elem.style, this.prop); this.options.hide = true; this.custom(this.cur(), 0); }, step: function(c) { var a = aa(); if (c || a >= this.options.duration + this.startTime) { this.now = this.end; this.pos = this.state = 1; this.update(); this.options.curAnim[this.prop] = true; var e = true; for (var f in this.options.curAnim) { if (this.options.curAnim[f] !== true) { e = false; } } if (e) { if (this.options.display != null) { this.elem.style.overflow = this.options.overflow; this.elem.style.display = this.options.display; if (V.css(this.elem, "display") == "none") { this.elem.style.display = "block"; } } if (this.options.hide) { V(this.elem).hide(); } if (this.options.hide || this.options.show) { for (var d in this.options.curAnim) { V.attr(this.elem.style, d, this.options.orig[d]); } } this.options.complete.call(this.elem); } return false; } else { var b = a - this.startTime; this.state = b / this.options.duration; this.pos = V.easing[this.options.easing || (V.easing.swing ? "swing" : "linear")](this.state, b, 0, 1, this.options.duration); this.now = this.start + ((this.end - this.start) * this.pos); this.update(); } return true; } }; V.extend(V.fx, { speeds: { slow: 600, fast: 200, _default: 400 }, step: { opacity: function(a) { V.attr(a.elem.style, "opacity", a.now); }, _default: function(a) { if (a.elem.style && a.elem.style[a.prop] != null) { a.elem.style[a.prop] = a.now + a.unit; } else { a.elem[a.prop] = a.now; } } } }); if (document.documentElement.getBoundingClientRect) { V.fn.offset = function() { if (!this[0]) { return { top: 0, left: 0 }; } if (this[0] === this[0].ownerDocument.body) { return V.offset.bodyOffset(this[0]); } var c = this[0].getBoundingClientRect(), f = this[0].ownerDocument, b = f.body, a = f.documentElement, h = a.clientTop || b.clientTop || 0, g = a.clientLeft || b.clientLeft || 0, e = c.top + (self.pageYOffset || V.boxModel && a.scrollTop || b.scrollTop) - h, d = c.left + (self.pageXOffset || V.boxModel && a.scrollLeft || b.scrollLeft) - g; return { top: e, left: d }; }; } else { V.fn.offset = function() { if (!this[0]) { return { top: 0, left: 0 }; } if (this[0] === this[0].ownerDocument.body) { return V.offset.bodyOffset(this[0]); } V.offset.initialized || V.offset.initialize(); var f = this[0], c = f.offsetParent, b = f, k = f.ownerDocument, i, d = k.documentElement, g = k.body, h = k.defaultView, a = h.getComputedStyle(f, null), j = f.offsetTop, e = f.offsetLeft; while ((f = f.parentNode) && f !== g && f !== d) { i = h.getComputedStyle(f, null); j -= f.scrollTop, e -= f.scrollLeft; if (f === c) { j += f.offsetTop, e += f.offsetLeft; if (V.offset.doesNotAddBorder && !(V.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(f.tagName))) { j += parseInt(i.borderTopWidth, 10) || 0, e += parseInt(i.borderLeftWidth, 10) || 0; } b = c, c = f.offsetParent; } if (V.offset.subtractsBorderForOverflowNotVisible && i.overflow !== "visible") { j += parseInt(i.borderTopWidth, 10) || 0, e += parseInt(i.borderLeftWidth, 10) || 0; } a = i; } if (a.position === "relative" || a.position === "static") { j += g.offsetTop, e += g.offsetLeft; } if (a.position === "fixed") { j += Math.max(d.scrollTop, g.scrollTop), e += Math.max(d.scrollLeft, g.scrollLeft); } return { top: j, left: e }; }; } V.offset = { initialize: function() { if (this.initialized) { return; } var h = document.body, b = document.createElement("div"), d, c, j, e, i, a, f = h.style.marginTop, g = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>'; i = { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" }; for (a in i) { b.style[a] = i[a]; } b.innerHTML = g; h.insertBefore(b, h.firstChild); d = b.firstChild, c = d.firstChild, e = d.nextSibling.firstChild.firstChild; this.doesNotAddBorder = (c.offsetTop !== 5); this.doesAddBorderForTableAndCells = (e.offsetTop === 5); d.style.overflow = "hidden", d.style.position = "relative"; this.subtractsBorderForOverflowNotVisible = (c.offsetTop === -5); h.style.marginTop = "1px"; this.doesNotIncludeMarginInBodyOffset = (h.offsetTop === 0); h.style.marginTop = f; h.removeChild(b); this.initialized = true; }, bodyOffset: function(b) { V.offset.initialized || V.offset.initialize(); var a = b.offsetTop, c = b.offsetLeft; if (V.offset.doesNotIncludeMarginInBodyOffset) { a += parseInt(V.curCSS(b, "marginTop", true), 10) || 0, c += parseInt(V.curCSS(b, "marginLeft", true), 10) || 0; } return { top: a, left: c }; } }; V.fn.extend({ position: function() { var d = 0, c = 0, f; if (this[0]) { var a = this.offsetParent(), e = this.offset(), b = /^body|html$/i.test(a[0].tagName) ? { top: 0, left: 0} : a.offset(); e.top -= Q(this, "marginTop"); e.left -= Q(this, "marginLeft"); b.top += Q(a, "borderTopWidth"); b.left += Q(a, "borderLeftWidth"); f = { top: e.top - b.top, left: e.left - b.left }; } return f; }, offsetParent: function() { var a = this[0].offsetParent || document.body; while (a && (!/^body|html$/i.test(a.tagName) && V.css(a, "position") == "static")) { a = a.offsetParent; } return V(a); } }); V.each(["Left", "Top"], function(c, b) { var a = "scroll" + b; V.fn[a] = function(d) { if (!this[0]) { return null; } return d !== ac ? this.each(function() { this == S || this == document ? S.scrollTo(!c ? d : V(S).scrollLeft(), c ? d : V(S).scrollTop()) : this[a] = d; }) : this[0] == S || this[0] == document ? self[c ? "pageYOffset" : "pageXOffset"] || V.boxModel && document.documentElement[a] || document.body[a] : this[0][a]; }; }); V.each(["Height", "Width"], function(d, a) { var e = d ? "Left" : "Top", c = d ? "Right" : "Bottom", f = a.toLowerCase(); V.fn["inner" + a] = function() { return this[0] ? V.css(this[0], f, false, "padding") : null; }; V.fn["outer" + a] = function(g) { return this[0] ? V.css(this[0], f, false, g ? "margin" : "border") : null; }; var b = a.toLowerCase(); V.fn[b] = function(g) { return this[0] == S ? document.compatMode == "CSS1Compat" && document.documentElement["client" + a] || document.body["client" + a] : this[0] == document ? Math.max(document.documentElement["client" + a], document.body["scroll" + a], document.documentElement["scroll" + a], document.body["offset" + a], document.documentElement["offset" + a]) : g === ac ? (this.length ? V.css(this[0], b) : null) : this.css(b, typeof g === "string" ? g : g + "px"); }; }); })(); (function(k) { var R, h, m, x, t, U, V, a, E, H; var z = 0, j = {}, d = [], p = 0, f = {}, F = []; var q = null, T = new Image, J = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, w = /[^\.]\.(swf)\s*$/i; var u, e = 1; var y, C, B = false, r = 20, v = k.extend(k("<div/>")[0], { prop: 0 }), i = 0, S = !k.support.opacity && !window.XMLHttpRequest; k.fn.fixPNG = function() { return this.each(function() { var W = k(this).css("backgroundImage"); if (W.match(/^url\(["']?(.*\.png)["']?\)$/i)) { W = RegExp.$1; k(this).css({ backgroundImage: "none", filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=" + (k(this).css("backgroundRepeat") == "no-repeat" ? "crop" : "scale") + ", src='" + W + "')" }).each(function() { var X = k(this).css("position"); if (X != "absolute" && X != "relative") { k(this).css("position", "relative"); } }); } }); }; k.fn.fancybox = function(W) { k(this).data("fancybox", k.extend({}, W)); k(this).unbind("click.fb").bind("click.fb", function(Y) { Y.preventDefault(); if (B) { return; } k(this).blur(); B = true; d = []; z = 0; var X = k(this).attr("rel") || ""; if (!X || X == "" || X === "nofollow") { d.push(this); } else { d = k("a[rel=" + X + "], area[rel=" + X + "]"); z = d.index(this); } Q(); return false; }); return this; }; k.fancybox = function(Z, W) { if (B) { return; } B = true; d = []; z = 0; if (k.isArray(Z)) { for (var X = 0, Y = Z.length; X < Y; X++) { if (typeof Z[X] == "object") { k(Z[X]).data("fancybox", k.extend({}, W, Z[X])); } else { Z[X] = k({}).data("fancybox", k.extend({ content: Z[X] }, W)); } } d = jQuery.merge(d, Z); } else { if (typeof Z == "object") { k(Z).data("fancybox", k.extend({}, W, Z)); } else { Z = k({}).data("fancybox", k.extend({ content: Z }, W)); } d.push(Z); } Q(); }; k.fancybox.showActivity = function() { clearInterval(u); h.show(); u = setInterval(s, 66); }; k.fancybox.prev = function() { return k.fancybox.pos(p - 1); }; k.fancybox.next = function() { return k.fancybox.pos(p + 1); }; k.fancybox.pos = function(W) { if (B) { return; } W = parseInt(W); if (W > -1 && F.length > W) { z = W; Q(); } if (f.cyclic && F.length > 1 && W < 0) { z = F.length - 1; Q(); } if (f.cyclic && F.length > 1 && W >= F.length) { z = 0; Q(); } return; }; k.fancybox.cancel = function() { if (B) { return; } B = true; L(); if (j && k.isFunction(j.callbackOnCancel)) { j.callbackOnCancel(d, z, j); } B = false; }; k.fancybox.close = function() { if (B || x.is(":hidden")) { return; } B = true; if (f && k.isFunction(f.callbackOnClosing)) { if (f.callbackOnClosing(F, p, f) === false) { B = false; return; } } L(); k(a.add(E).add(H)).hide(); k("#fancybox-title").remove(); x.unbind(); U.unbind(); m.unbind(); k(document).unbind("keydown.fb"); function W() { m.fadeOut("fast"); x.hide(); k.event.trigger("fancybox-cleanup"); U.empty(); if (k.isFunction(f.callbackOnClosed)) { f.callbackOnClosed(F, p, f); } F = j = []; p = selecteIndex = 0; f = j = {}; B = false; } U.css("overflow", "hidden"); if (f.zoomSpeedOut > 0) { y = D(); var X = x.position(); C = { top: X.top, left: X.left, width: x.width(), height: x.height() }; if (f.zoomOpacity) { C.opacity = 1; } v.prop = 1; k(v).animate({ prop: 0 }, { duration: f.zoomSpeedOut, easing: f.easingOut, step: A, complete: W }); } else { x.fadeOut(k.browser.msie && m.is(":visible") ? 50 : "fast", W); } }; k.fancybox.resize = function() { if (B || x.is(":hidden")) { return; } B = true; var X = U.wrapInner("<div style='overflow:auto'></div>").children(); var W = X.height(); x.css({ height: W + (f.padding * 2) + i }); U.css({ height: W }); X.replaceWith(X.children()); k.fancybox.center(); }; k.fancybox.center = function() { B = true; var Y = c(); var W = f.margin; var X = { width: x.width(), height: x.height() }; X.top = Y[3] + ((Y[1] - (X.height + (r * 2))) * 0.5); X.left = Y[2] + ((Y[0] - (X.width + (r * 2))) * 0.5); X.top = X.top < Y[3] + W ? Y[3] + W : X.top; X.left = X.left < Y[2] + W ? Y[2] + W : X.left; k(x).css(X); B = false; }; function L() { h.hide(); k(T).unbind(); if (q) { q.abort(); } R.empty(); } function Q() { L(); var W = d[z]; if (typeof k(W).data("fancybox") == "undefined") { j = k.extend({}, g, j); } else { j = k.extend({}, g, k(W).data("fancybox")); } var Y, Z, ab = W.title || k(W).title || j.title || ""; if (W.nodeName && (/^(?:javascript|#)/i).test(W.href)) { Y = j.href || null; } else { Y = W.href || k(W).href || j.href || null; } if (j.type) { Z = j.type; if (!Y) { Y = j.content; } } else { if (Y) { if (Y.match(J)) { Z = "image"; } else { if (Y.match(w)) { Z = "swf"; } else { if (k(W).hasClass("iframe")) { Z = "iframe"; } else { if (Y.match(/#/)) { W = Y.substr(Y.indexOf("#")); Z = k(W).length > 0 ? "inline" : "ajax"; } else { Z = "ajax"; } } } } } else { if (j.content) { W = j.content; Z = "html"; j.content = null; } else { Z = "inline"; } } } j.type = Z; j.href = Y; j.title = ab; if (j.autoDimensions && j.type !== "iframe" && j.type !== "swf") { j.frameWidth = "auto"; j.frameHeight = "auto"; } if (j.modal) { j.overlayShow = true; j.hideOnOverlayClick = false; j.hideOnContentClick = false; j.enableEscapeButton = false; j.showCloseButton = false; } if (k.isFunction(j.callbackOnStart)) { if (j.callbackOnStart(d, z, j) === false) { B = false; return; } } R.css("padding", (r + j.padding + j.margin)); k(".fancybox-inline-tmp").bind("fancybox-change", function() { k(this).replaceWith(U.children()); }); switch (Z) { case "html": R.html(W); G(); break; case "inline": W = Y ? Y.substr(Y.indexOf("#")) : W; k('<div class="fancybox-inline-tmp" />').hide().insertBefore(k(W)).bind("fancybox-cleanup", function() { k(this).replaceWith(U.children()); }); k(W).appendTo(R); G(); break; case "image": T = new Image; T.src = Y; if (T.complete) { P(); } else { B = false; k.fancybox.showActivity(); k(T).unbind().one("load", P); } break; case "swf": var ac = ""; var ad = ""; ac += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + j.frameWidth + '" height="' + j.frameHeight + '"><param name="movie" value="' + Y + '"></param>'; k.each(j.swf, function(ae, af) { ac += '<param name="' + ae + '" value="' + af + '"></param>'; ad += " " + ae + '="' + af + '"'; }); ac += '<embed src="' + Y + '" type="application/x-shockwave-flash" width="' + j.frameWidth + '" height="' + j.frameHeight + '"' + ad + "></embed></object>"; R.html(ac); G(); break; case "ajax": var aa = Y.split("#", 2); var X = j.ajax.data || {}; if (aa.length > 1) { Y = aa[0]; typeof X == "string" ? X += "&selector=" + aa[1] : X.selector = aa[1]; } B = false; k.fancybox.showActivity(); q = k.ajax(k.extend(j.ajax, { url: Y, data: X, success: function(ae) { R.html(ae); G(); } })); break; case "iframe": B = false; k('<iframe id="fancybox-frame" name="fancybox-frame' + Math.round(Math.random() * 1000) + '" frameborder="0" hspace="0" scrolling="no" src="' + Y + '"></iframe>').appendTo(R).load(function() { B = true; k(this).unbind(); O(); }); break; } } function P() { B = true; j.frameWidth = T.width; j.frameHeight = T.height; k("<img />").attr({ id: "fancybox-img", src: T.src, alt: j.title }).appendTo(R); O(); } function G() { if (j.frameWidth == "auto") { j.frameWidth = R.width(); } if (j.frameHeight == "auto") { j.frameHeight = R.height(); } O(); } function O() { h.hide(); F = d; p = z; f = j; U[0].scrollTop = 0; U[0].scrollLeft = 0; if (f.overlayShow) { if (S) { k("select:not(#fancybox-tmp select)").filter(function() { return this.style.visibility !== "hidden"; }).css({ visibility: "hidden" }).one("fancybox-cleanup", function() { this.style.visibility = "inherit"; }); } m.css({ "background-color": f.overlayColor, opacity: f.overlayOpacity }).unbind().show(); } C = o(); n(); if (x.is(":visible")) { k(a.add(E).add(H)).hide(); var W = x.position(); y = { top: W.top, left: W.left, width: x.width(), height: x.height() }; var X = (y.width == C.width && y.height == C.height); U.fadeOut(X ? "fast" : "normal", function() { k.event.trigger("fancybox-change"); U.css({ top: f.padding, left: f.padding, width: y.width - (f.padding * 2) > 0 ? y.width - (f.padding * 2) : 1, height: y.height - (f.padding * 2) > 0 ? y.height - (f.padding * 2) : 1 }).empty(); U.css("overflow", "hidden"); function Y() { U.html(R.contents()).fadeIn(X ? "fast" : "normal", I); } v.prop = 0; k(v).animate({ prop: 1 }, { duration: X ? 0 : f.zoomSpeedChange, easing: f.easingChange, step: A, complete: Y }); }); return; } x.css("opacity", 1); if (f.zoomSpeedIn > 0) { y = D(); U.css({ top: f.padding, left: f.padding, width: y.width - (f.padding * 2) > 0 ? y.width - (f.padding * 2) : 1, height: y.height - (f.padding * 2) > 0 ? y.height - (f.padding * 2) : 1 }); U.html(R.contents()); x.css(y).show(); if (f.zoomOpacity) { C.opacity = 0; } v.prop = 0; k(v).animate({ prop: 1 }, { duration: f.zoomSpeedIn, easing: f.easingIn, step: A, complete: I }); } else { U.css({ top: f.padding, left: f.padding, width: C.width - (f.padding * 2) > 0 ? C.width - (f.padding * 2) : 1, height: C.height - (f.padding * 2) - i > 0 ? C.height - (f.padding * 2) - i : 1 }); U.html(R.contents()); x.css(C).fadeIn(k.browser.msie && m.is(":visible") ? 50 : "fast", I); } } function A(aa) { var Y = Math.round(y.width + (C.width - y.width) * aa); var X = Math.round(y.height + (C.height - y.height) * aa); var W = Math.round(y.top + (C.top - y.top) * aa); var ab = Math.round(y.left + (C.left - y.left) * aa); k(x).css({ width: Y + "px", height: X + "px", top: W + "px", left: ab + "px" }); Y -= f.padding * 2; X -= f.padding * 2 + (i * aa); if (Y > 0 && X > 0) { U.css({ width: Y + "px", height: X + "px" }); } if (typeof C.opacity !== "undefined") { var Z = aa < 0.5 ? 0.5 : aa; x.css("opacity", Z); } } function I() { if (k.browser.msie) { U[0].style.removeAttribute("filter"); x[0].style.removeAttribute("filter"); } if (k(F[p]).is("img") == false && j.type !== "image" && j.type !== "iframe") { U.css({ overflow: "auto" }); } k("#fancybox-title").show(); f.hideOnContentClick ? U.one("click", k.fancybox.close) : U.unbind(); f.hideOnOverlayClick ? m.one("click", k.fancybox.close) : m.unbind(); f.showCloseButton ? a.show() : a.hide(); l(); if (k.isFunction(f.callbackOnComplete)) { f.callbackOnComplete(F, p, f); } B = false; K(); } function o() { var ac = c(); var Y = {}; var X = f.margin; var Z = f.autoScale; var W = (r + X) * 2; var aa = (r + X) * 2; if (f.frameWidth.toString().indexOf("%") > -1) { Y.width = ((ac[0] * parseFloat(f.frameWidth)) / 100) - (r * 2); Z = false; } else { Y.width = f.frameWidth + (f.padding * 2); } if (f.frameHeight.toString().indexOf("%") > -1) { Y.height = ((ac[1] * parseFloat(f.frameHeight)) / 100) - (r * 2); Z = false; } else { Y.height = f.frameHeight + (f.padding * 2); } if (Z && (Y.width > (ac[0] - W) || Y.height > (ac[1] - aa))) { if (k(F[p]).is("img") || j.type == "image" || j.type == "swf") { var ab = Math.min(Math.min(ac[0] - W, Y.width) / Y.width, Math.min(ac[1] - aa, Y.height) / Y.height); Y.width = Math.round(ab * Y.width); Y.height = Math.round(ab * Y.height); } else { Y.width = Math.min(Y.width, (ac[0] - W)); Y.height = Math.min(Y.height, (ac[1] - aa)); } } Y.top = ac[3] + ((ac[1] - (Y.height + (r * 2))) * 0.5); Y.left = ac[2] + ((ac[0] - (Y.width + (r * 2))) * 0.5); if (f.autoScale == false) { Y.top = Y.top < ac[3] + X ? ac[3] + X : Y.top; Y.left = Y.left < ac[2] + X ? ac[2] + X : Y.left; } return Y; } function D() { var aa = F[p]; var X = c(); var W = { width: 1, height: 1, top: X[3] + X[1] * 0.5, left: X[2] + X[0] * 0.5 }; var Z = false; if (typeof aa.orig !== "undefined" && aa.orig.nodeName) { Z = k(aa.orig); } else { if (k(aa).children("img:first").length) { Z = k(aa).children("img:first"); } else { if (aa.nodeName) { Z = k(aa); } } } if (Z && Z.length) { var Y = M(Z); W.width = Y.width + (f.padding * 2); W.height = Y.height + (f.padding * 2); W.top = Y.top - f.padding - r; W.left = Y.left - f.padding - r; } return W; } function l() { k(document).unbind("keydown.fb").bind("keydown.fb", function(W) { if (W.keyCode == 27 && f.enableEscapeButton) { W.preventDefault(); k.fancybox.close(); } else { if (W.keyCode == 37) { W.preventDefault(); k.fancybox.prev(); } else { if (W.keyCode == 39) { W.preventDefault(); k.fancybox.next(); } } } }); if (k.fn.mousewheel) { x.unbind("mousewheel.fb"); if (F.length > 1) { x.bind("mousewheel.fb", function(X, W) { X.preventDefault(); if (B || W == 0) { return; } W < 0 ? k.fancybox.prev() : k.fancybox.next(); }); } } if ((f.cyclic && F.length > 1) || p != 0) { E.show(); } if ((f.cyclic && F.length > 1) || p != (F.length - 1)) { H.show(); } } function K() { if ((F.length - 1) > p) { var X = F[p + 1].href; if (typeof X !== "undefined" && X.match(J)) { var W = new Image(); W.src = X; } } if (p > 0) { var X = F[p - 1].href; if (typeof X !== "undefined" && X.match(J)) { var W = new Image(); W.src = X; } } } function s() { if (!h.is(":visible")) { clearInterval(u); return; } k("div", h).css("top", (e * -40) + "px"); e = (e + 1) % 12; } function c() { var fx = x.css('position') === 'fixed'; return [k(window).width(), k(window).height(), fx ? 0 : k(document).scrollLeft(), fx ? 0 : k(document).scrollTop()]; } function M(X) { var W = X.offset(); W.top += parseFloat(X.css("paddingTop")) || 0; W.left += parseFloat(X.css("paddingLeft")) || 0; W.top += parseFloat(X.css("border-top-width")) || 0; W.left += parseFloat(X.css("border-left-width")) || 0; W.width = X.width(); W.height = X.height(); return W; } function n() { k("#fancybox-title").remove(); i = 0; if (f.titleShow == false) { return false; } var Z = F[p]; var W = f.title; W = k.isFunction(f.titleFormat) ? f.titleFormat(W, F, p, f) : N(W); if (W == false || W.length < 1) { return; } if (W.length > 0) { var X = C.width - (f.padding * 2); var Y = f.titlePosition == "inside" ? "fancybox-title-inside" : "fancybox-title-outside"; k('<div id="fancybox-title" class="' + Y + '" />').css({ width: X, paddingLeft: f.padding, paddingRight: f.padding }).html(W).appendTo("body"); i = k("#fancybox-title").outerHeight(true); if (f.titlePosition == "outside") { k("#fancybox-title").css("bottom", i * -1); i = 0; } else { i = i - f.padding; C.height += i; } k("#fancybox-title").appendTo(t).hide(); if (S) { k("#fancybox-title span").fixPNG(); } } } function N(W) { if (W.length) { return f.titlePosition == "inside" ? W : '<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">' + W + '</span><span id="fancybox-title-right"></span></span>'; } return false; } function b() { if (k("#fancybox-wrap").length) { return; } R = k('<div id="fancybox-tmp"></div>').appendTo("body"); h = k('<div id="fancybox-loading"><div></div></div>').appendTo("body"); m = k('<div id="fancybox-overlay"></div>').appendTo("body"); x = k('<div id="fancybox-wrap"></div>').appendTo("body"); t = k('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(x); U = k('<div id="fancybox-inner"></div').appendTo(t); a = k('<a id="fancybox-close"></a>').appendTo(t); E = k('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>').appendTo(t); H = k('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>').appendTo(t); a.click(k.fancybox.close); h.click(k.fancybox.cancel); E.bind("click", function(W) { W.preventDefault(); k.fancybox.prev(); }); H.bind("click", function(W) { W.preventDefault(); k.fancybox.next(); }); if (k.browser.msie) { t.find(".fancy-bg").fixPNG(); } if (S) { k(a.add(".fancy-ico").add("div", h)).fixPNG(); m.get(0).style.setExpression("height", "document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'"); h.get(0).style.setExpression("top", "(-20 + ( document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px'"); t.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>'); } } var g = { padding: 10, margin: 20, ajax: {}, swf: { wmode: "transparent" }, modal: false, cyclic: false, autoScale: true, autoDimensions: true, frameWidth: 560, frameHeight: 340, zoomOpacity: false, zoomSpeedIn: 0, zoomSpeedOut: 0, zoomSpeedChange: 300, easingIn: "swing", easingOut: "swing", easingChange: "swing", overlayShow: false, overlayOpacity: 0.3, overlayColor: "#666", titleShow: true, titlePosition: "outside", titleFormat: null, enableEscapeButton: true, showCloseButton: true, hideOnOverlayClick: true, hideOnContentClick: false, callbackOnStart: null, callbackOnCancel: null, callbackOnComplete: null, callbackOnClosing: null, callbackOnClosed: null }; k(document).ready(function() { b(); }); })(jQuery);

var $mp=jQuery.noConflict(true);
var _handled = false;
var displayMode = "";

var MediaPass = {

    root: "https://www.mediapass.com/",

    addStyleSheet: function(a) {
        var b = document.createElement("link");
        b.setAttribute("type", "text/css");
        b.href = MediaPass.root + a; b.setAttribute("rel", "StyleSheet");
        document.getElementsByTagName("head")[0].appendChild(b);
    },



    shouldShow: function() {
        var a = navigator.userAgent.toLowerCase();
        if (/safari/.test(a)) {
            if (/^(?!.*chrome).*$/.test(a)) { return false; }
        } return true;
    },

    init: function(a, f) {
        this.publisher_key = a;
        if (!this.shouldShow()) { return; }
        $mp(document).ready(function() {
            MediaPass.addStyleSheet("/static/css/fb.css");

            var browserName = navigator.appName;
            
            if ($mp(".media-pass-article").length > 0)
            { displayMode = "inline-article"; }
            else if ($mp("#media-pass-video").length > 0)
            { displayMode = "inline-video"; }
            else
            { displayMode = "overlay"; }

            if (f === undefined) f = "0";

            var c = $mp("#media-pass-tease");
            var b = "";
            if (c.length > 0) { b = $mp(c[0]).text(); }
            $mp.getJSON(MediaPass.root + "subscription/check?key=" + a + "&uri=" + escape(location.href) + "&title=" + escape(document.title) + "&snip=" + escape(b) + "&said=" + escape(f) + "&callback=?", function(e) {
                if (e.authorized !== true && typeof e.error === "undefined") {
                    MediaPass.gate(e.url, e.akey, e.pkey, e.snip, displayMode, browserName);
                }
            });
        });
    },




    gate: function(b, d, a, c, e, f) {

        var mpurl = this.root + b + "?uri=" + location.href + "&title=" + escape(document.title) + "&snip=" + escape(c) + "&akey=" + d + "&pkey=" + a + "&display=" + displayMode;
        var objtag = '<object id="mediapass" name="mediapass" height="100%" width="100%" type="text/html" data="' + mpurl + '"><\/object>'; //Not IE
        var iframetag = '<iframe id="mpiframe" src="' + mpurl + '" width="100%" height="100%" FRAMEBORDER="0"></iframe>'; //IE

        switch (e) {

            case 'inline-article':
            
                $mp('.media-pass-article').html('');
                $mp('.media-pass-article').height(400);
                $mp('.media-pass-article').css('padding', '0px 5px 0px 5px');

		if ($mp('.media-pass-article').width() < 430) {
                    $mp('.media-pass-article').width(430);
                } else if ($mp('.media-pass-article').width() > 600) {
                    $mp('.media-pass-article').width(600);
                }

                if (f == "Microsoft Internet Explorer") {
                    $mp('.media-pass-article').html(iframetag);
                    $mp('.media-pass-article').show();
                } else {
                    $mp('.media-pass-article').html(objtag);
                    $mp('.media-pass-article').show();
                }
                break;

            case 'inline-video':

                $mp('#media-pass-video').bind('mouseover', function() {

                    if (_handled == false) {

                        $mp('#media-pass-video').html('');
                        $mp('#media-pass-video').height(400);
                        
                        if ($mp('#media-pass-video').width() < 400) {
                            $mp('#media-pass-video').width(400);
                        } else if ($mp('#media-pass-video').width() > 600) {
                            $mp('#media-pass-video').width(600);
                        }
                        $mp('#media-pass-video').css('padding','0px 5px 0px 5px');

                        if (f == "Microsoft Internet Explorer") {
                            $mp('#media-pass-video').html(iframetag);
                            $mp('#media-pass-video').show();
                        } else {
                            $mp('#media-pass-video').html(objtag);
                            $mp('#media-pass-video').show();
                        }
                        _handled = true;
                    }
                });

                break;

            default:
                $mp.fancybox({ href: this.root + b + "?uri=" + location.href + "&title=" + escape(document.title) + "&snip=" + escape(c) + "&akey=" + d + "&pkey=" + a + "&display=overlay" }, { frameWidth: 821, frameHeight: 550, width: 821, height: 550, autoScale: false, type: "iframe", overlayOpacity: 0.9, modal: true });

        }
        
    }
};