﻿$(function ()
{
    $(".fancyimg").colorbox().attr('onfocus', 'this.blur()');
    $(".fancy").colorbox({ overlayClose: false, iframe: true, innerWidth: 500, innerHeight: 500 });
    $(".fancy800700").colorbox({ overlayClose: false, iframe: true, innerWidth: 800, innerHeight: 700 });
    $(".fancy600500").colorbox({ overlayClose: false, iframe: true, innerWidth: 600, innerHeight: 500 });
    $(".fancy500400").colorbox({ overlayClose: false, iframe: true, innerWidth: 500, innerHeight: 400 });
    $(".fancy500600").colorbox({ overlayClose: false, iframe: true, innerWidth: 500, innerHeight: 600 });
    $(".youtube").colorbox({ iframe: true, innerWidth: 425, innerHeight: 344 });
    $(".frame80").colorbox({ width: "80%", height: "80%", iframe: true });
    $(".latest_img").fadeTo("slow", 0.3);
    $(".latest_img").hover(function() { $(this).fadeTo("slow", 1.0); }, function() { $(this).fadeTo("slow", 0.3); });
    $(".fancyimg img").attr('title', "按我看大圖").after('<img style="position: relative; left: -35px;"src="/images/zoom.png" alt="" title="按我看大圖"/>');
});
 /*	ColorBox v1.3.9 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 */
