Deprecated: Creation of dynamic property Gcms\Config::$version is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$booking_w is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$inventory_w is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$repair_first_status is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$repair_send_mail is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$edocument_format_no is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$edocument_send_mail is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$edocument_file_typies is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$edocument_upload_size is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$edocument_download_action is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$booking_line_id is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$booking_send_mail is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$personnel_w is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$personnel_h is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$personnel_status is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$booking_status is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$booking_notifications is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$edocument_line_id is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$repair_line_id is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$repair_status_success is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Deprecated: Creation of dynamic property Gcms\Config::$booking_approving is deprecated in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php on line 242
Warning: Cannot modify header information - headers already sent by (output started at /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Config.php:242) in /home/lat6/domains/latyao.ac.th/public_html/eoffice/Kotchasan/Language.php on line 408
window.$K = (function() { "use strict"; var domloaded = false; var $K = { emptyFunction: function() {}, resultFunction: function() { return true; }, isMobile: function() { return (typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1); }, init: function(element) { forEach(element.querySelectorAll("input,textarea"), function(elem) { var tagName = $G(elem).tagName.toLowerCase(), type = elem.get("type"), type = type ? type.toLowerCase() : ""; if (elem.initObj !== true && (tagName == "textarea" || (type !== "hidden" && type !== "radio" && type !== "checkbox" && type !== "button" && type !== "submit"))) { var obj = new Object(); obj.tagName = tagName; obj.type = type; elem.initObj = true; obj.title = elem.title; obj.required = elem.get("required"); obj.disabled = elem.get("disabled") !== null; obj.maxlength = floatval(elem.get("maxlength")); obj.pattern = elem.get("pattern"); if (obj.pattern !== null) { obj.pattern = new RegExp("^(?:" + obj.pattern + ")$"); elem.setAttribute("pattern", "(.*){0,}"); } obj.dataset = elem.dataset; if (typeof obj.dataset == "undefined") { obj.dataset = {}; forEach(elem.attributes, function() { var hs = this.name.match(/^data\-(.+)/); if (hs) { obj.dataset[hs[0]] = this.value; } }); } if (obj.tagName == "textarea") { if (obj.maxlength > 0 || obj.required || obj.pattern) { var _docheck = function() { if (this.value == "" && obj.required !== null) { this.addClass("required"); this.invalid(obj.title !== "" ? obj.title : trans("Please fill in") + (this.placeholder == "" ? "" : " " + this.placeholder)); } else if (this.value != "" && obj.pattern && !obj.pattern.test(this.value)) { this.invalid(obj.title !== "" ? obj.title : trans("Invalid data")); } else if (obj.required !== null || obj.pattern) { this.reset(); } }; elem.srcObj = obj; elem.addEvent("keyup", _docheck); elem.addEvent("change", _docheck); } } else if (obj.tagName == "input") { var c = elem.hasClass("currency number integer color inputgroup"); if (c !== false) { obj.type = c; } if (elem.min) { obj.min = elem.min; } if (elem.max) { obj.max = elem.max; } var autofocus = elem.get("autofocus"); var text = elem; if (obj.type == "date") { new GCalendar(text); } else if (obj.type == "number" || obj.type == "integer" || obj.type == "tel" || obj.type == "email" || obj.type == "url" || obj.type == "color" || obj.type == "currency" || obj.type == "time") { var o = { type: "text", name: elem.name, disabled: obj.disabled }; if (elem.id != "") { o.id = elem.id; } text = $G().create("input", o); if (elem.value != "") { text.value = elem.value; } if (obj.title != "") { text.title = obj.title; } if (elem.size) { text.size = elem.size; } if (elem.placeholder) { text.placeholder = elem.placeholder; } if (obj.maxlength > 0) { text.maxlength = obj.maxlength; } if (elem.readOnly) { text.readOnly = true; } if (obj.type == "currency") { text.digit = floatval(obj.dataset['digit'] ? obj.dataset['digit'] : 2); } text.className = elem.className; text.initObj = true; elem.replace(text); if (obj.type == "color") { new GDDColor(text, function(c) { this.input.style.backgroundColor = c; this.input.style.color = this.invertColor(c); this.input.value = c; this.input.callEvent("change"); }); } else if (obj.type == "time") { new GTime(text); } else if (obj.type == "email" || obj.type == "url") { if (obj.pattern == null) { if (obj.type == "email") { obj.pattern = /^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/; } else { obj.pattern = /^[a-z0-9\-\.:\/\#%\?\&\=_@~]{3,}$/i; } } text.addEvent("keyup", _docheck); text.addEvent("change", _docheck); } else { if (!obj.dataset["keyboard"]) { if (obj.type == "integer") { obj.dataset["keyboard"] = "1234567890-"; } else if (obj.type == "currency") { obj.dataset["keyboard"] = "1234567890-.,"; } else if (obj.type == "number" || obj.type == "tel") { obj.dataset["keyboard"] = "1234567890"; } } if (obj.dataset["keyboard"]) { obj.pattern = new RegExp("^(?:[" + obj.dataset["keyboard"].preg_quote() + "]+)$"); if (obj.type == "integer" || obj.type == "currency" || obj.type == "number") { new GInput(text, obj.dataset["keyboard"], function() { if (obj.min) { this.value = Math.max(obj.min, floatval(this.value)); } if (obj.max) { this.value = Math.min(obj.max, floatval(this.value)); } if (obj.type == "currency") { this.value = toCurrency(this.value, this.digit); } }); } else { new GInput(text, obj.dataset["keyboard"]); } } } } else if (obj.type == "file") { if (elem.hasClass("g-file")) { var p = elem.parentNode; elem.setStyle("opacity", 0); elem.style.cursor = "pointer"; elem.style.position = "absolute"; elem.style.left = 0; elem.style.top = 1; p.style.position = "relative"; var display = document.createElement("input"); display.setAttribute("type", "text"); display.id = elem.id; elem.id = elem.id + "_tmp"; display.disabled = true; display.placeholder = elem.placeholder; p.appendChild(display); elem.style.zIndex = text.style.zIndex + 1; elem.style.height = "100%"; elem.style.width = "100%"; elem.addEvent("change", function() { if (this.files) { var input = this, hs, files = [], preview = $E(this.get("data-preview")), max = floatval(input.get("data-max")), validImageTypes = ['image/gif', 'image/jpeg', 'image/jpg', 'image/png']; if (preview) { preview.innerHTML = ''; } forEach(input.files, function() { if (max > 0 && this.size > max) { input.invalid(input.title); } else { files.push(this.name); input.valid(); if (preview) { hs = /\.([a-z0-9]+)$/.exec(this.name.toLowerCase()); var div = document.createElement('div'); div.className = 'file-thumb'; if (hs) { div.innerHTML = hs[1]; } preview.appendChild(div); if (validImageTypes.includes(this.type) && window.FileReader) { var r = new FileReader(); r.onload = function(evt) { div.innerHTML = ''; div.style.backgroundImage = 'url(' + evt.target.result + ')'; }; r.readAsDataURL(this); } } } }); display.value = files.join(', '); display.callEvent("change", { value: this.value, files: this.files }); } }); elem.initObj = true; } } else if (obj.type == "range") { new GRange(elem); } else if (obj.type == "inputgroup") { new GInputGroup(elem); } else if (elem.get("list")) { new Datalist(elem); } else if (obj.pattern) { new GMask(text, function() { return obj.pattern.test(this.value); }); } if (typeof obj.dataset !== "undefined") { for (var prop in obj.dataset) { if (obj.dataset[prop] !== null) { text.setAttribute("data-" + prop, obj.dataset[prop]); } } } if (autofocus !== null) { text.focus(); if (obj.type == "text") { text.select(); } } if (obj.pattern || obj.required) { text.srcObj = obj; } } } }); } }; if (typeof Array.prototype.indexOf != "function") { Array.prototype.indexOf = function(t, i) { i || (i = 0); var l = this.length; if (i < 0) { i = l + i; } for (; i < l; i++) { if (this[i] == t) { return i; } } return -1; }; } if (typeof forEach != "function") { window.forEach = function(a, f) { var i, l = a.length, x = []; for (i = 0; i < l; i++) { x.push(a[i]); } for (i = 0; i < l; i++) { if (f.call(x[i], x[i], i) == true) { break; } } }; } window.floatval = function(val) { var n = parseFloat(typeof val == 'string' ? val.replace(/[^0-9\-\.]/g, '') : val); return isNaN(n) ? 0 : n; }; window.toCurrency = function(val, digit) { return floatval(val).toFixed(Object.isNull(digit) ? 2 : digit).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,') }; window.round = function(val, digit) { var value = Math.round(val * Math.pow(10, digit)) / Math.pow(10, digit); if (val - value > 0) { return value + Math.floor((2 * Math.round((val - value) * Math.pow(10, digit + 1))) / 10) / Math.pow(10, digit); } else { return value; } }; window.copyToClipboard = function(text) { var el = document.createElement("textarea"); el.value = text; el.setAttribute('readonly', ''); el.style.position = 'absolute'; el.style.top = '-1000px'; document.body.appendChild(el); el.select(); document.execCommand("copy"); document.body.removeChild(el); }; window.trans = function(val) { try { var patt = /^[_]+|[_]+$/g; return eval(val.replace(/[\s]/g, "_").replace("?", "").replace(patt, "").toUpperCase()); } catch (e) { return val; } }; window.debug = function(val) { var p = document.createElement("p"), div = $E("gdebug"); if (!div) { div = document.createElement("div"); div.id = "gdebug"; document.body.appendChild(div); div.style.cssText = "left:0;bottom:0;width:100%;height:100px;color:#F00;background-color:#FFF;position:fixed;line-height:1;padding:10px;overflow:auto;"; } p.style.cssText = "margin:0;"; p.innerText = val; div.appendChild(p); div.scrollTop = div.scrollHeight; }; window.timeToMinute = function(time) { var sp = time.split(':'); if (sp.length == 1) { return 0; } else { return (floatval(sp[0]) * 60) + floatval(sp[1]); } }; window.timeToSecond = function(time) { var sp = time.split(':'); if (sp.length == 1) { return 0; } else { return (floatval(sp[0]) * 60) + (floatval(sp[1] * 60) + floatval(sp[2])); } }; Function.prototype.bind = function(o) { var __method = this; return function() { return __method.apply(o, arguments); }; }; Date.prototype.fromTime = function(mktime) { return new Date(mktime * 1000); }; Date.prototype.format = function(fmt) { var result = ""; for (var i = 0; i < fmt.length; i++) { result += this.formatter(fmt.charAt(i)); } return result; }; Date.prototype.formatter = function(c) { switch (c) { case "d": return this.getDate().toString().leftPad(2, "0"); 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).toString().leftPad(2, "0"); case "M": return Date.monthNames[this.getMonth()]; case "F": return Date.longMonthNames[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 c; } }; 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) { if (Object.isString(d)) { d = new Date(d.replace(/-/g, '/')); } var date = d.getDate(), month = d.getMonth(), year = d.getFullYear(), dateStr = this.getDate(), monthStr = this.getMonth(), yearStr = this.getFullYear(), theYear = yearStr - year, theMonth = monthStr - month, theDate = dateStr - date, days = 0; 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 = floatval(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; } return { day: inDays, month: inMonths, year: inYears, days: Math.floor(Math.abs(this.getTime() - d.getTime()) / 86400000) }; }; 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; String.prototype.entityify = function() { return this.replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'") .replace(/\\/g, "\") .replace(/&/g, "&") .replace(/\{/g, "{") .replace(/\}/g, "}"); }; String.prototype.unentityify = function() { return this.replace(/</g, "<") .replace(/>/g, ">") .replace(/"/g, '"') .replace(/[0]?39;/g, "'") .replace(/\/g, "\\") .replace(/&/g, "&") .replace(/{/g, "{") .replace(/}/g, "}"); }; String.prototype.toJSON = function() { try { return JSON.parse(this); } catch (e) { return false; } }; String.prototype.toInt = function() { return floatval(this); }; String.prototype.currFormat = function() { return floatval(this).toFixed(2); }; String.prototype.preg_quote = function() { return this.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1"); }; String.prototype.capitalize = function() { return this.replace(/\b[a-z]/g, function(m) { return m.toUpperCase(); }); }; String.prototype.evalScript = function() { var regex = /(.*?)<\/script>/g; var t = this.replace(/[\r\n]/g, "").replace(/\/\/<\!\[CDATA\[/g, "").replace(/\/\/\]\]>/g, ""); var m = regex.exec(t); while (m) { try { eval(m[1]); } catch (e) {} m = regex.exec(t); } return this; }; String.prototype.leftPad = function(c, f) { var r = ""; for (var i = 0; i < c - this.length; i++) { r = r + f; } return r + this; }; String.prototype.trim = function() { return this.replace(/^(\s| )+|(\s| )+$/g, ""); }; String.prototype.ltrim = function() { return this.replace(/^(\s| )+/, ""); }; String.prototype.rtrim = function() { return this.replace(/(\s| )+$/, ""); }; String.prototype.strip_tags = function(allowed) { allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(""); var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi; var php = /|<\?(?:php)?[\s\S]*?\?>/gi; return this.replace(php, "").replace(tags, function($0, $1) { return allowed.indexOf("<" + $1.toLowerCase() + ">") > -1 ? $0 : ""; }); }; String.prototype.toDOM = function() { var s = function(a) { return a .replace(/>/g, ">") .replace(/</g, "<") .replace(/ /g, " ") .replace(/"/g, '"') .replace(/[0]?39;/g, "'") .replace(/\/g, "\\") .replace(/&/g, "&"); }; var t = function(a) { return a.replace(/ /g, ""); }; var u = function(a) { var b = document.createDocumentFragment(); var c = a.indexOf(" "); if (c == -1) { var d = a.toLowerCase(); b.appendChild(document.createElement(d)); } else { d = t(a.substring(0, c)).toLowerCase(); if (document.all && (d == "input" || d == "iframe")) { try { b.appendChild(document.createElement("<" + a + "/>")); return b; } catch (e) {} } a = a.substring(c + 1); b.appendChild(document.createElement(d)); while (a.length > 0) { var e = a.indexOf("="); if (e >= 0) { var f = t(a.substring(0, e)).toLowerCase(); var g = a.indexOf('"'); a = a.substring(g + 1); g = a.indexOf('"'); var h = s(a.substring(0, g)); a = a.substring(g + 2); if (document.all && f == "style") { b.lastChild.style.cssText = h; } else if (f == "class") { b.lastChild.className = h; } else { b.lastChild.setAttribute(f, h); } } else { break; } } } return b; }; var v = function(a, b, c) { var d = a; var e = b; c = c.toLowerCase(); var f = e.indexOf("" + c + ">"); d = d.concat(e.substring(0, f)); e = e.substring(f); while (d.indexOf("<" + c) != -1) { d = d.substring(d.indexOf("<" + c)); d = d.substring(d.indexOf(">") + 1); e = e.substring(e.indexOf(">") + 1); f = e.indexOf("" + c + ">"); d = d.concat(e.substring(0, f)); e = e.substring(f); } return b.length - e.length; }; var w = function(a) { var b = document.createDocumentFragment(); while (a && a.length > 0) { var c = a.indexOf("<"); if (c == -1) { a = s(a); b.appendChild(document.createTextNode(a)); a = null; } if (c > 0) { var d = s(a.substring(0, c)); b.appendChild(document.createTextNode(d)); a = a.substring(c); } if (c == 0) { var e = a.indexOf(""); var g = a.substring(4, f); g = s(g); b.appendChild(document.createComment(g)); a = a.substring(f + 3); } else { var h = a.indexOf(">"); if (a.substring(h - 1, h) == "/") { var i = a.indexOf("/>"); var j = a.substring(1, i); b.appendChild(u(j)); a = a.substring(i + 2); } else { var k = a.indexOf(">"); var l = a.substring(1, k); var m = document.createDocumentFragment(); m.appendChild(u(l)); a = a.substring(k + 1); var n = a.substring(0, a.indexOf("")); a = a.substring(a.indexOf("")); if (n.indexOf("<") != -1) { var o = m.lastChild.nodeName; var p = v(n, a, o); n = n.concat(a.substring(0, p)); a = a.substring(p); } a = a.substring(a.indexOf(">") + 1); m.lastChild.appendChild(w(n)); b.appendChild(m); } } } } return b; }; return w(this); }; String.prototype.toDate = function() { var patt = /(([0-9]{4,4})-([0-9]{1,2})-([0-9]{1,2})|today|tomorrow|yesterday)([\s]{0,}([+-])[\s]{0,}([0-9]+))?/, hs = patt.exec(this), d; if (hs) { if (typeof hs[2] == "undefined") { d = new Date(); } else { d = new Date(floatval(hs[2]), floatval(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] == "+" && floatval(hs[7]) > 0) { d.setDate(d.getDate() + floatval(hs[7])); } else if (hs[6] == "-" && floatval(hs[7]) > 0) { d.setDate(d.getDate() - floatval(hs[7])); } return d; } else { return null; } }; Number.prototype.format = function(decimals, dec_point, thousands_sep) { decimals = isNaN((decimals = Math.abs(decimals))) ? 2 : decimals; dec_point = dec_point == undefined ? "." : dec_point; thousands_sep = thousands_sep == undefined ? "," : thousands_sep; var n = this, s = n < 0 ? "-" : "", i = String(parseInt((n = Math.abs(Number(n) || 0).toFixed(decimals)))), j = (j = i.length) > 3 ? j % 3 : 0; return (s + (j ? i.substr(0, j) + thousands_sep : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands_sep) + (decimals ? dec_point + Math.abs(n - i).toFixed(decimals).slice(2) : "")); }; document.viewport = { getWidth: function() { return ( document.documentElement.clientWidth || document.body.clientWidth || self.innerWidth ); }, getHeight: function() { return ( document.documentElement.clientHeight || document.body.clientHeight || self.innerHeight ); }, getscrollTop: function() { return ( window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop ); }, getscrollLeft: function() { return ( window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft ); } }; document.css = function(css, id) { var style = document.createElement("style"); if (id) { style.id = "css_" + id; if ($E("css_" + id)) { $E("css_" + id).parentNode.removeChild($E("css_" + id)); } } if (css !== null) { if (style.styleSheet) { style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } document.getElementsByTagName("head")[0].appendChild(style); } }; 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 ); }, toArray: function(o) { var prop, result = []; for (prop in o) { result.push(o[prop]); } return result; } }); window.GClass = { create: function() { return function() { this.initialize.apply(this, arguments); }; } }; window.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 (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); } return this; }, setHTML: function(o) { try { this.innerHTML = o; } catch (e) { o = o .replace(/[\r\n\t]/g, "") .replace(/