﻿/* Compiled from X 4.05 with XC 1.0 on 20Mar07 */function xAddClass(e, c) { e = xGetElementById(e); if (!e) return false; if (!xHasClass(e, c)) e.className += ' ' + c; return true; }; function xAddEventListener(e, eT, eL, cap) { if (!(e = xGetElementById(e))) return; eT = eT.toLowerCase(); if (e == window && !e.opera && !document.all) { if (eT == 'resize') { var pREL = e.xREL; e.xPCW = xClientWidth(); e.xPCH = xClientHeight(); e.xREL = pREL ? function() { eL(); pREL(); } : eL; xResizeEvent(); return; } if (eT == 'scroll') { e.xPSL = xScrollLeft(); e.xPST = xScrollTop(); var pSEL = e.xSEL; e.xSEL = pSEL ? function() { eL(); pSEL(); } : eL; xScrollEvent(); return; } } if (e.addEventListener) e.addEventListener(eT, eL, cap); else if (e.attachEvent) e.attachEvent('on' + eT, eL); else { var pev = e['on' + eT]; e['on' + eT] = pev ? function() { eL(); typeof (pev) == 'string' ? eval(pev) : pev(); } : eL; } } function xResizeEvent() { if (window.xREL) setTimeout('xResizeEvent()', 250); var w = window, cw = xClientWidth(), ch = xClientHeight(); if (w.xPCW != cw || w.xPCH != ch) { w.xPCW = cw; w.xPCH = ch; if (w.xREL) w.xREL(); } } function xScrollEvent() { if (window.xSEL) setTimeout('xScrollEvent()', 250); var w = window, sl = xScrollLeft(), st = xScrollTop(); if (w.xPSL != sl || w.xPST != st) { w.xPSL = sl; w.xPST = st; if (w.xSEL) w.xSEL(); } } function xAniEllipse(xa, xr, yr, a1, a2, tt, at, qc, oed, oea, oef) { var a = xa.init(xa.e, at, qc, tt, onRun, onRun, oed, oea, oef); a.x1 = a1 * (Math.PI / 180); a.x2 = a2 * (Math.PI / 180); var sx = xLeft(a.e) + (xWidth(a.e) / 2); var sy = xTop(a.e) + (xHeight(a.e) / 2); a.xc = sx - (xr * Math.cos(a.x1)); a.yc = sy - (yr * Math.sin(a.x1)); a.xr = xr; a.yr = yr; if (a.as) a.start(); return a; function onRun(o) { xMoveTo(o.e, Math.round(o.xr * Math.cos(o.x)) + o.xc - (xWidth(o.e) / 2), Math.round(o.yr * Math.sin(o.x)) + o.yc - (xHeight(o.e) / 2)); } } function xAniLine(xa, x, y, tt, at, qc, oed, oea, oef) { var a = xa.init(xa.e, at, qc, tt, onRun, onRun, oed, oea, oef); a.x1 = xLeft(a.e); a.y1 = xTop(a.e); a.x2 = x; a.y2 = y; if (a.as) a.start(); return a; function onRun(o) { xMoveTo(o.e, Math.round(o.x), Math.round(o.y)); } } function xAnimation(e, at, qc, tt, orf, otf, oed, oea, oef) { this.init(e, at, qc, tt, orf, otf, oed, oea, oef); var a = xAnimation.instances; var i; for (i = 0; i < a.length; ++i) { if (!a[i]) break; } a[i] = this; this.idx = i; } xAnimation.instances = []; xAnimation.prototype.init = function(e, at, qc, tt, orf, otf, oed, oea, oef) { this.e = xGetElementById(e); this.at = at || 2; this.qc = qc || 1; this.tt = tt; this.orf = orf; this.otf = otf; this.oed = oed; this.oea = oea; this.oef = oef; this.to = 20; this.as = true; return this; }; xAnimation.prototype.start = function() { var a = this; if (a.at == 1) { a.ap = 1 / a.tt; } else { a.ap = a.qc * (Math.PI / (2 * a.tt)); } if (xDef(a.x1)) { a.xm = a.x2 - a.x1; } if (xDef(a.y1)) { a.ym = a.y2 - a.y1; } if (!(a.qc % 2)) { if (xDef(a.x1)) a.x2 = a.x1; if (xDef(a.y1)) a.y2 = a.y1; } if (!a.tmr) { var d = new Date(); a.t1 = d.getTime(); a.tmr = setTimeout('xAnimation.run(' + a.idx + ')', 1); } }; xAnimation.run = function(i) { var a = xAnimation.instances[i]; if (!a) { return; } var d = new Date(); a.et = d.getTime() - a.t1; if (a.et < a.tt) { a.tmr = setTimeout('xAnimation.run(' + i + ')', a.to); a.af = a.ap * a.et; if (a.at == 2) { a.af = Math.abs(Math.sin(a.af)); } else if (a.at == 3) { a.af = 1 - Math.abs(Math.cos(a.af)); } if (xDef(a.x1)) a.x = a.xm * a.af + a.x1; if (xDef(a.y1)) a.y = a.ym * a.af + a.y1; a.orf(a); } else { var rep = false; if (xDef(a.x2)) a.x = a.x2; if (xDef(a.y2)) a.y = a.y2; a.tmr = null; a.otf(a); if (xDef(a.oef)) { if (a.oed) setTimeout(a.oef, a.oed); else if (xStr(a.oef)) { rep = eval(a.oef); } else { rep = a.oef(a, a.oea); } } if (rep) { a.resume(true); } } }; xAnimation.prototype.pause = function() { var s = false; if (this.tmr) { clearTimeout(this.tmr); this.tmr = null; s = true; } return s; }; xAnimation.prototype.resume = function(fromStart) { var s = false; if (!this.tmr) { var d = new Date(); this.t1 = d.getTime(); if (!fromStart) this.t1 -= this.et; this.tmr = setTimeout('xAnimation.run(' + this.idx + ')', this.to); s = true; } return s; }; xAnimation.prototype.kill = function() { this.pause(); xAnimation.instances[this.idx] = null; }; function xAniOpacity(xa, o, tt, at, qc, oed, oea, oef) { var a = xa.init(xa.e, at, qc, tt, onRun, onRun, oed, oea, oef); a.x1 = xOpacity(a.e); a.x2 = o; if (a.as) a.start(); return a; function onRun(o) { xOpacity(o.e, o.x); } } function xAniScroll(xa, x, y, tt, at, oed, oea, oef) { var a = xa.init(xa.e, at, 1, tt, onRun, onRun, oed, oea, oef); a.x1 = xScrollLeft(a.e, 1); a.y1 = xScrollTop(a.e, 1); a.x2 = x; a.y2 = y; if (a.as && a.e.scrollTo) a.start(); return a; function onRun(o) { o.e.scrollTo(Math.round(o.x), Math.round(o.y)); } } function xAniSize(xa, w, h, tt, at, qc, oed, oea, oef) { var a = xa.init(xa.e, at, qc, tt, onRun, onRun, oed, oea, oef); a.x1 = xWidth(a.e); a.y1 = xHeight(a.e); a.x2 = w; a.y2 = h; if (a.as) a.start(); return a; function onRun(o) { xResizeTo(o.e, Math.round(o.x), Math.round(o.y)); } } function xAppendChild(oParent, oChild) { if (oParent.appendChild) return oParent.appendChild(oChild); else return null; } function xBackground(e, c, i) { if (!(e = xGetElementById(e))) return ''; var bg = ''; if (e.style) { if (xStr(c)) { e.style.backgroundColor = c; } if (xStr(i)) { e.style.backgroundImage = (i != '') ? 'url(' + i + ')' : null; } bg = e.style.backgroundColor; } return bg; } function xBar(dir, conStyle, barStyle) { this.value = 0; this.update = function(v) { if (v < 0) v = 0; else if (v > this.inMax) v = this.inMax; this.con.title = this.bar.title = this.value = v; switch (this.dir) { case 'ltr': v = this.scale(v, this.w); xLeft(this.bar, v - this.w); break; case 'rtl': v = this.scale(v, this.w); xLeft(this.bar, this.w - v); break; case 'btt': v = this.scale(v, this.h); xTop(this.bar, this.h - v); break; case 'ttb': v = this.scale(v, this.h); xTop(this.bar, v - this.h); break; } }; this.paint = function(x, y, w, h) { if (xNum(x)) this.x = x; if (xNum(y)) this.y = y; if (xNum(w)) this.w = w; if (xNum(h)) this.h = h; xResizeTo(this.con, this.w, this.h); xMoveTo(this.con, this.x, this.y); xResizeTo(this.bar, this.w, this.h); xMoveTo(this.bar, 0, 0); }; this.reset = function(max, start) { if (xNum(max)) this.inMax = max; if (xNum(start)) this.start = start; this.update(this.start); }; this.scale = function(v, outMax) { return Math.round(xLinearScale(v, 0, this.inMax, 0, outMax)); }; this.dir = dir; this.x = 0; this.y = 0; this.w = 100; this.h = 100; this.inMax = 100; this.start = 0; this.conStyle = conStyle; this.barStyle = barStyle; this.con = document.createElement('DIV'); this.con.className = this.conStyle; this.bar = document.createElement('DIV'); this.bar.className = this.barStyle; this.con.appendChild(this.bar); document.body.appendChild(this.con); } function xCapitalize(str) { var i, c, wd, s = '', cap = true; for (i = 0; i < str.length; ++i) { c = str.charAt(i); wd = isWordDelim(c); if (wd) { cap = true; } if (cap && !wd) { c = c.toUpperCase(); cap = false; } s += c; } return s; function isWordDelim(c) { return c == ' ' || c == '\n' || c == '\t'; } } function xCardinalPosition(e, cp, margin, outside) { if (!(e = xGetElementById(e))) return; if (typeof (cp) != 'string') { window.status = 'xCardinalPosition error: cp=' + cp + ', id=' + e.id; return; } var x = xLeft(e), y = xTop(e), w = xWidth(e), h = xHeight(e); var pw, ph, p = xParent(e); if (p == document || p.nodeName.toLowerCase() == 'html') { pw = xClientWidth(); ph = xClientHeight(); } else { pw = xWidth(p); ph = xHeight(p); } var sx = xScrollLeft(p), sy = xScrollTop(p); var right = sx + pw, bottom = sy + ph; var cenLeft = sx + Math.floor((pw - w) / 2), cenTop = sy + Math.floor((ph - h) / 2); if (!margin) margin = 0; else { if (outside) margin = -margin; sx += margin; sy += margin; right -= margin; bottom -= margin; } switch (cp.toLowerCase()) { case 'n': x = cenLeft; if (outside) y = sy - h; else y = sy; break; case 'ne': if (outside) { x = right; y = sy - h; } else { x = right - w; y = sy; } break; case 'e': y = cenTop; if (outside) x = right; else x = right - w; break; case 'se': if (outside) { x = right; y = bottom; } else { x = right - w; y = bottom - h } break; case 's': x = cenLeft; if (outside) y = sy - h; else y = bottom - h; break; case 'sw': if (outside) { x = sx - w; y = bottom; } else { x = sx; y = bottom - h; } break; case 'w': y = cenTop; if (outside) x = sx - w; else x = sx; break; case 'nw': if (outside) { x = sx - w; y = sy - h; } else { x = sx; y = sy; } break; case 'cen': x = cenLeft; y = cenTop; break; case 'cenh': x = cenLeft; break; case 'cenv': y = cenTop; break; } var o = new Object(); o.x = x; o.y = y; return o; } function xClientHeight() { var v = 0, d = document, w = window; if (d.compatMode == 'CSS1Compat' && !w.opera && d.documentElement && d.documentElement.clientHeight) { v = d.documentElement.clientHeight; } else if (d.body && d.body.clientHeight) { v = d.body.clientHeight; } else if (xDef(w.innerWidth, w.innerHeight, d.width)) { v = w.innerHeight; if (d.width > w.innerWidth) v -= 16; } return v; } function xClientWidth() { var v = 0, d = document, w = window; if (d.compatMode == 'CSS1Compat' && !w.opera && d.documentElement && d.documentElement.clientWidth) { v = d.documentElement.clientWidth; } else if (d.body && d.body.clientWidth) { v = d.body.clientWidth; } else if (xDef(w.innerWidth, w.innerHeight, d.height)) { v = w.innerWidth; if (d.height > w.innerHeight) v -= 16; } return v; } function xClip(e, t, r, b, l) { if (!(e = xGetElementById(e))) return; if (e.style) { if (xNum(l)) e.style.clip = 'rect(' + t + 'px ' + r + 'px ' + b + 'px ' + l + 'px)'; else e.style.clip = 'rect(0 ' + parseInt(e.style.width) + 'px ' + parseInt(e.style.height) + 'px 0)'; } } function xColEqualizer() { var i, j, h = []; for (i = 1, j = 0; i < arguments.length; i += 2, ++j) { h[j] = xHeight(arguments[i]); } h.sort(d); for (i = 0; i < arguments.length; i += 2) { xHeight(arguments[i], h[0]); } return h[0]; function d(a, b) { return b - a; } } function xCollapsible(outerEle, bShow) { var container = xGetElementById(outerEle); if (!container) { return null; } var isUL = container.nodeName.toUpperCase() == 'UL'; var i, trg, aTgt = xGetElementsByTagName(isUL ? 'UL' : 'DIV', container); for (i = 0; i < aTgt.length; ++i) { trg = xPrevSib(aTgt[i]); if (trg && (isUL || trg.nodeName.charAt(0).toUpperCase() == 'H')) { aTgt[i].xTrgPtr = trg; aTgt[i].style.display = bShow ? 'block' : 'none'; trg.style.cursor = 'pointer'; trg.xTgtPtr = aTgt[i]; trg.onclick = trg_onClick; } } function trg_onClick() { var tgt = this.xTgtPtr.style; tgt.display = (tgt.display == 'none') ? "block" : "none"; } this.displayAll = function(bShow) { for (var i = 0; i < aTgt.length; ++i) { if (aTgt[i].xTrgPtr) { aTgt[i].style.display = bShow ? "block" : "none"; } } }; this.onUnload = function() { if (!container || !aTgt) { return; } for (i = 0; i < aTgt.length; ++i) { trg = aTgt[i].xTrgPtr; if (trg) { if (trg.xTgtPtr) { trg.xTgtPtr.TrgPtr = null; trg.xTgtPtr = null; } trg.onclick = null; } } }; } function xColor(e, s) { if (!(e = xGetElementById(e))) return ''; var c = ''; if (e.style && xDef(e.style.color)) { if (xStr(s)) e.style.color = s; c = e.style.color; } return c; } function xCreateElement(sTag) { if (document.createElement) return document.createElement(sTag); else return null; } function xDef() { for (var i = 0; i < arguments.length; ++i) { if (typeof (arguments[i]) == 'undefined') return false; } return true; } function xDeg(rad) { return rad * (180 / Math.PI); } function xDeleteCookie(name, path) { if (xGetCookie(name)) { document.cookie = name + "=" + "; path=" + ((!path) ? "/" : path) + "; expires=" + new Date(0).toGMTString(); } } function xDisableDrag(id, last) { if (!window._xDrgMgr) return; var ele = xGetElementById(id); ele.xDraggable = false; ele.xODS = null; ele.xOD = null; ele.xODE = null; xRemoveEventListener(ele, 'mousedown', _xOMD, false); if (_xDrgMgr.mm && last) { _xDrgMgr.mm = false; xRemoveEventListener(document, 'mousemove', _xOMM, false); } } function xDisplay(e, s) { if (!(e = xGetElementById(e))) return null; if (e.style && xDef(e.style.display)) { if (xStr(s)) e.style.display = s; return e.style.display; } return null; } function xEach(c, f, s) { var l = c.length; for (var i = (s || 0); i < l; i++) { f(c[i], i, l); } }; function xEachUntilReturn(c, f, s) { var r, l = c.length; for (var i = (s || 0); i < l; i++) { r = f(c[i], i, l); if (r !== undefined) break; } return r; }; function xEditable(container, trigger) { var editElement = null; var container = xGetElementById(container); var trigger = xGetElementById(trigger); var newID = container.id + "_edit"; xAddEventListener(trigger, 'click', BeginEdit); function BeginEdit() { if (!editElement) { editElement = xCreateElement('input'); editElement.setAttribute('id', newID); editElement.setAttribute('name', newID); editElement.setAttribute('value', container.innerHTML); editElement.setAttribute('autocomplete', 'OFF'); xAddEventListener(editElement, 'blur', EndEditClick); xAddEventListener(editElement, 'keypress', EndEditKey); container.innerHTML = ''; container.appendChild(editElement); editElement.select(); editElement.focus(); } else { editElement.select(); editElement.focus(); } } function EndEditClick() { container.innerHTML = editElement.value; editElement = null; } function EndEditKey(evt) { var e = new xEvent(evt); if (e.keyCode == 13) { container.innerHTML = editElement.value; editElement = null; } } } function xEllipse(e, xRadius, yRadius, radiusInc, totalTime, startAngle, stopAngle) { if (!(e = xGetElementById(e))) return; if (!e.timeout) e.timeout = 25; e.xA = xRadius; e.yA = yRadius; e.radiusInc = radiusInc; e.slideTime = totalTime; startAngle *= (Math.PI / 180); stopAngle *= (Math.PI / 180); var startTime = (startAngle * e.slideTime) / (stopAngle - startAngle); e.stopTime = e.slideTime + startTime; e.B = (stopAngle - startAngle) / e.slideTime; e.xD = xLeft(e) - Math.round(e.xA * Math.cos(e.B * startTime)); e.yD = xTop(e) - Math.round(e.yA * Math.sin(e.B * startTime)); e.xTarget = Math.round(e.xA * Math.cos(e.B * e.stopTime) + e.xD); e.yTarget = Math.round(e.yA * Math.sin(e.B * e.stopTime) + e.yD); var d = new Date(); e.C = d.getTime() - startTime; if (!e.moving) { e.stop = false; _xEllipse(e); } } function _xEllipse(e) { if (!(e = xGetElementById(e))) return; var now, t, newY, newX; now = new Date(); t = now.getTime() - e.C; if (e.stop) { e.moving = false; } else if (t < e.stopTime) { setTimeout("_xEllipse('" + e.id + "')", e.timeout); if (e.radiusInc) { e.xA += e.radiusInc; e.yA += e.radiusInc; } newX = Math.round(e.xA * Math.cos(e.B * t) + e.xD); newY = Math.round(e.yA * Math.sin(e.B * t) + e.yD); xMoveTo(e, newX, newY); e.moving = true; } else { if (e.radiusInc) { e.xTarget = Math.round(e.xA * Math.cos(e.B * e.slideTime) + e.xD); e.yTarget = Math.round(e.yA * Math.sin(e.B * e.slideTime) + e.yD); } xMoveTo(e, e.xTarget, e.yTarget); e.moving = false; if (e.onslideend) e.onslideend(); } } var _xDrgMgr = { ele: null, mm: false }; function xEnableDrag(id, fS, fD, fE) { var ele = xGetElementById(id); ele.xDraggable = true; ele.xODS = fS; ele.xOD = fD; ele.xODE = fE; xAddEventListener(ele, 'mousedown', _xOMD, false); if (!_xDrgMgr.mm) { _xDrgMgr.mm = true; xAddEventListener(document, 'mousemove', _xOMM, false); } } function _xOMD(e) { var evt = new xEvent(e); var ele = evt.target; while (ele && !ele.xDraggable) { ele = xParent(ele); } if (ele) { xPreventDefault(e); ele.xDPX = evt.pageX; ele.xDPY = evt.pageY; _xDrgMgr.ele = ele; xAddEventListener(document, 'mouseup', _xOMU, false); if (ele.xODS) { ele.xODS(ele, evt.pageX, evt.pageY); } } } function _xOMM(e) { var evt = new xEvent(e); if (_xDrgMgr.ele) { xPreventDefault(e); var ele = _xDrgMgr.ele; var dx = evt.pageX - ele.xDPX; var dy = evt.pageY - ele.xDPY; ele.xDPX = evt.pageX; ele.xDPY = evt.pageY; if (ele.xOD) { ele.xOD(ele, dx, dy); } else { xMoveTo(ele, xLeft(ele) + dx, xTop(ele) + dy); } } } function _xOMU(e) { if (_xDrgMgr.ele) { xPreventDefault(e); xRemoveEventListener(document, 'mouseup', _xOMU, false); if (_xDrgMgr.ele.xODE) { var evt = new xEvent(e); _xDrgMgr.ele.xODE(_xDrgMgr.ele, evt.pageX, evt.pageY); } _xDrgMgr.ele = null; } } function xEvalTextarea() { var f = document.createElement('FORM'); f.onsubmit = 'return false'; var t = document.createElement('TEXTAREA'); t.id = 'xDebugTA'; t.name = 'xDebugTA'; t.rows = '20'; t.cols = '60'; var b = document.createElement('INPUT'); b.type = 'button'; b.value = 'Evaluate'; b.onclick = function() { eval(this.form.xDebugTA.value); }; f.appendChild(t); f.appendChild(b); document.body.appendChild(f); } function xEvent(evt) { var e = evt || window.event; if (!e) return; if (e.type) this.type = e.type; if (e.target) this.target = e.target; else if (e.srcElement) this.target = e.srcElement; if (e.relatedTarget) this.relatedTarget = e.relatedTarget; else if (e.type == 'mouseover' && e.fromElement) this.relatedTarget = e.fromElement; else if (e.type == 'mouseout') this.relatedTarget = e.toElement; if (xDef(e.pageX, e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; } else if (xDef(e.clientX, e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); } if (xDef(e.offsetX, e.offsetY)) { this.offsetX = e.offsetX; this.offsetY = e.offsetY; } else if (xDef(e.layerX, e.layerY)) { this.offsetX = e.layerX; this.offsetY = e.layerY; } else { this.offsetX = this.pageX - xPageX(this.target); this.offsetY = this.pageY - xPageY(this.target); } this.keyCode = e.keyCode || e.which || 0; this.shiftKey = e.shiftKey; this.ctrlKey = e.ctrlKey; this.altKey = e.altKey; } function xFenster(eleId, iniX, iniY, barId, resBtnId, maxBtnId) { var me = this; var ele = xGetElementById(eleId); var rBtn = xGetElementById(resBtnId); var mBtn = xGetElementById(maxBtnId); var x, y, w, h, maximized = false; this.onunload = function() { if (!window.opera) { xDisableDrag(barId); xDisableDrag(rBtn); mBtn.onclick = ele.onmousedown = null; me = ele = rBtn = mBtn = null; } }; this.paint = function() { xMoveTo(rBtn, xWidth(ele) - xWidth(rBtn), xHeight(ele) - xHeight(rBtn)); xMoveTo(mBtn, xWidth(ele) - xWidth(rBtn), 0); }; function barOnDrag(e, mdx, mdy) { xMoveTo(ele, xLeft(ele) + mdx, xTop(ele) + mdy); } function resOnDrag(e, mdx, mdy) { xResizeTo(ele, xWidth(ele) + mdx, xHeight(ele) + mdy); me.paint(); } function fenOnMousedown() { xZIndex(ele, xFenster.z++); } function maxOnClick() { if (maximized) { maximized = false; xResizeTo(ele, w, h); xMoveTo(ele, x, y); } else { w = xWidth(ele); h = xHeight(ele); x = xLeft(ele); y = xTop(ele); xMoveTo(ele, xScrollLeft(), xScrollTop()); maximized = true; xResizeTo(ele, xClientWidth(), xClientHeight()); } me.paint(); } xFenster.z++; xMoveTo(ele, iniX, iniY); this.paint(); xEnableDrag(barId, null, barOnDrag, null); xEnableDrag(rBtn, null, resOnDrag, null); mBtn.onclick = maxOnClick; ele.onmousedown = fenOnMousedown; xShow(ele); } xFenster.z = 0; function xFindAfterByClassName(ele, clsName) { var re = new RegExp('\\b' + clsName + '\\b', 'i'); return xWalkToLast(ele, function(n) { if (n.className.search(re) != -1) return n; }); } function xFindBeforeByClassName(ele, clsName) { var re = new RegExp('\\b' + clsName + '\\b', 'i'); return xWalkToFirst(ele, function(n) { if (n.className.search(re) != -1) return n; }); } function xFirstChild(e, t) { var c = e ? e.firstChild : null; if (t) while (c && c.nodeName != t) { c = c.nextSibling; } else while (c && c.nodeType != 1) { c = c.nextSibling; } return c; } function xGetComputedStyle(oEle, sProp, bInt) { var s, p = 'undefined'; var dv = document.defaultView; if (dv && dv.getComputedStyle) { s = dv.getComputedStyle(oEle, ''); if (s) p = s.getPropertyValue(sProp); } else if (oEle.currentStyle) { var i, c, a = sProp.split('-'); sProp = a[0]; for (i = 1; i < a.length; ++i) { c = a[i].charAt(0); sProp += a[i].replace(c, c.toUpperCase()); } p = oEle.currentStyle[sProp]; } else return null; return bInt ? (parseInt(p) || 0) : p; } function xGetCookie(name) { var value = null, search = name + "="; if (document.cookie.length > 0) { var offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; var end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; value = unescape(document.cookie.substring(offset, end)); } } return value; } function xGetCSSRules(ss) { return ss.rules ? ss.rules : ss.cssRules; } function xGetElementById(e) { if (typeof (e) == 'string') { if (document.getElementById) e = document.getElementById(e); else if (document.all) e = document.all[e]; else e = null; } return e; } function xGetElementsByAttribute(sTag, sAtt, sRE, fn) { var a, list, found = new Array(), re = new RegExp(sRE, 'i'); list = xGetElementsByTagName(sTag); for (var i = 0; i < list.length; ++i) { a = list[i].getAttribute(sAtt); if (!a) { a = list[i][sAtt]; } if (typeof (a) == 'string' && a.search(re) != -1) { found[found.length] = list[i]; if (fn) fn(list[i]); } } return found; } function xGetElementsByClassName(c, p, t, f) { var found = new Array(); var re = new RegExp('\\b' + c + '\\b', 'i'); var list = xGetElementsByTagName(t, p); for (var i = 0; i < list.length; ++i) { if (list[i].className && list[i].className.search(re) != -1) { found[found.length] = list[i]; if (f) f(list[i]); } } return found; } function xGetElementsByTagName(t, p) { var list = null; t = t || '*'; p = p || document; if (p.getElementsByTagName) { list = p.getElementsByTagName(t); if (t == '*' && (!list || !list.length)) list = p.all; } else { if (t == '*') list = p.all; else if (p.all && p.all.tags) list = p.all.tags(t); } return list || new Array(); } function xGetElePropsArray(ele, eleName) { var u = 'undefined'; var i = 0, a = new Array(); nv('Element', eleName); nv('id', (xDef(ele.id) ? ele.id : u)); nv('tagName', (xDef(ele.tagName) ? ele.tagName : u)); nv('xWidth()', xWidth(ele)); nv('style.width', (xDef(ele.style) && xDef(ele.style.width) ? ele.style.width : u)); nv('offsetWidth', (xDef(ele.offsetWidth) ? ele.offsetWidth : u)); nv('scrollWidth', (xDef(ele.offsetWidth) ? ele.offsetWidth : u)); nv('clientWidth', (xDef(ele.clientWidth) ? ele.clientWidth : u)); nv('xHeight()', xHeight(ele)); nv('style.height', (xDef(ele.style) && xDef(ele.style.height) ? ele.style.height : u)); nv('offsetHeight', (xDef(ele.offsetHeight) ? ele.offsetHeight : u)); nv('scrollHeight', (xDef(ele.offsetHeight) ? ele.offsetHeight : u)); nv('clientHeight', (xDef(ele.clientHeight) ? ele.clientHeight : u)); nv('xLeft()', xLeft(ele)); nv('style.left', (xDef(ele.style) && xDef(ele.style.left) ? ele.style.left : u)); nv('offsetLeft', (xDef(ele.offsetLeft) ? ele.offsetLeft : u)); nv('style.pixelLeft', (xDef(ele.style) && xDef(ele.style.pixelLeft) ? ele.style.pixelLeft : u)); nv('xTop()', xTop(ele)); nv('style.top', (xDef(ele.style) && xDef(ele.style.top) ? ele.style.top : u)); nv('offsetTop', (xDef(ele.offsetTop) ? ele.offsetTop : u)); nv('style.pixelTop', (xDef(ele.style) && xDef(ele.style.pixelTop) ? ele.style.pixelTop : u)); nv('', ''); nv('xGetComputedStyle()', ''); nv('top'); nv('right'); nv('bottom'); nv('left'); nv('width'); nv('height'); nv('color'); nv('background-color'); nv('font-family'); nv('font-size'); nv('text-align'); nv('line-height'); nv('content'); nv('float'); nv('clear'); nv('margin'); nv('padding'); nv('padding-top'); nv('padding-right'); nv('padding-bottom'); nv('padding-left'); nv('border-top-width'); nv('border-right-width'); nv('border-bottom-width'); nv('border-left-width'); nv('position'); nv('overflow'); nv('visibility'); nv('display'); nv('z-index'); nv('clip'); nv('cursor'); return a; function nv(name, value) { a[i] = new Object(); a[i].name = name; a[i].value = typeof (value) == 'undefined' ? xGetComputedStyle(ele, name) : value; ++i; } } function xGetElePropsString(ele, eleName, newLine) { var s = '', a = xGetElePropsArray(ele, eleName); for (var i = 0; i < a.length; ++i) { s += a[i].name + ' = ' + a[i].value + (newLine || '\n'); } return s; } function xGetStyleSheetFromLink(cl) { return cl.styleSheet ? cl.styleSheet : cl.sheet; } function xGetURLArguments() { var idx = location.href.indexOf('?'); var params = new Array(); if (idx != -1) { var pairs = location.href.substring(idx + 1, location.href.length).split('&'); for (var i = 0; i < pairs.length; i++) { nameVal = pairs[i].split('='); params[i] = nameVal[1]; params[nameVal[0]] = nameVal[1]; } } return params; } function xHasClass(e, c) { e = xGetElementById(e); if (!e || !e.className) return false; return (e.className == c) || e.className.match(new RegExp('\\b' + c + '\\b')); }; function xHasPoint(e, x, y, t, r, b, l) { if (!xNum(t)) { t = r = b = l = 0; } else if (!xNum(r)) { r = b = l = t; } else if (!xNum(b)) { l = r; b = t; } var eX = xPageX(e), eY = xPageY(e); return (x >= eX + l && x <= eX + xWidth(e) - r && y >= eY + t && y <= eY + xHeight(e) - b); } function xHasStyleSelector(ss) { if (!xHasStyleSheets()) return undefined; function testSelector(cr) { return cr.selectorText.indexOf(ss) >= 0; } return xTraverseDocumentStyleSheets(testSelector); } function xHasStyleSheets() { return document.styleSheets ? true : false; } function xHeight(e, h) { if (!(e = xGetElementById(e))) return 0; if (xNum(h)) { if (h < 0) h = 0; else h = Math.round(h); } else h = -1; var css = xDef(e.style); if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') { h = xClientHeight(); } else if (css && xDef(e.offsetHeight) && xStr(e.style.height)) { if (h >= 0) { var pt = 0, pb = 0, bt = 0, bb = 0; if (document.compatMode == 'CSS1Compat') { var gcs = xGetComputedStyle; pt = gcs(e, 'padding-top', 1); if (pt !== null) { pb = gcs(e, 'padding-bottom', 1); bt = gcs(e, 'border-top-width', 1); bb = gcs(e, 'border-bottom-width', 1); } else if (xDef(e.offsetHeight, e.style.height)) { e.style.height = h + 'px'; pt = e.offsetHeight - h; } } h -= (pt + pb + bt + bb); if (isNaN(h) || h < 0) return; else e.style.height = h + 'px'; } h = e.offsetHeight; } else if (css && xDef(e.style.pixelHeight)) { if (h >= 0) e.style.pixelHeight = h; h = e.style.pixelHeight; } return h; } function xHex(n, digits, prefix) { var p = '', n = Math.ceil(n); if (prefix) p = prefix; n = n.toString(16); for (var i = 0; i < digits - n.length; ++i) { p += '0'; } return p + n; } function xHide(e) { return xVisibility(e, 0); } var xOp7Up, xOp6Dn, xIE4Up, xIE4, xIE5, xNN4, xUA = navigator.userAgent.toLowerCase(); if (window.opera) { var i = xUA.indexOf('opera'); if (i != -1) { var v = parseInt(xUA.charAt(i + 6)); xOp7Up = v >= 7; xOp6Dn = v < 7; } } else if (navigator.vendor != 'KDE' && document.all && xUA.indexOf('msie') != -1) { xIE4Up = parseFloat(navigator.appVersion) >= 4; xIE4 = xUA.indexOf('msie 4') != -1; xIE5 = xUA.indexOf('msie 5') != -1; } else if (document.layers) { xNN4 = true; } xMac = xUA.indexOf('mac') != -1; function xImgAsyncWait(fnStatus, fnInit, fnError, sErrorImg, sAbortImg, imgArray) { var i, imgs = imgArray || document.images; for (i = 0; i < imgs.length; ++i) { imgs[i].onload = imgOnLoad; imgs[i].onerror = imgOnError; imgs[i].onabort = imgOnAbort; } xIAW.fnStatus = fnStatus; xIAW.fnInit = fnInit; xIAW.fnError = fnError; xIAW.imgArray = imgArray; xIAW(); function imgOnLoad() { this.wasLoaded = true; } function imgOnError() { if (sErrorImg && !this.wasError) { this.src = sErrorImg; } this.wasError = true; } function imgOnAbort() { if (sAbortImg && !this.wasAborted) { this.src = sAbortImg; } this.wasAborted = true; } } function xIAW() { var me = arguments.callee; if (!me) { return; } var i, imgs = me.imgArray ? me.imgArray : document.images; var c = 0, e = 0, a = 0, n = imgs.length; for (i = 0; i < n; ++i) { if (imgs[i].wasError) { ++e; } else if (imgs[i].wasAborted) { ++a; } else if (imgs[i].complete || imgs[i].wasLoaded) { ++c; } } if (me.fnStatus) { me.fnStatus(n, c, e, a); } if (c + e + a == n) { if ((e || a) && me.fnError) { me.fnError(n, c, e, a); } else if (me.fnInit) { me.fnInit(); } } else setTimeout('xIAW()', 250); } function xImgRollSetup(p, s, x) { var ele, id; for (var i = 3; i < arguments.length; ++i) { id = arguments[i]; if (ele = xGetElementById(id)) { ele.xIOU = p + id + x; ele.xIOO = new Image(); ele.xIOO.src = p + id + s + x; ele.onmouseout = imgOnMouseout; ele.onmouseover = imgOnMouseover; } } function imgOnMouseout(e) { if (this.xIOU) { this.src = this.xIOU; } } function imgOnMouseover(e) { if (this.xIOO && this.xIOO.complete) { this.src = this.xIOO.src; } } } function xInnerHtml(e, h) { if (!(e = xGetElementById(e)) || !xStr(e.innerHTML)) return null; var s = e.innerHTML; if (xStr(h)) { e.innerHTML = h; } return s; } function xIntersection(e1, e2, o) { var ix1, iy2, iw, ih, intersect = true; var e1x1 = xPageX(e1); var e1x2 = e1x1 + xWidth(e1); var e1y1 = xPageY(e1); var e1y2 = e1y1 + xHeight(e1); var e2x1 = xPageX(e2); var e2x2 = e2x1 + xWidth(e2); var e2y1 = xPageY(e2); var e2y2 = e2y1 + xHeight(e2); if (e1x1 <= e2x1) { ix1 = e2x1; if (e1x2 < e2x1) intersect = false; else iw = Math.min(e1x2, e2x2) - e2x1; } else { ix1 = e1x1; if (e2x2 < e1x1) intersect = false; else iw = Math.min(e1x2, e2x2) - e1x1; } if (e1y2 >= e2y2) { iy2 = e2y2; if (e1y1 > e2y2) intersect = false; else ih = e2y2 - Math.max(e1y1, e2y1); } else { iy2 = e1y2; if (e2y1 > e1y2) intersect = false; else ih = e1y2 - Math.max(e1y1, e2y1); } if (intersect && typeof (o) == 'object') { o.x = ix1; o.y = iy2 - ih; o.w = iw; o.h = ih; } return intersect; } function xLeft(e, iX) { if (!(e = xGetElementById(e))) return 0; var css = xDef(e.style); if (css && xStr(e.style.left)) { if (xNum(iX)) e.style.left = iX + 'px'; else { iX = parseInt(e.style.left); if (isNaN(iX)) iX = xGetComputedStyle(e, 'left', 1); if (isNaN(iX)) iX = 0; } } else if (css && xDef(e.style.pixelLeft)) { if (xNum(iX)) e.style.pixelLeft = iX; else iX = e.style.pixelLeft; } return iX; } xLibrary = { version: '4.05', license: 'GNU LGPL', url: 'http://cross-browser.com/' }; function xLinearScale(val, iL, iH, oL, oH) { var m = (oH - oL) / (iH - iL); var b = oL - (iL * m); return m * val + b; } function xLoadScript(url) { if (document.createElement && document.getElementsByTagName) { var s = document.createElement('script'); var h = document.getElementsByTagName('head'); if (s && h.length) { s.src = url; h[0].appendChild(s); } } } function xMenu1(triggerId, menuId, mouseMargin, openEvent) { var isOpen = false; var trg = xGetElementById(triggerId); var mnu = xGetElementById(menuId); if (trg && mnu) { xAddEventListener(trg, openEvent, onOpen, false); } function onOpen() { if (!isOpen) { xMoveTo(mnu, xPageX(trg), xPageY(trg) + xHeight(trg)); xShow(mnu); xAddEventListener(document, 'mousemove', onMousemove, false); isOpen = true; } } function onMousemove(ev) { var e = new xEvent(ev); if (!xHasPoint(mnu, e.pageX, e.pageY, -mouseMargin) && !xHasPoint(trg, e.pageX, e.pageY, -mouseMargin)) { xHide(mnu); xRemoveEventListener(document, 'mousemove', onMousemove, false); isOpen = false; } } } function xMenu1A(triggerId, menuId, mouseMargin, slideTime, openEvent) { var isOpen = false; var trg = xGetElementById(triggerId); var mnu = xGetElementById(menuId); if (trg && mnu) { xHide(mnu); xAddEventListener(trg, openEvent, onOpen, false); } function onOpen() { if (!isOpen) { xMoveTo(mnu, xPageX(trg), xPageY(trg)); xShow(mnu); xSlideTo(mnu, xPageX(trg), xPageY(trg) + xHeight(trg), slideTime); xAddEventListener(document, 'mousemove', onMousemove, false); isOpen = true; } } function onMousemove(ev) { var e = new xEvent(ev); if (!xHasPoint(mnu, e.pageX, e.pageY, -mouseMargin) && !xHasPoint(trg, e.pageX, e.pageY, -mouseMargin)) { xRemoveEventListener(document, 'mousemove', onMousemove, false); xSlideTo(mnu, xPageX(trg), xPageY(trg), slideTime); setTimeout("xHide('" + menuId + "')", slideTime); isOpen = false; } } } function xMenu1B(openTriggerId, closeTriggerId, menuId, slideTime, bOnClick) { xMenu1B.instances[xMenu1B.instances.length] = this; var isOpen = false; var oTrg = xGetElementById(openTriggerId); var cTrg = xGetElementById(closeTriggerId); var mnu = xGetElementById(menuId); if (oTrg && cTrg && mnu) { xHide(mnu); if (bOnClick) oTrg.onclick = openOnEvent; else oTrg.onmouseover = openOnEvent; cTrg.onclick = closeOnClick; } function openOnEvent() { if (!isOpen) { for (var i = 0; i < xMenu1B.instances.length; ++i) { xMenu1B.instances[i].close(); } xMoveTo(mnu, xPageX(oTrg), xPageY(oTrg)); xShow(mnu); xSlideTo(mnu, xPageX(oTrg), xPageY(oTrg) + xHeight(oTrg), slideTime); isOpen = true; } } function closeOnClick() { if (isOpen) { xSlideTo(mnu, xPageX(oTrg), xPageY(oTrg), slideTime); setTimeout("xHide('" + menuId + "')", slideTime); isOpen = false; } } this.close = function() { closeOnClick(); } } xMenu1B.instances = new Array(); function xMenu5(idUL, btnClass, idAutoOpen) { var i, ul, btns, mnu = xGetElementById(idUL); btns = xGetElementsByClassName(btnClass, mnu, 'DIV'); for (i = 0; i < btns.length; ++i) { ul = xNextSib(btns[i], 'UL'); btns[i].xClpsTgt = ul; btns[i].onclick = btn_onClick; set_display(btns[i], 0); } if (idAutoOpen) { var e = xGetElementById(idAutoOpen); while (e && e != mnu) { if (e.xClpsTgt) set_display(e, 1); while (e && e != mnu && e.nodeName != 'LI') e = e.parentNode; e = e.parentNode; while (e && !e.xClpsTgt) e = xPrevSib(e); } } function btn_onClick() { var thisLi, fc, pUl; if (this.xClpsTgt.style.display == 'none') { set_display(this, 1); var li = this.parentNode; thisLi = li; pUl = li.parentNode; li = xFirstChild(pUl); while (li) { if (li != thisLi) { fc = xFirstChild(li); if (fc && fc.xClpsTgt) { set_display(fc, 0); } } li = xNextSib(li); } } else { set_display(this, 0); } } function set_display(ele, bBlock) { if (bBlock) { ele.xClpsTgt.style.display = 'block'; ele.innerHTML = '-'; } else { ele.xClpsTgt.style.display = 'none'; ele.innerHTML = '+'; } } this.onUnload = function() { for (i = 0; i < btns.length; ++i) { btns[i].xClpsTgt = null; btns[i].onclick = null; } } } function xMoveTo(e, x, y) { xLeft(e, x); xTop(e, y); } function xName(e) { if (!e) return e; else if (e.id && e.id != "") return e.id; else if (e.name && e.name != "") return e.name; else if (e.nodeName && e.nodeName != "") return e.nodeName; else if (e.tagName && e.tagName != "") return e.tagName; else return e; } function xNextSib(e, t) { var s = e ? e.nextSibling : null; if (t) while (s && s.nodeName != t) { s = s.nextSibling; } else while (s && s.nodeType != 1) { s = s.nextSibling; } return s; } function xNum() { for (var i = 0; i < arguments.length; ++i) { if (isNaN(arguments[i]) || typeof (arguments[i]) != 'number') return false; } return true; } function xOffsetLeft(e) { if (!(e = xGetElementById(e))) return 0; if (xDef(e.offsetLeft)) return e.offsetLeft; else return 0; } function xOffsetTop(e) { if (!(e = xGetElementById(e))) return 0; if (xDef(e.offsetTop)) return e.offsetTop; else return 0; } function xOpacity(e, o) { var set = xDef(o); if (!(e = xGetElementById(e))) return 2; if (xStr(e.style.opacity)) { if (set) e.style.opacity = o + ''; else o = parseFloat(e.style.opacity); } else if (xStr(e.style.filter)) { if (set) e.style.filter = 'alpha(opacity=' + (100 * o) + ')'; else if (e.filters && e.filters.alpha) { o = e.filters.alpha.opacity / 100; } } else if (xStr(e.style.MozOpacity)) { if (set) e.style.MozOpacity = o + ''; else o = parseFloat(e.style.MozOpacity); } else if (xStr(e.style.KhtmlOpacity)) { if (set) e.style.KhtmlOpacity = o + ''; else o = parseFloat(e.style.KhtmlOpacity); } return isNaN(o) ? 1 : o; } function xPad(s, len, c, left) { if (typeof s != 'string') s = s + ''; if (left) { for (var i = s.length; i < len; ++i) s = c + s; } else { for (var i = s.length; i < len; ++i) s += c; } return s; } function xPageX(e) { if (!(e = xGetElementById(e))) return 0; var x = 0; while (e) { if (xDef(e.offsetLeft)) x += e.offsetLeft; e = xDef(e.offsetParent) ? e.offsetParent : null; } return x; } function xPageY(e) { if (!(e = xGetElementById(e))) return 0; var y = 0; while (e) { if (xDef(e.offsetTop)) y += e.offsetTop; e = xDef(e.offsetParent) ? e.offsetParent : null; } return y; } function xParaEq(e, xExpr, yExpr, totalTime) { if (!(e = xGetElementById(e))) return; e.t = 0; e.tStep = .008; if (!e.timeout) e.timeout = 25; e.xExpr = xExpr; e.yExpr = yExpr; e.slideTime = totalTime; var d = new Date(); e.C = d.getTime(); if (!e.moving) { e.stop = false; _xParaEq(e); } } function _xParaEq(e) { if (!(e = xGetElementById(e))) return; var now = new Date(); var et = now.getTime() - e.C; e.t += e.tStep; t = e.t; if (e.stop) { e.moving = false; } else if (!e.slideTime || et < e.slideTime) { setTimeout("_xParaEq('" + e.id + "')", e.timeout); var p = xParent(e), centerX, centerY; centerX = (xWidth(p) / 2) - (xWidth(e) / 2); centerY = (xHeight(p) / 2) - (xHeight(e) / 2); e.xTarget = Math.round((eval(e.xExpr) * centerX) + centerX) + xScrollLeft(p); e.yTarget = Math.round((eval(e.yExpr) * centerY) + centerY) + xScrollTop(p); xMoveTo(e, e.xTarget, e.yTarget); e.moving = true; } else { e.moving = false; if (e.onslideend) e.onslideend(); } } function xParent(e, bNode) { if (!(e = xGetElementById(e))) return null; var p = null; if (!bNode && xDef(e.offsetParent)) p = e.offsetParent; else if (xDef(e.parentNode)) p = e.parentNode; else if (xDef(e.parentElement)) p = e.parentElement; return p; } function xParentChain(e, delim, bNode) { if (!(e = xGetElementById(e))) return; var lim = 100, s = "", d = delim || "\n"; while (e) { s += xName(e) + ', ofsL:' + e.offsetLeft + ', ofsT:' + e.offsetTop + d; e = xParent(e, bNode); if (!lim--) break; } return s; } function xParentNode(ele, n) { while (ele && n--) { ele = ele.parentNode; } return ele; } function xPopup(sTmrType, uTimeout, sPos1, sPos2, sPos3, sStyle, sId, sUrl) { if (document.getElementById && document.createElement && document.body && document.body.appendChild) { var e = document.createElement('IFRAME'); this.ele = e; e.id = sId; e.style.position = 'absolute'; e.className = sStyle; e.src = sUrl; document.body.appendChild(e); xShow(e); this.tmr = xTimer.set(sTmrType, this, sTmrType, uTimeout); this.open = false; this.margin = 10; this.pos1 = sPos1; this.pos2 = sPos2; this.pos3 = sPos3; this.slideTime = 500; this.interval(); } } xPopup.prototype.show = function() { this.interval(); }; xPopup.prototype.hide = function() { this.timeout(); }; xPopup.prototype.timeout = function() { if (this.open) { var e = this.ele; var pos = xCardinalPosition(e, this.pos3, this.margin, true); xSlideTo(e, pos.x, pos.y, this.slideTime); setTimeout("xHide('" + e.id + "')", this.slideTime); this.open = false; } }; xPopup.prototype.interval = function() { if (!this.open) { var e = this.ele; var pos = xCardinalPosition(e, this.pos1, this.margin, true); xMoveTo(e, pos.x, pos.y); xShow(e); pos = xCardinalPosition(e, this.pos2, this.margin, false); xSlideTo(e, pos.x, pos.y, this.slideTime); this.open = true; } }; function xPreventDefault(e) { if (e && e.preventDefault) e.preventDefault(); else if (window.event) window.event.returnValue = false; } function xPrevSib(e, t) { var s = e ? e.previousSibling : null; if (t) while (s && s.nodeName != t) { s = s.previousSibling; } else while (s && s.nodeType != 1) { s = s.previousSibling; } return s; } function xRad(deg) { return deg * (Math.PI / 180); } function xRemoveClass(e, c) { e = xGetElementById(e); if (!e) return false; if (xHasClass(e, c)) e.className = e.className.replace(new RegExp('(^| )' + c + '($| )', 'g'), ''); return true; }; function xRemoveEventListener(e, eT, eL, cap) { if (!(e = xGetElementById(e))) return; eT = eT.toLowerCase(); if (e == window) { if (eT == 'resize' && e.xREL) { e.xREL = null; return; } if (eT == 'scroll' && e.xSEL) { e.xSEL = null; return; } } if (e.removeEventListener) e.removeEventListener(eT, eL, cap); else if (e.detachEvent) e.detachEvent('on' + eT, eL); else e['on' + eT] = null; } function xResizeTo(e, w, h) { xWidth(e, w); xHeight(e, h); } function xScrollLeft(e, bWin) { var offset = 0; if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') { var w = window; if (bWin && e) w = e; if (w.document.documentElement && w.document.documentElement.scrollLeft) offset = w.document.documentElement.scrollLeft; else if (w.document.body && xDef(w.document.body.scrollLeft)) offset = w.document.body.scrollLeft; } else { e = xGetElementById(e); if (e && xNum(e.scrollLeft)) offset = e.scrollLeft; } return offset; } function xScrollTop(e, bWin) { var offset = 0; if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') { var w = window; if (bWin && e) w = e; if (w.document.documentElement && w.document.documentElement.scrollTop) offset = w.document.documentElement.scrollTop; else if (w.document.body && xDef(w.document.body.scrollTop)) offset = w.document.body.scrollTop; } else { e = xGetElementById(e); if (e && xNum(e.scrollTop)) offset = e.scrollTop; } return offset; } function xSelect(sId, fnSubOnChange) { this.ready = false; var s0 = xGetElementById(sId); if (!s0 || !s0.firstChild || !s0.nodeName || !document.createElement || !s0.form || !s0.form.appendChild) { return; } var s1 = document.createElement('SELECT'); s1.id = sId + '_main'; s1.display = 'block'; s1.style.position = 'absolute'; s1.xSelObj = this; s1.xSelData = new Array(); s0.form.appendChild(s1); var ig = 0, io, op, og, a = s1.xSelData; og = s0.firstChild; while (og) { if (og.nodeName.toLowerCase() == 'optgroup') { io = 0; a[ig] = new Array(); a[ig][io] = og.label; op = og.firstChild; while (op) { if (op.nodeName.toLowerCase() == 'option') { io++; a[ig][io] = op.innerHTML; } op = op.nextSibling; } ig++; } og = og.nextSibling; } for (ig = 0; ig < a.length; ++ig) { op = new Option(a[ig][0]); s1.options[ig] = op; } var s2 = document.createElement('SELECT'); s2.id = sId + '_sub'; s2.display = 'block'; s2.style.position = 'absolute'; s2.xSelMain = s1; s1.xSelSub = s2; s0.form.appendChild(s2); s1.onchange = xSelectMain_OnChange; s2.onchange = fnSubOnChange; xHide(s0); xMoveTo(s1, xOffsetLeft(s0), xOffsetTop(s0)); xShow(s1); xMoveTo(s2, xOffsetLeft(s0) + xWidth(s1), xOffsetTop(s0)); xShow(s2); s1.onchange(); this.ready = true; } function xSelectMain_OnChange() { var io, s2 = this.xSelSub; for (io = 0; io < s2.options.length; ++io) { s2.options[io] = null; } var a = this.xSelData, ig = this.selectedIndex; for (io = 1; io < a[ig].length; ++io) { op = new Option(a[ig][io]); s2.options[io - 1] = op; } } function xSequence(seq) { var ai = 0; var stop = true; var running = false; function runSeq() { if (stop) { running = false; return; } if (this.onslideend) this.onslideend = null; if (ai >= seq.length) ai = 0; var i = ai; ++ai; if (seq[i][0] != -1) { setTimeout(runSeq, seq[i][0]); } else { if (seq[i][2] && seq[i][2][0]) seq[i][2][0].onslideend = runSeq; } if (seq[i][1]) { if (seq[i][2]) seq[i][1].apply(window, seq[i][2]); else seq[i][1](); } } this.run = function(si) { if (!running) { if (xDef(si) && si >= 0 && si < seq.length) ai = si; stop = false; running = true; runSeq(); } }; this.stop = function() { stop = true; }; this.onUnload = function() { if (!window.opera) { for (var i = 0; i < seq.length; ++i) { if (seq[i][2] && seq[i][2][0] && seq[i][2][0].onslideend) seq[i][2][0].onslideend = runSeq; } } }; } function xSetCookie(name, value, expire, path) { document.cookie = name + "=" + escape(value) + ((!expire) ? "" : ("; expires=" + expire.toGMTString())) + "; path=" + ((!path) ? "/" : path); } function xSetIETitle() { var ua = navigator.userAgent.toLowerCase(); if (!window.opera && navigator.vendor != 'KDE' && document.all && ua.indexOf('msie') != -1 && !document.layers) { var i = ua.indexOf('msie') + 1; var v = ua.substr(i + 4, 3); document.title = 'IE ' + v + ' - ' + document.title; } } function xShow(e) { return xVisibility(e, 1); } function xSlideCornerTo(e, corner, targetX, targetY, totalTime) { if (!(e = xGetElementById(e))) return; if (!e.timeout) e.timeout = 25; e.xT = targetX; e.yT = targetY; e.slideTime = totalTime; e.corner = corner.toLowerCase(); e.stop = false; switch (e.corner) { case 'nw': e.xA = e.xT - xLeft(e); e.yA = e.yT - xTop(e); e.xD = xLeft(e); e.yD = xTop(e); break; case 'sw': e.xA = e.xT - xLeft(e); e.yA = e.yT - (xTop(e) + xHeight(e)); e.xD = xLeft(e); e.yD = xTop(e) + xHeight(e); break; case 'ne': e.xA = e.xT - (xLeft(e) + xWidth(e)); e.yA = e.yT - xTop(e); e.xD = xLeft(e) + xWidth(e); e.yD = xTop(e); break; case 'se': e.xA = e.xT - (xLeft(e) + xWidth(e)); e.yA = e.yT - (xTop(e) + xHeight(e)); e.xD = xLeft(e) + xWidth(e); e.yD = xTop(e) + xHeight(e); break; default: alert("xSlideCornerTo: Invalid corner"); return; } if (e.slideLinear) e.B = 1 / e.slideTime; else e.B = Math.PI / (2 * e.slideTime); var d = new Date(); e.C = d.getTime(); if (!e.moving) _xSlideCornerTo(e); } function _xSlideCornerTo(e) { if (!(e = xGetElementById(e))) return; var now, seX, seY; now = new Date(); t = now.getTime() - e.C; if (e.stop) { e.moving = false; e.stop = false; return; } else if (t < e.slideTime) { setTimeout("_xSlideCornerTo('" + e.id + "')", e.timeout); s = e.B * t; if (!e.slideLinear) s = Math.sin(s); newX = Math.round(e.xA * s + e.xD); newY = Math.round(e.yA * s + e.yD); } else { newX = e.xT; newY = e.yT; } seX = xLeft(e) + xWidth(e); seY = xTop(e) + xHeight(e); switch (e.corner) { case 'nw': xMoveTo(e, newX, newY); xResizeTo(e, seX - xLeft(e), seY - xTop(e)); break; case 'sw': if (e.xT != xLeft(e)) { xLeft(e, newX); xWidth(e, seX - xLeft(e)); } xHeight(e, newY - xTop(e)); break; case 'ne': xWidth(e, newX - xLeft(e)); if (e.yT != xTop(e)) { xTop(e, newY); xHeight(e, seY - xTop(e)); } break; case 'se': xWidth(e, newX - xLeft(e)); xHeight(e, newY - xTop(e)); break; default: e.stop = true; } e.moving = true; if (t >= e.slideTime) { e.moving = false; if (e.onslideend) e.onslideend(); } } function xSlideTo(e, x, y, uTime) { if (!(e = xGetElementById(e))) return; if (!e.timeout) e.timeout = 25; e.xTarget = x; e.yTarget = y; e.slideTime = uTime; e.stop = false; e.yA = e.yTarget - xTop(e); e.xA = e.xTarget - xLeft(e); if (e.slideLinear) e.B = 1 / e.slideTime; else e.B = Math.PI / (2 * e.slideTime); e.yD = xTop(e); e.xD = xLeft(e); var d = new Date(); e.C = d.getTime(); if (!e.moving) _xSlideTo(e); } function _xSlideTo(e) { if (!(e = xGetElementById(e))) return; var now, s, t, newY, newX; now = new Date(); t = now.getTime() - e.C; if (e.stop) { e.moving = false; } else if (t < e.slideTime) { setTimeout("_xSlideTo('" + e.id + "')", e.timeout); s = e.B * t; if (!e.slideLinear) s = Math.sin(s); newX = Math.round(e.xA * s + e.xD); newY = Math.round(e.yA * s + e.yD); xMoveTo(e, newX, newY); e.moving = true; } else { xMoveTo(e, e.xTarget, e.yTarget); e.moving = false; if (e.onslideend) e.onslideend(); } } function xSmartLoadScript(url) { var loadedBefore = false; if (typeof (xLoadedList) != "undefined") { for (i = 0; i < xLoadedList.length; i++) { if (xLoadedList[i] == url) { loadedBefore = true; break; } } } if (document.createElement && document.getElementsByTagName && !loadedBefore) { var s = document.createElement('script'); var h = document.getElementsByTagName('head'); if (s && h.length) { s.src = url; h[0].appendChild(s); if (typeof (xLoadedList) == "undefined") xLoadedList = new Array(); xLoadedList.push(url); } } } function xSplitter(sSplId, uSplX, uSplY, uSplW, uSplH, bHorizontal, uBarW, uBarPos, uBarLimit, bBarEnabled, uSplBorderW, oSplChild1, oSplChild2) { var pane1, pane2, splW, splH; var splEle, barPos, barLim, barEle; function barOnDrag(ele, dx, dy) { var bp; if (bHorizontal) { bp = barPos + dx; if (bp < uBarLimit || bp > splW - uBarLimit) { return; } xWidth(pane1, xWidth(pane1) + dx); xLeft(barEle, xLeft(barEle) + dx); xWidth(pane2, xWidth(pane2) - dx); xLeft(pane2, xLeft(pane2) + dx); barPos = bp; } else { bp = barPos + dy; if (bp < uBarLimit || bp > splH - uBarLimit) { return; } xHeight(pane1, xHeight(pane1) + dy); xTop(barEle, xTop(barEle) + dy); xHeight(pane2, xHeight(pane2) - dy); xTop(pane2, xTop(pane2) + dy); barPos = bp; } if (oSplChild1) { oSplChild1.paint(xWidth(pane1), xHeight(pane1)); } if (oSplChild2) { oSplChild2.paint(xWidth(pane2), xHeight(pane2)); } } this.paint = function(uNewW, uNewH, uNewBarPos, uNewBarLim) { if (uNewW == 0) { return; } var w1, h1, w2, h2; splW = uNewW; splH = uNewH; barPos = uNewBarPos || barPos; barLim = uNewBarLim || barLim; xMoveTo(splEle, uSplX, uSplY); xResizeTo(splEle, uNewW, uNewH); if (bHorizontal) { w1 = barPos; h1 = uNewH - 2 * uSplBorderW; w2 = uNewW - w1 - uBarW - 2 * uSplBorderW; h2 = h1; xMoveTo(pane1, 0, 0); xResizeTo(pane1, w1, h1); xMoveTo(barEle, w1, 0); xResizeTo(barEle, uBarW, h1); xMoveTo(pane2, w1 + uBarW, 0); xResizeTo(pane2, w2, h2); } else { w1 = uNewW - 2 * uSplBorderW; ; h1 = barPos; w2 = w1; h2 = uNewH - h1 - uBarW - 2 * uSplBorderW; xMoveTo(pane1, 0, 0); xResizeTo(pane1, w1, h1); xMoveTo(barEle, 0, h1); xResizeTo(barEle, w1, uBarW); xMoveTo(pane2, 0, h1 + uBarW); xResizeTo(pane2, w2, h2); } if (oSplChild1) { pane1.style.overflow = 'hidden'; oSplChild1.paint(w1, h1); } if (oSplChild2) { pane2.style.overflow = 'hidden'; oSplChild2.paint(w2, h2); } }; splEle = xGetElementById(sSplId); pane1 = xFirstChild(splEle, 'DIV'); pane2 = xNextSib(pane1, 'DIV'); barEle = xNextSib(pane2, 'DIV'); pane1.style.zIndex = 2; pane2.style.zIndex = 2; barEle.style.zIndex = 1; barPos = uBarPos; barLim = uBarLimit; this.paint(uSplW, uSplH); if (bBarEnabled) { xEnableDrag(barEle, null, barOnDrag, null); barEle.style.cursor = bHorizontal ? 'e-resize' : 'n-resize'; } splEle.style.visibility = 'visible'; } function xStopPropagation(evt) { if (evt && evt.stopPropagation) evt.stopPropagation(); else if (window.event) window.event.cancelBubble = true; } function xStr(s) { for (var i = 0; i < arguments.length; ++i) { if (typeof (arguments[i]) != 'string') return false; } return true; } function xStrEndsWith(s, end) { if (!xStr(s, end)) return false; var l = s.length; var r = l - end.length; if (r > 0) return s.substring(r, l) == end; return s == end; } function xStrReplaceEnd(s, newEnd) { if (!xStr(s, newEnd)) return s; var l = s.length; var r = l - newEnd.length; if (r > 0) return s.substring(0, r) + newEnd; return newEnd; } function xStrStartsWith(s, beg) { if (!xStr(s, beg)) return false; var l = s.length; var r = beg.length; if (r > l) return false; if (r == l) return s.substring(0, r) == beg; return s == beg; } function xTableCellVisibility(bShow, sec, nRow, nCol) { sec = xGetElementById(sec); if (sec && nRow < sec.rows.length && nCol < sec.rows[nRow].cells.length) { sec.rows[nRow].cells[nCol].style.visibility = bShow ? 'visible' : 'hidden'; } } function xTableColDisplay(bShow, sec, nCol) { var r; sec = xGetElementById(sec); if (sec && nCol < sec.rows[0].cells.length) { for (r = 0; r < sec.rows.length; ++r) { sec.rows[r].cells[nCol].style.display = bShow ? '' : 'none'; } } } function xTableCursor(id, inh, def, hov, sel) { var tbl = xGetElementById(id); if (tbl) { xTableIterate(tbl, init); } function init(obj, isRow) { if (isRow) { obj.className = def; obj.onmouseover = trOver; obj.onmouseout = trOut; } else { obj.className = inh; obj.onmouseover = tdOver; obj.onmouseout = tdOut; } } this.unload = function() { xTableIterate(tbl, done); }; function done(o) { o.onmouseover = o.onmouseout = null; } function trOver() { this.className = hov; } function trOut() { this.className = def; } function tdOver() { this.className = sel; } function tdOut() { this.className = inh; } } function xTableIterate(sec, fnCallback, data) { var r, c; sec = xGetElementById(sec); if (!sec || !fnCallback) { return; } for (r = 0; r < sec.rows.length; ++r) { if (false == fnCallback(sec.rows[r], true, r, c, data)) { return; } for (c = 0; c < sec.rows[r].cells.length; ++c) { if (false == fnCallback(sec.rows[r].cells[c], false, r, c, data)) { return; } } } } function xTableRowDisplay(bShow, sec, nRow) { sec = xGetElementById(sec); if (sec && nRow < sec.rows.length) { sec.rows[nRow].style.display = bShow ? '' : 'none'; } } function xTabPanelGroup(id, w, h, th, clsTP, clsTG, clsTD, clsTS) { function onClick() { paint(this); return false; } function onFocus() { paint(this); } function paint(tab) { tab.className = clsTS; xZIndex(tab, highZ++); xDisplay(panels[tab.xTabIndex], 'block'); if (selectedIndex != tab.xTabIndex) { xDisplay(panels[selectedIndex], 'none'); tabs[selectedIndex].className = clsTD; selectedIndex = tab.xTabIndex; } } var panelGrp, tabGrp, panels, tabs, highZ, selectedIndex; this.select = function(n) { if (n && n <= tabs.length) { var t = tabs[n - 1]; if (t.focus) t.focus(); else t.onclick(); } }; this.onUnload = function() { if (!window.opera) for (var i = 0; i < tabs.length; ++i) { tabs[i].onfocus = tabs[i].onclick = null; } }; this.onResize = function(newW, newH) { var x = 0, i; if (newW) { w = newW; xWidth(panelGrp, w); } else w = xWidth(panelGrp); if (newH) { h = newH; xHeight(panelGrp, h); } else h = xHeight(panelGrp); xResizeTo(tabGrp[0], w, th); xMoveTo(tabGrp[0], 0, 0); w -= 2; var tw = w / tabs.length; for (i = 0; i < tabs.length; ++i) { xResizeTo(tabs[i], tw, th); xMoveTo(tabs[i], x, 0); x += tw; tabs[i].xTabIndex = i; tabs[i].onclick = onClick; tabs[i].onfocus = onFocus; xDisplay(panels[i], 'none'); xResizeTo(panels[i], w, h - th - 2); xMoveTo(panels[i], 0, th); } highZ = i; tabs[selectedIndex].onclick(); }; panelGrp = xGetElementById(id); if (!panelGrp) { return null; } panels = xGetElementsByClassName(clsTP, panelGrp); tabs = xGetElementsByClassName(clsTD, panelGrp); tabGrp = xGetElementsByClassName(clsTG, panelGrp); if (!panels || !tabs || !tabGrp || panels.length != tabs.length || tabGrp.length != 1) { return null; } selectedIndex = 0; this.onResize(w, h); } function xTimerMgr() { this.timers = new Array(); } xTimerMgr.prototype.set = function(type, obj, sMethod, uTime, data) { return (this.timers[this.timers.length] = new xTimerObj(type, obj, sMethod, uTime, data)); }; xTimerMgr.prototype.run = function() { var i, t, d = new Date(), now = d.getTime(); for (i = 0; i < this.timers.length; ++i) { t = this.timers[i]; if (t && t.running) { t.elapsed = now - t.time0; if (t.elapsed >= t.preset) { t.obj[t.mthd](t); if (t.type.charAt(0) == 'i') { t.time0 = now; } else { t.stop(); } } } } }; function xTimerObj(type, obj, mthd, preset, data) { this.data = data; this.type = type; this.obj = obj; this.mthd = mthd; this.preset = preset; this.reset(); } xTimerObj.prototype.stop = function() { this.running = false; }; xTimerObj.prototype.start = function() { this.running = true; }; xTimerObj.prototype.reset = function() { var d = new Date(); this.time0 = d.getTime(); this.elapsed = 0; this.running = true; }; var xTimer = new xTimerMgr(); setInterval('xTimer.run()', 250); function xTimes(n, f, s) { s = s || 0; n = n + s; for (var i = s; i < n; i++) f(i); }; function xToggleClass(e, c) { if (!(e = xGetElementById(e))) return null; if (!xRemoveClass(e, c) && !xAddClass(e, c)) return false; return true; } document.write("<style type='text/css'>#xTooltipElement{position:absolute;visibility:hidden;}</style>"); document.write("<div id='xTooltipElement'>xTooltipElement</div>"); function xTooltipGroup(grpClassOrIdList, tipClass, origin, xOffset, yOffset, textList) { this.c = tipClass; this.o = origin; this.x = xOffset; this.y = yOffset; var i, tips; if (xStr(grpClassOrIdList)) { tips = xGetElementsByClassName(grpClassOrIdList); for (i = 0; i < tips.length; ++i) { tips[i].xTooltip = this; } } else { tips = new Array(); for (i = 0; i < grpClassOrIdList.length; ++i) { tips[i] = xGetElementById(grpClassOrIdList[i]); if (!tips[i]) { alert('Element not found for id = ' + grpClassOrIdList[i]); } else { tips[i].xTooltip = this; tips[i].xTooltipText = textList[i]; } } } if (!xTooltipGroup.tipEle) { xTooltipGroup.tipEle = xGetElementById('xTooltipElement'); xAddEventListener(document, 'mousemove', xTooltipGroup.docOnMousemove, false); } } xTooltipGroup.trgEle = null; xTooltipGroup.tipEle = null; xTooltipGroup.docOnMousemove = function(oEvent) { var o, e = new xEvent(oEvent); if (e.target && (o = e.target.xTooltip)) { o.show(e.target, e.pageX, e.pageY); } else if (xTooltipGroup.trgEle) { xTooltipGroup.trgEle.xTooltip.hide(); } }; xTooltipGroup.prototype.show = function(trigEle, mx, my) { if (xTooltipGroup.trgEle != trigEle) { xTooltipGroup.tipEle.className = trigEle.xTooltip.c; xTooltipGroup.tipEle.innerHTML = trigEle.xTooltipText ? trigEle.xTooltipText : trigEle.title; xTooltipGroup.trgEle = trigEle; } var x, y, tipW, trgW, trgX; tipW = xWidth(xTooltipGroup.tipEle); trgW = xWidth(trigEle); trgX = xPageX(trigEle); switch (this.o) { case 'right': if (trgX + this.x + trgW + tipW < xClientWidth()) { x = trgX + this.x + trgW; } else { x = trgX - tipW - this.x; } y = xPageY(trigEle) + this.y; break; case 'top': x = trgX + this.x; y = xPageY(trigEle) - xHeight(trigEle) + this.y; break; case 'mouse': if (mx + this.x + tipW < xClientWidth()) { x = mx + this.x; } else { x = mx - tipW - this.x; } y = my + this.y; break; } xMoveTo(xTooltipGroup.tipEle, x, y); xShow(xTooltipGroup.tipEle); }; xTooltipGroup.prototype.hide = function() { xMoveTo(xTooltipGroup.tipEle, -1000, -1000); xTooltipGroup.trgEle = null; }; function xTop(e, iY) { if (!(e = xGetElementById(e))) return 0; var css = xDef(e.style); if (css && xStr(e.style.top)) { if (xNum(iY)) e.style.top = iY + 'px'; else { iY = parseInt(e.style.top); if (isNaN(iY)) iY = xGetComputedStyle(e, 'top', 1); if (isNaN(iY)) iY = 0; } } else if (css && xDef(e.style.pixelTop)) { if (xNum(iY)) e.style.pixelTop = iY; else iY = e.style.pixelTop; } return iY; } function xTraverseDocumentStyleSheets(cb) { var ssList = document.styleSheets; if (!ssList) return undefined; for (i = 0; i < ssList.length; i++) { var ss = ssList[i]; if (!ss) continue; if (xTraverseStyleSheet(ss, cb)) return true; } return false; } function xTraverseStyleSheet(ss, cb) { if (!ss) return false; var rls = xGetCSSRules(ss); if (!rls) return undefined; var result; for (var j = 0; j < rls.length; j++) { var cr = rls[j]; if (cr.selectorText) { result = cb(cr); if (result) return true; } if (cr.type && cr.type == 3 && cr.styleSheet) xTraverseStyleSheet(cr.styleSheet, cb); } if (ss.imports) { for (var j = 0; j < ss.imports.length; j++) { if (xTraverseStyleSheet(ss.imports[j], cb)) return true; } } return false; } function xTriStateImage(idOut, urlOver, urlDown, fnUp) { var img; if (typeof Image != 'undefined' && document.getElementById) { img = document.getElementById(idOut); if (img) { var urlOut = img.src; var i = new Image(); i.src = urlOver; i = new Image(); i.src = urlDown; img.onmouseover = function() { this.src = urlOver; }; img.onmouseout = function() { this.src = urlOut; }; img.onmousedown = function() { this.src = urlDown; }; img.onmouseup = function() { this.src = urlOver; if (fnUp) { fnUp(); } }; } } this.onunload = function() { if (!window.opera && img) { img.onmouseover = img.onmouseout = img.onmousedown = null; img = null; } }; } function xVisibility(e, bShow) { if (!(e = xGetElementById(e))) return null; if (e.style && xDef(e.style.visibility)) { if (xDef(bShow)) e.style.visibility = bShow ? 'visible' : 'hidden'; return e.style.visibility; } return null; } function xWalkEleTree(n, f, d, l, b) { if (typeof l == 'undefined') l = 0; if (typeof b == 'undefined') b = 0; var v = f(n, l, b, d); if (!v) return 0; if (v == 1) { for (var c = n.firstChild; c; c = c.nextSibling) { if (c.nodeType == 1) { if (!l) ++b; if (!xWalkEleTree(c, f, d, l + 1, b)) return 0; } } } return 1; } function xWalkToFirst(oNode, fnVisit, skip, data) { var r = null; while (oNode) { if (oNode.nodeType == 1 && oNode != skip) { r = fnVisit(oNode, data); if (r) return r; } var n = oNode; while (n = n.previousSibling) { if (n != skip) { r = xWalkTreeRev(n, fnVisit, skip, data); if (r) return r; } } oNode = oNode.parentNode; } return r; } function xWalkToLast(oNode, fnVisit, skip, data) { var r = null; if (oNode) { r = xWalkTree2(oNode, fnVisit, skip, data); if (r) return r; while (oNode) { var n = oNode; while (n = n.nextSibling) { if (n != skip) { r = xWalkTree2(n, fnVisit, skip, data); if (r) return r; } } oNode = oNode.parentNode; } } return r; } function xWalkTree(n, f) { f(n); for (var c = n.firstChild; c; c = c.nextSibling) { if (c.nodeType == 1) xWalkTree(c, f); } } function xWalkTree2(oNode, fnVisit, skip, data) { var r = null; if (oNode) { if (oNode.nodeType == 1 && oNode != skip) { r = fnVisit(oNode, data); if (r) return r; } for (var c = oNode.firstChild; c; c = c.nextSibling) { if (c != skip) r = xWalkTree2(c, fnVisit, skip, data); if (r) return r; } } return r; } function xWalkTreeRev(oNode, fnVisit, skip, data) { var r = null; if (oNode) { if (oNode.nodeType == 1 && oNode != skip) { r = fnVisit(oNode, data); if (r) return r; } for (var c = oNode.lastChild; c; c = c.previousSibling) { if (c != skip) r = xWalkTreeRev(c, fnVisit, skip, data); if (r) return r; } } return r; } function xWidth(e, w) { if (!(e = xGetElementById(e))) return 0; if (xNum(w)) { if (w < 0) w = 0; else w = Math.round(w); } else w = -1; var css = xDef(e.style); if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') { w = xClientWidth(); } else if (css && xDef(e.offsetWidth) && xStr(e.style.width)) { if (w >= 0) { var pl = 0, pr = 0, bl = 0, br = 0; if (document.compatMode == 'CSS1Compat') { var gcs = xGetComputedStyle; pl = gcs(e, 'padding-left', 1); if (pl !== null) { pr = gcs(e, 'padding-right', 1); bl = gcs(e, 'border-left-width', 1); br = gcs(e, 'border-right-width', 1); } else if (xDef(e.offsetWidth, e.style.width)) { e.style.width = w + 'px'; pl = e.offsetWidth - w; } } w -= (pl + pr + bl + br); if (isNaN(w) || w < 0) return; else e.style.width = w + 'px'; } w = e.offsetWidth; } else if (css && xDef(e.style.pixelWidth)) { if (w >= 0) e.style.pixelWidth = w; w = e.style.pixelWidth; } return w; } function xWinClass(clsName, winName, w, h, x, y, loc, men, res, scr, sta, too) { var thisObj = this; var e = '', c = ',', xf = 'left=', yf = 'top='; this.n = name; if (document.layers) { xf = 'screenX='; yf = 'screenY='; } this.f = (w ? 'width=' + w + c : e) + (h ? 'height=' + h + c : e) + (x >= 0 ? xf + x + c : e) + (y >= 0 ? yf + y + c : e) + 'location=' + loc + ',menubar=' + men + ',resizable=' + res + ',scrollbars=' + scr + ',status=' + sta + ',toolbar=' + too; this.opened = function() { return this.w && !this.w.closed; }; this.close = function() { if (this.opened()) this.w.close(); }; this.focus = function() { if (this.opened()) this.w.focus(); }; this.load = function(sUrl) { if (this.opened()) this.w.location.href = sUrl; else this.w = window.open(sUrl, this.n, this.f); this.focus(); return false; }; function onClick() { return thisObj.load(this.href); } xGetElementsByClassName(clsName, document, '*', bindOnClick); function bindOnClick(e) { e.onclick = onClick; } } function xWindow(name, w, h, x, y, loc, men, res, scr, sta, too) { var e = '', c = ',', xf = 'left=', yf = 'top='; this.n = name; if (document.layers) { xf = 'screenX='; yf = 'screenY='; } this.f = (w ? 'width=' + w + c : e) + (h ? 'height=' + h + c : e) + (x >= 0 ? xf + x + c : e) + (y >= 0 ? yf + y + c : e) + 'location=' + loc + ',menubar=' + men + ',resizable=' + res + ',scrollbars=' + scr + ',status=' + sta + ',toolbar=' + too; this.opened = function() { return this.w && !this.w.closed; }; this.close = function() { if (this.opened()) this.w.close(); }; this.focus = function() { if (this.opened()) this.w.focus(); }; this.load = function(sUrl) { if (this.opened()) this.w.location.href = sUrl; else this.w = window.open(sUrl, this.n, this.f); this.focus(); return false; }; } var xChildWindow = null; function xWinOpen(sUrl) { var features = "left=0,top=0,width=600,height=500,location=0,menubar=0," + "resizable=1,scrollbars=1,status=0,toolbar=0"; if (xChildWindow && !xChildWindow.closed) { xChildWindow.location.href = sUrl; } else { xChildWindow = window.open(sUrl, "myWinName", features); } xChildWindow.focus(); return false; } var xWinScrollWin = null; function xWinScrollTo(win, x, y, uTime) { var e = win; if (!e.timeout) e.timeout = 25; var st = xScrollTop(e, 1); var sl = xScrollLeft(e, 1); e.xTarget = x; e.yTarget = y; e.slideTime = uTime; e.stop = false; e.yA = e.yTarget - st; e.xA = e.xTarget - sl; if (e.slideLinear) e.B = 1 / e.slideTime; else e.B = Math.PI / (2 * e.slideTime); e.yD = st; e.xD = sl; var d = new Date(); e.C = d.getTime(); if (!e.moving) { xWinScrollWin = e; _xWinScrollTo(); } } function _xWinScrollTo() { var e = xWinScrollWin || window; var now, s, t, newY, newX; now = new Date(); t = now.getTime() - e.C; if (e.stop) { e.moving = false; } else if (t < e.slideTime) { setTimeout("_xWinScrollTo()", e.timeout); s = e.B * t; if (!e.slideLinear) s = Math.sin(s); newX = Math.round(e.xA * s + e.xD); newY = Math.round(e.yA * s + e.yD); e.scrollTo(newX, newY); e.moving = true; } else { e.scrollTo(e.xTarget, e.yTarget); xWinScrollWin = null; e.moving = false; if (e.onslideend) e.onslideend(); } } function xZIndex(e, uZ) { if (!(e = xGetElementById(e))) return 0; if (e.style && xDef(e.style.zIndex)) { if (xNum(uZ)) e.style.zIndex = uZ; uZ = parseInt(e.style.zIndex); } return uZ; }