(function (b, gb) { var v = "none", t = "click", N = "LoadedContent", d = false, x = "resize.", o = "y", u = "auto", f = true, M = "nofollow", q = "on", n = "x"; function e(a, c) { a = a ? ' id="' + k + a + '"' : ""; c = c ? ' style="' + c + '"' : ""; return b("<div" + a + c + "/>") } function p(a, b) { b = b === n ? m.width() : m.height(); return typeof a === "string" ? Math.round(a.match(/%/) ? b / 100 * parseInt(a, 10) : parseInt(a, 10)) : a } function Q(c) { c = b.isFunction(c) ? c.call(h) : c; return a.photo || c.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i) } function cb() { for (var c in a) if (b.isFunction(a[c]) && c.substring(0, 2) !== q) a[c] = a[c].call(h); a.rel = a.rel || h.rel || M; a.href = a.href || b(h).attr("href"); a.title = a.title || h.title } function db(d) { h = d; a = b.extend({}, b(h).data(r)); cb(); if (a.rel !== M) { i = b("." + H).filter(function () { return (b(this).data(r).rel || this.rel) === a.rel }); g = i.index(h); if (g === -1) { i = i.add(h); g = i.length - 1 } } else { i = b(h); g = 0 } if (!w) { w = F = f; R = h; try { R.blur() } catch (e) { } b.event.trigger(hb); a.onOpen && a.onOpen.call(h); y.css({ opacity: +a.opacity, cursor: a.overlayClose ? "pointer" : u }).show(); a.w = p(a.initialWidth, n); a.h = p(a.initialHeight, o); c.position(0); S && m.bind(x + O + " scroll." + O, function () { y.css({ width: m.width(), height: m.height(), top: m.scrollTop(), left: m.scrollLeft() }) }).trigger("scroll." + O) } T.add(I).add(J).add(z).add(U).hide(); V.html(a.close).show(); c.slideshow(); c.load() } var eb = { transition: "elastic", speed: 300, width: d, initialWidth: "600", innerWidth: d, maxWidth: d, height: d, initialHeight: "450", innerHeight: d, maxHeight: d, scalePhotos: f, scrolling: f, inline: d, html: d, iframe: d, photo: d, href: d, title: d, rel: d, opacity: .9, preloading: f, current: "image {current} of {total}", previous: "previous", next: "next", close: "close", open: d, loop: f, slideshow: d, slideshowAuto: f, slideshowSpeed: 2500, slideshowStart: "start slideshow", slideshowStop: "stop slideshow", onOpen: d, onLoad: d, onComplete: d, onCleanup: d, onClosed: d, overlayClose: f, escKey: f, arrowKey: f }, r = "colorbox", k = "cbox", hb = k + "_open", P = k + "_load", W = k + "_complete", X = k + "_cleanup", fb = k + "_closed", G = b.browser.msie && !b.support.opacity, S = G && b.browser.version < 7, O = k + "_IE6", y, j, E, s, Y, Z, ab, bb, i, m, l, K, L, U, T, z, J, I, V, C, D, A, B, h, R, g, a, w, F, c, H = k + "Element"; c = b.fn[r] = b[r] = function (c, d) { var a = this; if (!a[0] && a.selector) return a; c = c || {}; if (d) c.onComplete = d; if (!a[0] || a.selector === undefined) { a = b("<a/>"); c.open = f } a.each(function () { b(this).data(r, b.extend({}, b(this).data(r) || eb, c)).addClass(H) }); c.open && db(a[0]); return a }; c.init = function () { var h = "hover"; m = b(gb); j = e().attr({ id: r, "class": G ? k + "IE" : "" }); y = e("Overlay", S ? "position:absolute" : "").hide(); E = e("Wrapper"); s = e("Content").append(l = e(N, "width:0; height:0"), L = e("LoadingOverlay").add(e("LoadingGraphic")), U = e("Title"), T = e("Current"), J = e("Next"), I = e("Previous"), z = e("Slideshow"), V = e("Close")); E.append(e().append(e("TopLeft"), Y = e("TopCenter"), e("TopRight")), e().append(Z = e("MiddleLeft"), s, ab = e("MiddleRight")), e().append(e("BottomLeft"), bb = e("BottomCenter"), e("BottomRight"))).children().children().css({ "float": "left" }); K = e(d, "position:absolute; width:9999px; visibility:hidden; display:none"); b("body").prepend(y, j.append(E, K)); s.children().hover(function () { b(this).addClass(h) }, function () { b(this).removeClass(h) }).addClass(h); C = Y.height() + bb.height() + s.outerHeight(f) - s.height(); D = Z.width() + ab.width() + s.outerWidth(f) - s.width(); A = l.outerHeight(f); B = l.outerWidth(f); j.css({ "padding-bottom": C, "padding-right": D }).hide(); J.click(c.next); I.click(c.prev); V.click(c.close); s.children().removeClass(h); b("." + H).live(t, function (a) { if (a.button !== 0 && typeof a.button !== "undefined" || a.ctrlKey || a.shiftKey || a.altKey) return f; else { db(this); return d } }); y.click(function () { a.overlayClose && c.close() }); b(document).bind("keydown", function (b) { if (w && a.escKey && b.keyCode === 27) { b.preventDefault(); c.close() } if (w && a.arrowKey && !F && i[1]) if (b.keyCode === 37 && (g || a.loop)) { b.preventDefault(); I.click() } else if (b.keyCode === 39 && (g < i.length - 1 || a.loop)) { b.preventDefault(); J.click() } }) }; c.remove = function () { j.add(y).remove(); b("." + H).die(t).removeData(r).removeClass(H) }; c.position = function (f, b) { function c(a) { Y[0].style.width = bb[0].style.width = s[0].style.width = a.style.width; L[0].style.height = L[1].style.height = s[0].style.height = Z[0].style.height = ab[0].style.height = a.style.height } var e, h = Math.max(m.height() - a.h - A - C, 0) / 2 + m.scrollTop(), g = Math.max(m.width() - a.w - B - D, 0) / 2 + m.scrollLeft(); e = j.width() === a.w + B && j.height() === a.h + A ? 0 : f; E[0].style.width = E[0].style.height = "9999px"; j.dequeue().animate({ width: a.w + B, height: a.h + A, top: h, left: g }, { duration: e, complete: function () { c(this); F = d; E[0].style.width = a.w + B + D + "px"; E[0].style.height = a.h + A + C + "px"; b && b() }, step: function () { c(this) } }) }; c.resize = function (b) { if (w) { b = b || {}; if (b.width) a.w = p(b.width, n) - B - D; if (b.innerWidth) a.w = p(b.innerWidth, n); l.css({ width: a.w }); if (b.height) a.h = p(b.height, o) - A - C; if (b.innerHeight) a.h = p(b.innerHeight, o); if (!b.innerHeight && !b.height) { b = l.wrapInner("<div style='overflow:auto'></div>").children(); a.h = b.height(); b.replaceWith(b.children()) } l.css({ height: a.h }); c.position(a.transition === v ? 0 : a.speed) } }; c.prep = function (o) { var d = "hidden"; function n(t) { var o, q, s, n, d = i.length, e = a.loop; c.position(t, function () { function t() { G && j[0].style.removeAttribute("filter") } if (w) { G && p && l.fadeIn(100); a.iframe && b("<iframe frameborder=0" + (a.scrolling ? "" : " scrolling='no'") + (G ? " allowtransparency='true'" : "") + "/>").attr({ src: a.href, name: (new Date).getTime() }).appendTo(l); l.show(); U.show().html(a.title); if (d > 1) { T.html(a.current.replace(/\{current\}/, g + 1).replace(/\{total\}/, d)).show(); J[e || g < d - 1 ? "show" : "hide"]().html(a.next); I[e || g ? "show" : "hide"]().html(a.previous); o = g ? i[g - 1] : i[d - 1]; s = g < d - 1 ? i[g + 1] : i[0]; if (a.slideshow) { z.show(); g === d - 1 && !e && j.is("." + k + "Slideshow_on") && z.click() } if (a.preloading) { n = b(s).data(r).href || s.href; q = b(o).data(r).href || o.href; if (Q(n)) b("<img/>")[0].src = n; if (Q(q)) b("<img/>")[0].src = q } } L.hide(); a.transition === "fade" ? j.fadeTo(f, 1, function () { t() }) : t(); m.bind(x + k, function () { c.position(0) }); b.event.trigger(W); a.onComplete && a.onComplete.call(h) } }) } if (w) { var p, f = a.transition === v ? 0 : a.speed; m.unbind(x + k); l.remove(); l = e(N).html(o); l.hide().appendTo(K.show()).css({ width: function () { a.w = a.w || l.width(); a.w = a.mw && a.mw < a.w ? a.mw : a.w; return a.w } (), overflow: a.scrolling ? u : d }).css({ height: function () { a.h = a.h || l.height(); a.h = a.mh && a.mh < a.h ? a.mh : a.h; return a.h } () }).prependTo(s); K.hide(); b("#" + k + "Photo").css({ cssFloat: v }); S && b("select").not(j.find("select")).filter(function () { return this.style.visibility !== d }).css({ visibility: d }).one(X, function () { this.style.visibility = "inherit" }); a.transition === "fade" ? j.fadeTo(f, 0, function () { n(0) }) : n(f) } }; c.load = function () { var j, d, q, m = c.prep; F = f; h = i[g]; a = b.extend({}, b(h).data(r)); cb(); b.event.trigger(P); a.onLoad && a.onLoad.call(h); a.h = a.height ? p(a.height, o) - A - C : a.innerHeight && p(a.innerHeight, o); a.w = a.width ? p(a.width, n) - B - D : a.innerWidth && p(a.innerWidth, n); a.mw = a.w; a.mh = a.h; if (a.maxWidth) { a.mw = p(a.maxWidth, n) - B - D; a.mw = a.w && a.w < a.mw ? a.w : a.mw } if (a.maxHeight) { a.mh = p(a.maxHeight, o) - A - C; a.mh = a.h && a.h < a.mh ? a.h : a.mh } j = a.href; L.show(); if (a.inline) { e("InlineTemp").hide().insertBefore(b(j)[0]).bind(P + " " + X, function () { b(this).replaceWith(l.children()) }); m(b(j)) } else if (a.iframe) m(" "); else if (a.html) m(a.html); else if (Q(j)) { d = new Image; d.onload = function () { var e; d.onload = null; d.id = k + "Photo"; b(d).css({ margin: u, border: v, display: "block", cssFloat: "left" }); if (a.scalePhotos) { q = function () { d.height -= d.height * e; d.width -= d.width * e }; if (a.mw && d.width > a.mw) { e = (d.width - a.mw) / d.width; q() } if (a.mh && d.height > a.mh) { e = (d.height - a.mh) / d.height; q() } } if (a.h) d.style.marginTop = Math.max(a.h - d.height, 0) / 2 + "px"; setTimeout(function () { m(d) }, 1); i[1] && (g < i.length - 1 || a.loop) && b(d).css({ cursor: "pointer" }).click(c.next); if (G) d.style.msInterpolationMode = "bicubic" }; d.src = j } else e().appendTo(K).load(j, function (c, a, b) { m(a === "error" ? "Request unsuccessful: " + b.statusText : this) }) }; c.next = function () { if (!F) { g = g < i.length - 1 ? g + 1 : 0; c.load() } }; c.prev = function () { if (!F) { g = g ? g - 1 : i.length - 1; c.load() } }; c.slideshow = function () { function f() { z.text(a.slideshowStop).bind(W, function () { d = setTimeout(c.next, a.slideshowSpeed) }).bind(P, function () { clearTimeout(d) }).one(t, function () { e() }); j.removeClass(b + "off").addClass(b + q) } var e, d, b = k + "Slideshow_"; z.bind(fb, function () { z.unbind(); clearTimeout(d); j.removeClass(b + "off " + b + q) }); e = function () { clearTimeout(d); z.text(a.slideshowStart).unbind(W + " " + P).one(t, function () { f(); d = setTimeout(c.next, a.slideshowSpeed) }); j.removeClass(b + q).addClass(b + "off") }; if (a.slideshow && i[1]) a.slideshowAuto ? f() : e() }; c.close = function () { if (w) { w = d; b.event.trigger(X); a.onCleanup && a.onCleanup.call(h); m.unbind("." + k + " ." + O); y.fadeTo("fast", 0); j.stop().fadeTo("fast", 0, function () { j.find("iframe").attr("src", "about:blank"); l.remove(); j.add(y).css({ opacity: 1, cursor: u }).hide(); try { R.focus() } catch (c) { } setTimeout(function () { b.event.trigger(fb); a.onClosed && a.onClosed.call(h) }, 1) }) } }; c.element = function () { return b(h) }; c.settings = eb; b(c.init) })(jQuery, this);
 /*jquery.cycle.lite.min.js*/
 (function(D) { var A = "Lite-1.0"; D.fn.cycle = function(E) { return this.each(function() { E = E || {}; if (this.cycleTimeout) { clearTimeout(this.cycleTimeout) } this.cycleTimeout = 0; this.cyclePause = 0; var I = D(this); var J = E.slideExpr ? D(E.slideExpr, this) : I.children(); var G = J.get(); if (G.length < 2) { if (window.console && window.console.log) { window.console.log("terminating; too few slides: " + G.length) } return } var H = D.extend({}, D.fn.cycle.defaults, E || {}, D.metadata ? I.metadata() : D.meta ? I.data() : {}); H.before = H.before ? [H.before] : []; H.after = H.after ? [H.after] : []; H.after.unshift(function() { H.busy = 0 }); var F = this.className; H.width = parseInt((F.match(/w:(\d+)/) || [])[1]) || H.width; H.height = parseInt((F.match(/h:(\d+)/) || [])[1]) || H.height; H.timeout = parseInt((F.match(/t:(\d+)/) || [])[1]) || H.timeout; if (I.css("position") == "static") { I.css("position", "relative") } if (H.width) { I.width(H.width) } if (H.height && H.height != "auto") { I.height(H.height) } var K = 0; J.css({ position: "absolute", top: 0, left: 0 }).hide().each(function(M) { D(this).css("z-index", G.length - M) }); D(G[K]).css("opacity", 1).show(); if (D.browser.msie) { G[K].style.removeAttribute("filter") } if (H.fit && H.width) { J.width(H.width) } if (H.fit && H.height && H.height != "auto") { J.height(H.height) } if (H.pause) { I.hover(function() { this.cyclePause = 1 }, function() { this.cyclePause = 0 }) } D.fn.cycle.transitions.fade(I, J, H); J.each(function() { var M = D(this); this.cycleH = (H.fit && H.height) ? H.height : M.height(); this.cycleW = (H.fit && H.width) ? H.width : M.width() }); J.not(":eq(" + K + ")").css({ opacity: 0 }); if (H.cssFirst) { D(J[K]).css(H.cssFirst) } if (H.timeout) { if (H.speed.constructor == String) { H.speed = { slow: 600, fast: 200}[H.speed] || 400 } if (!H.sync) { H.speed = H.speed / 2 } while ((H.timeout - H.speed) < 250) { H.timeout += H.speed } } H.speedIn = H.speed; H.speedOut = H.speed; H.slideCount = G.length; H.currSlide = K; H.nextSlide = 1; var L = J[K]; if (H.before.length) { H.before[0].apply(L, [L, L, H, true]) } if (H.after.length > 1) { H.after[1].apply(L, [L, L, H, true]) } if (H.click && !H.next) { H.next = H.click } if (H.next) { D(H.next).bind("click", function() { return C(G, H, H.rev ? -1 : 1) }) } if (H.prev) { D(H.prev).bind("click", function() { return C(G, H, H.rev ? 1 : -1) }) } if (H.timeout) { this.cycleTimeout = setTimeout(function() { B(G, H, 0, !H.rev) }, H.timeout + (H.delay || 0)) } }) }; function B(J, E, I, K) { if (E.busy) { return } var H = J[0].parentNode, M = J[E.currSlide], L = J[E.nextSlide]; if (H.cycleTimeout === 0 && !I) { return } if (I || !H.cyclePause) { if (E.before.length) { D.each(E.before, function(N, O) { O.apply(L, [M, L, E, K]) }) } var F = function() { if (D.browser.msie) { this.style.removeAttribute("filter") } D.each(E.after, function(N, O) { O.apply(L, [M, L, E, K]) }) }; if (E.nextSlide != E.currSlide) { E.busy = 1; D.fn.cycle.custom(M, L, E, F) } var G = (E.nextSlide + 1) == J.length; E.nextSlide = G ? 0 : E.nextSlide + 1; E.currSlide = G ? J.length - 1 : E.nextSlide - 1 } if (E.timeout) { H.cycleTimeout = setTimeout(function() { B(J, E, 0, !E.rev) }, E.timeout) } } function C(E, F, I) { var H = E[0].parentNode, G = H.cycleTimeout; if (G) { clearTimeout(G); H.cycleTimeout = 0 } F.nextSlide = F.currSlide + I; if (F.nextSlide < 0) { F.nextSlide = E.length - 1 } else { if (F.nextSlide >= E.length) { F.nextSlide = 0 } } B(E, F, 1, I >= 0); return false } D.fn.cycle.custom = function(K, H, I, E) { var J = D(K), G = D(H); G.css({ opacity: 0 }); var F = function() { G.animate({ opacity: 1 }, I.speedIn, I.easeIn, E) }; J.animate({ opacity: 0 }, I.speedOut, I.easeOut, function() { J.css({ display: "none" }); if (!I.sync) { F() } }); if (I.sync) { F() } }; D.fn.cycle.transitions = { fade: function(F, G, E) { G.not(":eq(0)").css("opacity", 0); E.before.push(function() { D(this).show() }) } }; D.fn.cycle.ver = function() { return A }; D.fn.cycle.defaults = { timeout: 4000, speed: 1000, next: null, prev: null, before: null, after: null, height: "auto", sync: 1, fit: 0, pause: 0, delay: 0, slideExpr: null} })(jQuery);
 /*jquery.treeview.min.js*/
 (function($) { $.extend($.fn, { swapClass: function(c1, c2) { var c1Elements = this.filter('.' + c1); this.filter('.' + c2).removeClass(c2).addClass(c1); c1Elements.removeClass(c1).addClass(c2); return this; }, replaceClass: function(c1, c2) { return this.filter('.' + c1).removeClass(c1).addClass(c2).end(); }, hoverClass: function(className) { className = className || "hover"; return this.hover(function() { $(this).addClass(className); }, function() { $(this).removeClass(className); }); }, heightToggle: function(animated, callback) { animated ? this.animate({ height: "toggle" }, animated, callback) : this.each(function() { jQuery(this)[jQuery(this).is(":hidden") ? "show" : "hide"](); if (callback) callback.apply(this, arguments); }); }, heightHide: function(animated, callback) { if (animated) { this.animate({ height: "hide" }, animated, callback); } else { this.hide(); if (callback) this.each(callback); } }, prepareBranches: function(settings) { if (!settings.prerendered) { this.filter(":last-child:not(ul)").addClass(CLASSES.last); this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide(); } return this.filter(":has(>ul)"); }, applyClasses: function(settings, toggler) { this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) { toggler.apply($(this).next()); }).add($("a", this)).hoverClass(); if (!settings.prerendered) { this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last, CLASSES.lastExpandable); this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last, CLASSES.lastCollapsable); this.prepend("<div class=\"" + CLASSES.hitarea + "\"/>").find("div." + CLASSES.hitarea).each(function() { var classes = ""; $.each($(this).parent().attr("class").split(" "), function() { classes += this + "-hitarea "; }); $(this).addClass(classes); }); } this.find("div." + CLASSES.hitarea).click(toggler); }, treeview: function(settings) { settings = $.extend({ cookieId: "treeview" }, settings); if (settings.add) { return this.trigger("add", [settings.add]); } if (settings.toggle) { var callback = settings.toggle; settings.toggle = function() { return callback.apply($(this).parent()[0], arguments); }; } function treeController(tree, control) { function handler(filter) { return function() { toggler.apply($("div." + CLASSES.hitarea, tree).filter(function() { return filter ? $(this).parent("." + filter).length : true; })); return false; }; } $("a:eq(0)", control).click(handler(CLASSES.collapsable)); $("a:eq(1)", control).click(handler(CLASSES.expandable)); $("a:eq(2)", control).click(handler()); } function toggler() { $(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea, CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable, CLASSES.expandable).swapClass(CLASSES.lastCollapsable, CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated, settings.toggle); if (settings.unique) { $(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea, CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable, CLASSES.expandable).replaceClass(CLASSES.lastCollapsable, CLASSES.lastExpandable).find(">ul").heightHide(settings.animated, settings.toggle); } } function serialize() { function binary(arg) { return arg ? 1 : 0; } var data = []; branches.each(function(i, e) { data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0; }); $.cookie(settings.cookieId, data.join("")); } function deserialize() { var stored = $.cookie(settings.cookieId); if (stored) { var data = stored.split(""); branches.each(function(i, e) { $(e).find(">ul")[parseInt(data[i]) ? "show" : "hide"](); }); } } this.addClass("treeview"); var branches = this.find("li").prepareBranches(settings); switch (settings.persist) { case "cookie": var toggleCallback = settings.toggle; settings.toggle = function() { serialize(); if (toggleCallback) { toggleCallback.apply(this, arguments); } }; deserialize(); break; case "location": var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); }); if (current.length) { current.addClass("selected").parents("ul, li").add(current.next()).show(); } break; } branches.applyClasses(settings, toggler); if (settings.control) { treeController(this, settings.control); $(settings.control).show(); } return this.bind("add", function(event, branches) { $(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea); $(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings, toggler); }); } }); var CLASSES = $.fn.treeview.classes = { open: "open", closed: "closed", expandable: "expandable", expandableHitarea: "expandable-hitarea", lastExpandableHitarea: "lastExpandable-hitarea", collapsable: "collapsable", collapsableHitarea: "collapsable-hitarea", lastCollapsableHitarea: "lastCollapsable-hitarea", lastCollapsable: "lastCollapsable", lastExpandable: "lastExpandable", last: "last", hitarea: "hitarea" }; $.fn.Treeview = $.fn.treeview; })(jQuery);
 /*tinysort.js*/
 (function(B) { B.tinysort = { id: "TinySort", version: "1.0.2", defaults: { order: "asc", attr: "", place: "start", returns: false} }; B.fn.extend({ tinysort: function(H, I) { if (H && typeof (H) != "string") { I = H; H = null } var E = B.extend({}, B.tinysort.defaults, I); var O = {}; this.each(function(S) { var U = (!H || H == "") ? B(this) : B(this).find(H); var T = E.order == "rand" ? "" + Math.random() : (E.attr == "" ? U.text() : U.attr(E.attr)); var R = B(this).parent(); if (!O[R]) { O[R] = { s: [], n: []} } if (U.length > 0) { O[R].s.push({ s: T, e: B(this), n: S }) } else { O[R].n.push({ e: B(this), n: S }) } }); for (var G in O) { var D = O[G]; D.s.sort(function J(T, S) { var R = T.s.toLowerCase ? T.s.toLowerCase() : T.s; var U = S.s.toLowerCase ? S.s.toLowerCase() : S.s; if (C(T.s) && C(S.s)) { R = parseFloat(T.s); U = parseFloat(S.s) } return (E.order == "asc" ? 1 : -1) * (R < U ? -1 : (R > U ? 1 : 0)) }) } var L = []; for (var G in O) { var D = O[G]; var M = []; var F = B(this).length; switch (E.place) { case "first": B.each(D.s, function(R, S) { F = Math.min(F, S.n) }); break; case "org": B.each(D.s, function(R, S) { M.push(S.n) }); break; case "end": F = D.n.length; break; default: F = 0 } var P = [0, 0]; for (var K = 0; K < B(this).length; K++) { var N = K >= F && K < F + D.s.length; if (A(M, K)) { N = true } var Q = (N ? D.s : D.n)[P[N ? 0 : 1]].e; Q.parent().append(Q); if (N || !E.returns) { L.push(Q.get(0)) } P[N ? 0 : 1]++ } } return this.setArray(L) } }); function C(D) { return /^[\+-]?\d*\.?\d*$/.exec(D) } function A(E, F) { var D = false; B.each(E, function(H, G) { if (!D) { D = G == F } }); return D } B.fn.TinySort = B.fn.Tinysort = B.fn.tsort = B.fn.tinysort })(jQuery);
 /*jquery.alert.min.js*/
 (function($) { $.alerts = { verticalOffset: -75, horizontalOffset: 0, repositionOnResize: true, overlayOpacity: .01, overlayColor: "#FFF", draggable: true, okButton: "&nbsp;\u78ba\u5b9a&nbsp;", cancelButton: "&nbsp;\u53d6\u6d88&nbsp;", dialogClass: null, alert: function(type, message, title, callback) { if (title == null) title = "Alert"; $.alerts._show(title, message, null, type, function(result) { callback && callback(result) }) }, confirm: function(message, title, callback) { if (title == null) title = "Confirm"; $.alerts._show(title, message, null, "confirm", function(result) { callback && callback(result) }) }, prompt: function(message, value, title, callback) { if (title == null) title = "Prompt"; $.alerts._show(title, message, value, "prompt", function(result) { callback && callback(result) }) }, _show: function(title, msg, value, type, callback) { $.alerts._hide(); $.alerts._overlay("show"); $("BODY").append('<div id="popup_container"><h1 id="popup_title"></h1><div id="popup_content"><div id="popup_message"></div></div></div>'); $.alerts.dialogClass && $("#popup_container").addClass($.alerts.dialogClass); var pos = $.browser.msie && parseInt($.browser.version) <= 6 ? "absolute" : "fixed"; $("#popup_container").css({ position: pos, zIndex: 99999, padding: 0, margin: 0 }); $.browser.msie && parseInt($.browser.version) <= 6 && $("#popup_container").bgiframe(); $("#popup_title").text(title); $("#popup_content").addClass(type); $("#popup_message").text(msg); $("#popup_message").html($("#popup_message").text().replace(/\n/g, "<br />")); $("#popup_container").css({ minWidth: $("#popup_container").outerWidth(), maxWidth: $("#popup_container").outerWidth() }); $.alerts._reposition(); $.alerts._maintainPosition(true); switch (type) { case "info": case "warning": case "success": case "error": $("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /></div>'); $("#popup_ok").click(function() { $.alerts._hide(); callback(true) }); $("#popup_ok").focus().keypress(function(e) { (e.keyCode == 13 || e.keyCode == 27) && $("#popup_ok").trigger("click") }); break; case "confirm": $("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>'); $("#popup_ok").click(function() { $.alerts._hide(); callback && callback(true) }); $("#popup_cancel").click(function() { $.alerts._hide(); callback && callback(false) }); $("#popup_ok").focus(); $("#popup_ok, #popup_cancel").keypress(function(e) { e.keyCode == 13 && $("#popup_ok").trigger("click"); e.keyCode == 27 && $("#popup_cancel").trigger("click") }); break; case "prompt": $("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>'); $("#popup_prompt").width($("#popup_message").width()); $("#popup_ok").click(function() { var val = $("#popup_prompt").val(); $.alerts._hide(); callback && callback(val) }); $("#popup_cancel").click(function() { $.alerts._hide(); callback && callback(null) }); $("#popup_prompt, #popup_ok, #popup_cancel").keypress(function(e) { e.keyCode == 13 && $("#popup_ok").trigger("click"); e.keyCode == 27 && $("#popup_cancel").trigger("click") }); value && $("#popup_prompt").val(value); $("#popup_prompt").focus().select(); break } if ($.alerts.draggable) try { $("#popup_container").draggable({ handle: $("#popup_title") }); $("#popup_title").css({ cursor: "move" }) } catch (e) { } }, _hide: function() { $("#popup_container").remove(); $.alerts._overlay("hide"); $.alerts._maintainPosition(false) }, _overlay: function(status) { switch (status) { case "show": $.alerts._overlay("hide"); $("BODY").append('<div id="popup_overlay"></div>'); $("#popup_overlay").css({ position: "absolute", zIndex: 99998, top: "0px", left: "0px", width: "100%", height: $(window).height() + "px", background: $.alerts.overlayColor, opacity: $.alerts.overlayOpacity }); break; case "hide": $("#popup_overlay").remove(); break } }, _reposition: function() { var top = $(window).height() / 2 - $("#popup_container").outerHeight() / 2 + $.alerts.verticalOffset, left = $(window).width() / 2 - $("#popup_container").outerWidth() / 2 + $.alerts.horizontalOffset; if (top < 0) top = 0; if (left < 0) left = 0; if ($.browser.msie && parseInt($.browser.version) <= 6) top = top + $(window).scrollTop(); $("#popup_container").css({ top: top + "px", left: left + "px" }); $("#popup_overlay").height($(document).height()) }, _maintainPosition: function(status) { if ($.alerts.repositionOnResize) switch (status) { case true: $(window).bind("resize", function() { $.alerts._reposition() }); break; case false: $(window).unbind("resize"); break } } }; jAlert = function(type, message, title, callback) { $.alerts.alert(type, message, title, callback) }; jConfirm = function(message, title, callback) { $.alerts.confirm(message, title, callback) }; jPrompt = function(message, value, title, callback) { $.alerts.prompt(message, value, title, callback) } })(jQuery);
 /*jQuery.cookie*/
 jQuery.cookie = function(name, value, options) { if (typeof value != 'undefined') { options = options || {}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = ';expires=' + date.toUTCString(); } var path = options.path ? ';path=' + options.path : ''; var domain = options.domain ? ';domain=' + options.domain : ''; var secure = options.secure ? ';secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } };
 /*jquery.curvycorners.min.js*/
 (function($)
 {
     $.fn.corner = function(options)
     {
         function BlendColour(Col1, Col2, Col1Fraction) { var red1 = parseInt(Col1.substr(1, 2), 16); var green1 = parseInt(Col1.substr(3, 2), 16); var blue1 = parseInt(Col1.substr(5, 2), 16); var red2 = parseInt(Col2.substr(1, 2), 16); var green2 = parseInt(Col2.substr(3, 2), 16); var blue2 = parseInt(Col2.substr(5, 2), 16); if (Col1Fraction > 1 || Col1Fraction < 0) Col1Fraction = 1; var endRed = Math.round((red1 * Col1Fraction) + (red2 * (1 - Col1Fraction))); if (endRed > 255) endRed = 255; if (endRed < 0) endRed = 0; var endGreen = Math.round((green1 * Col1Fraction) + (green2 * (1 - Col1Fraction))); if (endGreen > 255) endGreen = 255; if (endGreen < 0) endGreen = 0; var endBlue = Math.round((blue1 * Col1Fraction) + (blue2 * (1 - Col1Fraction))); if (endBlue > 255) endBlue = 255; if (endBlue < 0) endBlue = 0; return "#" + IntToHex(endRed) + IntToHex(endGreen) + IntToHex(endBlue); } function IntToHex(strNum) { base = strNum / 16; rem = strNum % 16; base = base - (rem / 16); baseS = MakeHex(base); remS = MakeHex(rem); return baseS + '' + remS; } function MakeHex(x) { if ((x >= 0) && (x <= 9)) { return x; } else { switch (x) { case 10: return "A"; case 11: return "B"; case 12: return "C"; case 13: return "D"; case 14: return "E"; case 15: return "F"; }; return "F"; }; } function pixelFraction(x, y, r) { var pixelfraction = 0; var xvalues = new Array(1); var yvalues = new Array(1); var point = 0; var whatsides = ""; var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(x, 2))); if ((intersect >= y) && (intersect < (y + 1))) { whatsides = "Left"; xvalues[point] = 0; yvalues[point] = intersect - y; point = point + 1; }; var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(y + 1, 2))); if ((intersect >= x) && (intersect < (x + 1))) { whatsides = whatsides + "Top"; xvalues[point] = intersect - x; yvalues[point] = 1; point = point + 1; }; var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(x + 1, 2))); if ((intersect >= y) && (intersect < (y + 1))) { whatsides = whatsides + "Right"; xvalues[point] = 1; yvalues[point] = intersect - y; point = point + 1; }; var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(y, 2))); if ((intersect >= x) && (intersect < (x + 1))) { whatsides = whatsides + "Bottom"; xvalues[point] = intersect - x; yvalues[point] = 0; }; switch (whatsides) { case "LeftRight": pixelfraction = Math.min(yvalues[0], yvalues[1]) + ((Math.max(yvalues[0], yvalues[1]) - Math.min(yvalues[0], yvalues[1])) / 2); break; case "TopRight": pixelfraction = 1 - (((1 - xvalues[0]) * (1 - yvalues[1])) / 2); break; case "TopBottom": pixelfraction = Math.min(xvalues[0], xvalues[1]) + ((Math.max(xvalues[0], xvalues[1]) - Math.min(xvalues[0], xvalues[1])) / 2); break; case "LeftBottom": pixelfraction = (yvalues[0] * xvalues[1]) / 2; break; default: pixelfraction = 1; }; return pixelfraction; } function rgb2Hex(rgbColour) { try { var rgbArray = rgb2Array(rgbColour); var red = parseInt(rgbArray[0]); var green = parseInt(rgbArray[1]); var blue = parseInt(rgbArray[2]); var hexColour = "#" + IntToHex(red) + IntToHex(green) + IntToHex(blue); } catch (e) { alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex"); }; return hexColour; } function rgb2Array(rgbColour) { var rgbValues = rgbColour.substring(4, rgbColour.indexOf(")")); var rgbArray = rgbValues.split(", "); return rgbArray; } function format_colour(colour)
         {
             var returnColour = "transparent"; if (colour != "" && colour != "transparent")
             {
                 if (colour.substr(0, 3) == "rgb" && colour.substr(0, 4) != "rgba") { returnColour = rgb2Hex(colour); } else if (colour.length == 4) { returnColour = "#" + colour.substring(1, 2) + colour.substring(1, 2) + colour.substring(2, 3) + colour.substring(2, 3) + colour.substring(3, 4) + colour.substring(3, 4); } else
                 { returnColour = colour; };
             }; return returnColour;
         }; function strip_px(value) { return parseInt(((value != "auto" && value.indexOf("%") == -1 && value != "" && value.indexOf("px") !== -1) ? value.slice(0, value.indexOf("px")) : 0)) } function drawPixel(box, intx, inty, colour, transAmount, height, newCorner, image, bgImage, cornerRadius, isBorder, borderWidth, boxWidth, settings)
         {
             var $$ = $(box); var pixel = document.createElement("div"); $(pixel).css({ height: height, width: "1px", position: "absolute", "font-size": "1px", overflow: "hidden" }); var topMaxRadius = Math.max(settings.tl ? settings.tl.radius : 0, settings.tr ? settings.tr.radius : 0); if (image == -1 && bgImage != "")
             {
                 if (topMaxRadius > 0) $(pixel).css("background-position", "-" + ((boxWidth - cornerRadius - borderWidth) + intx) + "px -" + (($$.height() + topMaxRadius - borderWidth) - inty) + "px"); else
                     $(pixel).css("background-position", "-" + ((boxWidth - cornerRadius - borderWidth) + intx) + "px -" + (($$.height()) - inty) + "px"); $(pixel).css({ "background-image": bgImage, "background-repeat": $$.css("background-repeat"), "background-color": colour });
             } else
             { if (!isBorder) $(pixel).css("background-color", colour).addClass('hasBackgroundColor'); else $(pixel).css("background-color", colour); }; if (transAmount != 100) setOpacity(pixel, transAmount); $(pixel).css({ top: inty + "px", left: intx + "px" }); return pixel;
         }; function setOpacity(obj, opacity) { opacity = (opacity == 100) ? 99.999 : opacity; if ($.browser.safari && obj.tagName != "IFRAME") { var rgbArray = rgb2Array(obj.style.backgroundColor); var red = parseInt(rgbArray[0]); var green = parseInt(rgbArray[1]); var blue = parseInt(rgbArray[2]); obj.style.backgroundColor = "rgba(" + red + ", " + green + ", " + blue + ", " + opacity / 100 + ")"; } else if (typeof (obj.style.opacity) != "undefined") { obj.style.opacity = opacity / 100; } else if (typeof (obj.style.MozOpacity) != "undefined") { obj.style.MozOpacity = opacity / 100; } else if (typeof (obj.style.filter) != "undefined") { obj.style.filter = "alpha(opacity:" + opacity + ")"; } else if (typeof (obj.style.KHTMLOpacity) != "undefined") { obj.style.KHTMLOpacity = opacity / 100; } } function applyCorners(box, settings)
         {
             var $$ = $(box); var thebgImage = $$.css("backgroundImage"); var topContainer = null; var bottomContainer = null; var masterCorners = new Array(); var contentDIV = null; var boxHeight = strip_px($$.css("height")) ? strip_px($$.css("height")) : box.scrollHeight; var boxWidth = strip_px($$.css("width")) ? strip_px($$.css("width")) : box.scrollWidth; var borderWidth = strip_px($$.css("borderTopWidth")) ? strip_px($$.css("borderTopWidth")) : 0; var boxPaddingTop = strip_px($$.css("paddingTop")); var boxPaddingBottom = strip_px($$.css("paddingBottom")); var boxPaddingLeft = strip_px($$.css("paddingLeft")); var boxPaddingRight = strip_px($$.css("paddingRight")); var boxColour = format_colour($$.css("backgroundColor")); var bgImage = (thebgImage != "none" && thebgImage != "initial") ? thebgImage : ""; var borderColour = format_colour($$.css("borderTopColor")); var borderString = borderWidth + "px" + " solid " + borderColour; var topMaxRadius = Math.max(settings.tl ? settings.tl.radius : 0, settings.tr ? settings.tr.radius : 0); var botMaxRadius = Math.max(settings.bl ? settings.bl.radius : 0, settings.br ? settings.br.radius : 0); $$.addClass('hasCorners').css({ "padding": "0", "borderColor": box.style.borderColour, 'overflow': 'visible' }); if (box.style.position != "absolute") $$.css("position", "relative"); if (($.browser.msie)) { if ($.browser.version == 6 && box.style.width == "auto" && box.style.height == "auto") $$.css("width", "100%"); $$.css("zoom", "1"); $("*", $$).css("zoom", "normal"); } for (var t = 0; t < 2; t++) { switch (t) { case 0: if (settings.tl || settings.tr) { var newMainContainer = document.createElement("div"); topContainer = box.appendChild(newMainContainer); $(topContainer).css({ width: "100%", "font-size": "1px", overflow: "hidden", position: "absolute", "padding-left": borderWidth, "padding-right": borderWidth, height: topMaxRadius + "px", top: 0 - topMaxRadius + "px", left: 0 - borderWidth + "px" }).addClass('topContainer'); }; break; case 1: if (settings.bl || settings.br) { var newMainContainer = document.createElement("div"); bottomContainer = box.appendChild(newMainContainer); $(bottomContainer).css({ width: "100%", "font-size": "1px", overflow: "hidden", position: "absolute", "padding-left": borderWidth, "padding-right": borderWidth, height: botMaxRadius, bottom: 0 - botMaxRadius + "px", left: 0 - borderWidth + "px" }).addClass('bottomContainer'); }; break; }; }; if (settings.autoPad == true) { var contentContainer = document.createElement("div"); var contentContainer2 = document.createElement("div"); var clearDiv = document.createElement("div"); $(contentContainer2).css({ margin: "0", "padding-bottom": boxPaddingBottom, "padding-top": boxPaddingTop, "padding-left": boxPaddingLeft, "padding-right": boxPaddingRight, 'overflow': 'visible' }).addClass('hasBackgroundColor content_container'); $(contentContainer).css({ position: "relative", 'float': "left", width: "100%", "margin-top": "-" + Math.abs(topMaxRadius - borderWidth) + "px", "margin-bottom": "-" + Math.abs(botMaxRadius - borderWidth) + "px" }).addClass = "autoPadDiv"; $(clearDiv).css("clear", "both"); contentContainer2.appendChild(contentContainer); contentContainer2.appendChild(clearDiv); $$.wrapInner(contentContainer2); }; if (topContainer) $$.css("border-top", 0); if (bottomContainer) $$.css("border-bottom", 0); var corners = ["tr", "tl", "br", "bl"]; for (var i in corners)
             {
                 if (i > -1 < 4)
                 {
                     var cc = corners[i]; if (!settings[cc])
                     {
                         if (((cc == "tr" || cc == "tl") && topContainer != null) || ((cc == "br" || cc == "bl") && bottomContainer != null))
                         {
                             var newCorner = document.createElement("div"); $(newCorner).css({ position: "relative", "font-size": "1px", overflow: "hidden" }); if (bgImage == "") $(newCorner).css("background-color", boxColour); else
                                 $(newCorner).css("background-image", bgImage).css("background-color", boxColour); ; switch (cc)
                             {
                                 case "tl": $(newCorner).css({ height: topMaxRadius - borderWidth, "margin-right": settings.tr.radius - (borderWidth * 2), "border-left": borderString, "border-top": borderString, left: -borderWidth + "px", "background-repeat": $$.css("background-repeat"), "background-position": borderWidth + "px 0px" }); break; case "tr": $(newCorner).css({ height: topMaxRadius - borderWidth, "margin-left": settings.tl.radius - (borderWidth * 2), "border-right": borderString, "border-top": borderString, left: borderWidth + "px", "background-repeat": $$.css("background-repeat"), "background-position": "-" + (topMaxRadius + borderWidth) + "px 0px" }); break; case "bl": if (topMaxRadius > 0) $(newCorner).css({ height: botMaxRadius - borderWidth, "margin-right": settings.br.radius - (borderWidth * 2), "border-left": borderString, "border-bottom": borderString, left: -borderWidth + "px", "background-repeat": $$.css("background-repeat"), "background-position": "0px -" + ($$.height() + topMaxRadius - borderWidth + 1) + "px" }); else
                                         $(newCorner).css({ height: botMaxRadius - borderWidth, "margin-right": settings.br.radius - (borderWidth * 2), "border-left": borderString, "border-bottom": borderString, left: -borderWidth + "px", "background-repeat": $$.css("background-repeat"), "background-position": "0px -" + ($$.height()) + "px" }); break; case "br": if (topMaxRadius > 0) $(newCorner).css({ height: botMaxRadius - borderWidth, "margin-left": settings.bl.radius - (borderWidth * 2), "border-right": borderString, "border-bottom": borderString, left: borderWidth + "px", "background-repeat": $$.css("background-repeat"), "background-position": "-" + settings.bl.radius + borderWidth + "px -" + ($$.height() + topMaxRadius - borderWidth + 1) + "px" }); else
                                         $(newCorner).css({ height: botMaxRadius - borderWidth, "margin-left": settings.bl.radius - (borderWidth * 2), "border-right": borderString, "border-bottom": borderString, left: borderWidth + "px", "background-repeat": $$.css("background-repeat"), "background-position": "-" + settings.bl.radius + borderWidth + "px -" + ($$.height()) + "px" }); break;
                             };
                         };
                     } else
                     {
                         if (masterCorners[settings[cc].radius]) { var newCorner = masterCorners[settings[cc].radius].cloneNode(true); } else
                         {
                             var newCorner = document.createElement("DIV"); $(newCorner).css({ height: settings[cc].radius, width: settings[cc].radius, position: "absolute", "font-size": "1px", overflow: "hidden" }); var borderRadius = parseInt(settings[cc].radius - borderWidth); for (var intx = 0, j = settings[cc].radius; intx < j; intx++)
                             {
                                 if ((intx + 1) >= borderRadius) var y1 = -1; else
                                     var y1 = (Math.floor(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow((intx + 1), 2))) - 1); if (borderRadius != j)
                                 {
                                     if ((intx) >= borderRadius) var y2 = -1; else
                                         var y2 = Math.ceil(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow(intx, 2))); if ((intx + 1) >= j) var y3 = -1; else
                                         var y3 = (Math.floor(Math.sqrt(Math.pow(j, 2) - Math.pow((intx + 1), 2))) - 1);
                                 }; if ((intx) >= j) var y4 = -1; else
                                     var y4 = Math.ceil(Math.sqrt(Math.pow(j, 2) - Math.pow(intx, 2))); if (y1 > -1) newCorner.appendChild(drawPixel(box, intx, 0, boxColour, 100, (y1 + 1), newCorner, -1, bgImage, settings[cc].radius, 0, borderWidth, boxWidth, settings)); if (borderRadius != j) { for (var inty = (y1 + 1); inty < y2; inty++) { if (settings.antiAlias) { if (bgImage != "") { var borderFract = (pixelFraction(intx, inty, borderRadius) * 100); if (borderFract < 30) { newCorner.appendChild(drawPixel(box, intx, inty, borderColour, 100, 1, newCorner, 0, bgImage, settings[cc].radius, 1, borderWidth, boxWidth, settings)); } else { newCorner.appendChild(drawPixel(box, intx, inty, borderColour, 100, 1, newCorner, -1, bgImage, settings[cc].radius, 1, borderWidth, boxWidth, settings)); }; } else { var pixelcolour = BlendColour(boxColour, borderColour, pixelFraction(intx, inty, borderRadius)); newCorner.appendChild(drawPixel(box, intx, inty, pixelcolour, 100, 1, newCorner, 0, bgImage, settings[cc].radius, cc, 1, borderWidth, boxWidth, settings)); }; }; }; if (settings.antiAlias) { if (y3 >= y2) { if (y2 == -1) y2 = 0; newCorner.appendChild(drawPixel(box, intx, y2, borderColour, 100, (y3 - y2 + 1), newCorner, 0, bgImage, 0, 1, borderWidth, boxWidth, settings)); } } else { if (y3 >= y1) { newCorner.appendChild(drawPixel(box, intx, (y1 + 1), borderColour, 100, (y3 - y1), newCorner, 0, bgImage, 0, 1, borderWidth, boxWidth, settings)); } }; var outsideColour = borderColour; } else { var outsideColour = boxColour; var y3 = y1; }; if (settings.antiAlias) { for (var inty = (y3 + 1); inty < y4; inty++) { newCorner.appendChild(drawPixel(box, intx, inty, outsideColour, (pixelFraction(intx, inty, j) * 100), 1, newCorner, ((borderWidth > 0) ? 0 : -1), bgImage, settings[cc].radius, 1, borderWidth, boxWidth, settings)); }; };
                             }; masterCorners[settings[cc].radius] = newCorner.cloneNode(true);
                         }; if (cc != "br")
                         {
                             for (var t = 0, k = newCorner.childNodes.length; t < k; t++)
                             {
                                 var pixelBar = newCorner.childNodes[t]; var pixelBarTop = strip_px($(pixelBar).css("top")); var pixelBarLeft = strip_px($(pixelBar).css("left")); var pixelBarHeight = strip_px($(pixelBar).css("height")); if (cc == "tl" || cc == "bl") { $(pixelBar).css("left", settings[cc].radius - pixelBarLeft - 1 + "px"); }; if (cc == "tr" || cc == "tl") { $(pixelBar).css("top", settings[cc].radius - pixelBarHeight - pixelBarTop + "px"); }; switch (cc)
                                 {
                                     case "tr": $(pixelBar).css("background-position", "-" + Math.abs((boxWidth - settings[cc].radius + borderWidth) + pixelBarLeft) + "px -" + Math.abs(settings[cc].radius - pixelBarHeight - pixelBarTop - borderWidth) + "px"); break; case "tl": $(pixelBar).css("background-position", "-" + Math.abs((settings[cc].radius - pixelBarLeft - 1) - borderWidth) + "px -" + Math.abs(settings[cc].radius - pixelBarHeight - pixelBarTop - borderWidth) + "px"); break; case "bl": if (topMaxRadius > 0) $(pixelBar).css("background-position", "-" + Math.abs((settings[cc].radius - pixelBarLeft - 1) - borderWidth) + "px -" + Math.abs(($$.height() + topMaxRadius - borderWidth + 1)) + "px"); else
                                             $(pixelBar).css("background-position", "-" + Math.abs((settings[cc].radius - pixelBarLeft - 1) - borderWidth) + "px -" + Math.abs(($$.height())) + "px"); break;
                                 };
                             };
                         };
                     }; if (newCorner) { switch (cc) { case "tl": if ($(newCorner).css("position") == "absolute") $(newCorner).css("top", "0"); if ($(newCorner).css("position") == "absolute") $(newCorner).css("left", "0"); if (topContainer) topContainer.appendChild(newCorner); break; case "tr": if ($(newCorner).css("position") == "absolute") $(newCorner).css("top", "0"); if ($(newCorner).css("position") == "absolute") $(newCorner).css("right", "0"); if (topContainer) topContainer.appendChild(newCorner); break; case "bl": if ($(newCorner).css("position") == "absolute") $(newCorner).css("bottom", "0"); if (newCorner.style.position == "absolute") $(newCorner).css("left", "0"); if (bottomContainer) bottomContainer.appendChild(newCorner); break; case "br": if ($(newCorner).css("position") == "absolute") $(newCorner).css("bottom", "0"); if ($(newCorner).css("position") == "absolute") $(newCorner).css("right", "0"); if (bottomContainer) bottomContainer.appendChild(newCorner); break; }; };
                 };
             }; var radiusDiff = new Array(); radiusDiff["t"] = Math.abs(settings.tl.radius - settings.tr.radius); radiusDiff["b"] = Math.abs(settings.bl.radius - settings.br.radius); for (z in radiusDiff)
             {
                 if (z == "t" || z == "b")
                 {
                     if (radiusDiff[z]) { var smallerCornerType = ((settings[z + "l"].radius < settings[z + "r"].radius) ? z + "l" : z + "r"); var newFiller = document.createElement("div"); $(newFiller).css({ height: radiusDiff[z], width: settings[smallerCornerType].radius + "px", position: "absolute", "font-size": "1px", overflow: "hidden", "background-color": boxColour, "background-image": bgImage }); switch (smallerCornerType) { case "tl": $(newFiller).css({ "bottom": "0", "left": "0", "border-left": borderString, "background-position": "0px -" + (settings[smallerCornerType].radius - borderWidth) }); topContainer.appendChild(newFiller); break; case "tr": $(newFiller).css({ "bottom": "0", "right": "0", "border-right": borderString, "background-position": "0px -" + (settings[smallerCornerType].radius - borderWidth) + "px" }); topContainer.appendChild(newFiller); break; case "bl": $(newFiller).css({ "top": "0", "left": "0", "border-left": borderString, "background-position": "0px -" + ($$.height() + settings[smallerCornerType].radius - borderWidth) }); bottomContainer.appendChild(newFiller); break; case "br": $(newFiller).css({ "top": "0", "right": "0", "border-right": borderString, "background-position": "0px -" + ($$.height() + settings[smallerCornerType].radius - borderWidth) }); bottomContainer.appendChild(newFiller); break; } }; var newFillerBar = document.createElement("div"); $(newFillerBar).css({ position: "relative", "font-size": "1px", overflow: "hidden", "background-color": boxColour, "background-image": bgImage, "background-repeat": $$.css("background-repeat") }); switch (z)
                     {
                         case "t": if (topContainer) { if (settings.tl.radius && settings.tr.radius) { $(newFillerBar).css({ height: topMaxRadius - borderWidth + "px", "margin-left": settings.tl.radius - borderWidth + "px", "margin-right": settings.tr.radius - borderWidth + "px", "border-top": borderString }).addClass('hasBackgroundColor'); if (bgImage != "") $(newFillerBar).css("background-position", "-" + (topMaxRadius + borderWidth) + "px 0px"); topContainer.appendChild(newFillerBar); }; $$.css("background-position", "0px -" + (topMaxRadius - borderWidth + 1) + "px"); }; break; case "b": if (bottomContainer)
                             {
                                 if (settings.bl.radius && settings.br.radius)
                                 {
                                     $(newFillerBar).css({ height: botMaxRadius - borderWidth + "px", "margin-left": settings.bl.radius - borderWidth + "px", "margin-right": settings.br.radius - borderWidth + "px", "border-bottom": borderString }); if (bgImage != "" && topMaxRadius > 0) $(newFillerBar).css("background-position", "-" + (settings.bl.radius - borderWidth) + "px -" + ($$.height() + topMaxRadius - borderWidth + 1) + "px"); else
                                         $(newFillerBar).css("background-position", "-" + (settings.bl.radius - borderWidth) + "px -" + ($$.height()) + "px").addClass('hasBackgroundColor'); bottomContainer.appendChild(newFillerBar);
                                 };
                             }; break;
                     };
                 };
             }; $$.prepend(topContainer); $$.prepend(bottomContainer);
         } var settings = { tl: { radius: 8 }, tr: { radius: 8 }, bl: { radius: 8 }, br: { radius: 8 }, antiAlias: true, autoPad: true, validTags: ["div"] }; if (options && typeof (options) != 'string') $.extend(settings, options); return this.each(function() { if (!$(this).is('.hasCorners')) { applyCorners(this, settings); } });
     };
 })(jQuery);
 function getParameter(queryString, parameterName) { var parameterName = parameterName + "="; if (queryString.length > 0) { begin = queryString.indexOf(parameterName); if (begin != -1) { begin += parameterName.length; end = queryString.indexOf("&", begin); if (end == -1) { end = queryString.length } return unescape(queryString.substring(begin, end)); } return "null"; } }