AJS = { BASE_URL: "", drag_obj: null, drag_elm: null, _drop_zones: [], _cur_pos: null, getScrollTop: function() { var a; if (document.documentElement && document.documentElement.scrollTop) { a = document.documentElement.scrollTop } else { if (document.body) { a = document.body.scrollTop } } return a }, addClass: function() { var c = AJS.forceArray(arguments); var b = c.pop(); var a = function(d) { if (!new RegExp("(^|\\s)" + b + "(\\s|$)").test(d.className)) { d.className += (d.className ? " " : "") + b } }; AJS.map(c, function(d) { a(d) }) }, setStyle: function() { var c = AJS.forceArray(arguments); var b = c.pop(); var a = c.pop(); AJS.map(c, function(d) { d.style[a] = AJS.getCssDim(b) }) }, extend: function(d) { var c = new this("no_init"); for (k in d) { var b = c[k]; var a = d[k]; if (b && b != a && typeof a == "function") { a = this._parentize(a, b) } c[k] = a } return new AJS.Class(c) }, log: function(a) { if (window.console) { console.log(a) } else { var b = AJS.$("ajs_logger"); if (!b) { b = AJS.DIV({ id: "ajs_logger", style: "color: green; position: absolute; left: 0" }); b.style.top = AJS.getScrollTop() + "px"; AJS.ACN(AJS.getBody(), b) } AJS.setHTML(b, "" + a) } }, setHeight: function() { var a = AJS.forceArray(arguments); a.splice(a.length - 1, 0, "height"); AJS.setStyle.apply(null, a) }, _getRealScope: function(a, c) { c = AJS.$A(c); var b = a._cscope || window; return function() { var d = AJS.$FA(arguments).concat(c); return a.apply(b, d) } }, documentInsert: function(a) { if (typeof (a) == "string") { a = AJS.HTML2DOM(a) } document.write('<span id="dummy_holder"></span>'); AJS.swapDOM(AJS.$("dummy_holder"), a) }, getWindowSize: function(c) { c = c || document; var b, a; if (self.innerHeight) { b = self.innerWidth; a = self.innerHeight } else { if (c.documentElement && c.documentElement.clientHeight) { b = c.documentElement.clientWidth; a = c.documentElement.clientHeight } else { if (c.body) { b = c.body.clientWidth; a = c.body.clientHeight } } } return { w: b, h: a} }, flattenList: function(b) { var c = []; var a = function(e, d) { AJS.map(d, function(f) { if (f == null) { } else { if (AJS.isArray(f)) { a(e, f) } else { e.push(f) } } }) }; a(c, b); return c }, isFunction: function(a) { return (typeof a == "function") }, setEventKey: function(a) { a.key = a.keyCode ? a.keyCode : a.charCode; if (window.event) { a.ctrl = window.event.ctrlKey; a.shift = window.event.shiftKey } else { a.ctrl = a.ctrlKey; a.shift = a.shiftKey } switch (a.key) { case 63232: a.key = 38; break; case 63233: a.key = 40; break; case 63235: a.key = 39; break; case 63234: a.key = 37; break } }, removeElement: function() { var a = AJS.forceArray(arguments); AJS.map(a, function(b) { AJS.swapDOM(b, null) }) }, _unloadListeners: function() { if (AJS.listeners) { AJS.map(AJS.listeners, function(c, b, a) { AJS.REV(c, b, a) }) } AJS.listeners = [] }, join: function(b, a) { try { return a.join(b) } catch (d) { var c = a[0] || ""; AJS.map(a, function(e) { c += b + e }, 1); return c + "" } }, getIndex: function(d, c, b) { for (var a = 0; a < c.length; a++) { if (b && b(c[a]) || d == c[a]) { return a } } return -1 }, isIn: function(c, a) { var b = AJS.getIndex(c, a); if (b != -1) { return true } else { return false } }, isArray: function(a) { return a instanceof Array }, setLeft: function() { var a = AJS.forceArray(arguments); a.splice(a.length - 1, 0, "left"); AJS.setStyle.apply(null, a) }, appendChildNodes: function(a) { if (arguments.length >= 2) { AJS.map(arguments, function(b) { if (AJS.isString(b)) { b = AJS.TN(b) } if (AJS.isDefined(b)) { a.appendChild(b) } }, 1) } return a }, getElementsByTagAndClassName: function(g, f, d, b) { var h = []; if (!AJS.isDefined(d)) { d = document } if (!AJS.isDefined(g)) { g = "*" } var a = d.getElementsByTagName(g); var e = a.length; var c = new RegExp("(^|\\s)" + f + "(\\s|$)"); for (i = 0, j = 0; i < e; i++) { if (c.test(a[i].className) || f == null) { h[j] = a[i]; j++ } } if (b) { return h[0] } else { return h } }, isOpera: function() { return (navigator.userAgent.toLowerCase().indexOf("opera") != -1) }, isString: function(a) { return (typeof a == "string") }, hideElement: function(b) { var a = AJS.forceArray(arguments); AJS.map(a, function(c) { c.style.display = "none" }) }, setOpacity: function(b, a) { b.style.opacity = a; b.style.filter = "alpha(opacity=" + a * 100 + ")" }, insertBefore: function(b, a) { a.parentNode.insertBefore(b, a); return b }, setWidth: function() { var a = AJS.forceArray(arguments); a.splice(a.length - 1, 0, "width"); AJS.setStyle.apply(null, a) }, createArray: function(a) { if (AJS.isArray(a) && !AJS.isString(a)) { return a } else { if (!a) { return [] } else { return [a] } } }, isDict: function(b) { var a = String(b); return a.indexOf(" Object") != -1 }, isMozilla: function() { return (navigator.userAgent.toLowerCase().indexOf("gecko") != -1 && navigator.productSub >= 20030210) }, removeEventListener: function(e, d, a, c) { var b = "ajsl_" + d + a; if (!c) { c = false } a = e[b] || a; if (e["on" + d] == a) { e["on" + d] = e[b + "old"] } if (e.removeEventListener) { e.removeEventListener(d, a, c); if (AJS.isOpera()) { e.removeEventListener(d, a, !c) } } else { if (e.detachEvent) { e.detachEvent("on" + d, a) } } }, callLater: function(a, c) { var b = function() { a() }; window.setTimeout(b, c) }, setTop: function() { var a = AJS.forceArray(arguments); a.splice(a.length - 1, 0, "top"); AJS.setStyle.apply(null, a) }, _createDomShortcuts: function() { var b = ["ul", "li", "td", "tr", "th", "tbody", "table", "input", "span", "b", "a", "div", "img", "button", "h1", "h2", "h3", "h4", "h5", "h6", "br", "textarea", "form", "p", "select", "option", "optgroup", "iframe", "script", "center", "dl", "dt", "dd", "small", "pre", "i"]; var a = function(c) { AJS[c.toUpperCase()] = function() { return AJS.createDOM.apply(null, [c, arguments]) } }; AJS.map(b, a); AJS.TN = function(c) { return document.createTextNode(c) } }, addCallback: function(a) { this.callbacks.unshift(a) }, bindMethods: function(c) { for (var b in c) { var a = c[b]; if (typeof (a) == "function") { c[b] = AJS.$b(a, c) } } }, partial: function(b) { var a = AJS.$FA(arguments); a.shift(); return function() { a = a.concat(AJS.$FA(arguments)); return b.apply(window, a) } }, isNumber: function(a) { return (typeof a == "number") }, getCssDim: function(a) { if (AJS.isString(a)) { return a } else { return a + "px" } }, isIe: function() { return (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1) }, removeClass: function() { var c = AJS.forceArray(arguments); var a = c.pop(); var b = function(d) { d.className = d.className.replace(new RegExp("\\s?" + a, "g"), "") }; AJS.map(c, function(d) { b(d) }) }, setHTML: function(b, a) { b.innerHTML = a; return b }, map: function(d, f, c, a) { var e = 0, b = d.length; if (c) { e = c } if (a) { b = a } for (e; e < b; e++) { var g = f(d[e], e); if (g != undefined) { return g } } }, addEventListener: function(h, g, l, f, e) { var d = "ajsl_" + g + l; if (!e) { e = false } AJS.listeners = AJS.$A(AJS.listeners); if (AJS.isIn(g, ["keypress", "keydown", "keyup", "click"])) { var c = l; l = function(m) { AJS.setEventKey(m); return c.apply(window, arguments) } } var b = AJS.isIn(g, ["submit", "load", "scroll", "resize"]); var a = AJS.$A(h); AJS.map(a, function(n) { if (f) { var m = l; l = function(r) { AJS.REV(n, g, l); return m.apply(window, arguments) } } if (b) { var q = n["on" + g]; var o = function() { if (q) { l(arguments); return q(arguments) } else { return l(arguments) } }; n[d] = o; n[d + "old"] = q; h["on" + g] = o } else { n[d] = l; if (n.attachEvent) { n.attachEvent("on" + g, l) } else { if (n.addEventListener) { n.addEventListener(g, l, e) } } AJS.listeners.push([n, g, l]) } }) }, preloadImages: function() { AJS.AEV(window, "load", AJS.$p(function(a) { AJS.map(a, function(c) { var b = new Image(); b.src = c }) }, arguments)) }, forceArray: function(a) { var b = []; AJS.map(a, function(c) { b.push(c) }); return b }, update: function(b, a) { for (var c in a) { b[c] = a[c] } return b }, getBody: function() { return AJS.$bytc("body")[0] }, HTML2DOM: function(b, a) { var c = AJS.DIV(); c.innerHTML = b; if (a) { return c.childNodes[0] } else { return c } }, getElement: function(a) { if (AJS.isString(a) || AJS.isNumber(a)) { return document.getElementById(a) } else { return a } }, showElement: function() { var a = AJS.forceArray(arguments); AJS.map(a, function(b) { b.style.display = "" }) }, bind: function(b, c, a) { b._cscope = c; return AJS._getRealScope(b, a) }, createDOM: function(f, d) { var e = 0, c; var h = document.createElement(f); var a = d[0]; if (AJS.isDict(d[e])) { for (k in a) { c = a[k]; if (k == "style" || k == "s") { h.style.cssText = c } else { if (k == "c" || k == "class" || k == "className") { h.className = c } else { h.setAttribute(k, c) } } } e++ } if (a == null) { e = 1 } for (var b = e; b < d.length; b++) { var c = d[b]; if (c) { var g = typeof (c); if (g == "string" || g == "number") { c = AJS.TN(c) } h.appendChild(c) } } return h }, swapDOM: function(c, b) { c = AJS.getElement(c); var a = c.parentNode; if (b) { b = AJS.getElement(b); a.replaceChild(b, c) } else { a.removeChild(c) } return b }, isDefined: function(a) { return (a != "undefined" && a != null) } }; AJS.$ = AJS.getElement; AJS.$$ = AJS.getElements; AJS.$f = AJS.getFormElement; AJS.$p = AJS.partial; AJS.$b = AJS.bind; AJS.$A = AJS.createArray; AJS.DI = AJS.documentInsert; AJS.ACN = AJS.appendChildNodes; AJS.RCN = AJS.replaceChildNodes; AJS.AEV = AJS.addEventListener; AJS.REV = AJS.removeEventListener; AJS.$bytc = AJS.getElementsByTagAndClassName; AJS.$AP = AJS.absolutePosition; AJS.$FA = AJS.forceArray; AJS.addEventListener(window, "unload", AJS._unloadListeners); AJS._createDomShortcuts(); AJS.Class = function(b) { var a = function() { if (arguments[0] != "no_init") { return this.init.apply(this, arguments) } }; a.prototype = b; AJS.update(a, AJS.Class.prototype); return a }; AJS.Class.prototype = { extend: function(c) { var b = new this("no_init"); for (k in c) { var a = b[k]; var d = c[k]; if (a && a != d && typeof d == "function") { d = this._parentize(d, a) } b[k] = d } return new AJS.Class(b) }, implement: function(a) { AJS.update(this.prototype, a) }, _parentize: function(b, a) { return function() { this.parent = a; return b.apply(this, arguments) } } }; script_loaded = true; script_loaded = true; AJS.fx = { _shades: { 0: "ffffff", 1: "ffffee", 2: "ffffdd", 3: "ffffcc", 4: "ffffbb", 5: "ffffaa", 6: "ffff99" }, highlight: function(c, b) { var a = new AJS.fx.Base(); a.elm = AJS.$(c); a.options.duration = 600; a.setOptions(b); AJS.update(a, { increase: function() { if (this.now == 7) { c.style.backgroundColor = "#fff" } else { c.style.backgroundColor = "#" + AJS.fx._shades[Math.floor(this.now)] } } }); return a.custom(6, 0) }, fadeIn: function(c, a) { a = a || {}; if (!a.from) { a.from = 0; AJS.setOpacity(c, 0) } if (!a.to) { a.to = 1 } var b = new AJS.fx.Style(c, "opacity", a); return b.custom(a.from, a.to) }, fadeOut: function(b, a) { a = a || {}; if (!a.from) { a.from = 1 } if (!a.to) { a.to = 0 } a.duration = 300; var c = new AJS.fx.Style(b, "opacity", a); return c.custom(a.from, a.to) }, setWidth: function(b, a) { var c = new AJS.fx.Style(b, "width", a); return c.custom(a.from, a.to) }, setHeight: function(b, a) { var c = new AJS.fx.Style(b, "height", a); return c.custom(a.from, a.to) } }; AJS.fx.Base = new AJS.Class({ init: function(a) { this.options = { onStart: function() { }, onComplete: function() { }, transition: AJS.fx.Transitions.sineInOut, duration: 500, wait: true, fps: 50 }; AJS.update(this.options, a); AJS.bindMethods(this) }, setOptions: function(a) { AJS.update(this.options, a) }, step: function() { var a = new Date().getTime(); if (a < this.time + this.options.duration) { this.cTime = a - this.time; this.setNow() } else { setTimeout(AJS.$b(this.options.onComplete, this, [this.elm]), 10); this.clearTimer(); this.now = this.to } this.increase() }, setNow: function() { this.now = this.compute(this.from, this.to) }, compute: function(b, c) { var a = c - b; return this.options.transition(this.cTime, b, a, this.options.duration) }, clearTimer: function() { clearInterval(this.timer); this.timer = null; return this }, _start: function(a, b) { if (!this.options.wait) { this.clearTimer() } if (this.timer) { return } setTimeout(AJS.$p(this.options.onStart, this.elm), 10); this.from = a; this.to = b; this.time = new Date().getTime(); this.timer = setInterval(this.step, Math.round(1000 / this.options.fps)); return this }, custom: function(a, b) { return this._start(a, b) }, set: function(a) { this.now = a; this.increase(); return this }, setStyle: function(c, a, b) { if (this.property == "opacity") { AJS.setOpacity(c, b) } else { AJS.setStyle(c, a, b) } } }); AJS.fx.Style = AJS.fx.Base.extend({ init: function(c, a, b) { this.parent(); this.elm = c; this.setOptions(b); this.property = a }, increase: function() { this.setStyle(this.elm, this.property, this.now) } }); AJS.fx.Styles = AJS.fx.Base.extend({ init: function(b, a) { this.parent(); this.elm = AJS.$(b); this.setOptions(a); this.now = {} }, setNow: function() { for (p in this.from) { this.now[p] = this.compute(this.from[p], this.to[p]) } }, custom: function(b) { if (this.timer && this.options.wait) { return } var a = {}; var c = {}; for (p in b) { a[p] = b[p][0]; c[p] = b[p][1] } return this._start(a, c) }, increase: function() { for (var a in this.now) { this.setStyle(this.elm, a, this.now[a]) } } }); AJS.fx.Transitions = { linear: function(e, a, g, f) { return g * e / f + a }, sineInOut: function(e, a, g, f) { return -g / 2 * (Math.cos(Math.PI * e / f) - 1) + a } }; script_loaded = true; script_loaded = true; var GB_CURRENT = null; GB_hide = function(a) { GB_CURRENT.hide(a) }; GreyBox = new AJS.Class({ init: function(c) { this.use_fx = AJS.fx; this.type = "page"; this.overlay_click_close = false; this.salt = 0; this.root_dir = GB_ROOT_DIR; this.callback_fns = []; this.reload_on_close = false; this.src_loader = this.root_dir + "loader_frame.html"; var b = window.location.hostname.indexOf("www"); var a = this.src_loader.indexOf("www"); if (b != -1 && a == -1) { this.src_loader = this.src_loader.replace("://", "://www.") } if (b == -1 && a != -1) { this.src_loader = this.src_loader.replace("://www.", "://") } this.show_loading = true; AJS.update(this, c) }, addCallback: function(a) { if (a) { this.callback_fns.push(a) } }, show: function(b) { GB_CURRENT = this; this.url = b; var a = [AJS.$bytc("object"), AJS.$bytc("select")]; AJS.map(AJS.flattenList(a), function(c) { c.style.visibility = "hidden" }); this.createElements(); return false }, hide: function(a) { var b = this; AJS.callLater(function() { var e = b.callback_fns; if (e != []) { AJS.map(e, function(f) { f() }) } b.onHide(); if (b.use_fx) { var d = b.overlay; AJS.fx.fadeOut(b.overlay, { onComplete: function() { AJS.removeElement(d); d = null }, duration: 300 }); AJS.removeElement(b.g_window) } else { AJS.removeElement(b.g_window, b.overlay) } b.removeFrame(); AJS.REV(window, "scroll", _GB_setOverlayDimension); AJS.REV(window, "resize", _GB_update); var c = [AJS.$bytc("object"), AJS.$bytc("select")]; AJS.map(AJS.flattenList(c), function(f) { f.style.visibility = "visible" }); GB_CURRENT = null; if (b.reload_on_close || document.reload_on_gb_close) { window.location = window.location } if (AJS.isFunction(a)) { a() } }, 10) }, update: function() { this.setOverlayDimension(); this.setFrameSize(); this.setWindowPosition() }, createElements: function() { this.initOverlay(); this.g_window = AJS.DIV({ id: "GB_window" }); AJS.hideElement(this.g_window); AJS.getBody().insertBefore(this.g_window, this.overlay.nextSibling); this.initFrame(); this.initHook(); this.update(); var a = this; if (this.use_fx) { AJS.fx.fadeIn(this.overlay, { duration: 300, to: 0.7, onComplete: function() { a.onShow(); AJS.showElement(a.g_window); a.startLoading() } }) } else { AJS.setOpacity(this.overlay, 0.7); AJS.showElement(this.g_window); this.onShow(); this.startLoading() } AJS.AEV(window, "scroll", _GB_setOverlayDimension); AJS.AEV(window, "resize", _GB_update) }, removeFrame: function() { try { AJS.removeElement(this.iframe) } catch (a) { } this.iframe = null }, startLoading: function() { this.iframe.src = this.src_loader + "?s=" + this.salt++; AJS.showElement(this.iframe) }, setOverlayDimension: function() { var b = AJS.getWindowSize(); if (AJS.isMozilla() || AJS.isOpera()) { AJS.setWidth(this.overlay, "100%") } else { AJS.setWidth(this.overlay, b.w) } var a = Math.max(AJS.getScrollTop() + b.h, AJS.getScrollTop() + this.height); if (a < AJS.getScrollTop()) { AJS.setHeight(this.overlay, a) } else { AJS.setHeight(this.overlay, AJS.getScrollTop() + b.h) } }, initOverlay: function() { this.overlay = AJS.DIV({ id: "GB_overlay" }); if (this.overlay_click_close) { AJS.AEV(this.overlay, "click", GB_hide) } AJS.setOpacity(this.overlay, 0); AJS.getBody().insertBefore(this.overlay, AJS.getBody().firstChild) }, initFrame: function() { if (!this.iframe) { var a = { name: "GB_frame", "class": "GB_frame", frameBorder: 0 }; if (AJS.isIe()) { a.src = 'javascript:false;document.write("");' } this.iframe = AJS.IFRAME(a); this.middle_cnt = AJS.DIV({ "class": "content" }, this.iframe); this.top_cnt = AJS.DIV(); this.bottom_cnt = AJS.DIV(); AJS.ACN(this.g_window, this.top_cnt, this.middle_cnt, this.bottom_cnt) } }, onHide: function() { }, onShow: function() { }, setFrameSize: function() { }, setWindowPosition: function() { }, initHook: function() { } }); _GB_update = function() { if (GB_CURRENT) { GB_CURRENT.update() } }; _GB_setOverlayDimension = function() { if (GB_CURRENT) { GB_CURRENT.setOverlayDimension() } }; AJS.preloadImages(GB_ROOT_DIR + "indicator.gif"); script_loaded = true; var GB_SETS = {}; function decoGreyboxLinks() { var a = AJS.$bytc("a"); AJS.map(a, function(d) { if (d.getAttribute("href") && d.getAttribute("rel")) { var b = d.getAttribute("rel"); if (b.indexOf("gb_") == 0) { var f = b.match(/\w+/)[0]; var e = b.match(/\[(.*)\]/)[1]; var c = 0; var g = { caption: d.title || "", url: d.href }; if (f == "gb_pageset" || f == "gb_imageset") { if (!GB_SETS[e]) { GB_SETS[e] = [] } GB_SETS[e].push(g); c = GB_SETS[e].length } if (f == "gb_pageset") { d.onclick = function() { GB_showFullScreenSet(GB_SETS[e], c); return false } } if (f == "gb_imageset") { d.onclick = function() { GB_showImageSet(GB_SETS[e], c); return false } } if (f == "gb_image") { d.onclick = function() { GB_showImage(g.caption, g.url); return false } } if (f == "gb_page") { d.onclick = function() { var h = e.split(/, ?/); GB_show(g.caption, g.url, parseInt(h[1]), parseInt(h[0])); return false } } if (f == "gb_page_fs") { d.onclick = function() { GB_showFullScreen(g.caption, g.url); return false } } if (f == "gb_page_center") { d.onclick = function() { var h = e.split(/, ?/); GB_showCenter(g.caption, g.url, parseInt(h[1]), parseInt(h[0])); return false } } } } }) } AJS.AEV(window, "load", decoGreyboxLinks); GB_showImage = function(c, d, a) { var b = { width: 300, height: 300, type: "image", fullscreen: false, center_win: true, caption: c, callback_fn: a }; var e = new GB_Gallery(b); return e.show(d) }; GB_showPage = function(e, a, d) { var b = { type: "page", caption: e, callback_fn: d, fullscreen: true, center_win: false }; var c = new GB_Gallery(b); return c.show(a) }; GB_Gallery = GreyBox.extend({ init: function(a) { this.parent({}); this.img_close = this.root_dir + "g_close.gif"; AJS.update(this, a); this.addCallback(this.callback_fn) }, initHook: function() { AJS.addClass(this.g_window, "GB_Gallery"); var d = AJS.DIV({ "class": "inner" }); this.header = AJS.DIV({ "class": "GB_header" }, d); AJS.setOpacity(this.header, 0); AJS.getBody().insertBefore(this.header, this.overlay.nextSibling); var b = AJS.TD({ id: "GB_caption", "class": "caption", width: "40%" }, this.caption); var g = AJS.TD({ id: "GB_middle", "class": "middle", width: "20%" }); var f = AJS.DIV({ "class": "gb_img_close" }); AJS.AEV(f, "click", GB_hide); var e = AJS.TD({ "class": "close", width: "40%" }, f); var c = AJS.TBODY(AJS.TR(b, g, e)); var a = AJS.TABLE({ cellspacing: "0", cellpadding: 0, border: 0 }, c); AJS.ACN(d, a); if (this.fullscreen) { AJS.AEV(window, "scroll", AJS.$b(this.setWindowPosition, this)) } else { AJS.AEV(window, "scroll", AJS.$b(this._setHeaderPos, this)) } }, setFrameSize: function() { var a = this.overlay.offsetWidth; var b = AJS.getWindowSize(); if (this.fullscreen) { this.width = a - 40; this.height = b.h - 80 } AJS.setWidth(this.iframe, this.width); AJS.setHeight(this.iframe, this.height); AJS.setWidth(this.header, a) }, _setHeaderPos: function() { AJS.setTop(this.header, AJS.getScrollTop() + 10) }, setWindowPosition: function() { var c = this.overlay.offsetWidth; var b = AJS.getWindowSize(); AJS.setLeft(this.g_window, ((c - 50 - this.width) / 2)); var a = AJS.getScrollTop() + 55; if (!this.center_win) { AJS.setTop(this.g_window, a) } else { var d = ((b.h - this.height) / 2) + 20 + AJS.getScrollTop(); if (d < 0) { d = 0 } if (a > d) { d = a } AJS.setTop(this.g_window, d) } this._setHeaderPos() }, onHide: function() { AJS.removeElement(this.header); AJS.removeClass(this.g_window, "GB_Gallery") }, onShow: function() { if (this.use_fx) { AJS.fx.fadeIn(this.header, { to: 1 }) } else { AJS.setOpacity(this.header, 1) } } }); AJS.preloadImages(GB_ROOT_DIR + "gb.sprite.png"); GB_showFullScreenSet = function(e, d, c) { var b = { type: "page", fullscreen: true, center_win: false }; var a = new GB_Sets(b, e); a.addCallback(c); a.showSet(d - 1); return false }; GB_showImageSet = function(e, d, c) { var b = { type: "image", fullscreen: false, center_win: true, width: 300, height: 300 }; var a = new GB_Sets(b, e); a.addCallback(c); a.showSet(d - 1); return false }; GB_Sets = GB_Gallery.extend({ init: function(a, b) { this.parent(a); if (!this.img_next) { this.img_next = this.root_dir + "next.gif" } if (!this.img_prev) { this.img_prev = this.root_dir + "prev.gif" } this.current_set = b }, showSet: function(b) { this.current_index = b; var a = this.current_set[this.current_index]; this.show(a.url); this._setCaption(a.caption); this.btn_prev = AJS.DIV({ "class": "left gb_img_prev" }); this.btn_next = AJS.DIV({ "class": "right gb_img_next" }); AJS.AEV(this.btn_prev, "click", AJS.$b(this.switchPrev, this)); AJS.AEV(this.btn_next, "click", AJS.$b(this.switchNext, this)); GB_STATUS = AJS.DIV({ "class": "GB_navStatus" }); AJS.ACN(AJS.$("GB_middle"), this.btn_prev, GB_STATUS, this.btn_next); this.updateStatus() }, updateStatus: function() { AJS.setHTML(GB_STATUS, (this.current_index + 1) + " / " + this.current_set.length); if (this.current_index == 0) { AJS.addClass(this.btn_prev, "disabled") } else { AJS.removeClass(this.btn_prev, "disabled") } if (this.current_index == this.current_set.length - 1) { AJS.addClass(this.btn_next, "disabled") } else { AJS.removeClass(this.btn_next, "disabled") } }, _setCaption: function(a) { AJS.setHTML(AJS.$("GB_caption"), a) }, updateFrame: function() { var a = this.current_set[this.current_index]; this._setCaption(a.caption); this.url = a.url; this.startLoading() }, switchPrev: function() { if (this.current_index != 0) { this.current_index--; this.updateFrame(); this.updateStatus() } }, switchNext: function() { if (this.current_index != this.current_set.length - 1) { this.current_index++; this.updateFrame(); this.updateStatus() } } }); AJS.AEV(window, "load", function() { }); GB_show = function(b, c, g, f, d) { var a = { caption: b, height: g || 500, width: f || 500, fullscreen: false, callback_fn: d }; var e = new GB_Window(a); return e.show(c) }; GB_showCenter = function(g, a, e, c, d) { var b = { caption: g, center_win: true, height: e || 500, width: c || 500, fullscreen: false, callback_fn: d }; var f = new GB_Window(b); return f.show(a) }; GB_showFullScreen = function(d, c, b) { var a = { caption: d, fullscreen: true, callback_fn: b }; var e = new GB_Window(a); return e.show(c) }; GB_Window = GreyBox.extend({ init: function(a) { this.parent({}); this.img_header = this.root_dir + "gb.sprite.png"; this.img_close = this.root_dir + "w_close.gif"; this.show_close_img = true; AJS.update(this, a); this.addCallback(this.callback_fn) }, initHook: function() { AJS.addClass(this.g_window, "GB_Window"); this.header = AJS.TABLE({ "class": "header" }); this.header.style.backgroundImage = "url(" + this.img_header + ")"; this.header.style.backgroundPosition = "0 -80px"; var e = AJS.TD({ "class": "caption" }, this.caption); var c = AJS.TD({ "class": "close" }); if (this.show_close_img) { var b = AJS.DIV({ "class": "gb_img_w_close" }); var a = AJS.SPAN("Close"); var d = AJS.DIV(b, a); AJS.AEV([b, a], "mouseover", function() { AJS.addClass(a, "on") }); AJS.AEV([b, a], "mouseout", function() { AJS.removeClass(a, "on") }); AJS.AEV([b, a], "mousedown", function() { AJS.addClass(a, "click") }); AJS.AEV([b, a], "mouseup", function() { AJS.removeClass(a, "click") }); AJS.AEV([b, a], "click", GB_hide); AJS.ACN(c, d) } tbody_header = AJS.TBODY(); AJS.ACN(tbody_header, AJS.TR(e, c)); AJS.ACN(this.header, tbody_header); AJS.ACN(this.top_cnt, this.header); if (this.fullscreen) { AJS.AEV(window, "scroll", AJS.$b(this.setWindowPosition, this)) } }, setFrameSize: function() { if (this.fullscreen) { var a = AJS.getWindowSize(); overlay_h = a.h; this.width = Math.round(this.overlay.offsetWidth - (this.overlay.offsetWidth / 100) * 10); this.height = Math.round(overlay_h - (overlay_h / 100) * 10) } AJS.setWidth(this.header, this.width + 6); AJS.setWidth(this.iframe, this.width); AJS.setHeight(this.iframe, this.height) }, setWindowPosition: function() { var b = AJS.getWindowSize(); AJS.setLeft(this.g_window, ((b.w - this.width) / 2) - 13); if (!this.center_win) { AJS.setTop(this.g_window, AJS.getScrollTop()) } else { var a = ((b.h - this.height) / 2) - 20 + AJS.getScrollTop(); if (a < 0) { a = 0 } AJS.setTop(this.g_window, a) } } }); script_loaded = true;
