var domloaded = false;var emptyFunction = function() {};var resultFunction = function() {return true;};var ajaxAccepts = {xml: "application/xml, text/xml",html: "text/html",text: "text/plain",json: "application/json, text/javascript",all: "text/html, text/plain, application/xml, text/xml, application/json, text/javascript"};var GBrowser = {IE: !!(window.attachEvent && !window.opera),Opera: !!window.opera,WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)};function sleep(ms) {var start = new Date().getTime();while (new Date().getTime() < start + ms) {}}function floatval(val) {var res = parseFloat(val);return isNaN(res) ? 0 : res;}function CurrencyFormatted(amount) {amount = ((floatval(amount) + 0.005) * 100 / 100);var s = new String(amount);return s.substr(0, s.indexOf('.') + 3);}function strToDate(date) {var patt = /(([0-9]{4,4})-([0-9]{1,2})-([0-9]{1,2})|today|tomorrow|yesterday)([\s]{0,}([+-])[\s]{0,}([0-9]+))?/;var hs = patt.exec(date);if (hs) {if (hs[2] == null || hs[2] == '') {d = new Date();} else {d = new Date(parseFloat(hs[2]), parseFloat(hs[3]) - 1, hs[4], 0, 0, 0, 0);}if (hs[1] == 'yesterday') {d.setDate(d.getDate() - 1);} else if (hs[1] == 'tomorrow') {d.setDate(d.getDate() + 1);}if (hs[6] == '+' && parseFloat(hs[7]) > 0) {d.setDate(d.getDate() + parseFloat(hs[7]));} else if (hs[6] == '-' && parseFloat(hs[7]) > 0) {d.setDate(d.getDate() - parseFloat(hs[7]));}return d;} else {return null;}}function mktimeToDate(mktime) {return new Date(mktime * 1000);}Date.prototype.dateFormat = function(format) {var result = "";for (var i = 0; i < format.length; i++) {result += this.dateToString(format.charAt(i));}return result;};Date.prototype.dateToString = function(character) {switch (character) {case "d":return this.getDate();case "D":return Date.dayNames[this.getDay()];case "y":return this.getFullYear().toString();case "Y":return (this.getFullYear() + Date.yearOffset).toString();case "m":return this.getMonth() + 1;case "M":return Date.monthNames[this.getMonth()];case "H":return this.getHours().toString().leftPad(2, '0');case "h":return this.getHours();case "A":return this.getHours() < 12 ? 'AM' : 'PM';case "a":return this.getHours() < 12 ? 'am' : 'pm';case "I":return this.getMinutes().toString().leftPad(2, '0');case "i":return this.getMinutes();case "S":return this.getSeconds().toString().leftPad(2, '0');case "s":return this.getSeconds();default:return character;}};Date.prototype.tomktime = function() {return Math.floor(this.getTime() / 1000);};Date.prototype.moveDate = function(value) {this.setDate(this.getDate() + value);return this;};Date.prototype.moveMonth = function(value) {this.setMonth(this.getMonth() + value);return this;};Date.prototype.moveYear = function(value) {this.setFullYear(this.getFullYear() + value);return this;};Date.prototype.isLeapYear = function() {var year = this.getFullYear();return ((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year)));};Date.prototype.daysInMonth = function() {var arr = Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);arr[1] = this.isLeapYear() ? 29 : 28;return arr[this.getMonth()];};Date.prototype.dayOfWeek = function() {var a = parseInt((14 - this.getMonth()) / 12);var y = this.getFullYear() - a;var m = this.getMonth() + 12 * a - 2;var d = (this.getDate() + y + parseInt(y / 4) - parseInt(y / 100) + parseInt(y / 400) + parseInt((31 * m) / 12)) % 7;return d;};Date.prototype.compare = function(d) {var date, month, year;if (Object.isString(d)) {var ds = d.split('-');year = ds[0].toInt();month = ds[1].toInt() - 1;date = ds[2].toInt();} else {date = d.getDate();month = d.getMonth();year = d.getFullYear();}var dateStr = this.getDate();var monthStr = this.getMonth();var yearStr = this.getFullYear();var theYear = yearStr - year;var theMonth = monthStr - month;var theDate = dateStr - date;var days = '';if (monthStr == 0 || monthStr == 2 || monthStr == 4 || monthStr == 6 || monthStr == 7 || monthStr == 9 || monthStr == 11) {days = 31;}if (monthStr == 3 || monthStr == 5 || monthStr == 8 || monthStr == 10) {days = 30;}if (monthStr == 1) {days = 28;}var inYears = theYear;var inMonths = theMonth;if (month < monthStr && date > dateStr) {inYears = parseFloat(inYears) + 1;inMonths = theMonth - 1;}if (month < monthStr && date <= dateStr) {inMonths = theMonth;} else if (month == monthStr && (date < dateStr || date == dateStr)) {inMonths = 0;} else if (month == monthStr && date > dateStr) {inMonths = 11;} else if (month > monthStr && date <= dateStr) {inYears = inYears - 1;inMonths = ((12 - -(theMonth)) + 1);} else if (month > monthStr && date > dateStr) {inMonths = ((12 - -(theMonth)));}var inDays = theDate;if (date > dateStr) {inYears = inYears - 1;inDays = days - (-(theDate));} else if (date == dateStr) {inDays = 0;}var result = ['day', 'month', 'year'];result.day = inDays;result.month = inMonths;result.year = inYears;return result;};Date.monthNames = ["Jan.", "Feb.", "Mar.", "Apr.", "May.", "Jun.", "Jul.", "Aug.", "Sep.", "Oct.", "Nov.", "Dec."];Date.longMonthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];Date.longDayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];Date.dayNames = ["Su.", "Mo.", "We.", "Tu.", "Th.", "Fr.", "Sa."];Date.yearOffset = 0;Object.extend = function(d, s) {for (var property in s) {d[property] = s[property];}return d;};Object.extend(Object, {isObject: function(o) {return typeof o == "object";},isFunction: function(o) {return typeof o == "function";},isString: function(o) {return typeof o == "string";},isNumber: function(o) {return typeof o == "number";},isNull: function(o) {return typeof o == "undefined";},isGElement: function(o) {return o != null && typeof o == "object" && 'Ready' in o && 'element' in o;}});var GClass = {create: function() {return function() {this.initialize.apply(this, arguments);};}};var GNative = GClass.create();GNative.prototype = {initialize: function() {this.elem = null;},Ready: function(f) {var s = this;var p = function() {if (domloaded && s.element()) {f.call($G(s.elem));} else {window.setTimeout(p, 10);}};p();},after: function(e) {var p = this.parentNode;if (p.firstChild == this || this.nextSibling == null) {p.appendChild(e);} else {p.insertBefore(e, this.nextSibling);}return e;},before: function(e) {var p = this.parentNode;if (p.firstChild == this) {p.appendChild(e);} else {p.insertBefore(e, this);}return e;},insert: function(e) {e = $G(e);this.appendChild(e);return e;},copy: function(o) {return $G(this.cloneNode(o || true));},replace: function(e) {var p = this.parentNode;p.insertBefore(e, this.nextSibling);p.removeChild(this);return $G(e);},remove: function() {if (this.element()) {this.parentNode.removeChild(this);}},setHTML: function(o) {try {this.innerHTML = o;} catch (e) {o = o.replace(/[\r\n\t]/g, '').replace(/]*>.*?<\/script>/ig, '');this.appendChild(o.toDOM());}},getTop: function() {return this.viewportOffset().top;},getLeft: function() {return this.viewportOffset().left;},getWidth: function() {return this.getDimensions().width;},getHeight: function() {return this.getDimensions().height;},getClientWidth: function() {return this.clientWidth - parseInt(this.getStyle('paddingLeft')) - parseInt(this.getStyle('paddingRight'));},getClientHeight: function() {return this.clientHeight - parseInt(this.getStyle('paddingTop')) - parseInt(this.getStyle('paddingBottom'));},viewportOffset: function() {var t = this.offsetTop;var l = this.offsetLeft;var p = this.offsetParent;while (p !== null) {t += p.offsetTop;l += p.offsetLeft;if (p.offsetParent == document.body && p.style.position == 'absolute') {break;}p = p.offsetParent;}var result = [l, t];result.left = l;result.top = t;return result;},getDimensions: function() {var ow, oh;if (this == document) {ow = Math.max(Math.max(document.body.scrollWidth, document.documentElement.scrollWidth), Math.max(document.body.offsetWidth, document.documentElement.offsetWidth), Math.max(document.body.clientWidth, document.documentElement.clientWidth));oh = Math.max(Math.max(document.body.scrollHeight, document.documentElement.scrollHeight), Math.max(document.body.offsetHeight, document.documentElement.offsetHeight), Math.max(document.body.clientHeight, document.documentElement.clientHeight));} else {var d = this.getStyle('display');if (d != 'none' && d !== null) {ow = this.offsetWidth;oh = this.offsetHeight;} else {var s = this.style;var ov = s.visibility;var op = s.position;var od = s.display;s.visibility = 'hidden';s.position = 'absolute';s.display = 'block';ow = this.clientWidth;oh = this.clientHeight;s.display = od;s.position = op;s.visibility = ov;}}var result = [ow, oh];result.width = ow;result.height = oh;return result;},getOffsetParent: function() {var e = this.offsetParent;if (!e) {e = this.parentNode;while (e != document.body && e.style.position == 'static') {e = e.parentNode;}}return GElement(e);},getStyle: function(s) {s = (s == 'float' && this.currentStyle) ? 'styleFloat' : s;s = (s == 'borderColor') ? 'borderBottomColor' : s;var v = (this.currentStyle) ? this.currentStyle[s] : null;v = (!v && window.getComputedStyle) ? document.defaultView.getComputedStyle(this, null).getPropertyValue(s.replace(/([A-Z])/g, "-$1").toLowerCase()) : v;if (s == 'opacity') {return Object.isNull(v) ? 100 : (parseFloat(v) * 100);} else {return v == 'auto' ? null : v;}},setStyle: function(p, v) {if (p == 'opacity') {if (window.ActiveXObject) {this.style.filter = "alpha(opacity=" + (v * 100) + ")";}this.style.opacity = v;} else if (p == 'float' || p == 'styleFloat' || p == 'cssFloat') {if (Object.isNull(this.style.styleFloat)) {this.style['cssFloat'] = v;} else {this.style['styleFloat'] = v;}} else if (p == 'backgroundColor' && this.tagName.toLowerCase() == 'iframe') {if (document.all) {this.contentWindow.document.bgColor = v;} else {this.style.backgroundColor = v;}} else if (p == 'borderColor') {this.style.borderLeftColor = v;this.style.borderTopColor = v;this.style.borderRightColor = v;this.style.borderBottomColor = v;} else {this.style[p] = v;}return this;},center: function() {var size = this.getDimensions();if (this.style.position == 'fixed') {this.style.top = ((document.viewport.getHeight() - size.height) / 2) + 'px';this.style.left = ((document.viewport.getWidth() - size.width) / 2) + 'px';} else {this.style.top = (document.viewport.getscrollTop() + ((document.viewport.getHeight() - size.height) / 2)) + 'px';this.style.left = (document.viewport.getscrollLeft() + ((document.viewport.getWidth() - size.width) / 2)) + 'px';}return this;},get: function(p) {try {return this.getAttribute(p);} catch (e) {return null;}},set: function(p, v) {try {this.setAttribute(p, v);} catch (e) {}return this;},hasClass: function(v) {var vs = v.split(' ');var cs = this.className.split(' ');for (var c = 0; c < cs.length; c++) {for (v = 0; v < vs.length; v++) {if (vs[v] != '' && vs[v] == cs[c]) {return vs[v];}}}return false;},addClass: function(v) {if (!v) {this.className = '';} else {var rm = v.split(' ');var cs = new Array();forEach(this.className.split(' '), function(c) {if (c !== '' && rm.indexOf(c) == -1) {cs.push(c);}});cs.push(v);this.className = cs.join(' ');}return this;},removeClass: function(v) {if (!Object.isNull(this.className)) {var rm = v.split(' ');var cs = new Array();forEach(this.className.split(' '), function(c) {if (c !== '' && rm.indexOf(c) == -1) {cs.push(c);}});this.className = cs.join(' ');}return this;},replaceClass: function(source, replace) {if (!Object.isNull(this.className)) {var rm = (replace + ' ' + source).split(' ');var cs = new Array();forEach(this.className.split(' '), function(c) {if (c !== '' && rm.indexOf(c) == -1) {cs.push(c);}});cs.push(replace);this.className = cs.join(' ');}return this;},hide: function() {this.display = this.getStyle('display');this.setStyle('display', 'none');return this;},show: function() {if (this.getStyle('display') == 'none') {this.setStyle('display', 'block');}return this;},visible: function() {return this.getStyle('display') != 'none';},toggle: function() {if (this.visible()) {this.hide();} else {this.show();}return this;},nextNode: function() {var n = this;do {n = n.nextSibling;} while (n && n.nodeType != 1);return n;},previousNode: function() {var p = this;do {p = p.previousSibling;} while (p && p.nodeType != 1);return p;},firstNode: function() {var p = this.firstChild;do {p = p.nextSibling;} while (p && p.nodeType != 1);return p;},callEvent: function(t) {var evt;if (document.createEvent) {evt = document.createEvent('Events');evt.initEvent(t, true, true);this.dispatchEvent(evt);} else if (document.createEventObject) {evt = document.createEventObject();this.fireEvent('on' + t, evt);}return this;},addEvent: function(t, f, c) {if (this.addEventListener) {c = !c ? false : c;this.addEventListener(t, f, c);} else if (this.attachEvent) {var tmp = this;tmp["e" + t + f] = f;tmp[t + f] = function() {tmp["e" + t + f](window.event);};tmp.attachEvent("on" + t, tmp[t + f]);}return this;},removeEvent: function(t, f) {if (this.removeEventListener) {this.removeEventListener(((t == 'mousewheel' && window.gecko) ? 'DOMMouseScroll' : t), f, false);} else if (this.detachEvent) {var tmp = this;tmp.detachEvent("on" + t, tmp[t + f]);tmp["e" + t + f] = null;tmp[t + f] = null;}return this;},highlight: function(o) {if (!this._highlight) {this._highlight = new GHighlight(this);}this._highlight.play(o);return this;},fadeTo: function(v, o) {if (!this._fade) {this._fade = new GFade(this);}this._fade.play({'from': this.getStyle('opacity'),'to': v,'onComplete': o || emptyFunction});return this;},fadeIn: function(o) {this.fadeTo(100, o);return this;},fadeOut: function(o) {this.fadeTo(0, o);return this;},shake: function() {var p = [15, 30, 15, 0, -15, -30, -15, 0, 15, 30, 15, 0, -15, -30, -15, 0];var o = this.style.position;this.style.position = 'relative';var m = this;function s(a) {if (a < p.length) {m.style.left = p[a] + 'px';a++;setTimeout(function() {s(a);}, 20);} else {m.style.position = o;}}s(0);return this;},load: function(u, o, c) {var s = {cache: true};for (var p in o) {s[p] = o[p];}var req = new GAjax(s);var d = u.split('?');var s = this;req.send(d[0], d[1], function(x) {s.setValue(x.responseText);if (c) {c.call(s, x);}});return this;},setValue: function(v) {function _find(e, a) {var s = e.getElementsByTagName('option');for (var i = 0; i < s.length; i++) {if (s[i].value == a) {return i;}}return -1;}v = decodeURIComponent(v);var t = this.tagName.toLowerCase();if (t == 'img') {this.src = v;} else if (t == 'select') {this.selectedIndex = _find(this, v);} else if (t == 'input') {if (this.type == 'checkbox' || this.type == 'radio') {this.checked = (parseFloat(v) == 1);} else {this.value = v.unentityify();}} else if (t == 'textarea') {this.value = v.unentityify();} else {this.setHTML(v);}return this;},element: function() {return Object.isString(this.elem) ? document.getElementById(this.elem) : this.elem;},create: function(em, o) {var v;if (em == 'iframe' || em == 'input') {var n = o.name || o.id || '';var i = o.id || o.name || '';if (window.ActiveXObject) {try {if (em == 'iframe') {v = document.createElement('