$estr = function() { return js.Boot.__string_rec(this,''); }
if(typeof js=='undefined') js = {}
js.Boot = function() { }
js.Boot.__name__ = ["js","Boot"];
js.Boot.__unhtml = function(s) {
return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
js.Boot.__trace = function(v,i) {
var msg = (i != null?((i.fileName + ":") + i.lineNumber) + ": ":"");
msg += js.Boot.__unhtml(js.Boot.__string_rec(v,"")) + "<br/>";
var d = document.getElementById("haxe:trace");
if(d == null) alert("No haxe:trace element defined\n" + msg);
else d.innerHTML += msg;
}
js.Boot.__clear_trace = function() {
var d = document.getElementById("haxe:trace");
if(d != null) d.innerHTML = "";
else null;
}
js.Boot.__closure = function(o,f) {
var m = o[f];
if(m == null) return null;
var f1 = function() {
return m.apply(o,arguments);
}
f1.scope = o;
f1.method = m;
return f1;
}
js.Boot.__string_rec = function(o,s) {
if(o == null) return "null";
if(s.length >= 5) return "<...>";
var t = typeof(o);
if(t == "function" && (o.__name__ != null || o.__ename__ != null)) t = "object";
switch(t) {
case "object":{
if(o instanceof Array) {
if(o.__enum__ != null) {
if(o.length == 2) return o[0];
var str = o[0] + "(";
s += "\t";
{
var _g1 = 2, _g = o.length;
while(_g1 < _g) {
var i = _g1++;
if(i != 2) str += "," + js.Boot.__string_rec(o[i],s);
else str += js.Boot.__string_rec(o[i],s);
}
}
return str + ")";
}
var l = o.length;
var i;
var str = "[";
s += "\t";
{
var _g = 0;
while(_g < l) {
var i1 = _g++;
str += ((i1 > 0?",":"")) + js.Boot.__string_rec(o[i1],s);
}
}
str += "]";
return str;
}
var tostr;
try {
tostr = o.toString;
}
catch( $e0 ) {
{
var e = $e0;
{
return "???";
}
}
}
if(tostr != null && tostr != Object.toString) {
var s2 = o.toString();
if(s2 != "[object Object]") return s2;
}
var k = null;
var str = "{\n";
s += "\t";
var hasp = (o.hasOwnProperty != null);
for( var k in o ) { ;
if(hasp && !o.hasOwnProperty(k)) continue;
if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__") continue;
if(str.length != 2) str += ", \n";
str += ((s + k) + " : ") + js.Boot.__string_rec(o[k],s);
}
s = s.substring(1);
str += ("\n" + s) + "}";
return str;
}break;
case "function":{
return "<function>";
}break;
case "string":{
return o;
}break;
default:{
return String(o);
}break;
}
}
js.Boot.__interfLoop = function(cc,cl) {
if(cc == null) return false;
if(cc == cl) return true;
var intf = cc.__interfaces__;
if(intf != null) {
var _g1 = 0, _g = intf.length;
while(_g1 < _g) {
var i = _g1++;
var i1 = intf[i];
if(i1 == cl || js.Boot.__interfLoop(i1,cl)) return true;
}
}
return js.Boot.__interfLoop(cc.__super__,cl);
}
js.Boot.__instanceof = function(o,cl) {
try {
if(o instanceof cl) {
if(cl == Array) return (o.__enum__ == null);
return true;
}
if(js.Boot.__interfLoop(o.__class__,cl)) return true;
}
catch( $e0 ) {
{
var e = $e0;
{
if(cl == null) return false;
}
}
}
switch(cl) {
case Int:{
return Math.ceil(o%2147483648.0) === o;
}break;
case Float:{
return typeof(o) == "number";
}break;
case Bool:{
return o === true || o === false;
}break;
case String:{
return typeof(o) == "string";
}break;
case Dynamic:{
return true;
}break;
default:{
if(o == null) return false;
return o.__enum__ == cl || (cl == Class && o.__name__ != null) || (cl == Enum && o.__ename__ != null);
}break;
}
}
js.Boot.__init = function() {
js.Lib.isIE = (typeof document!='undefined' && document.all != null && typeof window!='undefined' && window.opera == null);
js.Lib.isOpera = (typeof window!='undefined' && window.opera != null);
Array.prototype.copy = Array.prototype.slice;
Array.prototype.insert = function(i,x) {
this.splice(i,0,x);
}
Array.prototype.remove = (Array.prototype.indexOf?function(obj) {
var idx = this.indexOf(obj);
if(idx == -1) return false;
this.splice(idx,1);
return true;
}:function(obj) {
var i = 0;
var l = this.length;
while(i < l) {
if(this[i] == obj) {
this.splice(i,1);
return true;
}
i++;
}
return false;
});
Array.prototype.iterator = function() {
return { cur : 0, arr : this, hasNext : function() {
return this.cur < this.arr.length;
}, next : function() {
return this.arr[this.cur++];
}}
}
var cca = String.prototype.charCodeAt;
String.prototype.cca = cca;
String.prototype.charCodeAt = function(i) {
var x = cca.call(this,i);
if(isNaN(x)) return null;
return x;
}
var oldsub = String.prototype.substr;
String.prototype.substr = function(pos,len) {
if(pos != null && pos != 0 && len != null && len < 0) return "";
if(len == null) len = this.length;
if(pos < 0) {
pos = this.length + pos;
if(pos < 0) pos = 0;
}
else if(len < 0) {
len = (this.length + len) - pos;
}
return oldsub.apply(this,[pos,len]);
}
$closure = js.Boot.__closure;
}
js.Boot.prototype.__class__ = js.Boot;
EReg = function(r,opt) { if( r === $_ ) return; {
opt = opt.split("u").join("");
this.r = new RegExp(r,opt);
}}
EReg.__name__ = ["EReg"];
EReg.prototype.customReplace = function(s,f) {
var buf = new StringBuf();
while(true) {
if(!this.match(s)) break;
buf.b[buf.b.length] = this.matchedLeft();
buf.b[buf.b.length] = f(this);
s = this.matchedRight();
}
buf.b[buf.b.length] = s;
return buf.b.join("");
}
EReg.prototype.match = function(s) {
this.r.m = this.r.exec(s);
this.r.s = s;
this.r.l = RegExp.leftContext;
this.r.r = RegExp.rightContext;
return (this.r.m != null);
}
EReg.prototype.matched = function(n) {
return (this.r.m != null && n >= 0 && n < this.r.m.length?this.r.m[n]:(function($this) {
var $r;
throw "EReg::matched";
return $r;
}(this)));
}
EReg.prototype.matchedLeft = function() {
if(this.r.m == null) throw "No string matched";
if(this.r.l == null) return this.r.s.substr(0,this.r.m.index);
return this.r.l;
}
EReg.prototype.matchedPos = function() {
if(this.r.m == null) throw "No string matched";
return { pos : this.r.m.index, len : this.r.m[0].length}
}
EReg.prototype.matchedRight = function() {
if(this.r.m == null) throw "No string matched";
if(this.r.r == null) {
var sz = this.r.m.index + this.r.m[0].length;
return this.r.s.substr(sz,this.r.s.length - sz);
}
return this.r.r;
}
EReg.prototype.r = null;
EReg.prototype.replace = function(s,by) {
return s.replace(this.r,by);
}
EReg.prototype.split = function(s) {
var d = "#__delim__#";
return s.replace(this.r,d).split(d);
}
EReg.prototype.__class__ = EReg;
js.JsXml__ = function(p) { if( p === $_ ) return; {
null;
}}
js.JsXml__.__name__ = ["js","JsXml__"];
js.JsXml__.parse = function(str) {
var rules = [js.JsXml__.enode,js.JsXml__.epcdata,js.JsXml__.eend,js.JsXml__.ecdata,js.JsXml__.edoctype,js.JsXml__.ecomment,js.JsXml__.eprolog];
var nrules = rules.length;
var current = Xml.createDocument();
var stack = new List();
while(str.length > 0) {
var i = 0;
try {
while(i < nrules) {
var r = rules[i];
if(r.match(str)) {
switch(i) {
case 0:{
var x = Xml.createElement(r.matched(1));
current.addChild(x);
str = r.matchedRight();
while(js.JsXml__.eattribute.match(str)) {
x.set(js.JsXml__.eattribute.matched(1),js.JsXml__.eattribute.matched(3));
str = js.JsXml__.eattribute.matchedRight();
}
if(!js.JsXml__.eclose.match(str)) {
i = nrules;
throw "__break__";
}
if(js.JsXml__.eclose.matched(1) == ">") {
stack.push(current);
current = x;
}
str = js.JsXml__.eclose.matchedRight();
}break;
case 1:{
var x = Xml.createPCData(r.matched(0));
current.addChild(x);
str = r.matchedRight();
}break;
case 2:{
if(current._children != null && current._children.length == 0) {
var e = Xml.createPCData("");
current.addChild(e);
}
else null;
if(r.matched(1) != current._nodeName || stack.isEmpty()) {
i = nrules;
throw "__break__";
}
else null;
current = stack.pop();
str = r.matchedRight();
}break;
case 3:{
str = r.matchedRight();
if(!js.JsXml__.ecdata_end.match(str)) throw "End of CDATA section not found";
var x = Xml.createCData(js.JsXml__.ecdata_end.matchedLeft());
current.addChild(x);
str = js.JsXml__.ecdata_end.matchedRight();
}break;
case 4:{
var pos = 0;
var count = 0;
var old = str;
try {
while(true) {
if(!js.JsXml__.edoctype_elt.match(str)) throw "End of DOCTYPE section not found";
var p = js.JsXml__.edoctype_elt.matchedPos();
pos += p.pos + p.len;
str = js.JsXml__.edoctype_elt.matchedRight();
switch(js.JsXml__.edoctype_elt.matched(0)) {
case "[":{
count++;
}break;
case "]":{
count--;
if(count < 0) throw "Invalid ] found in DOCTYPE declaration";
}break;
default:{
if(count == 0) throw "__break__";
}break;
}
}
} catch( e ) { if( e != "__break__" ) throw e; }
var x = Xml.createDocType(old.substr(0,pos));
current.addChild(x);
}break;
case 5:{
if(!js.JsXml__.ecomment_end.match(str)) throw "Unclosed Comment";
var p = js.JsXml__.ecomment_end.matchedPos();
var x = Xml.createComment(str.substr(0,p.pos + p.len));
current.addChild(x);
str = js.JsXml__.ecomment_end.matchedRight();
}break;
case 6:{
var x = Xml.createProlog(r.matched(0));
current.addChild(x);
str = r.matchedRight();
}break;
}
throw "__break__";
}
i += 1;
}
} catch( e ) { if( e != "__break__" ) throw e; }
if(i == nrules) {
if(str.length > 10) throw (("Xml parse error : Unexpected " + str.substr(0,10)) + "...");
else throw ("Xml parse error : Unexpected " + str);
}
}
if(!stack.isEmpty()) throw "Xml parse error : Unclosed " + stack.last().getNodeName();
return current;
}
js.JsXml__.createElement = function(name) {
var r = new js.JsXml__();
r.nodeType = Xml.Element;
r._children = new Array();
r._attributes = new Hash();
r.setNodeName(name);
return r;
}
js.JsXml__.createPCData = function(data) {
var r = new js.JsXml__();
r.nodeType = Xml.PCData;
r.setNodeValue(data);
return r;
}
js.JsXml__.createCData = function(data) {
var r = new js.JsXml__();
r.nodeType = Xml.CData;
r.setNodeValue(data);
return r;
}
js.JsXml__.createComment = function(data) {
var r = new js.JsXml__();
r.nodeType = Xml.Comment;
r.setNodeValue(data);
return r;
}
js.JsXml__.createDocType = function(data) {
var r = new js.JsXml__();
r.nodeType = Xml.DocType;
r.setNodeValue(data);
return r;
}
js.JsXml__.createProlog = function(data) {
var r = new js.JsXml__();
r.nodeType = Xml.Prolog;
r.setNodeValue(data);
return r;
}
js.JsXml__.createDocument = function() {
var r = new js.JsXml__();
r.nodeType = Xml.Document;
r._children = new Array();
return r;
}
js.JsXml__.prototype._attributes = null;
js.JsXml__.prototype._children = null;
js.JsXml__.prototype._nodeName = null;
js.JsXml__.prototype._nodeValue = null;
js.JsXml__.prototype._parent = null;
js.JsXml__.prototype.addChild = function(x) {
if(this._children == null) throw "bad nodetype";
if(x._parent != null) x._parent._children.remove(x);
x._parent = this;
this._children.push(x);
}
js.JsXml__.prototype.attributes = function() {
if(this.nodeType != Xml.Element) throw "bad nodeType";
return this._attributes.keys();
}
js.JsXml__.prototype.elements = function() {
if(this._children == null) throw "bad nodetype";
return { cur : 0, x : this._children, hasNext : function() {
var k = this.cur;
var l = this.x.length;
while(k < l) {
if(this.x[k].nodeType == Xml.Element) break;
k += 1;
}
this.cur = k;
return k < l;
}, next : function() {
var k = this.cur;
var l = this.x.length;
while(k < l) {
var n = this.x[k];
k += 1;
if(n.nodeType == Xml.Element) {
this.cur = k;
return n;
}
}
return null;
}}
}
js.JsXml__.prototype.elementsNamed = function(name) {
if(this._children == null) throw "bad nodetype";
return { cur : 0, x : this._children, hasNext : function() {
var k = this.cur;
var l = this.x.length;
while(k < l) {
var n = this.x[k];
if(n.nodeType == Xml.Element && n._nodeName == name) break;
k++;
}
this.cur = k;
return k < l;
}, next : function() {
var k = this.cur;
var l = this.x.length;
while(k < l) {
var n = this.x[k];
k++;
if(n.nodeType == Xml.Element && n._nodeName == name) {
this.cur = k;
return n;
}
}
return null;
}}
}
js.JsXml__.prototype.exists = function(att) {
if(this.nodeType != Xml.Element) throw "bad nodeType";
return this._attributes.exists(att);
}
js.JsXml__.prototype.firstChild = function() {
if(this._children == null) throw "bad nodetype";
return this._children[0];
}
js.JsXml__.prototype.firstElement = function() {
if(this._children == null) throw "bad nodetype";
var cur = 0;
var l = this._children.length;
while(cur < l) {
var n = this._children[cur];
if(n.nodeType == Xml.Element) return n;
cur++;
}
return null;
}
js.JsXml__.prototype.get = function(att) {
if(this.nodeType != Xml.Element) throw "bad nodeType";
return this._attributes.get(att);
}
js.JsXml__.prototype.getNodeName = function() {
if(this.nodeType != Xml.Element) throw "bad nodeType";
return this._nodeName;
}
js.JsXml__.prototype.getNodeValue = function() {
if(this.nodeType == Xml.Element || this.nodeType == Xml.Document) throw "bad nodeType";
return this._nodeValue;
}
js.JsXml__.prototype.getParent = function() {
return this._parent;
}
js.JsXml__.prototype.insertChild = function(x,pos) {
if(this._children == null) throw "bad nodetype";
if(x._parent != null) x._parent._children.remove(x);
x._parent = this;
this._children.insert(pos,x);
}
js.JsXml__.prototype.iterator = function() {
if(this._children == null) throw "bad nodetype";
return { cur : 0, x : this._children, hasNext : function() {
return this.cur < this.x.length;
}, next : function() {
return this.x[this.cur++];
}}
}
js.JsXml__.prototype.nodeName = null;
js.JsXml__.prototype.nodeType = null;
js.JsXml__.prototype.nodeValue = null;
js.JsXml__.prototype.parent = null;
js.JsXml__.prototype.remove = function(att) {
if(this.nodeType != Xml.Element) throw "bad nodeType";
this._attributes.remove(att);
}
js.JsXml__.prototype.removeChild = function(x) {
if(this._children == null) throw "bad nodetype";
var b = this._children.remove(x);
if(b) x._parent = null;
return b;
}
js.JsXml__.prototype.set = function(att,value) {
if(this.nodeType != Xml.Element) throw "bad nodeType";
this._attributes.set(att,value);
}
js.JsXml__.prototype.setNodeName = function(n) {
if(this.nodeType != Xml.Element) throw "bad nodeType";
return this._nodeName = n;
}
js.JsXml__.prototype.setNodeValue = function(v) {
if(this.nodeType == Xml.Element || this.nodeType == Xml.Document) throw "bad nodeType";
return this._nodeValue = v;
}
js.JsXml__.prototype.toString = function() {
if(this.nodeType == Xml.PCData) return this._nodeValue;
if(this.nodeType == Xml.CData) return ("<![CDATA[" + this._nodeValue) + "]]>";
if(this.nodeType == Xml.Comment || this.nodeType == Xml.DocType || this.nodeType == Xml.Prolog) return this._nodeValue;
var s = new StringBuf();
if(this.nodeType == Xml.Element) {
s.b[s.b.length] = "<";
s.b[s.b.length] = this._nodeName;
{ var $it0 = this._attributes.keys();
while( $it0.hasNext() ) { var k = $it0.next();
{
s.b[s.b.length] = " ";
s.b[s.b.length] = k;
s.b[s.b.length] = "=\"";
s.b[s.b.length] = this._attributes.get(k);
s.b[s.b.length] = "\"";
}
}}
if(this._children.length == 0) {
s.b[s.b.length] = "/>";
return s.b.join("");
}
s.b[s.b.length] = ">";
}
{ var $it1 = this.iterator();
while( $it1.hasNext() ) { var x = $it1.next();
s.b[s.b.length] = x.toString();
}}
if(this.nodeType == Xml.Element) {
s.b[s.b.length] = "</";
s.b[s.b.length] = this._nodeName;
s.b[s.b.length] = ">";
}
return s.b.join("");
}
js.JsXml__.prototype.__class__ = js.JsXml__;
js.Lib = function() { }
js.Lib.__name__ = ["js","Lib"];
js.Lib.isIE = null;
js.Lib.isOpera = null;
js.Lib.document = null;
js.Lib.window = null;
js.Lib.alert = function(v) {
alert(js.Boot.__string_rec(v,""));
}
js.Lib.eval = function(code) {
return eval(code);
}
js.Lib.setErrorHandler = function(f) {
js.Lib.onerror = f;
}
js.Lib.prototype.__class__ = js.Lib;
if(typeof haxe=='undefined') haxe = {}
haxe.Http = function(url) { if( url === $_ ) return; {
this.url = url;
this.headers = new Hash();
this.params = new Hash();
this.async = true;
}}
haxe.Http.__name__ = ["haxe","Http"];
haxe.Http.requestUrl = function(url) {
var h = new haxe.Http(url);
h.async = false;
var r = null;
h.onData = function(d) {
r = d;
}
h.onError = function(e) {
throw e;
}
h.request(false);
return r;
}
haxe.Http.prototype.async = null;
haxe.Http.prototype.headers = null;
haxe.Http.prototype.onData = function(data) {
null;
}
haxe.Http.prototype.onError = function(msg) {
null;
}
haxe.Http.prototype.onStatus = function(status) {
null;
}
haxe.Http.prototype.params = null;
haxe.Http.prototype.postData = null;
haxe.Http.prototype.request = function(post) {
var me = this;
var r = new js.XMLHttpRequest();
var onreadystatechange = function() {
if(r.readyState != 4) return;
var s = (function($this) {
var $r;
try {
$r = r.status;
}
catch( $e0 ) {
{
var e = $e0;
$r = null;
}
}
return $r;
}(this));
if(s == undefined) s = null;
if(s != null) me.onStatus(s);
if(s != null && s >= 200 && s < 400) me.onData(r.responseText);
else switch(s) {
case null:{
me.onError("Failed to connect or resolve host");
}break;
case 12029:{
me.onError("Failed to connect to host");
}break;
case 12007:{
me.onError("Unknown host");
}break;
default:{
me.onError("Http Error #" + r.status);
}break;
}
}
if(this.async) r.onreadystatechange = onreadystatechange;
var uri = this.postData;
if(uri != null) post = true;
else { var $it1 = this.params.keys();
while( $it1.hasNext() ) { var p = $it1.next();
{
if(uri == null) uri = "";
else uri += "&";
uri += (StringTools.urlDecode(p) + "=") + StringTools.urlEncode(this.params.get(p));
}
}}
try {
if(post) r.open("POST",this.url,this.async);
else if(uri != null) {
var question = this.url.split("?").length <= 1;
r.open("GET",(this.url + ((question?"?":"&"))) + uri,this.async);
uri = null;
}
else r.open("GET",this.url,this.async);
}
catch( $e2 ) {
{
var e = $e2;
{
this.onError(e.toString());
return;
}
}
}
if(this.headers.get("Content-Type") == null && post && this.postData == null) r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
{ var $it3 = this.headers.keys();
while( $it3.hasNext() ) { var h = $it3.next();
r.setRequestHeader(h,this.headers.get(h));
}}
r.send(uri);
if(!this.async) onreadystatechange();
}
haxe.Http.prototype.setHeader = function(header,value) {
this.headers.set(header,value);
}
haxe.Http.prototype.setParameter = function(param,value) {
this.params.set(param,value);
}
haxe.Http.prototype.setPostData = function(data) {
this.postData = data;
}
haxe.Http.prototype.url = null;
haxe.Http.prototype.__class__ = haxe.Http;
js.Cookie = function() { }
js.Cookie.__name__ = ["js","Cookie"];
js.Cookie.set = function(name,value,expireDelay,path,domain) {
var s = (name + "=") + StringTools.urlEncode(value);
if(expireDelay != null) {
var d = DateTools.delta(Date.now(),expireDelay * 1000);
s += ";expires=" + d.toGMTString();
}
if(path != null) {
s += ";path=" + path;
}
if(domain != null) {
s += ";domain=" + domain;
}
js.Lib.document.cookie = s;
}
js.Cookie.all = function() {
var h = new Hash();
var a = js.Lib.document.cookie.split(";");
{
var _g = 0;
while(_g < a.length) {
var e = a[_g];
++_g;
e = StringTools.ltrim(e);
var t = e.split("=");
if(t.length < 2) continue;
h.set(t[0],StringTools.urlDecode(t[1]));
}
}
return h;
}
js.Cookie.get = function(name) {
return js.Cookie.all().get(name);
}
js.Cookie.exists = function(name) {
return js.Cookie.all().exists(name);
}
js.Cookie.remove = function(name,path,domain) {
js.Cookie.set(name,"",-10,path,domain);
}
js.Cookie.prototype.__class__ = js.Cookie;
DateTools = function() { }
DateTools.__name__ = ["DateTools"];
DateTools.__format_get = function(d,e) {
return (function($this) {
var $r;
switch(e) {
case "%":{
$r = "%";
}break;
case "C":{
$r = StringTools.lpad(Std.string(Std["int"](d.getFullYear() / 100)),"0",2);
}break;
case "d":{
$r = StringTools.lpad(Std.string(d.getDate()),"0",2);
}break;
case "D":{
$r = DateTools.__format(d,"%m/%d/%y");
}break;
case "e":{
$r = Std.string(d.getDate());
}break;
case "H":case "k":{
$r = StringTools.lpad(Std.string(d.getHours()),(e == "H"?"0":" "),2);
}break;
case "I":case "l":{
$r = (function($this) {
var $r;
var hour = d.getHours() % 12;
$r = StringTools.lpad(Std.string((hour == 0?12:hour)),(e == "I"?"0":" "),2);
return $r;
}($this));
}break;
case "m":{
$r = StringTools.lpad(Std.string(d.getMonth() + 1),"0",2);
}break;
case "M":{
$r = StringTools.lpad(Std.string(d.getMinutes()),"0",2);
}break;
case "n":{
$r = "\n";
}break;
case "p":{
$r = (d.getHours() > 11?"PM":"AM");
}break;
case "r":{
$r = DateTools.__format(d,"%I:%M:%S %p");
}break;
case "R":{
$r = DateTools.__format(d,"%H:%M");
}break;
case "s":{
$r = Std.string(Std["int"](d.getTime() / 1000));
}break;
case "S":{
$r = StringTools.lpad(Std.string(d.getSeconds()),"0",2);
}break;
case "t":{
$r = "\t";
}break;
case "T":{
$r = DateTools.__format(d,"%H:%M:%S");
}break;
case "u":{
$r = (function($this) {
var $r;
var t = d.getDay();
$r = (t == 0?"7":Std.string(t));
return $r;
}($this));
}break;
case "w":{
$r = Std.string(d.getDay());
}break;
case "y":{
$r = StringTools.lpad(Std.string(d.getFullYear() % 100),"0",2);
}break;
case "Y":{
$r = Std.string(d.getFullYear());
}break;
default:{
$r = (function($this) {
var $r;
throw ("Date.format %" + e) + "- not implemented yet.";
return $r;
}($this));
}break;
}
return $r;
}(this));
}
DateTools.__format = function(d,f) {
var r = new StringBuf();
var p = 0;
while(true) {
var np = f.indexOf("%",p);
if(np < 0) break;
r.b[r.b.length] = f.substr(p,np - p);
r.b[r.b.length] = DateTools.__format_get(d,f.substr(np + 1,1));
p = np + 2;
}
r.b[r.b.length] = f.substr(p,f.length - p);
return r.b.join("");
}
DateTools.format = function(d,f) {
return DateTools.__format(d,f);
}
DateTools.delta = function(d,t) {
return Date.fromTime(d.getTime() + t);
}
DateTools.getMonthDays = function(d) {
var month = d.getMonth();
var year = d.getFullYear();
if(month != 1) return DateTools.DAYS_OF_MONTH[month];
var isB = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
return (isB?29:28);
}
DateTools.seconds = function(n) {
return n * 1000.0;
}
DateTools.minutes = function(n) {
return (n * 60.0) * 1000.0;
}
DateTools.hours = function(n) {
return ((n * 60.0) * 60.0) * 1000.0;
}
DateTools.days = function(n) {
return (((n * 24.0) * 60.0) * 60.0) * 1000.0;
}
DateTools.parse = function(t) {
var s = t / 1000;
var m = s / 60;
var h = m / 60;
return { ms : t % 1000, seconds : Std["int"](s % 60), minutes : Std["int"](m % 60), hours : Std["int"](h % 24), days : Std["int"](h / 24)}
}
DateTools.make = function(o) {
return o.ms + 1000.0 * (o.seconds + 60.0 * (o.minutes + 60.0 * (o.hours + 24.0 * o.days)));
}
DateTools.prototype.__class__ = DateTools;
haxe.Log = function() { }
haxe.Log.__name__ = ["haxe","Log"];
haxe.Log.trace = function(v,infos) {
js.Boot.__trace(v,infos);
}
haxe.Log.clear = function() {
js.Boot.__clear_trace();
}
haxe.Log.prototype.__class__ = haxe.Log;
Std = function() { }
Std.__name__ = ["Std"];
Std["is"] = function(v,t) {
return js.Boot.__instanceof(v,t);
}
Std.string = function(s) {
return js.Boot.__string_rec(s,"");
}
Std["int"] = function(x) {
if(x < 0) return Math.ceil(x);
return Math.floor(x);
}
Std.parseInt = function(x) {
var v = parseInt(x);
if(Math.isNaN(v)) return null;
return v;
}
Std.parseFloat = function(x) {
return parseFloat(x);
}
Std.random = function(x) {
return Math.floor(Math.random() * x);
}
Std.prototype.__class__ = Std;
if(typeof mt=='undefined') mt = {}
if(!mt.js) mt.js = {}
mt.js.Tip = function() { }
mt.js.Tip.__name__ = ["mt","js","Tip"];
mt.js.Tip.lastRef = null;
mt.js.Tip.placeRef = null;
mt.js.Tip.initialized = null;
mt.js.Tip.tooltip = null;
mt.js.Tip.tooltipContent = null;
mt.js.Tip.mousePos = null;
mt.js.Tip.onHide = null;
mt.js.Tip.excludeList = null;
mt.js.Tip.show = function(refObj,contentHTML,cName,pRef) {
mt.js.Tip.init();
if(mt.js.Tip.tooltip == null) {
mt.js.Tip.tooltip = js.Lib.document.getElementById(mt.js.Tip.tooltipId);
if(mt.js.Tip.tooltip == null) {
mt.js.Tip.tooltip = js.Lib.document.createElement("div");
mt.js.Tip.tooltip.id = mt.js.Tip.tooltipId;
js.Lib.document.body.insertBefore(mt.js.Tip.tooltip,js.Lib.document.body.firstChild);
}
mt.js.Tip.tooltip.style.top = "-1000px";
mt.js.Tip.tooltip.style.position = "absolute";
mt.js.Tip.tooltip.style.zIndex = 10;
}
if(mt.js.Tip.tooltipContent == null) {
mt.js.Tip.tooltipContent = js.Lib.document.getElementById(mt.js.Tip.tooltipContentId);
if(mt.js.Tip.tooltipContent == null) {
mt.js.Tip.tooltipContent = js.Lib.document.createElement("div");
mt.js.Tip.tooltipContent.id = mt.js.Tip.tooltipContentId;
mt.js.Tip.tooltip.appendChild(mt.js.Tip.tooltipContent);
}
}
if(pRef == null) pRef = false;
mt.js.Tip.placeRef = pRef;
if(cName == null) mt.js.Tip.tooltip.className = mt.js.Tip.defaultClass;
else mt.js.Tip.tooltip.className = cName;
if(mt.js.Tip.lastRef != null && mt.js.Tip.onHide != null) {
mt.js.Tip.onHide();
mt.js.Tip.onHide = null;
}
mt.js.Tip.lastRef = refObj;
mt.js.Tip.tooltipContent.innerHTML = contentHTML;
if(mt.js.Tip.placeRef) mt.js.Tip.placeTooltipRef();
else mt.js.Tip.placeTooltip();
}
mt.js.Tip.exclude = function(id) {
var e = js.Lib.document.getElementById(id);
if(e == null) throw id + " not found";
if(mt.js.Tip.excludeList == null) mt.js.Tip.excludeList = new List();
mt.js.Tip.excludeList.add(e);
}
mt.js.Tip.placeTooltip = function() {
if(mt.js.Tip.mousePos == null) return;
var tts = mt.js.Tip.elementSize(mt.js.Tip.tooltip);
var w = mt.js.Tip.windowSize();
var top = 0;
var left = 0;
left = mt.js.Tip.mousePos.x + mt.js.Tip.xOffset;
top = mt.js.Tip.mousePos.y + mt.js.Tip.yOffset;
if(mt.js.Tip.excludeList != null) { var $it0 = mt.js.Tip.excludeList.iterator();
while( $it0.hasNext() ) { var e = $it0.next();
{
var s = mt.js.Tip.elementSize(e);
if(left > s.x + s.width || left + tts.width < s.x || top > s.y + s.height || top + tts.height < s.y) continue;
var dx1 = left - (s.x + s.width);
var dx2 = (left + tts.width) - s.x;
var dx = ((Math.abs(dx1) > Math.abs(dx2))?dx2:dx1);
var dy1 = top - (s.y + s.height);
var dy2 = (top + tts.height) - s.y;
var dy = ((Math.abs(dy1) > Math.abs(dy2))?dy2:dy1);
var cx = (left + tts.width / 2) - mt.js.Tip.mousePos.x;
var cy = (top + tts.height / 2) - mt.js.Tip.mousePos.y;
if((cx - dx) * (cx - dx) + cy * cy > cx * cx + (cy - dy) * (cy - dy)) top -= dy;
else left -= dx;
}
}}
if(top + tts.height > (w.height - 2) + w.scrollTop) {
if(mt.js.Tip.mousePos.y - tts.height > 5 + w.scrollTop) top = (mt.js.Tip.mousePos.y - tts.height) - 5;
else top = ((w.height - 2) + w.scrollTop) - tts.height;
}
if(left + tts.width > (w.width - 22) + w.scrollLeft) {
if(mt.js.Tip.mousePos.x - tts.width > 5 + w.scrollLeft) left = (mt.js.Tip.mousePos.x - tts.width) - 5;
else left = ((w.width - 22) + w.scrollLeft) - tts.width;
}
if(top < 0) top = 0;
if(left < 0) left = 0;
mt.js.Tip.tooltip.style.left = left + "px";
mt.js.Tip.tooltip.style.top = top + "px";
}
mt.js.Tip.placeTooltipRef = function() {
var o = mt.js.Tip.elementSize(mt.js.Tip.lastRef);
var tts = mt.js.Tip.elementSize(mt.js.Tip.tooltip);
if(o.width <= 0) mt.js.Tip.tooltip.style.left = (o.x) + "px";
else mt.js.Tip.tooltip.style.left = ((o.x - tts.width * 0.5) + o.width * 0.5) + "px";
mt.js.Tip.tooltip.style.top = (o.y + Math.max(mt.js.Tip.minOffsetY,o.height)) + "px";
}
mt.js.Tip.showTip = function(refObj,title,contentBase) {
contentBase = ("<p>" + contentBase) + "</p>";
mt.js.Tip.show(refObj,(("<div class=\"title\">" + title) + "</div>") + contentBase);
}
mt.js.Tip.hide = function() {
if(mt.js.Tip.lastRef == null) return;
mt.js.Tip.lastRef = null;
if(mt.js.Tip.onHide != null) {
mt.js.Tip.onHide();
mt.js.Tip.onHide = null;
}
mt.js.Tip.tooltip.style.top = "-1000px";
mt.js.Tip.tooltip.style.width = "";
}
mt.js.Tip.clean = function() {
if(mt.js.Tip.lastRef == null) return;
if(mt.js.Tip.lastRef.parentNode == null) return mt.js.Tip.hide();
if(mt.js.Tip.lastRef.id != null && mt.js.Tip.lastRef.id != "") {
if(js.Lib.document.getElementById(mt.js.Tip.lastRef.id) != mt.js.Tip.lastRef) return mt.js.Tip.hide();
}
return;
}
mt.js.Tip.elementSize = function(o) {
var ret = { x : 0, y : 0, width : o.clientWidth, height : o.clientHeight}
var p = o;
while(p != null) {
if(p.offsetParent != null) {
ret.x += p.offsetLeft - p.scrollLeft;
ret.y += p.offsetTop - p.scrollTop;
}
else {
ret.x += p.offsetLeft;
ret.y += p.offsetTop;
}
p = p.offsetParent;
}
return ret;
}
mt.js.Tip.windowSize = function() {
var ret = { x : 0, y : 0, width : js.Lib.window.innerWidth, height : js.Lib.window.innerHeight, scrollLeft : js.Lib.document.body.scrollLeft + js.Lib.document.documentElement.scrollLeft, scrollTop : js.Lib.document.body.scrollTop + js.Lib.document.documentElement.scrollTop}
var body = (js.Lib.isIE?js.Lib.document.documentElement:js.Lib.document.body);
if(ret.width == null) ret.width = body.clientWidth;
if(ret.height == null) ret.height = body.clientHeight;
return ret;
}
mt.js.Tip.onMouseMove = function(evt) {
try {
var posx = 0;
var posy = 0;
if(evt == null) evt = js.Lib.window.event;
var e = evt;
if(e.pageX || e.pageY) {
posx = e.pageX;
posy = e.pageY;
}
else if(e.clientX || e.clientY) {
posx = (e.clientX + js.Lib.document.body.scrollLeft) + js.Lib.document.documentElement.scrollLeft;
posy = (e.clientY + js.Lib.document.body.scrollTop) + js.Lib.document.documentElement.scrollTop;
}
mt.js.Tip.mousePos = { x : posx, y : posy}
if(mt.js.Tip.lastRef != null && !mt.js.Tip.placeRef) mt.js.Tip.placeTooltip();
}
catch( $e0 ) {
{
var e = $e0;
null;
}
}
}
mt.js.Tip.init = function() {
if(mt.js.Tip.initialized) return;
if(document.body != null) {
mt.js.Tip.initialized = true;
document.body.onmousemove = $closure(mt.js.Tip,"onMouseMove");
}
else null;
}
mt.js.Tip.prototype.__class__ = mt.js.Tip;
js.App = function() { }
js.App.__name__ = ["js","App"];
js.App.setField = function(id,value) {
var e = js.Lib.window.document.getElementById(id);
e.value = value;
}
js.App.validateCreateForm = function() {
var idRegion = (js.Lib.document.getElementById("idRegion")).value;
var name = (js.Lib.document.getElementById("name")).value;
var xml = Xml.parse(haxe.Http.requestUrl((("/create?idRegion=" + idRegion) + ";name=") + StringTools.urlEncode(name))).firstElement();
var rs = "";
{ var $it0 = xml.iterator();
while( $it0.hasNext() ) { var c = $it0.next();
{
rs += c.toString();
}
}}
if(xml.get("rs") != null) {
js.Lib.window.location = xml.get("rs");
}
else {
js.Lib.document.getElementById("result").innerHTML = rs;
}
}
js.App.refreshMessage = function() {
if(js.App.lock != null) return;
var r = new haxe.Http("/msg/refresh");
r.setHeader("X-Handler","js.MVApp");
r.onData = $closure(js.App,"onData");
r.onError = $closure(js.App,"onError");
r.setParameter("last",Std.string(js.App.lastMessage));
if(js.App.oldLock != null) {
js.App.oldLock.onData = function(v) {
null;
}
js.App.oldLock.onError = function(v) {
null;
}
js.App.oldLock = null;
}
js.App.lock = r;
js.App.lockTimeOut = new haxe.Timer(10000);
js.App.lockTimeOut.run = function() {
var me = js.App;
if(me.lockTimeOut != null) {
me.lockTimeOut.stop();
me.lockTimeOut = null;
}
me.oldLock = me.lock;
me.lock = null;
}
r.request(true);
}
js.App.sendMessage = function(form) {
if(js.App.lock != null) return;
var r = new haxe.Http("/msg/send");
r.setHeader("X-Handler","js.MVApp");
r.onData = $closure(js.App,"onData");
r.onError = $closure(js.App,"onError");
var a = js.Lib.window.location.host.split(".");
var domain = a.slice(-2).join(".");
var l = form.elements;
{
var _g1 = 0, _g = l.length;
while(_g1 < _g) {
var i = _g1++;
var e = l[i];
if(e.name == null || e.name == "") continue;
r.setParameter(e.name,e.value);
if(e.name == "nickname") js.Cookie.set("nickname",e.value,null,"/",domain);
if(e.type == "submit") {
e.disabled = true;
js.App.lockButton = e;
}
}
}
r.setParameter("last",Std.string(js.App.lastMessage));
if(js.App.oldLock != null) {
js.App.oldLock.onData = function(v) {
null;
}
js.App.oldLock.onError = function(v) {
null;
}
js.App.oldLock = null;
}
js.App.lock = r;
js.App.lockTimeOut = new haxe.Timer(10000);
js.App.lockTimeOut.run = function() {
var me = js.App;
if(me.lockTimeOut != null) {
me.lockTimeOut.stop();
me.lockTimeOut = null;
}
me.oldLock = me.lock;
me.lock = null;
}
js.Lib.document.body.style.cursor = "progress";
r.request(true);
}
js.App.onData = function(data) {
var x;
var e = null;
do {
e = js.Lib.document.getElementById("exec-js");
if(e != null) e.setAttribute("id","");
} while(e != null);
try {
x = Xml.parse(("<resp>" + data) + "</resp>").firstChild();
}
catch( $e0 ) {
{
var e1 = $e0;
{
return;
}
}
}
try {
{ var $it1 = x.elements();
while( $it1.hasNext() ) { var n = $it1.next();
{
if((n.getNodeName() == "fill" || n.getNodeName() == "add") && n.exists("id")) {
var id = n.get("id");
var d = js.Lib.document.getElementById(id);
if(d != null) {
var s = "";
{ var $it2 = n.iterator();
while( $it2.hasNext() ) { var c = $it2.next();
{
if(c.nodeType == Xml.CData) s += c.getNodeValue();
else s += c.toString();
}
}}
if(n.exists("class")) d.className = n.get("class");
if(n.getNodeName() == "add") d.innerHTML += s;
else d.innerHTML = s;
if(n.exists("scrollDown")) js.App.scrollDown(id);
}
else {
haxe.Log.trace("section not found",{ fileName : "App.hx", lineNumber : 147, className : "js.App", methodName : "onData"});
}
}
else if(n.getNodeName() == "style") {
if(n.exists("class")) js.Lib.document.getElementById(n.get("id")).className = n.get("class");
}
else if(n.getNodeName() == "input") {
var e1 = js.Lib.document.getElementById(n.get("id"));
var c = n.firstChild();
if(n.exists("value")) e1.value = n.get("value");
else if(c != null) e1.value = c.getNodeValue();
else e1.value = "";
}
else if(n.getNodeName() == "alert") {
js.Lib.alert(n.firstChild().getNodeValue());
}
else if(n.getNodeName() == "last") {
js.App.lastMessage = Std.parseInt(n.get("id"));
}
else null;
}
}}
}
catch( $e3 ) {
{
var e1 = $e3;
null;
}
}
var e1 = js.Lib.document.getElementById("exec-js");
if(e1 != null) {
try {
e1.setAttribute("id","");
js.Lib.eval(e1.innerHTML);
}
catch( $e4 ) {
{
var f = $e4;
null;
}
}
}
js.App.onEnd();
}
js.App.onError = function(msg) {
js.App.onEnd();
}
js.App.onEnd = function() {
js.Lib.document.body.style.cursor = "default";
if(js.App.lockTimeOut != null) {
js.App.lockTimeOut.stop();
js.App.lockTimeOut = null;
}
js.App.lock = null;
js.App.oldLock = null;
if(js.App.lockButton != null) js.App.lockButton.disabled = false;
}
js.App.scrollDown = function(id,force) {
if(force == null) force = false;
var div = js.Lib.document.getElementById(id);
if(div == null) return;
if(div.autoScroll == null) {
div.onscroll = function(e) {
div.autoScroll = (div.scrollTop / (div.scrollHeight - div.clientHeight) > 0.85);
}
div.autoScroll = true;
}
if(div.autoScroll || force) div.scrollTop = div.scrollHeight - div.clientHeight;
}
js.App.main = function() {
if(window != top && window != null && top != null) top.location.href = location.href;
else null;
}
js.App.initRefresh = function() {
var h = new haxe.Timer(120000);
h.run = function() {
js.App.refreshMessage();
}
}
js.App.prototype.__class__ = js.App;
haxe.Timer = function(time_ms) { if( time_ms === $_ ) return; {
this.id = haxe.Timer.arr.length;
haxe.Timer.arr[this.id] = this;
this.timerId = window.setInterval(("haxe.Timer.arr[" + this.id) + "].run();",time_ms);
}}
haxe.Timer.__name__ = ["haxe","Timer"];
haxe.Timer.delay = function(f,time_ms) {
var t = new haxe.Timer(time_ms);
t.run = function() {
t.stop();
f();
}
return t;
}
haxe.Timer.stamp = function() {
return Date.now().getTime() / 1000;
}
haxe.Timer.prototype.id = null;
haxe.Timer.prototype.run = function() {
null;
}
haxe.Timer.prototype.stop = function() {
if(this.id == null) return;
window.clearInterval(this.timerId);
haxe.Timer.arr[this.id] = null;
if(this.id > 100 && this.id == haxe.Timer.arr.length - 1) {
var p = this.id - 1;
while(p >= 0 && haxe.Timer.arr[p] == null) p--;
haxe.Timer.arr = haxe.Timer.arr.slice(0,p + 1);
}
this.id = null;
}
haxe.Timer.prototype.timerId = null;
haxe.Timer.prototype.__class__ = haxe.Timer;
StringTools = function() { }
StringTools.__name__ = ["StringTools"];
StringTools.urlEncode = function(s) {
return encodeURIComponent(s);
}
StringTools.urlDecode = function(s) {
return decodeURIComponent(s.split("+").join(" "));
}
StringTools.htmlEscape = function(s) {
return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
StringTools.htmlUnescape = function(s) {
return s.split("&gt;").join(">").split("&lt;").join("<").split("&amp;").join("&");
}
StringTools.startsWith = function(s,start) {
return (s.length >= start.length && s.substr(0,start.length) == start);
}
StringTools.endsWith = function(s,end) {
var elen = end.length;
var slen = s.length;
return (slen >= elen && s.substr(slen - elen,elen) == end);
}
StringTools.isSpace = function(s,pos) {
var c = s.charCodeAt(pos);
return (c >= 9 && c <= 13) || c == 32;
}
StringTools.ltrim = function(s) {
var l = s.length;
var r = 0;
while(r < l && StringTools.isSpace(s,r)) {
r++;
}
if(r > 0) return s.substr(r,l - r);
else return s;
}
StringTools.rtrim = function(s) {
var l = s.length;
var r = 0;
while(r < l && StringTools.isSpace(s,(l - r) - 1)) {
r++;
}
if(r > 0) {
return s.substr(0,l - r);
}
else {
return s;
}
}
StringTools.trim = function(s) {
return StringTools.ltrim(StringTools.rtrim(s));
}
StringTools.rpad = function(s,c,l) {
var sl = s.length;
var cl = c.length;
while(sl < l) {
if(l - sl < cl) {
s += c.substr(0,l - sl);
sl = l;
}
else {
s += c;
sl += cl;
}
}
return s;
}
StringTools.lpad = function(s,c,l) {
var ns = "";
var sl = s.length;
if(sl >= l) return s;
var cl = c.length;
while(sl < l) {
if(l - sl < cl) {
ns += c.substr(0,l - sl);
sl = l;
}
else {
ns += c;
sl += cl;
}
}
return ns + s;
}
StringTools.replace = function(s,sub,by) {
return s.split(sub).join(by);
}
StringTools.hex = function(n,digits) {
var s = "";
var hexChars = "0123456789ABCDEF";
do {
s = hexChars.charAt(n & 15) + s;
n >>>= 4;
} while(n > 0);
if(digits != null) while(s.length < digits) s = "0" + s;
return s;
}
StringTools.prototype.__class__ = StringTools;
Hash = function(p) { if( p === $_ ) return; {
this.h = {}
if(this.h.__proto__ != null) {
this.h.__proto__ = null;
delete(this.h.__proto__);
}
else null;
}}
Hash.__name__ = ["Hash"];
Hash.prototype.exists = function(key) {
try {
key = "$" + key;
return this.hasOwnProperty.call(this.h,key);
}
catch( $e0 ) {
{
var e = $e0;
{
for(var i in this.h)
if( i == key ) return true;
;
return false;
}
}
}
}
Hash.prototype.get = function(key) {
return this.h["$" + key];
}
Hash.prototype.h = null;
Hash.prototype.iterator = function() {
return { ref : this.h, it : this.keys(), hasNext : function() {
return this.it.hasNext();
}, next : function() {
var i = this.it.next();
return this.ref["$" + i];
}}
}
Hash.prototype.keys = function() {
var a = new Array();
for(var i in this.h)
a.push(i.substr(1));
;
return a.iterator();
}
Hash.prototype.remove = function(key) {
if(!this.exists(key)) return false;
delete(this.h["$" + key]);
return true;
}
Hash.prototype.set = function(key,value) {
this.h["$" + key] = value;
}
Hash.prototype.toString = function() {
var s = new StringBuf();
s.b[s.b.length] = "{";
var it = this.keys();
{ var $it0 = it;
while( $it0.hasNext() ) { var i = $it0.next();
{
s.b[s.b.length] = i;
s.b[s.b.length] = " => ";
s.b[s.b.length] = Std.string(this.get(i));
if(it.hasNext()) s.b[s.b.length] = ", ";
}
}}
s.b[s.b.length] = "}";
return s.b.join("");
}
Hash.prototype.__class__ = Hash;
List = function(p) { if( p === $_ ) return; {
this.length = 0;
}}
List.__name__ = ["List"];
List.prototype.add = function(item) {
var x = [item];
if(this.h == null) this.h = x;
else this.q[1] = x;
this.q = x;
this.length++;
}
List.prototype.clear = function() {
this.h = null;
this.q = null;
this.length = 0;
}
List.prototype.filter = function(f) {
var l2 = new List();
var l = this.h;
while(l != null) {
var v = l[0];
l = l[1];
if(f(v)) l2.add(v);
}
return l2;
}
List.prototype.first = function() {
return (this.h == null?null:this.h[0]);
}
List.prototype.h = null;
List.prototype.isEmpty = function() {
return (this.h == null);
}
List.prototype.iterator = function() {
return { h : this.h, hasNext : function() {
return (this.h != null);
}, next : function() {
if(this.h == null) return null;
var x = this.h[0];
this.h = this.h[1];
return x;
}}
}
List.prototype.join = function(sep) {
var s = new StringBuf();
var first = true;
var l = this.h;
while(l != null) {
if(first) first = false;
else s.b[s.b.length] = sep;
s.b[s.b.length] = l[0];
l = l[1];
}
return s.b.join("");
}
List.prototype.last = function() {
return (this.q == null?null:this.q[0]);
}
List.prototype.length = null;
List.prototype.map = function(f) {
var b = new List();
var l = this.h;
while(l != null) {
var v = l[0];
l = l[1];
b.add(f(v));
}
return b;
}
List.prototype.pop = function() {
if(this.h == null) return null;
var x = this.h[0];
this.h = this.h[1];
if(this.h == null) this.q = null;
this.length--;
return x;
}
List.prototype.push = function(item) {
var x = [item,this.h];
this.h = x;
if(this.q == null) this.q = x;
this.length++;
}
List.prototype.q = null;
List.prototype.remove = function(v) {
var prev = null;
var l = this.h;
while(l != null) {
if(l[0] == v) {
if(prev == null) this.h = l[1];
else prev[1] = l[1];
if(this.q == l) this.q = prev;
this.length--;
return true;
}
prev = l;
l = l[1];
}
return false;
}
List.prototype.toString = function() {
var s = new StringBuf();
var first = true;
var l = this.h;
s.b[s.b.length] = "{";
while(l != null) {
if(first) first = false;
else s.b[s.b.length] = ", ";
s.b[s.b.length] = Std.string(l[0]);
l = l[1];
}
s.b[s.b.length] = "}";
return s.b.join("");
}
List.prototype.__class__ = List;
StringBuf = function(p) { if( p === $_ ) return; {
this.b = new Array();
}}
StringBuf.__name__ = ["StringBuf"];
StringBuf.prototype.add = function(x) {
this.b[this.b.length] = x;
}
StringBuf.prototype.addChar = function(c) {
this.b[this.b.length] = String.fromCharCode(c);
}
StringBuf.prototype.addSub = function(s,pos,len) {
this.b[this.b.length] = s.substr(pos,len);
}
StringBuf.prototype.b = null;
StringBuf.prototype.toString = function() {
return this.b.join("");
}
StringBuf.prototype.__class__ = StringBuf;
IntIter = function(min,max) { if( min === $_ ) return; {
this.min = min;
this.max = max;
}}
IntIter.__name__ = ["IntIter"];
IntIter.prototype.hasNext = function() {
return this.min < this.max;
}
IntIter.prototype.max = null;
IntIter.prototype.min = null;
IntIter.prototype.next = function() {
return this.min++;
}
IntIter.prototype.__class__ = IntIter;
$Main = function() { }
$Main.__name__ = ["@Main"];
$Main.prototype.__class__ = $Main;
$_ = {}
js.Boot.__res = {}
js.Boot.__init();
{
Xml = js.JsXml__;
Xml.__name__ = ["Xml"];
Xml.Element = "element";
Xml.PCData = "pcdata";
Xml.CData = "cdata";
Xml.Comment = "comment";
Xml.DocType = "doctype";
Xml.Prolog = "prolog";
Xml.Document = "document";
}
{
var d = Date;
d.now = function() {
return new Date();
}
d.fromTime = function(t) {
var d1 = new Date();
d1["setTime"](t);
return d1;
}
d.fromString = function(s) {
switch(s.length) {
case 8:{
var k = s.split(":");
var d1 = new Date();
d1["setTime"](0);
d1["setUTCHours"](k[0]);
d1["setUTCMinutes"](k[1]);
d1["setUTCSeconds"](k[2]);
return d1;
}break;
case 10:{
var k = s.split("-");
return new Date(k[0],k[1] - 1,k[2],0,0,0);
}break;
case 19:{
var k = s.split(" ");
var y = k[0].split("-");
var t = k[1].split(":");
return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
}break;
default:{
throw "Invalid date format : " + s;
}break;
}
}
d.prototype["toString"] = function() {
var date = this;
var m = date.getMonth() + 1;
var d1 = date.getDate();
var h = date.getHours();
var mi = date.getMinutes();
var s = date.getSeconds();
return (((((((((date.getFullYear() + "-") + ((m < 10?"0" + m:"" + m))) + "-") + ((d1 < 10?"0" + d1:"" + d1))) + " ") + ((h < 10?"0" + h:"" + h))) + ":") + ((mi < 10?"0" + mi:"" + mi))) + ":") + ((s < 10?"0" + s:"" + s));
}
d.prototype.__class__ = d;
d.__name__ = ["Date"];
}
{
js.Lib.document = document;
js.Lib.window = window;
onerror = function(msg,url,line) {
var f = js.Lib.onerror;
if( f == null )
return false;
return f(msg,[url+":"+line]);
}
}
{
String.prototype.__class__ = String;
String.__name__ = ["String"];
Array.prototype.__class__ = Array;
Array.__name__ = ["Array"];
Int = { __name__ : ["Int"]}
Dynamic = { __name__ : ["Dynamic"]}
Float = Number;
Float.__name__ = ["Float"];
Bool = { __ename__ : ["Bool"]}
Class = { __name__ : ["Class"]}
Enum = { }
Void = { __ename__ : ["Void"]}
}
{
mt.js.Tip.init();
}
{
Math.NaN = Number["NaN"];
Math.NEGATIVE_INFINITY = Number["NEGATIVE_INFINITY"];
Math.POSITIVE_INFINITY = Number["POSITIVE_INFINITY"];
Math.isFinite = function(i) {
return isFinite(i);
}
Math.isNaN = function(i) {
return isNaN(i);
}
Math.__name__ = ["Math"];
}
{
js["XMLHttpRequest"] = (window.XMLHttpRequest?XMLHttpRequest:(window.ActiveXObject?function() {
try {
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch( $e0 ) {
{
var e = $e0;
{
try {
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch( $e1 ) {
{
var e1 = $e1;
{
throw "Unable to create XMLHttpRequest object.";
}
}
}
}
}
}
}:(function($this) {
var $r;
throw "Unable to create XMLHttpRequest object.";
return $r;
}(this))));
}
js.JsXml__.enode = new EReg("^<([a-zA-Z0-9:_-]+)","");
js.JsXml__.ecdata = new EReg("^<!\\[CDATA\\[","i");
js.JsXml__.edoctype = new EReg("^<!DOCTYPE","i");
js.JsXml__.eend = new EReg("^</([a-zA-Z0-9:_-]+)>","");
js.JsXml__.epcdata = new EReg("^[^<]+","");
js.JsXml__.ecomment = new EReg("^<!--","");
js.JsXml__.eprolog = new EReg("^<\\?[^\\?]+\\?>","");
js.JsXml__.eattribute = new EReg("^\\s*([a-zA-Z0-9:_-]+)\\s*=\\s*([\"'])([^\\2]*?)\\2","");
js.JsXml__.eclose = new EReg("^[ \\r\\n\\t]*(>|(/>))","");
js.JsXml__.ecdata_end = new EReg("\\]\\]>","");
js.JsXml__.edoctype_elt = new EReg("[\\[|\\]>]","");
js.JsXml__.ecomment_end = new EReg("-->","");
js.Lib.onerror = null;
DateTools.DAYS_OF_MONTH = [31,28,31,30,31,30,31,31,30,31,30,31];
mt.js.Tip.xOffset = 3;
mt.js.Tip.yOffset = 22;
mt.js.Tip.defaultClass = "normalTip";
mt.js.Tip.tooltipId = "tooltip";
mt.js.Tip.tooltipContentId = "tooltipContent";
mt.js.Tip.minOffsetY = 23;
js.App.ref = [mt.js.Tip];
js.App.lock = null;
js.App.lockTimeOut = null;
js.App.lockButton = null;
js.App.oldLock = null;
js.App.lastMessage = null;
haxe.Timer.arr = new Array();
$Main.init = js.App.main();
