﻿
/**
* Copyright (c) 2009, Nathan Bubna
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*
* Manages auto-refreshing of a page or specific elements,
* to keep data fresh and/or keep a server-side session alive.
*
*   $.refresh('keepAlive.do');
*   $('#notify').refresh('updates.json', 5*60*1000, function(data) {
*      addNotification(data.latest);
*   });
*
* Both the global and selection methods accept a url, a time in ms (optional),
* and a handler for the ajax call (optional).  Alternately, you can just pass
* in an options object.  If the JSON-REST plugin is available, it will use
* that for all calls unless you specify a different method option.
* 
* @version 0.5
* @name refresh
* @cat Plugins/Refresh
* @author Nathan Bubna
*/
(function($) {

    var R = $.refresh = $.fn.refresh = function(a, b, c) {
        return R.setup(opts.apply(this, arguments));
    };
    function opts(a, b, c) {
        var r = $.extend({}, R);
        if (typeof a == "string") {
            r.url = a;
            if (b && !$.isFunction(b)) r.time = b; else c = b;
            if (c) r.success = c;
        }
        else $.extend(r, a);
        if (!r.method) r.method = $.rest ? 'Read' : 'ajax';
        if (!r.target) r.target = this ? this : $;
        if (!r.type && !$.rest) r.type = 'GET';
        return r;
    }

    $.extend(R, {
        version: "0.5",
        url: null,
        time: (30 * 60 - 2) * 1000, //29m58s default
        success: null,
        method: null,
        setup: function(r) {
            if (r.cancel) r.cancel(); //clear old
            r.id = setInterval(function() { r.refresh(r); }, r.time);
            r.cancel = function() {
                clearInterval(r.id);
                return r;
            };
            return r;
        },
        refresh: function(r) {
            if (r.lastReturn) delete r.lastReturn;
            tmp = r.url;
            r.url += '?rnd=' + (new Date()).valueOf()
            r.lastReturn = r.target[r.method](r);
            r.url = tmp;
        }
    });

})(jQuery);

