﻿var GB_ROOT_DIR = "http://www.space2.com/greybox/greybox_v5_54/greybox/";

if (!window.AJS) { var AJS = { BASE_URL: "", ajaxErrorHandler: null, getQueryArgument: function (f) { var b = window.location.search.substring(1); var c = b.split("&"); for (var a = 0; a < c.length; a++) { var d = c[a].split("="); if (d[0] == f) { return d[1] } } return null }, _agent: navigator.userAgent.toLowerCase(), _agent_version: navigator.productSub, isIe: function () { return (AJS._agent.indexOf("msie") != -1 && AJS._agent.indexOf("opera") == -1) }, isIe8: function () { return AJS._agent.indexOf("msie 8") != -1 }, isSafari: function (a) { if (a) { return AJS._agent.indexOf("khtml") } return (AJS._agent.indexOf("khtml") != -1 && AJS._agent.match(/3\.\d\.\d safari/) == null) }, isOpera: function () { return AJS._agent.indexOf("opera") != -1 }, isMozilla: function () { return (AJS._agent.indexOf("gecko") != -1 && AJS._agent_version >= 20030210) }, isMac: function () { return (AJS._agent.indexOf("macintosh") != -1) }, isCamino: function () { return (AJS._agent.indexOf("camino") != -1) }, createArray: function (a) { if (AJS.isArray(a) && !AJS.isString(a)) { return a } else { if (!a) { return [] } else { return [a] } } }, forceArray: function (a) { var c = []; for (var b = 0; b < a.length; b++) { c.push(a[b]) } return c }, join: function (d, b) { try { return b.join(d) } catch (c) { var a = b[0] || ""; AJS.map(b, function (f) { a += d + f }, 1); return a + "" } }, isIn: function (c, b) { var a = AJS.getIndex(c, b); if (a != -1) { return true } else { return false } }, getIndex: function (d, b, c) { for (var a = 0; a < b.length; a++) { if (c && c(b[a]) || d == b[a]) { return a } } return -1 }, getFirst: function (a) { if (a.length > 0) { return a[0] } else { return null } }, getLast: function (a) { if (a.length > 0) { return a[a.length - 1] } else { return null } }, getRandom: function (a) { return a[Math.floor(Math.random() * a.length)] }, update: function (b, a) { for (var c in a) { b[c] = a[c] } return b }, flattenList: function (g) { var f = false; var a = []; for (var b = 0; b < g.length; b++) { var h = g[b]; if (AJS.isArray(h)) { f = true; break } if (h != null) { a.push(h) } } if (!f) { return a } var c = []; var d = function (j, i) { AJS.map(i, function (l) { if (l == null) { } else { if (AJS.isArray(l)) { d(j, l) } else { j.push(l) } } }) }; d(c, g); return c }, flattenElmArguments: function (a) { return AJS.flattenList(AJS.forceArray(a)) }, map: function (g, f, b, d) { var c = 0, a = g.length; if (b) { c = b } if (d) { a = d } for (c; c < a; c++) { var h = f(g[c], c); if (h != undefined) { return h } } }, rmap: function (d, c) { var b = d.length - 1, a = 0; for (b; b >= a; b--) { var f = c.apply(null, [d[b], b]); if (f != undefined) { return f } } }, filter: function (f, c, a, b) { var d = []; AJS.map(f, function (g) { if (c(g)) { d.push(g) } }, a, b); return d }, partial: function (b) { var a = AJS.$FA(arguments); a.shift(); return function () { a = a.concat(AJS.$FA(arguments)); return b.apply(window, a) } }, getElement: function (a) { if (AJS.isString(a) || AJS.isNumber(a)) { return document.getElementById(a) } else { return a } }, getElements: function () { var a = AJS.flattenElmArguments(arguments); var d = new Array(); for (var c = 0; c < a.length; c++) { var b = AJS.getElement(a[c]); d.push(b) } return d }, getElementsByTagAndClassName: function (a, b, n, h) { var g = []; if (!AJS.isDefined(n)) { n = document } if (!AJS.isDefined(a)) { a = "*" } var f, d; if (b && document.getElementsByClassName) { var c = n.getElementsByClassName(b); if (a == "*") { g = AJS.forceArray(c) } else { var m = c.length; for (f = 0; f < m; f++) { if (c[f].nodeName.toLowerCase() == a) { g.push(c[f]) } } } } else { var c = n.getElementsByTagName(a); if (!b) { g = AJS.forceArray(c) } else { var m = c.length; var l = new RegExp("(^|\\s)" + b + "(\\s|$)"); for (f = 0; f < m; f++) { if (l.test(c[f].className) || !b) { g.push(c[f]) } } } } if (h) { return g[0] } else { return g } }, nodeName: function (a) { return a.nodeName.toLowerCase() }, _nodeWalk: function (g, d, b, f) { var c = f(g); var a; if (d && b) { a = function (h) { return AJS.nodeName(h) == d && AJS.hasClass(h, b) } } else { if (d) { a = function (h) { return AJS.nodeName(h) == d } } else { a = function (h) { return AJS.hasClass(h, b) } } } if (a(g)) { return g } while (c) { if (a(c)) { return c } c = f(c) } return null }, getParentBytc: function (c, b, a) { return AJS._nodeWalk(c, b, a, function (d) { if (d) { return d.parentNode } }) }, getChildBytc: function (d, c, b) { var a = AJS.$bytc(c, b, d); if (a.length > 0) { return a[0] } else { return null } }, hasParent: function (c, b, a) { if (c == b) { return true } if (a == 0) { return false } return AJS.hasParent(c.parentNode, b, a - 1) }, getPreviousSiblingBytc: function (c, b, a) { return AJS._nodeWalk(c, b, a, function (d) { return d.previousSibling }) }, getNextSiblingBytc: function (c, b, a) { return AJS._nodeWalk(c, b, a, function (d) { return d.nextSibling }) }, getBody: function () { return AJS.$bytc("body")[0] }, getFormElement: function (c, a) { c = AJS.$(c); var b = null; AJS.map(c.elements, function (d) { if (d.name && d.name == a) { b = d } }); if (b) { return b } AJS.map(AJS.$bytc("select", null, c), function (d) { if (d.name && d.name == a) { b = d } }); return b }, getSelectValue: function (a) { var a = AJS.$(a); return a.options[a.selectedIndex].value }, documentInsert: function (a) { if (typeof (a) == "string") { a = AJS.HTML2DOM(a) } document.write('<span id="dummy_holder"></span>'); AJS.swapDOM(AJS.$("dummy_holder"), 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 }, appendToTop: function (d) { var b = AJS.flattenElmArguments(arguments).slice(1); if (b.length >= 1) { var c = d.firstChild; if (c) { while (true) { var a = b.shift(); if (a) { AJS.insertBefore(a, c) } else { break } } } else { AJS.ACN.apply(null, arguments) } } return d }, replaceChildNodes: function (b) { var a; while ((a = b.firstChild)) { AJS.swapDOM(a, null) } if (arguments.length < 2) { return b } else { return AJS.appendChildNodes.apply(null, arguments) } return b }, insertAfter: function (b, a) { a.parentNode.insertBefore(b, a.nextSibling); return b }, insertBefore: function (b, a) { a.parentNode.insertBefore(b, a); return b }, swapDOM: function (a, c) { a = AJS.getElement(a); var b = a.parentNode; if (c) { c = AJS.getElement(c); b.replaceChild(c, a) } else { b.removeChild(a) } return c }, removeElement: function () { var a = AJS.flattenElmArguments(arguments); try { AJS.map(a, function (c) { if ($(c)) { AJS.swapDOM(c, null) } }) } catch (b) { } }, createDOM: function (f, d) { var g = 0, a; var l = document.createElement(f); var b = d[0]; if (AJS.isDict(d[g])) { for (k in b) { a = b[k]; if (k == "style" || k == "s") { l.style.cssText = a } else { if (k == "c" || k == "class" || k == "className") { l.className = a } else { l.setAttribute(k, a) } } } g++ } if (b == null) { g = 1 } for (var c = g; c < d.length; c++) { var a = d[c]; if (a) { var h = typeof (a); if (h == "string" || h == "number") { a = AJS.TN(a) } l.appendChild(a) } } return l }, _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", "label", "thead"]; 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) } }, setHTML: function () { var a = AJS.flattenElmArguments(arguments); var b = a.pop(); AJS.map(a, function (c) { if (c) { c.innerHTML = b } }); return a[0] }, setVisibility: function () { var a = AJS.flattenElmArguments(arguments); var b = a.pop() && "visible" || "hidden"; AJS.setStyle(a, "visibility", b) }, showElement: function () { AJS.setStyle(AJS.flattenElmArguments(arguments), "display", "") }, hideElement: function (a) { AJS.setStyle(AJS.flattenElmArguments(arguments), "display", "none") }, isElementHidden: function (a) { return ((a.style.display == "none") || (a.style.visibility == "hidden")) }, isElementShown: function (a) { return !AJS.isElementHidden(a) }, setStyle: function () { var b = AJS.flattenElmArguments(arguments); var d = b.pop(); var a = ["top", "left", "right", "width", "height"]; if (AJS.isObject(d)) { AJS.map(b, function (f) { AJS.map(AJS.keys(d), function (h) { var g = d[h]; if (AJS.isIn(h, a)) { g = AJS.isString(g) && g || g + "px" } f.style[h] = g }) }) } else { var c = b.pop(); AJS.map(b, function (f) { if (AJS.isIn(c, a)) { d = AJS.isString(d) && d || d + "px" } f.style[c] = d }) } }, __cssDim: function (a, b) { var a = AJS.$FA(a); a.splice(a.length - 1, 0, b); AJS.setStyle.apply(null, a) }, setWidth: function () { return AJS.__cssDim(arguments, "width") }, setHeight: function () { return AJS.__cssDim(arguments, "height") }, setLeft: function () { return AJS.__cssDim(arguments, "left") }, setRight: function () { return AJS.__cssDim(arguments, "right") }, setTop: function () { return AJS.__cssDim(arguments, "top") }, setClass: function () { var a = AJS.flattenElmArguments(arguments); var b = a.pop(); AJS.map(a, function (c) { c.className = b }) }, addClass: function () { var b = AJS.flattenElmArguments(arguments); var a = b.pop(); var c = function (d) { if (!new RegExp("(^|\\s)" + a + "(\\s|$)").test(d.className)) { d.className += (d.className ? " " : "") + a } }; AJS.map(b, function (d) { c(d) }) }, hasClass: function (c, a) { if (!c || !c.className) { return false } var b = c.className; return (b.length > 0 && (b == a || new RegExp("(^|\\s)" + a + "(\\s|$)").test(b))) }, removeClass: function () { var c = AJS.flattenElmArguments(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) }) }, setOpacity: function (b, a) { if (a == 1) { b.style.opacity = 1; b.style.filter = "" } else { b.style.opacity = a; b.style.filter = "alpha(opacity=" + a * 100 + ")" } }, HTML2DOM: function (a, c) { var b = AJS.DIV(); b.innerHTML = a; if (c) { return b.childNodes[0] } else { return b } }, preloadImages: function () { AJS.AEV(window, "load", AJS.$p(function (a) { AJS.map(a, function (c) { var b = new Image(); b.src = c }) }, arguments)) }, RND: function (a, d, c) { c = c || window; var b = function (f, l) { l = l.split("|"); var j = d[l[0]]; for (var h = 1; h < l.length; h++) { j = c[l[h]](j) } if (j == "") { return "" } if (j == 0 || j == -1) { j += "" } return j || f }; return a.replace(/%\(([A-Za-z0-9_|.]*)\)/g, b) }, getXMLHttpRequest: function () { var b = [function () { return new XMLHttpRequest() }, function () { return new ActiveXObject("Msxml2.XMLHTTP") }, function () { return new ActiveXObject("Microsoft.XMLHTTP") }, function () { return new ActiveXObject("Msxml2.XMLHTTP.4.0") }, function () { throw "Browser does not support XMLHttpRequest" } ]; for (var a = 0; a < b.length; a++) { var c = b[a]; try { return c() } catch (d) { } } }, getRequest: function (a, c) { var b = AJS.getXMLHttpRequest(); if (a.match(/^https?:\/\//) == null) { if (AJS.BASE_URL != "") { if (AJS.BASE_URL.lastIndexOf("/") != AJS.BASE_URL.length - 1) { AJS.BASE_URL += "/" } a = AJS.BASE_URL + a } } if (!c) { c = "POST" } return new AJSDeferred(b, c, a) }, serializeJSON: function (j) { var a = typeof (j); if (a == "undefined") { return "null" } else { if (a == "number" || a == "boolean") { return j + "" } else { if (j === null) { return "null" } } } if (a == "string") { return AJS._reprString(j) } if (a == "object" && j.getFullYear) { return AJS._reprDate(j) } var f = arguments.callee; if (a != "function" && typeof (j.length) == "number") { var d = []; for (var c = 0; c < j.length; c++) { var h = f(j[c]); if (typeof (h) != "string") { h = "undefined" } d.push(h) } return "[" + d.join(",") + "]" } if (a == "function") { return null } d = []; for (var b in j) { var g; if (typeof (b) == "number") { g = '"' + b + '"' } else { if (typeof (b) == "string") { g = AJS._reprString(b) } else { continue } } h = f(j[b]); if (typeof (h) != "string") { continue } d.push(g + ":" + h) } return "{" + d.join(",") + "}" }, loadJSON: function (b, c, a) { var g = AJS.getRequest(b, c); var f = function (h, d) { var i = d.responseText; if (i == "Error") { g.errback(d) } else { return AJS.evalTxt(i) } }; g.addCallback(f); return g }, evalTxt: function (txt) { try { return eval("(" + txt + ")") } catch (e) { return eval(txt) } }, evalScriptTags: function (html) { var script_data = html.match(/<script.*?>((\n|\r|.)*?)<\/script>/g); if (script_data != null) { for (var i = 0; i < script_data.length; i++) { var script_only = script_data[i].replace(/<script.*?>/g, ""); script_only = script_only.replace(/<\/script>/g, ""); eval(script_only) } } }, encodeArguments: function (a) { var b = []; for (k in a) { b.push(k + "=" + AJS.urlencode(a[k])) } return b.join("&") }, _reprString: function (a) { return ('"' + a.replace(/(["\\])/g, "\\$1") + '"').replace(/[\f]/g, "\\f").replace(/[\b]/g, "\\b").replace(/[\n]/g, "\\n").replace(/[\t]/g, "\\t").replace(/[\r]/g, "\\r") }, _reprDate: function (c) { var d = c.getUTCFullYear(); var a = c.getUTCDate(); var f = c.getUTCMonth() + 1; var b = function (g) { if (g < 10) { g = "0" + g } return g }; return '"' + d + "-" + f + "-" + a + "T" + b(c.getUTCHours()) + ":" + b(c.getUTCMinutes()) + ":" + b(c.getUTCSeconds()) + '"' }, getMousePos: function (b) { var a = 0; var c = 0; if (!b) { var b = window.event } if (b.pageX || b.pageY) { a = b.pageX; c = b.pageY } else { if (b.clientX || b.clientY) { a = b.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; c = b.clientY + document.body.scrollTop + document.documentElement.scrollTop } } return { x: a, y: c} }, getScrollTop: function () { var a; if (document.documentElement && document.documentElement.scrollTop) { a = document.documentElement.scrollTop } else { if (document.body) { a = document.body.scrollTop } } return a }, absolutePosition: function (c) { if (!c) { return { x: 0, y: 0} } if (c.scrollLeft) { return { x: c.scrollLeft, y: c.scrollTop} } else { if (c.clientX) { return { x: c.clientX, y: c.clientY} } } var b = { x: c.offsetLeft, y: c.offsetTop }; if (c.offsetParent) { var a = c.offsetParent; while (a) { b.x += a.offsetLeft; b.y += a.offsetTop; a = a.offsetParent } } if (AJS.isSafari() && c.style.position == "absolute") { b.x -= document.body.offsetLeft; b.y -= document.body.offsetTop } return b }, 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} }, isOverlapping: function (g, c) { var j = AJS.absolutePosition(g); var i = AJS.absolutePosition(c); var m = j.y; var o = j.x; var f = o + g.offsetWidth; var d = m + g.offsetHeight; var l = i.y; var n = i.x; var b = n + c.offsetWidth; var a = l + c.offsetHeight; var h = function (p) { if (p > 0) { return "+" } else { if (p < 0) { return "-" } else { return 0 } } }; if ((h(m - a) != h(d - l)) && (h(o - b) != h(f - n))) { return true } return false }, getEventElm: function (b) { if (b && !b.type && !b.keyCode) { return b } var a; if (!b) { var b = window.event } if (b.target) { a = b.target } else { if (b.srcElement) { a = b.srcElement } } if (a && a.nodeType == 3) { a = a.parentNode } return a }, setEventKey: function (a) { if (!a) { a = window.event } a.key = a.keyCode ? a.keyCode : a.charCode; a.ctrl = a.ctrlKey; a.alt = a.altKey; a.meta = a.metaKey; a.shift = a.shiftKey }, onEvent: function (c, b, a, d) { c = AJS.$A(c); AJS.map(c, function (f) { if (f.events) { f.events[b] = {} } }); return AJS.AEV(c, b, a, d) }, ready_bound: false, is_ready: false, bindReady: function () { if (AJS.ready_bound) { return } AJS.ready_bound = true; if (document.addEventListener) { document.addEventListener("DOMContentLoaded", function () { document.removeEventListener("DOMContentLoaded", arguments.callee, false); AJS.ready() }, false) } else { if (document.attachEvent) { document.attachEvent("onreadystatechange", function () { if (document.readyState === "complete") { document.detachEvent("onreadystatechange", arguments.callee); AJS.ready() } }); if (document.documentElement.doScroll && window == window.top) { (function () { if (AJS.is_ready) { return } try { document.documentElement.doScroll("left") } catch (a) { setTimeout(arguments.callee, 0); return } AJS.ready() })() } } } AJS.AEV(window, "load", AJS.ready) }, ready_list: [], ready: function (a) { if (AJS.is_ready) { return } AJS.is_ready = true; AJS.map(AJS.ready_list, function (b) { b.call(window) }); AJS.ready_list = [] }, _f_guid: 0, _wipe_guid: 0, addEventListener: function (c, a, b, d) { c = AJS.$A(c); a = AJS.$A(a); AJS.map(c, function (f) { if (d) { b.listen_once = true } if (!b.$f_guid) { b.$f_guid = AJS._f_guid++ } if (!f.events) { f.events = {} } AJS.map(a, function (h) { var g = f.events[h]; if (f == window && h == "load") { AJS.ready_list.push(b) } else { if (h == "lazy_load") { h = "load" } if (!g) { g = f.events[h] = {}; if (f["on" + h]) { g[0] = f["on" + h] } } if (!f._wipe_guid) { f._wipe_guid = AJS._wipe_guid++ } g[b.$f_guid] = b; f["on" + h] = AJS.handleEvent } }); f = null }) }, handleEvent: function (h) { var g = this; h = h || window.event; if (!h) { return } if (!h.ctrl && h.type.indexOf("key") != -1) { AJS.setEventKey(h) } var b = this.events[h.type]; var a = []; var d = true; for (var c in b) { var f = this.$$handleEvent = b[c]; if (f == AJS.handleEvent) { continue } d = f(h); if (f.listen_once) { a.push(f) } } if (a.length > 0) { AJS.map(a, function (i) { delete g.events[h.type][i.$f_guid] }) } return d }, removeEventListener: function (c, b, a) { c = AJS.$A(c); map(c, function (d) { if (d.events && d.events[b]) { delete d.events[b][a.$f_guid] } }) }, bind: function (b, a, c) { b._cscope = a; return AJS._getRealScope(b, c) }, bindMethods: function (b) { for (var a in b) { var c = b[a]; if (typeof (c) == "function") { b[a] = AJS.$b(c, b) } } }, preventDefault: function (a) { if (AJS.isIe()) { window.event.returnValue = false } else { a.preventDefault() } }, _listenOnce: function (d, b, a) { var c = function () { AJS.removeEventListener(d, b, c); a(arguments) }; return c }, _getRealScope: function (b, c) { c = AJS.$A(c); var a = b._cscope || window; return function () { try { var d = AJS.$FA(arguments).concat(c); return b.apply(a, d) } catch (f) { } } }, _reccruing_tos: {}, setSingleTimeout: function (b, c, a) { var d = AJS._reccruing_tos[b]; if (d) { clearTimeout(d) } AJS._reccruing_tos[b] = setTimeout(c, a) }, keys: function (b) { var a = []; for (var c in b) { a.push(c) } return a }, values: function (b) { var a = []; for (var c in b) { a.push(b[c]) } return a }, urlencode: function (a) { return encodeURIComponent(AJS.isDefined(a) && a.toString() || "") }, urldecode: function (b) { var a = decodeURIComponent(AJS.isDefined(b) && b.toString() || ""); return a.replace(/\+/g, " ") }, isDefined: function (a) { return (a != "undefined" && a != null) }, isArray: function (b) { try { return b instanceof Array } catch (a) { return false } }, isString: function (a) { return (typeof a == "string") }, isNumber: function (a) { return (typeof a == "number") }, isObject: function (a) { return (typeof a == "object") }, isFunction: function (a) { return (typeof a == "function") }, isDict: function (b) { var a = String(b); return a.indexOf(" Object") != -1 }, exportToGlobalScope: function (a) { a = a || window; for (e in AJS) { if (e != "addEventListener") { a[e] = AJS[e] } } }, log: function (b) { try { if (window._firebug) { window._firebug.log(b) } else { if (window.console) { console.log(b) } } } catch (a) { } }, strip: function (a) { return a.replace(/^\s+/, "").replace(/\s+$/g, "") }, trim_if_needed: function (c, a, b) { if (c.length > a) { return c.substring(0, a) + (b || "...") } return c } }; AJS.Class = function (a) { var b = function () { if (arguments[0] != "no_init") { return this.init.apply(this, arguments) } }; b.prototype = a; AJS.update(b, AJS.Class.prototype); return b }; AJS.Class.prototype = { extend: function (a) { var b = new this("no_init"); for (k in a) { var c = b[k]; var d = a[k]; if (c && c != d && typeof d == "function") { d = this._parentize(d, c) } 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) } } }; AJS.$ = AJS.getElement; AJS.$$ = AJS.getElements; AJS.$f = AJS.getFormElement; AJS.$b = AJS.bind; AJS.$p = AJS.partial; AJS.$FA = AJS.forceArray; 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.loadJSONDoc = AJS.loadJSON; AJS.queryArguments = AJS.encodeArguments; AJS.$gp = AJS.getParentBytc; AJS.$gc = AJS.getChildBytc; AJS.$sv = AJS.setVisibility; AJS.generalErrorback = null; AJS.generalCallback = null; AJSDeferred = function (b, c, a) { this.callbacks = []; this.errbacks = []; this.req = b; this.http_method = c; this.http_url = a }; AJSDeferred.prototype = { excCallbackSeq: function (c, f) { var d = c.responseText; if (AJS.generalCallback) { d = AJS.generalCallback(c, f); if (!d) { return } } while (f.length > 0) { var b = f.pop(); var a = b(d, c); if (a) { d = a } else { if (a == false) { break } } } }, callback: function () { this.excCallbackSeq(this.req, this.callbacks) }, errback: function () { if (this.errbacks.length == 0) { if (AJS.ajaxErrorHandler) { AJS.ajaxErrorHandler(req.responseText, req) } else { var b = this.req.responseText.substring(0, 200); if (AJS.strip(b) && b.indexOf("<html") == -1) { alert("Error encountered:\n" + b) } } } if (AJS.generalErrorback) { var a = AJS.generalErrorback(this.req); if (!a) { return } } this.excCallbackSeq(this.req, this.errbacks) }, addErrback: function (a) { this.errbacks.unshift(a) }, addCallback: function (a) { this.callbacks.unshift(a) }, abort: function () { this.req.abort() }, addCallbacks: function (b, a) { this.addCallback(b); this.addErrback(a) }, _onreadystatechange: function () { var b = this.req; var f = this; if (b.readyState == 4) { var a = ""; try { a = b.status } catch (c) { } if (a == 200 || a == 304 || b.responseText == null) { this.callback() } else { this.errback() } } }, sendReq: function (d) { var c = this.req; var b = this.http_method; var a = this.http_url; if (b == "POST") { c.open(b, a, true); c.onreadystatechange = AJS.$b(this._onreadystatechange, this); c.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); if (AJS.isObject(d)) { c.send(AJS.encodeArguments(d)) } else { if (AJS.isDefined(d)) { c.send(d) } else { c.send("") } } } else { c.open("GET", a, true); c.onreadystatechange = AJS.$b(this._onreadystatechange, this); c.send(null) } } }; AJS._createDomShortcuts() } script_loaded = true; AJS.exportToGlobalScope(); AJS.bindReady();
script_loaded = true;

AJS.fx = { _shades: { 0: "ffffff", 1: "ffffee", 2: "ffffdd", 3: "ffffcc", 4: "ffffbb", 5: "ffffaa", 6: "ffff99" }, highlight: function (c, a) { var b = new AJS.fx.Base(); b.elm = AJS.$(c); b.options.duration = 600; b.setOptions(a); AJS.update(b, { increase: function () { if (this.now == 7) { c.style.backgroundColor = "#fff" } else { c.style.backgroundColor = "#" + AJS.fx._shades[Math.floor(this.now)] } } }); return b.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 (c, a) { a = a || {}; if (!a.from) { a.from = 1 } if (!a.to) { a.to = 0 } a.duration = 300; var b = new AJS.fx.Style(c, "opacity", a); return b.custom(a.from, a.to) }, setWidth: function (c, a) { var b = new AJS.fx.Style(c, "width", a); return b.custom(a.from, a.to) }, setHeight: function (c, a) { var b = new AJS.fx.Style(c, "height", a); return b.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 (c, b) { var a = b - c; return this.options.transition(this.cTime, c, a, this.options.duration) }, clearTimer: function () { clearInterval(this.timer); this.timer = null; return this }, _start: function (b, a) { if (!this.options.wait) { this.clearTimer() } if (this.timer) { return } setTimeout(AJS.$p(this.options.onStart, this.elm), 10); this.from = b; this.to = a; this.time = new Date().getTime(); this.timer = setInterval(this.step, Math.round(1000 / this.options.fps)); return this }, custom: function (b, a) { return this._start(b, a) }, 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, b, a) { this.parent(); this.elm = c; this.setOptions(a); this.property = b }, 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 (a) { if (this.timer && this.options.wait) { return } var c = {}; var b = {}; for (p in a) { c[p] = a[p][0]; b[p] = a[p][1] } return this._start(c, b) }, 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.asp"; 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 (a) { GB_CURRENT = this; this.url = a; var b = [AJS.$bytc("object"), AJS.$bytc("select")]; AJS.map(AJS.flattenList(b), function (c) { c.style.visibility = "hidden" }); this.createElements(); return false }, hide: function (a) { var b = this; setTimeout(function () { var d = b.callback_fns; if (d != []) { AJS.map(d, function (f) { f() }) } b.onHide(); if (b.use_fx) { var e = b.overlay; AJS.fx.fadeOut(b.overlay, { onComplete: function () { AJS.removeElement(e); e = 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) { window.location.reload() } 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 (c) { if (c.getAttribute("href") && c.getAttribute("rel")) { var b = c.getAttribute("rel"); if (b.indexOf("gb_") == 0) { var f = b.match(/\w+/)[0]; var e = b.match(/\[(.*)\]/)[1]; var d = 0; var g = { caption: c.title || "", url: c.href }; if (f == "gb_pageset" || f == "gb_imageset") { if (!GB_SETS[e]) { GB_SETS[e] = [] } GB_SETS[e].push(g); d = GB_SETS[e].length } if (f == "gb_pageset") { c.onclick = function () { GB_showFullScreenSet(GB_SETS[e], d); return false } } if (f == "gb_imageset") { c.onclick = function () { GB_showImageSet(GB_SETS[e], d); return false } } if (f == "gb_image") { c.onclick = function () { GB_showImage(g.caption, g.url); return false } } if (f == "gb_page") { c.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") { c.onclick = function () { GB_showFullScreen(g.caption, g.url); return false } } if (f == "gb_page_center") { c.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 (a, c, e) { var b = { width: 300, height: 300, type: "image", fullscreen: false, center_win: true, caption: a, callback_fn: e }; var d = new GB_Gallery(b); return d.show(c) }; GB_showPage = function (a, c, e) { var b = { type: "page", caption: a, callback_fn: e, fullscreen: true, center_win: false }; var d = new GB_Gallery(b); return d.show(c) }; 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 c = AJS.DIV({ "class": "inner" }); this.header = AJS.DIV({ "class": "GB_header" }, c); AJS.setOpacity(this.header, 0); AJS.getBody().insertBefore(this.header, this.overlay.nextSibling); var e = AJS.TD({ id: "GB_caption", "class": "caption", width: "40%" }, this.caption); var b = AJS.TD({ id: "GB_middle", "class": "middle", width: "20%" }); var f = AJS.IMG({ src: this.img_close }); AJS.AEV(f, "click", GB_hide); var a = AJS.TD({ "class": "close", width: "40%" }, f); var d = AJS.TBODY(AJS.TR(e, b, a)); var g = AJS.TABLE({ cellspacing: "0", cellpadding: 0, border: 0 }, d); AJS.ACN(c, g); 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 b = this.overlay.offsetWidth; var a = AJS.getWindowSize(); if (this.fullscreen) { this.width = b - 40; this.height = a.h - 80 } AJS.setWidth(this.iframe, this.width); AJS.setHeight(this.iframe, this.height); AJS.setWidth(this.header, b) }, _setHeaderPos: function () { AJS.setTop(this.header, AJS.getScrollTop() + 10) }, setWindowPosition: function () { var c = this.overlay.offsetWidth; var a = AJS.getWindowSize(); AJS.setLeft(this.g_window, ((c - 50 - this.width) / 2)); var d = AJS.getScrollTop() + 55; if (!this.center_win) { AJS.setTop(this.g_window, d) } else { var b = ((a.h - this.height) / 2) + 20 + AJS.getScrollTop(); if (b < 0) { b = 0 } if (d > b) { b = d } AJS.setTop(this.g_window, b) } 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 + "g_close.gif"); GB_showFullScreenSet = function (e, a, d) { var b = { type: "page", fullscreen: true, center_win: false }; var c = new GB_Sets(b, e); c.addCallback(d); c.showSet(a - 1); return false }; GB_showImageSet = function (e, a, d) { var b = { type: "image", fullscreen: false, center_win: true, width: 300, height: 300 }; var c = new GB_Sets(b, e); c.addCallback(d); c.showSet(a - 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 (a) { this.current_index = a; var b = this.current_set[this.current_index]; this.show(b.url); this._setCaption(b.caption); this.btn_prev = AJS.IMG({ "class": "left", src: this.img_prev }); this.btn_next = AJS.IMG({ "class": "right", src: this.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.SPAN({ "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 () { AJS.preloadImages(GB_ROOT_DIR + "next.gif", GB_ROOT_DIR + "prev.gif") }); GB_show = function (b, d, a, e, g) { var c = { caption: b, height: a || 500, width: e || 500, fullscreen: false, callback_fn: g }; var f = new GB_Window(c); return f.show(d) }; GB_showCenter = function (b, d, a, e, g) { var c = { caption: b, center_win: true, height: a || 500, width: e || 500, fullscreen: false, callback_fn: g }; var f = new GB_Window(c); return f.show(d) }; GB_showFullScreen = function (a, c, e) { var b = { caption: a, fullscreen: true, callback_fn: e }; var d = new GB_Window(b); return d.show(c) }; GB_Window = GreyBox.extend({ init: function (a) { this.parent({}); this.img_header = this.root_dir + "header_bg.gif"; 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 + ")"; var b = AJS.TD({ "class": "caption" }, this.caption); var a = AJS.TD({ "class": "close" }); if (this.show_close_img) { var e = AJS.IMG({ src: this.img_close }); var d = AJS.SPAN("Close"); var c = AJS.DIV(e, d); AJS.AEV([e, d], "mouseover", function () { AJS.addClass(d, "on") }); AJS.AEV([e, d], "mouseout", function () { AJS.removeClass(d, "on") }); AJS.AEV([e, d], "mousedown", function () { AJS.addClass(d, "click") }); AJS.AEV([e, d], "mouseup", function () { AJS.removeClass(d, "click") }); AJS.AEV([e, d], "click", GB_hide); AJS.ACN(a, c) } tbody_header = AJS.TBODY(); AJS.ACN(tbody_header, AJS.TR(b, a)); 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 a = AJS.getWindowSize(); AJS.setLeft(this.g_window, ((a.w - this.width) / 2) - 13); if (!this.center_win) { AJS.setTop(this.g_window, AJS.getScrollTop()) } else { var b = ((a.h - this.height) / 2) - 20 + AJS.getScrollTop(); if (b < 0) { b = 0 } AJS.setTop(this.g_window, b) } } }); AJS.preloadImages(GB_ROOT_DIR + "w_close.gif", GB_ROOT_DIR + "header_bg.gif");
script_loaded = true;