/*
    Curvycorners.js
    http://www.curvycorners.net/
*/
function browserdetect() { var A = navigator.userAgent.toLowerCase(); this.isIE = A.indexOf("msie") > -1; this.ieVer = this.isIE ? /msie\s(\d\.\d)/.exec(A)[1] : 0; this.isMoz = A.indexOf("firefox") != -1; this.isSafari = A.indexOf("safari") != -1; this.quirksMode = this.isIE && (!document.compatMode || document.compatMode.indexOf("BackCompat") > -1); this.isOp = "opera" in window; this.isWebKit = A.indexOf("webkit") != -1; if (this.isIE) { this.get_style = function(D, F) { if (!(F in D.currentStyle)) { return "" } var C = /^([\d.]+)(\w*)/.exec(D.currentStyle[F]); if (!C) { return D.currentStyle[F] } if (C[1] == 0) { return "0" } if (C[2] && C[2] !== "px") { var B = D.style.left; var E = D.runtimeStyle.left; D.runtimeStyle.left = D.currentStyle.left; D.style.left = C[1] + C[2]; C[0] = D.style.pixelLeft; D.style.left = B; D.runtimeStyle.left = E } return C[0] } } else { this.get_style = function(B, C) { C = C.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); return document.defaultView.getComputedStyle(B, "").getPropertyValue(C) } } } var curvyBrowser = new browserdetect; if (curvyBrowser.isIE) { try { document.execCommand("BackgroundImageCache", false, true) } catch (e) { } } function curvyCnrSpec(A) { this.selectorText = A; this.tlR = this.trR = this.blR = this.brR = 0; this.tlu = this.tru = this.blu = this.bru = ""; this.antiAlias = true } curvyCnrSpec.prototype.setcorner = function(B, C, A, D) { if (!B) { this.tlR = this.trR = this.blR = this.brR = parseInt(A); this.tlu = this.tru = this.blu = this.bru = D } else { propname = B.charAt(0) + C.charAt(0); this[propname + "R"] = parseInt(A); this[propname + "u"] = D } }; curvyCnrSpec.prototype.get = function(D) { if (/^(t|b)(l|r)(R|u)$/.test(D)) { return this[D] } if (/^(t|b)(l|r)Ru$/.test(D)) { var C = D.charAt(0) + D.charAt(1); return this[C + "R"] + this[C + "u"] } if (/^(t|b)Ru?$/.test(D)) { var B = D.charAt(0); B += this[B + "lR"] > this[B + "rR"] ? "l" : "r"; var A = this[B + "R"]; if (D.length === 3 && D.charAt(2) === "u") { A += this[B = "u"] } return A } throw new Error("Don't recognize property " + D) }; curvyCnrSpec.prototype.radiusdiff = function(A) { if (A !== "t" && A !== "b") { throw new Error("Param must be 't' or 'b'") } return Math.abs(this[A + "lR"] - this[A + "rR"]) }; curvyCnrSpec.prototype.setfrom = function(A) { this.tlu = this.tru = this.blu = this.bru = "px"; if ("tl" in A) { this.tlR = A.tl.radius } if ("tr" in A) { this.trR = A.tr.radius } if ("bl" in A) { this.blR = A.bl.radius } if ("br" in A) { this.brR = A.br.radius } if ("antiAlias" in A) { this.antiAlias = A.antiAlias } }; curvyCnrSpec.prototype.cloneOn = function(G) { var E = ["tl", "tr", "bl", "br"]; var H = 0; var C, A; for (C in E) { if (!isNaN(C)) { A = this[E[C] + "u"]; if (A !== "" && A !== "px") { H = new curvyCnrSpec; break } } } if (!H) { H = this } else { var B, D, F = curvyBrowser.get_style(G, "left"); for (C in E) { if (!isNaN(C)) { B = E[C]; A = this[B + "u"]; D = this[B + "R"]; if (A !== "px") { var F = G.style.left; G.style.left = D + A; D = G.style.pixelLeft; G.style.left = F } H[B + "R"] = D; H[B + "u"] = "px" } } G.style.left = F } return H }; curvyCnrSpec.prototype.radiusSum = function(A) { if (A !== "t" && A !== "b") { throw new Error("Param must be 't' or 'b'") } return this[A + "lR"] + this[A + "rR"] }; curvyCnrSpec.prototype.radiusCount = function(A) { var B = 0; if (this[A + "lR"]) { ++B } if (this[A + "rR"]) { ++B } return B }; curvyCnrSpec.prototype.cornerNames = function() { var A = []; if (this.tlR) { A.push("tl") } if (this.trR) { A.push("tr") } if (this.blR) { A.push("bl") } if (this.brR) { A.push("br") } return A }; function operasheet(C) { var A = document.styleSheets.item(C).ownerNode.text; A = A.replace(/\/\*(\n|\r|.)*?\*\//g, ""); var D = new RegExp("^s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}", "mg"); var G; this.rules = []; while ((G = D.exec(A)) !== null) { var F = new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)", "g"); var E, B = new curvyCnrSpec(G[1]); while ((E = F.exec(G[2])) !== null) { if (E[1] !== "z-") { B.setcorner(E[3], E[4], E[5], E[6]) } } this.rules.push(B) } } operasheet.contains_border_radius = function(A) { return /border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(A).ownerNode.text) }; function curvyCorners() { var G, D, E, B, J; if (typeof arguments[0] !== "object") { throw curvyCorners.newError("First parameter of curvyCorners() must be an object.") } if (arguments[0] instanceof curvyCnrSpec) { B = arguments[0]; if (!B.selectorText && typeof arguments[1] === "string") { B.selectorText = arguments[1] } } else { if (typeof arguments[1] !== "object" && typeof arguments[1] !== "string") { throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.") } D = arguments[1]; if (typeof D !== "string") { D = "" } if (D !== "" && D.charAt(0) !== "." && "autoPad" in arguments[0]) { D = "." + D } B = new curvyCnrSpec(D); B.setfrom(arguments[0]) } if (B.selectorText) { J = 0; var I = B.selectorText.replace(/\s+$/, "").split(/,\s*/); E = new Array; function A(M) { var L = M.split("#"); return (L.length === 2 ? "#" : "") + L.pop() } for (G = 0; G < I.length; ++G) { var K = A(I[G]); var H = K.split(" "); switch (K.charAt(0)) { case "#": D = H.length === 1 ? K : H[0]; D = document.getElementById(D.substr(1)); if (D === null) { curvyCorners.alert("No object with ID " + K + " exists yet.\nCall curvyCorners(settings, obj) when it is created.") } else { if (H.length === 1) { E.push(D) } else { E = E.concat(curvyCorners.getElementsByClass(H[1], D)) } } break; default: if (H.length === 1) { E = E.concat(curvyCorners.getElementsByClass(K)) } else { var C = curvyCorners.getElementsByClass(H[0]); for (D = 0; D < C.length; ++D) { E = E.concat(curvyCorners.getElementsByClass(H[1], C)) } } } } } else { J = 1; E = arguments } for (G = J, D = E.length; G < D; ++G) { if (E[G] && (!("IEborderRadius" in E[G].style) || E[G].style.IEborderRadius != "set")) { if (E[G].className && E[G].className.indexOf("curvyRedraw") !== -1) { if (typeof curvyCorners.redrawList === "undefined") { curvyCorners.redrawList = new Array } curvyCorners.redrawList.push({ node: E[G], spec: B, copy: E[G].cloneNode(false) }) } E[G].style.IEborderRadius = "set"; var F = new curvyObject(B, E[G]); F.applyCorners() } } } curvyCorners.prototype.applyCornersToAll = function() { curvyCorners.alert("This function is now redundant. Just call curvyCorners(). See documentation.") }; curvyCorners.redraw = function() { if (!curvyBrowser.isOp && !curvyBrowser.isIE) { return } if (!curvyCorners.redrawList) { throw curvyCorners.newError("curvyCorners.redraw() has nothing to redraw.") } var E = curvyCorners.bock_redraw; curvyCorners.block_redraw = true; for (var A in curvyCorners.redrawList) { if (isNaN(A)) { continue } var D = curvyCorners.redrawList[A]; if (!D.node.clientWidth) { continue } var B = D.copy.cloneNode(false); for (var C = D.node.firstChild; C != null; C = C.nextSibling) { if (C.className === "autoPadDiv") { break } } if (!C) { curvyCorners.alert("Couldn't find autoPad DIV"); break } D.node.parentNode.replaceChild(B, D.node); while (C.firstChild) { B.appendChild(C.removeChild(C.firstChild)) } D = new curvyObject(D.spec, D.node = B); D.applyCorners() } curvyCorners.block_redraw = E }; curvyCorners.adjust = function(obj, prop, newval) { if (curvyBrowser.isOp || curvyBrowser.isIE) { if (!curvyCorners.redrawList) { throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.") } var i, j = curvyCorners.redrawList.length; for (i = 0; i < j; ++i) { if (curvyCorners.redrawList[i].node === obj) { break } } if (i === j) { throw curvyCorners.newError("Object not redrawable") } obj = curvyCorners.redrawList[i].copy } if (prop.indexOf(".") === -1) { obj[prop] = newval } else { eval("obj." + prop + "='" + newval + "'") } }; curvyCorners.handleWinResize = function() { if (!curvyCorners.block_redraw) { curvyCorners.redraw() } }; curvyCorners.setWinResize = function(A) { curvyCorners.block_redraw = !A }; curvyCorners.newError = function(A) { return new Error("curvyCorners Error:\n" + A) }; curvyCorners.alert = function(A) { if (typeof curvyCornersVerbose === "undefined" || curvyCornersVerbose) { alert(A) } }; function curvyObject() { var U; this.box = arguments[1]; this.settings = arguments[0]; this.topContainer = this.bottomContainer = this.shell = U = null; var K = this.box.clientWidth; if (!K && curvyBrowser.isIE) { this.box.style.zoom = 1; K = this.box.clientWidth } if (!K) { if (!this.box.parentNode) { throw this.newError("box has no parent!") } for (U = this.box; ; U = U.parentNode) { if (!U || U.tagName === "BODY") { this.applyCorners = function() { }; curvyCorners.alert(this.errmsg("zero-width box with no accountable parent", "warning")); return } if (U.style.display === "none") { break } } U.style.display = "block"; K = this.box.clientWidth } if (arguments[0] instanceof curvyCnrSpec) { this.spec = arguments[0].cloneOn(this.box) } else { this.spec = new curvyCnrSpec(""); this.spec.setfrom(this.settings) } var b = curvyBrowser.get_style(this.box, "borderTopWidth"); var J = curvyBrowser.get_style(this.box, "borderBottomWidth"); var D = curvyBrowser.get_style(this.box, "borderLeftWidth"); var B = curvyBrowser.get_style(this.box, "borderRightWidth"); var I = curvyBrowser.get_style(this.box, "borderTopColor"); var G = curvyBrowser.get_style(this.box, "borderBottomColor"); var A = curvyBrowser.get_style(this.box, "borderLeftColor"); var E = curvyBrowser.get_style(this.box, "backgroundColor"); var C = curvyBrowser.get_style(this.box, "backgroundImage"); var Y = curvyBrowser.get_style(this.box, "backgroundRepeat"); if (this.box.currentStyle && this.box.currentStyle.backgroundPositionX) { var R = curvyBrowser.get_style(this.box, "backgroundPositionX"); var P = curvyBrowser.get_style(this.box, "backgroundPositionY") } else { var R = curvyBrowser.get_style(this.box, "backgroundPosition"); R = R.split(" "); var P = R[1]; R = R[0] } var O = curvyBrowser.get_style(this.box, "position"); var Z = curvyBrowser.get_style(this.box, "paddingTop"); var c = curvyBrowser.get_style(this.box, "paddingBottom"); var Q = curvyBrowser.get_style(this.box, "paddingLeft"); var a = curvyBrowser.get_style(this.box, "paddingRight"); var S = curvyBrowser.get_style(this.box, "border"); filter = curvyBrowser.ieVer > 7 ? curvyBrowser.get_style(this.box, "filter") : null; var H = this.spec.get("tR"); var M = this.spec.get("bR"); var W = function(f) { if (typeof f === "number") { return f } if (typeof f !== "string") { throw new Error("unexpected styleToNPx type " + typeof f) } var d = /^[-\d.]([a-z]+)$/.exec(f); if (d && d[1] != "px") { throw new Error("Unexpected unit " + d[1]) } if (isNaN(f = parseInt(f))) { f = 0 } return f }; var T = function(d) { return d <= 0 ? "0" : d + "px" }; try { this.borderWidth = W(b); this.borderWidthB = W(J); this.borderWidthL = W(D); this.borderWidthR = W(B); this.boxColour = curvyObject.format_colour(E); this.topPadding = W(Z); this.bottomPadding = W(c); this.leftPadding = W(Q); this.rightPadding = W(a); this.boxWidth = K; this.boxHeight = this.box.clientHeight; this.borderColour = curvyObject.format_colour(I); this.borderColourB = curvyObject.format_colour(G); this.borderColourL = curvyObject.format_colour(A); this.borderString = this.borderWidth + "px solid " + this.borderColour; this.borderStringB = this.borderWidthB + "px solid " + this.borderColourB; this.backgroundImage = ((C != "none") ? C : ""); this.backgroundRepeat = Y } catch (X) { throw this.newError("getMessage" in X ? X.getMessage() : X.message) } var F = this.boxHeight; var V = K; if (curvyBrowser.isOp) { R = W(R); P = W(P); if (R) { var N = V + this.borderWidthL + this.borderWidthR; if (R > N) { R = N } R = (N / R * 100) + "%" } if (P) { var N = F + this.borderWidth + this.borderWidthB; if (P > N) { P = N } P = (N / P * 100) + "%" } } if (curvyBrowser.quirksMode) { } else { this.boxWidth -= this.leftPadding + this.rightPadding; this.boxHeight -= this.topPadding + this.bottomPadding } this.contentContainer = document.createElement("div"); if (filter) { this.contentContainer.style.filter = filter } while (this.box.firstChild) { this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild)) } if (O != "absolute") { this.box.style.position = "relative" } this.box.style.padding = "0"; this.box.style.border = this.box.style.backgroundImage = "none"; this.box.style.backgroundColor = "transparent"; this.box.style.width = (V + this.borderWidthL + this.borderWidthR) + "px"; this.box.style.height = (F + this.borderWidth + this.borderWidthB) + "px"; var L = document.createElement("div"); L.style.position = "absolute"; if (filter) { L.style.filter = filter } if (curvyBrowser.quirksMode) { L.style.width = (V + this.borderWidthL + this.borderWidthR) + "px" } else { L.style.width = V + "px" } L.style.height = T(F + this.borderWidth + this.borderWidthB - H - M); L.style.padding = "0"; L.style.top = H + "px"; L.style.left = "0"; if (this.borderWidthL) { L.style.borderLeft = this.borderWidthL + "px solid " + this.borderColourL } if (this.borderWidth && !H) { L.style.borderTop = this.borderWidth + "px solid " + this.borderColour } if (this.borderWidthR) { L.style.borderRight = this.borderWidthR + "px solid " + this.borderColourL } if (this.borderWidthB && !M) { L.style.borderBottom = this.borderWidthB + "px solid " + this.borderColourB } L.style.backgroundColor = E; L.style.backgroundImage = this.backgroundImage; L.style.backgroundRepeat = this.backgroundRepeat; this.shell = this.box.appendChild(L); K = curvyBrowser.get_style(this.shell, "width"); if (K === "" || K === "auto" || K.indexOf("%") !== -1) { throw this.newError("Shell width is " + K) } this.boxWidth = (K != "" && K != "auto" && K.indexOf("%") == -1) ? parseInt(K) : this.shell.clientWidth; this.applyCorners = function() { if (this.backgroundObject) { var w = function(AO, i, t) { if (AO === 0) { return 0 } var k; if (AO === "right" || AO === "bottom") { return t - i } if (AO === "center") { return (t - i) / 2 } if (AO.indexOf("%") > 0) { return (t - i) * 100 / parseInt(AO) } return W(AO) }; this.backgroundPosX = w(R, this.backgroundObject.width, V); this.backgroundPosY = w(P, this.backgroundObject.height, F) } else { if (this.backgroundImage) { this.backgroundPosX = W(R); this.backgroundPosY = W(P) } } if (H) { v = document.createElement("div"); v.style.width = this.boxWidth + "px"; v.style.fontSize = "1px"; v.style.overflow = "hidden"; v.style.position = "absolute"; v.style.paddingLeft = this.borderWidth + "px"; v.style.paddingRight = this.borderWidth + "px"; v.style.height = H + "px"; v.style.top = -H + "px"; v.style.left = -this.borderWidthL + "px"; this.topContainer = this.shell.appendChild(v) } if (M) { var v = document.createElement("div"); v.style.width = this.boxWidth + "px"; v.style.fontSize = "1px"; v.style.overflow = "hidden"; v.style.position = "absolute"; v.style.paddingLeft = this.borderWidthB + "px"; v.style.paddingRight = this.borderWidthB + "px"; v.style.height = M + "px"; v.style.bottom = -M + "px"; v.style.left = -this.borderWidthL + "px"; this.bottomContainer = this.shell.appendChild(v) } var AG = this.spec.cornerNames(); for (var AK in AG) { if (!isNaN(AK)) { var AC = AG[AK]; var AD = this.spec[AC + "R"]; var AE, AH, j, AF; if (AC == "tr" || AC == "tl") { AE = this.borderWidth; AH = this.borderColour; AF = this.borderWidth } else { AE = this.borderWidthB; AH = this.borderColourB; AF = this.borderWidthB } j = AD - AF; var u = document.createElement("div"); u.style.height = this.spec.get(AC + "Ru"); u.style.width = this.spec.get(AC + "Ru"); u.style.position = "absolute"; u.style.fontSize = "1px"; u.style.overflow = "hidden"; var r, q, p; var n = filter ? parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]) : 100; for (r = 0; r < AD; ++r) { var m = (r + 1 >= j) ? -1 : Math.floor(Math.sqrt(Math.pow(j, 2) - Math.pow(r + 1, 2))) - 1; if (j != AD) { var h = (r >= j) ? -1 : Math.ceil(Math.sqrt(Math.pow(j, 2) - Math.pow(r, 2))); var f = (r + 1 >= AD) ? -1 : Math.floor(Math.sqrt(Math.pow(AD, 2) - Math.pow((r + 1), 2))) - 1 } var d = (r >= AD) ? -1 : Math.ceil(Math.sqrt(Math.pow(AD, 2) - Math.pow(r, 2))); if (m > -1) { this.drawPixel(r, 0, this.boxColour, n, (m + 1), u, true, AD) } if (j != AD) { if (this.spec.antiAlias) { for (q = m + 1; q < h; ++q) { if (this.backgroundImage != "") { var g = curvyObject.pixelFraction(r, q, j) * 100; this.drawPixel(r, q, AH, n, 1, u, g >= 30, AD) } else { if (this.boxColour !== "transparent") { var AB = curvyObject.BlendColour(this.boxColour, AH, curvyObject.pixelFraction(r, q, j)); this.drawPixel(r, q, AB, n, 1, u, false, AD) } else { this.drawPixel(r, q, AH, n >> 1, 1, u, false, AD) } } } if (f >= h) { if (h == -1) { h = 0 } this.drawPixel(r, h, AH, n, (f - h + 1), u, false, 0) } p = AH; q = f } else { if (f > m) { this.drawPixel(r, (m + 1), AH, n, (f - m), u, false, 0) } } } else { p = this.boxColour; q = m } if (this.spec.antiAlias) { while (++q < d) { this.drawPixel(r, q, p, (curvyObject.pixelFraction(r, q, AD) * n), 1, u, AF <= 0, AD) } } } for (var y = 0, AJ = u.childNodes.length; y < AJ; ++y) { var s = u.childNodes[y]; var AI = parseInt(s.style.top); var AM = parseInt(s.style.left); var AN = parseInt(s.style.height); if (AC == "tl" || AC == "bl") { s.style.left = (AD - AM - 1) + "px" } if (AC == "tr" || AC == "tl") { s.style.top = (AD - AN - AI) + "px" } s.style.backgroundRepeat = this.backgroundRepeat; if (this.backgroundImage) { switch (AC) { case "tr": s.style.backgroundPosition = (this.backgroundPosX - this.borderWidthL + AD - V - AM) + "px " + (this.backgroundPosY + AN + AI + this.borderWidth - AD) + "px"; break; case "tl": s.style.backgroundPosition = (this.backgroundPosX - AD + AM + this.borderWidthL) + "px " + (this.backgroundPosY - AD + AN + AI + this.borderWidth) + "px"; break; case "bl": s.style.backgroundPosition = (this.backgroundPosX - AD + AM + 1 + this.borderWidthL) + "px " + (this.backgroundPosY - F - this.borderWidth + (curvyBrowser.quirksMode ? AI : -AI) + AD) + "px"; break; case "br": if (curvyBrowser.quirksMode) { s.style.backgroundPosition = (this.backgroundPosX + this.borderWidthL - V + AD - AM) + "px " + (this.backgroundPosY - F - this.borderWidth + AI + AD) + "px" } else { s.style.backgroundPosition = (this.backgroundPosX - this.borderWidthL - V + AD - AM) + "px " + (this.backgroundPosY - F - this.borderWidth + AD - AI) + "px" } } } } switch (AC) { case "tl": u.style.top = u.style.left = "0"; this.topContainer.appendChild(u); break; case "tr": u.style.top = u.style.right = "0"; this.topContainer.appendChild(u); break; case "bl": u.style.bottom = u.style.left = "0"; this.bottomContainer.appendChild(u); break; case "br": u.style.bottom = u.style.right = "0"; this.bottomContainer.appendChild(u) } } } var x = { t: this.spec.radiusdiff("t"), b: this.spec.radiusdiff("b") }; for (z in x) { if (typeof z === "function") { continue } if (!this.spec.get(z + "R")) { continue } if (x[z]) { if (this.backgroundImage && this.spec.radiusSum(z) !== x[z]) { curvyCorners.alert(this.errmsg("Not supported: unequal non-zero top/bottom radii with background image")) } var AL = (this.spec[z + "lR"] < this.spec[z + "rR"]) ? z + "l" : z + "r"; var l = document.createElement("div"); l.style.height = x[z] + "px"; l.style.width = this.spec.get(AL + "Ru"); l.style.position = "absolute"; l.style.fontSize = "1px"; l.style.overflow = "hidden"; l.style.backgroundColor = this.boxColour; switch (AL) { case "tl": l.style.bottom = l.style.left = "0"; l.style.borderLeft = this.borderString; this.topContainer.appendChild(l); break; case "tr": l.style.bottom = l.style.right = "0"; l.style.borderRight = this.borderString; this.topContainer.appendChild(l); break; case "bl": l.style.top = l.style.left = "0"; l.style.borderLeft = this.borderStringB; this.bottomContainer.appendChild(l); break; case "br": l.style.top = l.style.right = "0"; l.style.borderRight = this.borderStringB; this.bottomContainer.appendChild(l) } } var o = document.createElement("div"); if (filter) { o.style.filter = filter } o.style.position = "relative"; o.style.fontSize = "1px"; o.style.overflow = "hidden"; o.style.width = this.fillerWidth(z); o.style.backgroundColor = this.boxColour; o.style.backgroundImage = this.backgroundImage; o.style.backgroundRepeat = this.backgroundRepeat; switch (z) { case "t": if (this.topContainer) { if (curvyBrowser.quirksMode) { o.style.height = 100 + H + "px" } else { o.style.height = 100 + H - this.borderWidth + "px" } o.style.marginLeft = this.spec.tlR ? (this.spec.tlR - this.borderWidthL) + "px" : "0"; o.style.borderTop = this.borderString; if (this.backgroundImage) { var AA = this.spec.tlR ? (this.backgroundPosX - (H - this.borderWidthL)) + "px " : "0 "; o.style.backgroundPosition = AA + this.backgroundPosY + "px"; this.shell.style.backgroundPosition = this.backgroundPosX + "px " + (this.backgroundPosY - H + this.borderWidthL) + "px" } this.topContainer.appendChild(o) } break; case "b": if (this.bottomContainer) { if (curvyBrowser.quirksMode) { o.style.height = M + "px" } else { o.style.height = M - this.borderWidthB + "px" } o.style.marginLeft = this.spec.blR ? (this.spec.blR - this.borderWidthL) + "px" : "0"; o.style.borderBottom = this.borderStringB; if (this.backgroundImage) { var AA = this.spec.blR ? (this.backgroundPosX + this.borderWidthL - M) + "px " : this.backgroundPosX + "px "; o.style.backgroundPosition = AA + (this.backgroundPosY - F - this.borderWidth + M) + "px" } this.bottomContainer.appendChild(o) } } } this.contentContainer.style.position = "absolute"; this.contentContainer.className = "autoPadDiv"; this.contentContainer.style.left = this.borderWidthL + "px"; this.contentContainer.style.paddingTop = this.topPadding + "px"; this.contentContainer.style.top = this.borderWidth + "px"; this.contentContainer.style.paddingLeft = this.leftPadding + "px"; this.contentContainer.style.paddingRight = this.rightPadding + "px"; z = V; if (!curvyBrowser.quirksMode) { z -= this.leftPadding + this.rightPadding } this.contentContainer.style.width = z + "px"; this.contentContainer.style.textAlign = curvyBrowser.get_style(this.box, "textAlign"); this.box.style.textAlign = "left"; this.box.appendChild(this.contentContainer); if (U) { U.style.display = "none" } }; if (this.backgroundImage) { R = this.backgroundCheck(R); P = this.backgroundCheck(P); if (this.backgroundObject) { this.backgroundObject.holdingElement = this; this.dispatch = this.applyCorners; this.applyCorners = function() { if (this.backgroundObject.complete) { this.dispatch() } else { this.backgroundObject.onload = new Function("curvyObject.dispatch(this.holdingElement);") } } } } } curvyObject.prototype.backgroundCheck = function(B) { if (B === "top" || B === "left" || parseInt(B) === 0) { return 0 } if (!(/^[-\d.]+px$/.test(B)) && !this.backgroundObject) { this.backgroundObject = new Image; var A = function(D) { var C = /url\("?([^'"]+)"?\)/.exec(D); return (C ? C[1] : D) }; this.backgroundObject.src = A(this.backgroundImage) } return B }; curvyObject.dispatch = function(A) { if ("dispatch" in A) { A.dispatch() } else { throw A.newError("No dispatch function") } }; curvyObject.prototype.drawPixel = function(J, G, A, F, H, I, C, E) { var B = document.createElement("div"); B.style.height = H + "px"; B.style.width = "1px"; B.style.position = "absolute"; B.style.fontSize = "1px"; B.style.overflow = "hidden"; var D = this.spec.get("tR"); B.style.backgroundColor = A; if (C && this.backgroundImage != "") { B.style.backgroundImage = this.backgroundImage; B.style.backgroundPosition = "-" + (this.boxWidth - (E - J) + this.borderWidth) + "px -" + ((this.boxHeight + D + G) - this.borderWidth) + "px" } if (F != 100) { curvyObject.setOpacity(B, F) } B.style.top = G + "px"; B.style.left = J + "px"; I.appendChild(B) }; curvyObject.prototype.fillerWidth = function(A) { var B = curvyBrowser.quirksMode ? 0 : this.spec.radiusCount(A) * this.borderWidthL; return (this.boxWidth - this.spec.radiusSum(A) + B) + "px" }; curvyObject.prototype.errmsg = function(C, D) { var B = "\ntag: " + this.box.tagName; if (this.box.id) { B += "\nid: " + this.box.id } if (this.box.className) { B += "\nclass: " + this.box.className } var A; if ((A = this.box.parentNode) === null) { B += "\n(box has no parent)" } else { B += "\nParent tag: " + A.tagName; if (A.id) { B += "\nParent ID: " + A.id } if (A.className) { B += "\nParent class: " + A.className } } if (D === undefined) { D = "warning" } return "curvyObject " + D + ":\n" + C + B }; curvyObject.prototype.newError = function(A) { return new Error(this.errmsg(A, "exception")) }; curvyObject.IntToHex = function(B) { var A = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; return A[B >>> 4] + "" + A[B & 15] }; curvyObject.BlendColour = function(L, J, G) { if (L === "transparent" || J === "transparent") { throw this.newError("Cannot blend with transparent") } if (L.charAt(0) !== "#") { L = curvyObject.format_colour(L) } if (J.charAt(0) !== "#") { J = curvyObject.format_colour(J) } var D = parseInt(L.substr(1, 2), 16); var K = parseInt(L.substr(3, 2), 16); var F = parseInt(L.substr(5, 2), 16); var C = parseInt(J.substr(1, 2), 16); var I = parseInt(J.substr(3, 2), 16); var E = parseInt(J.substr(5, 2), 16); if (G > 1 || G < 0) { G = 1 } var H = Math.round((D * G) + (C * (1 - G))); if (H > 255) { H = 255 } if (H < 0) { H = 0 } var B = Math.round((K * G) + (I * (1 - G))); if (B > 255) { B = 255 } if (B < 0) { B = 0 } var A = Math.round((F * G) + (E * (1 - G))); if (A > 255) { A = 255 } if (A < 0) { A = 0 } return "#" + curvyObject.IntToHex(H) + curvyObject.IntToHex(B) + curvyObject.IntToHex(A) }; curvyObject.pixelFraction = function(H, G, A) { var J; var E = A * A; var B = new Array(2); var F = new Array(2); var I = 0; var C = ""; var D = Math.sqrt(E - Math.pow(H, 2)); if (D >= G && D < (G + 1)) { C = "Left"; B[I] = 0; F[I] = D - G; ++I } D = Math.sqrt(E - Math.pow(G + 1, 2)); if (D >= H && D < (H + 1)) { C += "Top"; B[I] = D - H; F[I] = 1; ++I } D = Math.sqrt(E - Math.pow(H + 1, 2)); if (D >= G && D < (G + 1)) { C += "Right"; B[I] = 1; F[I] = D - G; ++I } D = Math.sqrt(E - Math.pow(G, 2)); if (D >= H && D < (H + 1)) { C += "Bottom"; B[I] = D - H; F[I] = 0 } switch (C) { case "LeftRight": J = Math.min(F[0], F[1]) + ((Math.max(F[0], F[1]) - Math.min(F[0], F[1])) / 2); break; case "TopRight": J = 1 - (((1 - B[0]) * (1 - F[1])) / 2); break; case "TopBottom": J = Math.min(B[0], B[1]) + ((Math.max(B[0], B[1]) - Math.min(B[0], B[1])) / 2); break; case "LeftBottom": J = F[0] * B[1] / 2; break; default: J = 1 } return J }; curvyObject.rgb2Array = function(A) { var B = A.substring(4, A.indexOf(")")); return B.split(", ") }; curvyObject.rgb2Hex = function(B) { try { var C = curvyObject.rgb2Array(B); var G = parseInt(C[0]); var E = parseInt(C[1]); var A = parseInt(C[2]); var D = "#" + curvyObject.IntToHex(G) + curvyObject.IntToHex(E) + curvyObject.IntToHex(A) } catch (F) { var H = "getMessage" in F ? F.getMessage() : F.message; throw new Error("Error (" + H + ") converting RGB value to Hex in rgb2Hex") } return D }; curvyObject.setOpacity = function(F, C) { C = (C == 100) ? 99.999 : C; if (curvyBrowser.isSafari && F.tagName != "IFRAME") { var B = curvyObject.rgb2Array(F.style.backgroundColor); var E = parseInt(B[0]); var D = parseInt(B[1]); var A = parseInt(B[2]); F.style.backgroundColor = "rgba(" + E + ", " + D + ", " + A + ", " + C / 100 + ")" } else { if (typeof F.style.opacity !== "undefined") { F.style.opacity = C / 100 } else { if (typeof F.style.MozOpacity !== "undefined") { F.style.MozOpacity = C / 100 } else { if (typeof F.style.filter != "undefined") { F.style.filter = "alpha(opacity=" + C + ")" } else { if (typeof F.style.KHTMLOpacity != "undefined") { F.style.KHTMLOpacity = C / 100 } } } } } }; function addEvent(D, C, B, A) { if (D.addEventListener) { D.addEventListener(C, B, A); return true } if (D.attachEvent) { return D.attachEvent("on" + C, B) } D["on" + C] = B; return false } curvyObject.getComputedColour = function(E) { var F = document.createElement("DIV"); F.style.backgroundColor = E; document.body.appendChild(F); if (window.getComputedStyle) { var D = document.defaultView.getComputedStyle(F, null).getPropertyValue("background-color"); F.parentNode.removeChild(F); if (D.substr(0, 3) === "rgb") { D = curvyObject.rgb2Hex(D) } return D } else { var A = document.body.createTextRange(); A.moveToElementText(F); A.execCommand("ForeColor", false, E); var B = A.queryCommandValue("ForeColor"); var C = "rgb(" + (B & 255) + ", " + ((B & 65280) >> 8) + ", " + ((B & 16711680) >> 16) + ")"; F.parentNode.removeChild(F); A = null; return curvyObject.rgb2Hex(C) } }; curvyObject.format_colour = function(A) { if (A != "" && A != "transparent") { if (A.substr(0, 3) === "rgb") { A = curvyObject.rgb2Hex(A) } else { if (A.charAt(0) !== "#") { A = curvyObject.getComputedColour(A) } else { if (A.length === 4) { A = "#" + A.charAt(1) + A.charAt(1) + A.charAt(2) + A.charAt(2) + A.charAt(3) + A.charAt(3) } } } } return A }; curvyCorners.getElementsByClass = function(H, F) { var E = new Array; if (F === undefined) { F = document } H = H.split("."); var A = "*"; if (H.length === 1) { A = H[0]; H = false } else { if (H[0]) { A = H[0] } H = H[1] } var D, C, B; if (A.charAt(0) === "#") { C = document.getElementById(A.substr(1)); if (C) { E.push(C) } } else { C = F.getElementsByTagName(A); B = C.length; if (H) { var G = new RegExp("(^|\\s)" + H + "(\\s|$)"); for (D = 0; D < B; ++D) { if (G.test(C[D].className)) { E.push(C[D]) } } } else { for (D = 0; D < B; ++D) { E.push(C[D]) } } } return E }; if (curvyBrowser.isMoz || curvyBrowser.isWebKit) { var curvyCornersNoAutoScan = true } else { curvyCorners.scanStyles = function() { function B(F) { var G = /^[\d.]+(\w+)$/.exec(F); return G[1] } var E, D, C; if (curvyBrowser.isIE) { function A(L) { var J = L.style; if (curvyBrowser.ieVer > 6) { var H = J["-webkit-border-radius"] || 0; var K = J["-webkit-border-top-right-radius"] || 0; var F = J["-webkit-border-top-left-radius"] || 0; var G = J["-webkit-border-bottom-right-radius"] || 0; var M = J["-webkit-border-bottom-left-radius"] || 0 } else { var H = J["webkit-border-radius"] || 0; var K = J["webkit-border-top-right-radius"] || 0; var F = J["webkit-border-top-left-radius"] || 0; var G = J["webkit-border-bottom-right-radius"] || 0; var M = J["webkit-border-bottom-left-radius"] || 0 } if (H || F || K || G || M) { var I = new curvyCnrSpec(L.selectorText); if (H) { I.setcorner(null, null, parseInt(H), B(H)) } else { if (K) { I.setcorner("t", "r", parseInt(K), B(K)) } if (F) { I.setcorner("t", "l", parseInt(F), B(F)) } if (M) { I.setcorner("b", "l", parseInt(M), B(M)) } if (G) { I.setcorner("b", "r", parseInt(G), B(G)) } } curvyCorners(I) } } for (E = 0; E < document.styleSheets.length; ++E) { if (document.styleSheets[E].imports) { for (D = 0; D < document.styleSheets[E].imports.length; ++D) { for (C = 0; C < document.styleSheets[E].imports[D].rules.length; ++C) { A(document.styleSheets[E].imports[D].rules[C]) } } } for (D = 0; D < document.styleSheets[E].rules.length; ++D) { A(document.styleSheets[E].rules[D]) } } } else { if (curvyBrowser.isOp) { for (E = 0; E < document.styleSheets.length; ++E) { if (operasheet.contains_border_radius(E)) { C = new operasheet(E); for (D in C.rules) { if (!isNaN(D)) { curvyCorners(C.rules[D]) } } } } } else { curvyCorners.alert("Scanstyles does nothing in Webkit/Firefox") } } }; curvyCorners.init = function() { if (arguments.callee.done) { return } arguments.callee.done = true; if (curvyBrowser.isWebKit && curvyCorners.init.timer) { clearInterval(curvyCorners.init.timer); curvyCorners.init.timer = null } curvyCorners.scanStyles() } } if (typeof curvyCornersNoAutoScan === "undefined" || curvyCornersNoAutoScan === false) { if (curvyBrowser.isOp) { document.addEventListener("DOMContentLoaded", curvyCorners.init, false) } else { addEvent(window, "load", curvyCorners.init, false) } };

// IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support
// (c) 2008-2009 Angus Turnbull http://www.twinhelix.com
// This is licensed under the GNU LGPL, version 2.1 or later.
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
var IEPNGFix = window.IEPNGFix || {};

IEPNGFix.tileBG = function (elm, pngSrc, ready) {
    // Params: A reference to a DOM element, the PNG src file pathname, and a
    // hidden "ready-to-run" passed when called back after image preloading.
    var data = this.data[elm.uniqueID],
        elmW = Math.max(elm.clientWidth, elm.scrollWidth),
        elmH = Math.max(elm.clientHeight, elm.scrollHeight),
        bgX = elm.currentStyle.backgroundPositionX,
        bgY = elm.currentStyle.backgroundPositionY,
        bgR = elm.currentStyle.backgroundRepeat;

    // Cache of DIVs created per element, and image preloader/data.
    if (!data.tiles) {
        data.tiles = {
            elm: elm,
            src: '',
            cache: [],
            img: new Image(),
            old: {}
        };
    }
    var tiles = data.tiles,
        pngW = tiles.img.width,
        pngH = tiles.img.height;

    if (pngSrc) {
        if (!ready && pngSrc != tiles.src) {
            // New image? Preload it with a callback to detect dimensions.
            tiles.img.onload = function () {
                this.onload = null;
                IEPNGFix.tileBG(elm, pngSrc, 1);
            };
            return tiles.img.src = pngSrc;
        }
    } else {
        // No image?
        if (tiles.src) ready = 1;
        pngW = pngH = 0;
    }
    tiles.src = pngSrc;

    if (!ready && elmW == tiles.old.w && elmH == tiles.old.h && bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) {
        return;
    }

    // Convert English and percentage positions to pixels.
    var pos = {
        top: '0%',
        left: '0%',
        center: '50%',
        bottom: '100%',
        right: '100%'
    },
        x, y, pc;
    x = pos[bgX] || bgX;
    y = pos[bgY] || bgY;
    if (pc = x.match(/(\d+)%/)) {
        x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100));
    }
    if (pc = y.match(/(\d+)%/)) {
        y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100));
    }
    x = parseInt(x);
    y = parseInt(y);

    // Handle backgroundRepeat.
    var repeatX = {
        'repeat': 1,
        'repeat-x': 1
    }[bgR],
        repeatY = {
            'repeat': 1,
            'repeat-y': 1
        }[bgR];
    if (repeatX) {
        x %= pngW;
        if (x > 0) x -= pngW;
    }
    if (repeatY) {
        y %= pngH;
        if (y > 0) y -= pngH;
    }

    // Go!
    this.hook.enabled = 0;
    if (!({
        relative: 1,
        absolute: 1
    }[elm.currentStyle.position])) {
        elm.style.position = 'relative';
    }
    var count = 0,
        xPos, maxX = repeatX ? elmW : x + 0.1,
        yPos, maxY = repeatY ? elmH : y + 0.1,
        d, s, isNew;
    if (pngW && pngH) {
        for (xPos = x; xPos < maxX; xPos += pngW) {
            for (yPos = y; yPos < maxY; yPos += pngH) {
                isNew = 0;
                if (!tiles.cache[count]) {
                    tiles.cache[count] = document.createElement('div');
                    isNew = 1;
                }
                var clipR = Math.max(0, xPos + pngW > elmW ? elmW - xPos : pngW),
                    clipB = Math.max(0, yPos + pngH > elmH ? elmH - yPos : pngH);
                d = tiles.cache[count];
                s = d.style;
                s.behavior = 'none';
                s.left = (xPos - parseInt(elm.currentStyle.paddingLeft)) + 'px';
                s.top = yPos + 'px';
                s.width = clipR + 'px';
                s.height = clipB + 'px';
                s.clip = 'rect(' + (yPos < 0 ? 0 - yPos : 0) + 'px,' + clipR + 'px,' + clipB + 'px,' + (xPos < 0 ? 0 - xPos : 0) + 'px)';
                s.display = 'block';
                if (isNew) {
                    s.position = 'absolute';
                    s.zIndex = -999;
                    if (elm.firstChild) {
                        elm.insertBefore(d, elm.firstChild);
                    } else {
                        elm.appendChild(d);
                    }
                }
                this.fix(d, pngSrc, 0);
                count++;
            }
        }
    }
    while (count < tiles.cache.length) {
        this.fix(tiles.cache[count], '', 0);
        tiles.cache[count++].style.display = 'none';
    }

    this.hook.enabled = 1;

    // Cache so updates are infrequent.
    tiles.old = {
        w: elmW,
        h: elmH,
        x: bgX,
        y: bgY,
        r: bgR
    };
};


IEPNGFix.update = function () {
    // Update all PNG backgrounds.
    for (var i in IEPNGFix.data) {
        var t = IEPNGFix.data[i].tiles;
        if (t && t.elm && t.src) {
            IEPNGFix.tileBG(t.elm, t.src);
        }
    }
};
IEPNGFix.update.timer = 0;

if (window.attachEvent && !window.opera) {
    window.attachEvent('onresize', function () {
        clearTimeout(IEPNGFix.update.timer);
        IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100);
    });
}


/*
* jQuery Autocomplete plugin 1.1
*
* Copyright (c) 2009 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
*/
; (function($) {
    $.fn.extend({ autocomplete: function(urlOrData, options) { var isUrl = typeof urlOrData == "string"; options = $.extend({}, $.Autocompleter.defaults, { url: isUrl ? urlOrData : null, data: isUrl ? null : urlOrData, delay: isUrl ? $.Autocompleter.defaults.delay : 10, max: options && !options.scroll ? 10 : 150 }, options); options.highlight = options.highlight || function(value) { return value; }; options.formatMatch = options.formatMatch || options.formatItem; return this.each(function() { new $.Autocompleter(this, options); }); }, result: function(handler) { return this.bind("result", handler); }, search: function(handler) { return this.trigger("search", [handler]); }, flushCache: function() { return this.trigger("flushCache"); }, setOptions: function(options) { return this.trigger("setOptions", [options]); }, unautocomplete: function() { return this.trigger("unautocomplete"); } }); $.Autocompleter = function(input, options) { var KEY = { UP: 38, DOWN: 40, DEL: 46, TAB: 9, RETURN: 13, ESC: 27, COMMA: 188, PAGEUP: 33, PAGEDOWN: 34, BACKSPACE: 8 }; var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); var timeout; var previousValue = ""; var cache = $.Autocompleter.Cache(options); var hasFocus = 0; var lastKeyPressCode; var config = { mouseDownOnSelect: false }; var select = $.Autocompleter.Select(options, input, selectCurrent, config); var blockSubmit; $.browser.opera && $(input.form).bind("submit.autocomplete", function() { if (blockSubmit) { blockSubmit = false; return false; } }); $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { hasFocus = 1; lastKeyPressCode = event.keyCode; switch (event.keyCode) { case KEY.UP: event.preventDefault(); if (select.visible()) { select.prev(); } else { onChange(0, true); } break; case KEY.DOWN: event.preventDefault(); if (select.visible()) { select.next(); } else { onChange(0, true); } break; case KEY.PAGEUP: event.preventDefault(); if (select.visible()) { select.pageUp(); } else { onChange(0, true); } break; case KEY.PAGEDOWN: event.preventDefault(); if (select.visible()) { select.pageDown(); } else { onChange(0, true); } break; case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: case KEY.TAB: case KEY.RETURN: if (selectCurrent()) { event.preventDefault(); blockSubmit = true; return false; } break; case KEY.ESC: select.hide(); break; default: clearTimeout(timeout); timeout = setTimeout(onChange, options.delay); break; } }).focus(function() { hasFocus++; }).blur(function() { hasFocus = 0; if (!config.mouseDownOnSelect) { hideResults(); } }).click(function() { if (hasFocus++ > 1 && !select.visible()) { onChange(0, true); } }).bind("search", function() { var fn = (arguments.length > 1) ? arguments[1] : null; function findValueCallback(q, data) { var result; if (data && data.length) { for (var i = 0; i < data.length; i++) { if (data[i].result.toLowerCase() == q.toLowerCase()) { result = data[i]; break; } } } if (typeof fn == "function") fn(result); else $input.trigger("result", result && [result.data, result.value]); } $.each(trimWords($input.val()), function(i, value) { request(value, findValueCallback, findValueCallback); }); }).bind("flushCache", function() { cache.flush(); }).bind("setOptions", function() { $.extend(options, arguments[1]); if ("data" in arguments[1]) cache.populate(); }).bind("unautocomplete", function() { select.unbind(); $input.unbind(); $(input.form).unbind(".autocomplete"); }); function selectCurrent() { var selected = select.selected(); if (!selected) return false; var v = selected.result; previousValue = v; if (options.multiple) { var words = trimWords($input.val()); if (words.length > 1) { var seperator = options.multipleSeparator.length; var cursorAt = $(input).selection().start; var wordAt, progress = 0; $.each(words, function(i, word) { progress += word.length; if (cursorAt <= progress) { wordAt = i; return false; } progress += seperator; }); words[wordAt] = v; v = words.join(options.multipleSeparator); } v += options.multipleSeparator; } $input.val(v); hideResultsNow(); $input.trigger("result", [selected.data, selected.value]); return true; } function onChange(crap, skipPrevCheck) { if (lastKeyPressCode == KEY.DEL) { select.hide(); return; } var currentValue = $input.val(); if (!skipPrevCheck && currentValue == previousValue) return; previousValue = currentValue; currentValue = lastWord(currentValue); if (currentValue.length >= options.minChars) { $input.addClass(options.loadingClass); if (!options.matchCase) currentValue = currentValue.toLowerCase(); request(currentValue, receiveData, hideResultsNow); } else { stopLoading(); select.hide(); } }; function trimWords(value) { if (!value) return [""]; if (!options.multiple) return [$.trim(value)]; return $.map(value.split(options.multipleSeparator), function(word) { return $.trim(value).length ? $.trim(word) : null; }); } function lastWord(value) { if (!options.multiple) return value; var words = trimWords(value); if (words.length == 1) return words[0]; var cursorAt = $(input).selection().start; if (cursorAt == value.length) { words = trimWords(value) } else { words = trimWords(value.replace(value.substring(cursorAt), "")); } return words[words.length - 1]; } function autoFill(q, sValue) { if (options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE) { $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); $(input).selection(previousValue.length, previousValue.length + sValue.length); } }; function hideResults() { clearTimeout(timeout); timeout = setTimeout(hideResultsNow, 200); }; function hideResultsNow() { var wasVisible = select.visible(); select.hide(); clearTimeout(timeout); stopLoading(); if (options.mustMatch) { $input.search(function(result) { if (!result) { if (options.multiple) { var words = trimWords($input.val()).slice(0, -1); $input.val(words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "")); } else { $input.val(""); $input.trigger("result", null); } } }); } }; function receiveData(q, data) { if (data && data.length && hasFocus) { stopLoading(); select.display(data, q); autoFill(q, data[0].value); select.show(); } else { hideResultsNow(); } }; function request(term, success, failure) { if (!options.matchCase) term = term.toLowerCase(); var data = cache.load(term); if (data && data.length) { success(term, data); } else if ((typeof options.url == "string") && (options.url.length > 0)) { var extraParams = { timestamp: +new Date() }; $.each(options.extraParams, function(key, param) { extraParams[key] = typeof param == "function" ? param() : param; }); $.ajax({ mode: "abort", port: "autocomplete" + input.name, dataType: options.dataType, url: options.url, data: $.extend({ q: lastWord(term), limit: options.max }, extraParams), success: function(data) { var parsed = options.parse && options.parse(data) || parse(data); cache.add(term, parsed); success(term, parsed); } }); } else { select.emptyList(); failure(term); } }; function parse(data) { var parsed = []; var rows = data.split("\n"); for (var i = 0; i < rows.length; i++) { var row = $.trim(rows[i]); if (row) { row = row.split("|"); parsed[parsed.length] = { data: row, value: row[0], result: options.formatResult && options.formatResult(row, row[0]) || row[0] }; } } return parsed; }; function stopLoading() { $input.removeClass(options.loadingClass); }; }; $.Autocompleter.defaults = { inputClass: "ac_input", resultsClass: "ac_results", loadingClass: "ac_loading", minChars: 1, delay: 400, matchCase: false, matchSubset: true, matchContains: false, cacheLength: 10, max: 100, mustMatch: false, extraParams: {}, selectFirst: true, formatItem: function(row) { return row[0]; }, formatMatch: null, autoFill: false, width: 0, multiple: false, multipleSeparator: ", ", highlight: function(value, term) { return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"); }, scroll: true, scrollHeight: 180 }; $.Autocompleter.Cache = function(options) {
        var data = {}; var length = 0; function matchSubset(s, sub) { if (!options.matchCase) s = s.toLowerCase(); var i = s.indexOf(sub); if (options.matchContains == "word") { i = s.toLowerCase().search("\\b" + sub.toLowerCase()); } if (i == -1) return false; return i == 0 || options.matchContains; }; function add(q, value) { if (length > options.cacheLength) { flush(); } if (!data[q]) { length++; } data[q] = value; } function populate() { if (!options.data) return false; var stMatchSets = {}, nullData = 0; if (!options.url) options.cacheLength = 1; stMatchSets[""] = []; for (var i = 0, ol = options.data.length; i < ol; i++) { var rawValue = options.data[i]; rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; var value = options.formatMatch(rawValue, i + 1, options.data.length); if (value === false) continue; var firstChar = value.charAt(0).toLowerCase(); if (!stMatchSets[firstChar]) stMatchSets[firstChar] = []; var row = { value: value, data: rawValue, result: options.formatResult && options.formatResult(rawValue) || value }; stMatchSets[firstChar].push(row); if (nullData++ < options.max) { stMatchSets[""].push(row); } }; $.each(stMatchSets, function(i, value) { options.cacheLength++; add(i, value); }); } setTimeout(populate, 25); function flush() { data = {}; length = 0; } return { flush: flush, add: add, populate: populate, load: function(q) {
            if (!options.cacheLength || !length) return null; if (!options.url && options.matchContains) { var csub = []; for (var k in data) { if (k.length > 0) { var c = data[k]; $.each(c, function(i, x) { if (matchSubset(x.value, q)) { csub.push(x); } }); } } return csub; } else
                if (data[q]) { return data[q]; } else
                if (options.matchSubset) { for (var i = q.length - 1; i >= options.minChars; i--) { var c = data[q.substr(0, i)]; if (c) { var csub = []; $.each(c, function(i, x) { if (matchSubset(x.value, q)) { csub[csub.length] = x; } }); return csub; } } } return null;
        } 
        };
    }; $.Autocompleter.Select = function(options, input, select, config) { var CLASSES = { ACTIVE: "ac_over" }; var listItems, active = -1, data, term = "", needsInit = true, element, list; function init() { if (!needsInit) return; element = $("<div/>").hide().addClass(options.resultsClass).css("position", "absolute").appendTo(document.body); list = $("<ul/>").appendTo(element).mouseover(function(event) { if (target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); $(target(event)).addClass(CLASSES.ACTIVE); } }).click(function(event) { $(target(event)).addClass(CLASSES.ACTIVE); select(); input.focus(); return false; }).mousedown(function() { config.mouseDownOnSelect = true; }).mouseup(function() { config.mouseDownOnSelect = false; }); if (options.width > 0) element.css("width", options.width); needsInit = false; } function target(event) { var element = event.target; while (element && element.tagName != "LI") element = element.parentNode; if (!element) return []; return element; } function moveSelect(step) { listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE); movePosition(step); var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); if (options.scroll) { var offset = 0; listItems.slice(0, active).each(function() { offset += this.offsetHeight; }); if ((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); } else if (offset < list.scrollTop()) { list.scrollTop(offset); } } }; function movePosition(step) { active += step; if (active < 0) { active = listItems.size() - 1; } else if (active >= listItems.size()) { active = 0; } } function limitNumberOfItems(available) { return options.max && options.max < available ? options.max : available; } function fillList() { list.empty(); var max = limitNumberOfItems(data.length); for (var i = 0; i < max; i++) { if (!data[i]) continue; var formatted = options.formatItem(data[i].data, i + 1, max, data[i].value, term); if (formatted === false) continue; var li = $("<li/>").html(options.highlight(formatted, term)).addClass(i % 2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0]; $.data(li, "ac_data", data[i]); } listItems = list.find("li"); if (options.selectFirst) { listItems.slice(0, 1).addClass(CLASSES.ACTIVE); active = 0; } if ($.fn.bgiframe) list.bgiframe(); } return { display: function(d, q) { init(); data = d; term = q; fillList(); }, next: function() { moveSelect(1); }, prev: function() { moveSelect(-1); }, pageUp: function() { if (active != 0 && active - 8 < 0) { moveSelect(-active); } else { moveSelect(-8); } }, pageDown: function() { if (active != listItems.size() - 1 && active + 8 > listItems.size()) { moveSelect(listItems.size() - 1 - active); } else { moveSelect(8); } }, hide: function() { element && element.hide(); listItems && listItems.removeClass(CLASSES.ACTIVE); active = -1; }, visible: function() { return element && element.is(":visible"); }, current: function() { return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); }, show: function() { var offset = $(input).offset(); element.css({ width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), top: offset.top + input.offsetHeight, left: offset.left }).show(); if (options.scroll) { list.scrollTop(0); list.css({ maxHeight: options.scrollHeight, overflow: 'auto' }); if ($.browser.msie && typeof document.body.style.maxHeight === "undefined") { var listHeight = 0; listItems.each(function() { listHeight += this.offsetHeight; }); var scrollbarsVisible = listHeight > options.scrollHeight; list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight); if (!scrollbarsVisible) { listItems.width(list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right"))); } } } }, selected: function() { var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); return selected && selected.length && $.data(selected[0], "ac_data"); }, emptyList: function() { list && list.empty(); }, unbind: function() { element && element.remove(); } }; }; $.fn.selection = function(start, end) { if (start !== undefined) { return this.each(function() { if (this.createTextRange) { var selRange = this.createTextRange(); if (end === undefined || start == end) { selRange.move("character", start); selRange.select(); } else { selRange.collapse(true); selRange.moveStart("character", start); selRange.moveEnd("character", end); selRange.select(); } } else if (this.setSelectionRange) { this.setSelectionRange(start, end); } else if (this.selectionStart) { this.selectionStart = start; this.selectionEnd = end; } }); } var field = this[0]; if (field.createTextRange) { var range = document.selection.createRange(), orig = field.value, teststring = "<->", textLength = range.text.length; range.text = teststring; var caretAt = field.value.indexOf(teststring); field.value = orig; this.selection(caretAt, caretAt + textLength); return { start: caretAt, end: caretAt + textLength} } else if (field.selectionStart !== undefined) { return { start: field.selectionStart, end: field.selectionEnd} } };
})(jQuery);

/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-07-21 18:45:56 -0500 (Sat, 21 Jul 2007) $
 * $Rev: 2447 $
 *
 * Version 2.1.1
 */
/*(function($) {
    $.fn.bgIframe = $.fn.bgiframe = function(s) {
        if ($.browser.msie && /6.0/.test(navigator.userAgent)) {
            s = $.extend({
                top: 'auto',
                left: 'auto',
                width: 'auto',
                height: 'auto',
                opacity: true,
                src: 'javascript:false;'
            }, s || {});
            var prop = function(n) {
                return n && n.constructor == Number ? n + 'px' : n;
            },
                html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + s.src + '"' + 'style="display:block;position:absolute;z-index:-1;' + (s.opacity !== false ? 'filter:Alpha(Opacity=\'0\');' : '') + 'top:' + (s.top == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')' : prop(s.top)) + ';' + 'left:' + (s.left == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')' : prop(s.left)) + ';' + 'width:' + (s.width == 'auto' ? 'expression(this.parentNode.offsetWidth+\'px\')' : prop(s.width)) + ';' + 'height:' + (s.height == 'auto' ? 'expression(this.parentNode.offsetHeight+\'px\')' : prop(s.height)) + ';' + '"/>';
            return this.each(function() {
                if ($('> iframe.bgiframe', this).length == 0) {
                    this.insertBefore(document.createElement(html), this.firstChild);
                }
            });
        }
        return this;
    };
})(jQuery);*/


/*!
* liScroll 1.0
* Examples and documentation at: 
* http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html
* 2007-2010 Gian Carlo Mingati
* Version: 1.0.2 (30-MARCH-2009)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Requires:
* jQuery v1.2.x or later
* 
*/
jQuery.fn.liScroll = function(a) { a = jQuery.extend({ travelocity: 0.07 }, a); return this.each(function() { var c = jQuery(this); c.addClass("newsticker"); var f = 0; var i = c.wrap("<div class='mask'></div>"); var e = c.parent().wrap("<div class='tickercontainer'></div>"); var g = c.parent().parent().width(); c.find("li").each(function(j) { f += jQuery(this, j).outerWidth(true) }); c.width(f); var d = f + g; var b = d / a.travelocity; function h(k, j) { c.animate({ left: "-=" + k }, j, "linear", function() { c.css("left", g); h(d, b) }) } h(d, b); c.hover(function() { jQuery(this).stop() }, function() { var l = jQuery(this).offset(); var j = l.left + f; var k = j / a.travelocity; h(j, k) }) }) };

/*
* jQuery UI Stars v3.0.1
* http://plugins.jquery.com/project/Star_Rating_widget
*
* Copyright (c) 2010 Marek "Orkan" Zajac (orkans@gmail.com)
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*
* $Rev: 164 $
* $Date:: 2010-05-01 #$
* $Build: 35 (2010-05-01)
*
* Depends:
*	jquery.ui.core.js
*	jquery.ui.widget.js
*
*/
(function(A) { A.widget("ui.stars", { options: { inputType: "radio", split: 0, disabled: false, cancelTitle: "Cancel Rating", cancelValue: 0, cancelShow: true, disableValue: true, oneVoteOnly: false, showTitles: false, captionEl: null, callback: null, starWidth: 16, cancelClass: "ui-stars-cancel", starClass: "ui-stars-star", starOnClass: "ui-stars-star-on", starHoverClass: "ui-stars-star-hover", starDisabledClass: "ui-stars-star-disabled", cancelHoverClass: "ui-stars-cancel-hover", cancelDisabledClass: "ui-stars-cancel-disabled" }, _create: function() { var C = this, F = this.options, B = 0; this.element.data("former.stars", this.element.html()); F.isSelect = F.inputType == "select"; this.$form = A(this.element).closest("form"); this.$selec = F.isSelect ? A("select", this.element) : null; this.$rboxs = F.isSelect ? A("option", this.$selec) : A(":radio", this.element); this.$stars = this.$rboxs.map(function(I) { var J = { value: this.value, title: (F.isSelect ? this.text : this.title) || this.value, isDefault: (F.isSelect && this.defaultSelected) || this.defaultChecked }; if (I == 0) { F.split = typeof F.split != "number" ? 0 : F.split; F.val2id = []; F.id2val = []; F.id2title = []; F.name = F.isSelect ? C.$selec.get(0).name : this.name; F.disabled = F.disabled || (F.isSelect ? A(C.$selec).attr("disabled") : A(this).attr("disabled")) } if (J.value == F.cancelValue) { F.cancelTitle = J.title; return null } F.val2id[J.value] = B; F.id2val[B] = J.value; F.id2title[B] = J.title; if (J.isDefault) { F.checked = B; F.value = F.defaultValue = J.value; F.title = J.title } var H = A("<div/>").addClass(F.starClass); var K = A("<a/>").attr("title", F.showTitles ? J.title : "").text(J.value); if (F.split) { var G = (B % F.split); var L = Math.floor(F.starWidth / F.split); H.width(L); K.css("margin-left", "-" + (G * L) + "px") } B++; return H.append(K).get(0) }); F.items = B; F.isSelect ? this.$selec.remove() : this.$rboxs.remove(); this.$cancel = A("<div/>").addClass(F.cancelClass).append(A("<a/>").attr("title", F.showTitles ? F.cancelTitle : "").text(F.cancelValue)); F.cancelShow &= !F.disabled && !F.oneVoteOnly; F.cancelShow && this.element.append(this.$cancel); this.element.append(this.$stars); if (F.checked === undefined) { F.checked = -1; F.value = F.defaultValue = F.cancelValue; F.title = "" } this.$value = A("<input type='hidden' name='" + F.name + "' value='" + F.value + "' />"); this.element.append(this.$value); this.$stars.bind("click.stars", function(H) { if (!F.forceSelect && F.disabled) { return false } var G = C.$stars.index(this); F.checked = G; F.value = F.id2val[G]; F.title = F.id2title[G]; C.$value.attr({ disabled: F.disabled ? "disabled" : "", value: F.value }); D(G, false); C._disableCancel(); !F.forceSelect && C.callback(H, "star") }).bind("mouseover.stars", function() { if (F.disabled) { return false } var G = C.$stars.index(this); D(G, true) }).bind("mouseout.stars", function() { if (F.disabled) { return false } D(C.options.checked, false) }); this.$cancel.bind("click.stars", function(G) { if (!F.forceSelect && (F.disabled || F.value == F.cancelValue)) { return false } F.checked = -1; F.value = F.cancelValue; F.title = ""; C.$value.val(F.value); F.disableValue && C.$value.attr({ disabled: "disabled" }); E(); C._disableCancel(); !F.forceSelect && C.callback(G, "cancel") }).bind("mouseover.stars", function() { if (C._disableCancel()) { return false } C.$cancel.addClass(F.cancelHoverClass); E(); C._showCap(F.cancelTitle) }).bind("mouseout.stars", function() { if (C._disableCancel()) { return false } C.$cancel.removeClass(F.cancelHoverClass); C.$stars.triggerHandler("mouseout.stars") }); this.$form.bind("reset.stars", function() { !F.disabled && C.select(F.defaultValue) }); A(window).unload(function() { C.$cancel.unbind(".stars"); C.$stars.unbind(".stars"); C.$form.unbind(".stars"); C.$selec = C.$rboxs = C.$stars = C.$value = C.$cancel = C.$form = null }); function D(G, I) { if (G != -1) { var J = I ? F.starHoverClass : F.starOnClass; var H = I ? F.starOnClass : F.starHoverClass; C.$stars.eq(G).prevAll("." + F.starClass).andSelf().removeClass(H).addClass(J); C.$stars.eq(G).nextAll("." + F.starClass).removeClass(F.starHoverClass + " " + F.starOnClass); C._showCap(F.id2title[G]) } else { E() } } function E() { C.$stars.removeClass(F.starOnClass + " " + F.starHoverClass); C._showCap("") } this.select(F.value); F.disabled && this.disable() }, _disableCancel: function() { var C = this.options, B = C.disabled || C.oneVoteOnly || (C.value == C.cancelValue); if (B) { this.$cancel.removeClass(C.cancelHoverClass).addClass(C.cancelDisabledClass) } else { this.$cancel.removeClass(C.cancelDisabledClass) } this.$cancel.css("opacity", B ? 0.5 : 1); return B }, _disableAll: function() { var B = this.options; this._disableCancel(); if (B.disabled) { this.$stars.filter("div").addClass(B.starDisabledClass) } else { this.$stars.filter("div").removeClass(B.starDisabledClass) } }, _showCap: function(B) { var C = this.options; if (C.captionEl) { C.captionEl.text(B) } }, value: function() { return this.options.value }, select: function(D) { var C = this.options, B = (D == C.cancelValue) ? this.$cancel : this.$stars.eq(C.val2id[D]); C.forceSelect = true; B.triggerHandler("click.stars"); C.forceSelect = false }, selectID: function(D) { var C = this.options, B = (D == -1) ? this.$cancel : this.$stars.eq(D); C.forceSelect = true; B.triggerHandler("click.stars"); C.forceSelect = false }, enable: function() { this.options.disabled = false; this._disableAll() }, disable: function() { this.options.disabled = true; this._disableAll() }, destroy: function() { this.$form.unbind(".stars"); this.$cancel.unbind(".stars").remove(); this.$stars.unbind(".stars").remove(); this.$value.remove(); this.element.unbind(".stars").html(this.element.data("former.stars")).removeData("stars"); return this }, callback: function(C, B) { var D = this.options; D.callback && D.callback(this, B, D.value, C); D.oneVoteOnly && !D.disabled && this.disable() } }); A.extend(A.ui.stars, { version: "3.0.1" }) })(jQuery);

/*
* jQuery Watermark plugin
* Version 1.2.1 (7-DEC-2010)
* @requires jQuery v1.3 or later
*
* Examples at: http://mario.ec/static/jq-watermark/
* Copyright (c) 2010 Mario Estrada
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
*/
(function(a) { var b = a.browser.msie && a.browser.version < 8, c = 4; a.watermarker = function() { }, a.extend(a.watermarker, { defaults: { color: "#999", left: 0, top: 0, fallback: !1, animDuration: 300, minOpacity: .6 }, setDefaults: function(b) { a.extend(a.watermarker.defaults, b) }, checkVal: function(b, c, d) { b.length == 0 ? a(c).show() : a(c).hide(); return b.length > 0 }, html5_support: function() { var a = document.createElement("input"); return "placeholder" in a } }), a.fn.watermark = function(d, e) { var e, f; e = a.extend(a.watermarker.defaults, e), f = this.filter("textarea, input:not(:checkbox,:radio,:file,:submit,:reset)"); if (!e.fallback || !a.watermarker.html5_support()) { f.each(function() { var f, g, h, i, j, k, l, m, n = 0, o, p; f = a(this), f.attr("data-jq-watermark") != "processed" && (g = f.attr("placeholder") != undefined && f.attr("placeholder") != "" ? "placeholder" : "title", h = d === undefined || d === "" ? a(this).attr(g) : d, i = a('<span class="watermark_container"></span>'), j = a('<span class="watermark">' + h + "</span>"), g == "placeholder" && f.removeAttr("placeholder"), i.css({ display: "inline-block", position: "relative" }), b && i.css({ zoom: 1, display: "inline" }), f.wrap(i).attr("data-jq-watermark", "processed"), this.nodeName.toLowerCase() == "textarea" ? (e_height = f.css("line-height"), e_height = e_height === "normal" ? parseInt(f.css("font-size")) : e_height, n = f.css("padding-top") != "auto" ? parseInt(f.css("padding-top")) : 0) : (e_height = f.outerHeight(), e_height <= 0 && (e_height = f.css("padding-top") != "auto" ? parseInt(f.css("padding-top")) : 0, e_height += f.css("padding-bottom") != "auto" ? parseInt(f.css("padding-bottom")) : 0, e_height += f.css("height") != "auto" ? parseInt(f.css("height")) : 0)), n += f.css("margin-top") != "auto" ? parseInt(f.css("margin-top")) : 0, k = f.css("margin-left") != "auto" ? parseInt(f.css("margin-left")) : 0, k += f.css("padding-left") != "auto" ? parseInt(f.css("padding-left")) : 0, j.css({ position: "absolute", display: "block", fontFamily: f.css("font-family"), fontSize: f.css("font-size"), color: e.color, left: c + e.left + k, top: e.top + n, height: e_height, lineHeight: e_height + "px", textAlign: "left", pointerEvents: "none" }).data("jq_watermark_element", f), a.watermarker.checkVal(f.val(), j), j.click(function() { a(a(this).data("jq_watermark_element")).trigger("click").trigger("focus") }), f.before(j).bind("focus.jq_watermark", function() { a.watermarker.checkVal(a(this).val(), j) || j.stop().fadeTo(e.animDuration, e.minOpacity) }).bind("blur.jq_watermark change.jq_watermark", function() { a.watermarker.checkVal(a(this).val(), j) || j.stop().fadeTo(e.animDuration, 1) }).bind("keydown.jq_watermark, paste.jq_watermark", function(b) { a(j).hide() }).bind("keyup.jq_watermark", function(b) { a.watermarker.checkVal(a(this).val(), j) })) }); return this } }, a(".jq_watermark").watermark() })(jQuery)

        
