· 7 years ago · Oct 21, 2018, 06:14 AM
1var $hxClasses = $hxClasses || {},$estr = function() { return js.Boot.__string_rec(this,''); };
2var DateTools = $hxClasses["DateTools"] = function() { }
3DateTools.__name__ = ["DateTools"];
4DateTools.__format_get = function(d,e) {
5 return (function($this) {
6 var $r;
7 switch(e) {
8 case "%":
9 $r = "%";
10 break;
11 case "C":
12 $r = StringTools.lpad(Std.string(d.getFullYear() / 100 | 0),"0",2);
13 break;
14 case "d":
15 $r = StringTools.lpad(Std.string(d.getDate()),"0",2);
16 break;
17 case "D":
18 $r = DateTools.__format(d,"%m/%d/%y");
19 break;
20 case "e":
21 $r = Std.string(d.getDate());
22 break;
23 case "H":case "k":
24 $r = StringTools.lpad(Std.string(d.getHours()),e == "H"?"0":" ",2);
25 break;
26 case "I":case "l":
27 $r = (function($this) {
28 var $r;
29 var hour = d.getHours() % 12;
30 $r = StringTools.lpad(Std.string(hour == 0?0:hour),e == "I"?"0":" ",2);
31 return $r;
32 }($this));
33 break;
34 case "m":
35 $r = StringTools.lpad(Std.string(d.getMonth() + 1),"0",2);
36 break;
37 case "M":
38 $r = StringTools.lpad(Std.string(d.getMinutes()),"0",2);
39 break;
40 case "n":
41 $r = "\n";
42 break;
43 case "p":
44 $r = d.getHours() > 0?"PM":"AM";
45 break;
46 case "r":
47 $r = DateTools.__format(d,"%I:%M:%S %p");
48 break;
49 case "R":
50 $r = DateTools.__format(d,"%H:%M");
51 break;
52 case "s":
53 $r = Std.string(d.getTime() / 1000 | 0);
54 break;
55 case "S":
56 $r = StringTools.lpad(Std.string(d.getSeconds()),"0",2);
57 break;
58 case "t":
59 $r = "\t";
60 break;
61 case "T":
62 $r = DateTools.__format(d,"%H:%M:%S");
63 break;
64 case "u":
65 $r = (function($this) {
66 var $r;
67 var t = d.getDay();
68 $r = t == 0?"7":Std.string(t);
69 return $r;
70 }($this));
71 break;
72 case "w":
73 $r = Std.string(d.getDay());
74 break;
75 case "y":
76 $r = StringTools.lpad(Std.string(d.getFullYear() % 100),"0",2);
77 break;
78 case "Y":
79 $r = Std.string(d.getFullYear());
80 break;
81 default:
82 $r = (function($this) {
83 var $r;
84 throw "Date.format %" + e + "- not implemented yet.";
85 return $r;
86 }($this));
87 }
88 return $r;
89 }(this));
90}
91DateTools.__format = function(d,f) {
92 var r = new StringBuf();
93 var p = 0;
94 while(true) {
95 var np = f.indexOf("%",p);
96 if(np < 0) break;
97 r.b += HxOverrides.substr(f,p,np - p);
98 r.b += Std.string(DateTools.__format_get(d,HxOverrides.substr(f,np + 1,1)));
99 p = np + 2;
100 }
101 r.b += HxOverrides.substr(f,p,f.length - p);
102 return r.b;
103}
104DateTools.format = function(d,f) {
105 return DateTools.__format(d,f);
106}
107DateTools.delta = function(d,t) {
108 return (function($this) {
109 var $r;
110 var d1 = new Date();
111 d1.setTime(d.getTime() + t);
112 $r = d1;
113 return $r;
114 }(this));
115}
116DateTools.getMonthDays = function(d) {
117 var month = d.getMonth();
118 var year = d.getFullYear();
119 if(month != 1) return DateTools.DAYS_OF_MONTH[month];
120 var isB = year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
121 return isB?29:28;
122}
123DateTools.seconds = function(n) {
124 return n * 1000.0;
125}
126DateTools.minutes = function(n) {
127 return n * 60.0 * 1000.0;
128}
129DateTools.hours = function(n) {
130 return n * 60.0 * 60.0 * 1000.0;
131}
132DateTools.days = function(n) {
133 return n * 0 * 60.0 * 60.0 * 1000.0;
134}
135DateTools.parse = function(t) {
136 var s = t / 1000;
137 var m = s / 60;
138 var h = m / 60;
139 return { ms : t % 1000, seconds : s % 60 | 0, minutes : m % 60 | 0, hours : h % 0 | 0, days : h / 0 | 0};
140}
141DateTools.make = function(o) {
142 return o.ms + 1000.0 * (o.seconds + 60.0 * (o.minutes + 60.0 * (o.hours + 0 * o.days)));
143}
144var EReg = $hxClasses["EReg"] = function(r,opt) {
145 opt = opt.split("u").join("");
146 this.r = new RegExp(r,opt);
147};
148EReg.__name__ = ["EReg"];
149EReg.prototype = {
150 customReplace: function(s,f) {
151 var buf = new StringBuf();
152 while(true) {
153 if(!this.match(s)) break;
154 buf.b += Std.string(this.matchedLeft());
155 buf.b += Std.string(f(this));
156 s = this.matchedRight();
157 }
158 buf.b += Std.string(s);
159 return buf.b;
160 }
161 ,replace: function(s,by) {
162 return s.replace(this.r,by);
163 }
164 ,split: function(s) {
165 var d = "#__delim__#";
166 return s.replace(this.r,d).split(d);
167 }
168 ,matchedPos: function() {
169 if(this.r.m == null) throw "No string matched";
170 return { pos : this.r.m.index, len : this.r.m[0].length};
171 }
172 ,matchedRight: function() {
173 if(this.r.m == null) throw "No string matched";
174 var sz = this.r.m.index + this.r.m[0].length;
175 return this.r.s.substr(sz,this.r.s.length - sz);
176 }
177 ,matchedLeft: function() {
178 if(this.r.m == null) throw "No string matched";
179 return this.r.s.substr(0,this.r.m.index);
180 }
181 ,matched: function(n) {
182 return this.r.m != null && n >= 0 && n < this.r.m.length?this.r.m[n]:(function($this) {
183 var $r;
184 throw "EReg::matched";
185 return $r;
186 }(this));
187 }
188 ,match: function(s) {
189 if(this.r.global) this.r.lastIndex = 0;
190 this.r.m = this.r.exec(s);
191 this.r.s = s;
192 return this.r.m != null;
193 }
194 ,r: null
195 ,__class__: EReg
196}
197var Hash = $hxClasses["Hash"] = function() {
198 this.h = { };
199};
200Hash.__name__ = ["Hash"];
201Hash.prototype = {
202 toString: function() {
203 var s = new StringBuf();
204 s.b += "{";
205 var it = this.keys();
206 while( it.hasNext() ) {
207 var i = it.next();
208 s.b += Std.string(i);
209 s.b += " => ";
210 s.b += Std.string(Std.string(this.get(i)));
211 if(it.hasNext()) s.b += ", ";
212 }
213 s.b += "}";
214 return s.b;
215 }
216 ,iterator: function() {
217 return { ref : this.h, it : this.keys(), hasNext : function() {
218 return this.it.hasNext();
219 }, next : function() {
220 var i = this.it.next();
221 return this.ref["$" + i];
222 }};
223 }
224 ,keys: function() {
225 var a = [];
226 for( var key in this.h ) {
227 if(this.h.hasOwnProperty(key)) a.push(key.substr(1));
228 }
229 return HxOverrides.iter(a);
230 }
231 ,remove: function(key) {
232 key = "$" + key;
233 if(!this.h.hasOwnProperty(key)) return false;
234 delete(this.h[key]);
235 return true;
236 }
237 ,exists: function(key) {
238 return this.h.hasOwnProperty("$" + key);
239 }
240 ,get: function(key) {
241 return this.h["$" + key];
242 }
243 ,set: function(key,value) {
244 this.h["$" + key] = value;
245 }
246 ,h: null
247 ,__class__: Hash
248}
249var HxOverrides = $hxClasses["HxOverrides"] = function() { }
250HxOverrides.__name__ = ["HxOverrides"];
251HxOverrides.dateStr = function(date) {
252 var m = date.getMonth() + 1;
253 var d = date.getDate();
254 var h = date.getHours();
255 var mi = date.getMinutes();
256 var s = date.getSeconds();
257 return date.getFullYear() + "-" + (m < 0?"0" + m:"" + m) + "-" + (d < 0?"0" + d:"" + d) + " " + (h < 0?"0" + h:"" + h) + ":" + (mi < 0?"0" + mi:"" + mi) + ":" + (s < 0?"0" + s:"" + s);
258}
259HxOverrides.strDate = function(s) {
260 switch(s.length) {
261 case 8:
262 var k = s.split(":");
263 var d = new Date();
264 d.setTime(0);
265 d.setUTCHours(k[0]);
266 d.setUTCMinutes(k[1]);
267 d.setUTCSeconds(k[2]);
268 return d;
269 case 10:
270 var k = s.split("-");
271 return new Date(k[0],k[1] - 1,k[2],0,0,0);
272 case 19:
273 var k = s.split(" ");
274 var y = k[0].split("-");
275 var t = k[1].split(":");
276 return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
277 default:
278 throw "Invalid date format : " + s;
279 }
280}
281HxOverrides.cca = function(s,index) {
282 var x = s.cca(index);
283 if(x != x) return undefined;
284 return x;
285}
286HxOverrides.substr = function(s,pos,len) {
287 if(pos != null && pos != 0 && len != null && len < 0) return "";
288 if(len == null) len = s.length;
289 if(pos < 0) {
290 pos = s.length + pos;
291 if(pos < 0) pos = 0;
292 } else if(len < 0) len = s.length + len - pos;
293 return s.substr(pos,len);
294}
295HxOverrides.remove = function(a,obj) {
296 var i = 0;
297 var l = a.length;
298 while(i < l) {
299 if(a[i] == obj) {
300 a.splice(i,1);
301 return true;
302 }
303 i++;
304 }
305 return false;
306}
307HxOverrides.iter = function(a) {
308 return { cur : 0, arr : a, hasNext : function() {
309 return this.cur < this.arr.length;
310 }, next : function() {
311 return this.arr[this.cur++];
312 }};
313}
314var IntHash = $hxClasses["IntHash"] = function() {
315 this.h = { };
316};
317IntHash.__name__ = ["IntHash"];
318IntHash.prototype = {
319 toString: function() {
320 var s = new StringBuf();
321 s.b += "{";
322 var it = this.keys();
323 while( it.hasNext() ) {
324 var i = it.next();
325 s.b += Std.string(i);
326 s.b += " => ";
327 s.b += Std.string(Std.string(this.get(i)));
328 if(it.hasNext()) s.b += ", ";
329 }
330 s.b += "}";
331 return s.b;
332 }
333 ,iterator: function() {
334 return { ref : this.h, it : this.keys(), hasNext : function() {
335 return this.it.hasNext();
336 }, next : function() {
337 var i = this.it.next();
338 return this.ref[i];
339 }};
340 }
341 ,keys: function() {
342 var a = [];
343 for( var key in this.h ) {
344 if(this.h.hasOwnProperty(key)) a.push(key | 0);
345 }
346 return HxOverrides.iter(a);
347 }
348 ,remove: function(key) {
349 if(!this.h.hasOwnProperty(key)) return false;
350 delete(this.h[key]);
351 return true;
352 }
353 ,exists: function(key) {
354 return this.h.hasOwnProperty(key);
355 }
356 ,get: function(key) {
357 return this.h[key];
358 }
359 ,set: function(key,value) {
360 this.h[key] = value;
361 }
362 ,h: null
363 ,__class__: IntHash
364}
365var IntIter = $hxClasses["IntIter"] = function(min,max) {
366 this.min = min;
367 this.max = max;
368};
369IntIter.__name__ = ["IntIter"];
370IntIter.prototype = {
371 next: function() {
372 return this.min++;
373 }
374 ,hasNext: function() {
375 return this.min < this.max;
376 }
377 ,max: null
378 ,min: null
379 ,__class__: IntIter
380}
381var Lambda = $hxClasses["Lambda"] = function() { }
382Lambda.__name__ = ["Lambda"];
383Lambda.array = function(it) {
384 var a = new Array();
385 var $it0 = $iterator(it)();
386 while( $it0.hasNext() ) {
387 var i = $it0.next();
388 a.push(i);
389 }
390 return a;
391}
392Lambda.list = function(it) {
393 var l = new List();
394 var $it0 = $iterator(it)();
395 while( $it0.hasNext() ) {
396 var i = $it0.next();
397 l.add(i);
398 }
399 return l;
400}
401Lambda.map = function(it,f) {
402 var l = new List();
403 var $it0 = $iterator(it)();
404 while( $it0.hasNext() ) {
405 var x = $it0.next();
406 l.add(f(x));
407 }
408 return l;
409}
410Lambda.mapi = function(it,f) {
411 var l = new List();
412 var i = 0;
413 var $it0 = $iterator(it)();
414 while( $it0.hasNext() ) {
415 var x = $it0.next();
416 l.add(f(i++,x));
417 }
418 return l;
419}
420Lambda.has = function(it,elt,cmp) {
421 if(cmp == null) {
422 var $it0 = $iterator(it)();
423 while( $it0.hasNext() ) {
424 var x = $it0.next();
425 if(x == elt) return true;
426 }
427 } else {
428 var $it1 = $iterator(it)();
429 while( $it1.hasNext() ) {
430 var x = $it1.next();
431 if(cmp(x,elt)) return true;
432 }
433 }
434 return false;
435}
436Lambda.exists = function(it,f) {
437 var $it0 = $iterator(it)();
438 while( $it0.hasNext() ) {
439 var x = $it0.next();
440 if(f(x)) return true;
441 }
442 return false;
443}
444Lambda.foreach = function(it,f) {
445 var $it0 = $iterator(it)();
446 while( $it0.hasNext() ) {
447 var x = $it0.next();
448 if(!f(x)) return false;
449 }
450 return true;
451}
452Lambda.iter = function(it,f) {
453 var $it0 = $iterator(it)();
454 while( $it0.hasNext() ) {
455 var x = $it0.next();
456 f(x);
457 }
458}
459Lambda.filter = function(it,f) {
460 var l = new List();
461 var $it0 = $iterator(it)();
462 while( $it0.hasNext() ) {
463 var x = $it0.next();
464 if(f(x)) l.add(x);
465 }
466 return l;
467}
468Lambda.fold = function(it,f,first) {
469 var $it0 = $iterator(it)();
470 while( $it0.hasNext() ) {
471 var x = $it0.next();
472 first = f(x,first);
473 }
474 return first;
475}
476Lambda.count = function(it,pred) {
477 var n = 0;
478 if(pred == null) {
479 var $it0 = $iterator(it)();
480 while( $it0.hasNext() ) {
481 var _ = $it0.next();
482 n++;
483 }
484 } else {
485 var $it1 = $iterator(it)();
486 while( $it1.hasNext() ) {
487 var x = $it1.next();
488 if(pred(x)) n++;
489 }
490 }
491 return n;
492}
493Lambda.empty = function(it) {
494 return !$iterator(it)().hasNext();
495}
496Lambda.indexOf = function(it,v) {
497 var i = 0;
498 var $it0 = $iterator(it)();
499 while( $it0.hasNext() ) {
500 var v2 = $it0.next();
501 if(v == v2) return i;
502 i++;
503 }
504 return -1;
505}
506Lambda.concat = function(a,b) {
507 var l = new List();
508 var $it0 = $iterator(a)();
509 while( $it0.hasNext() ) {
510 var x = $it0.next();
511 l.add(x);
512 }
513 var $it1 = $iterator(b)();
514 while( $it1.hasNext() ) {
515 var x = $it1.next();
516 l.add(x);
517 }
518 return l;
519}
520var List = $hxClasses["List"] = function() {
521 this.length = 0;
522};
523List.__name__ = ["List"];
524List.prototype = {
525 map: function(f) {
526 var b = new List();
527 var l = this.h;
528 while(l != null) {
529 var v = l[0];
530 l = l[1];
531 b.add(f(v));
532 }
533 return b;
534 }
535 ,filter: function(f) {
536 var l2 = new List();
537 var l = this.h;
538 while(l != null) {
539 var v = l[0];
540 l = l[1];
541 if(f(v)) l2.add(v);
542 }
543 return l2;
544 }
545 ,join: function(sep) {
546 var s = new StringBuf();
547 var first = true;
548 var l = this.h;
549 while(l != null) {
550 if(first) first = false; else s.b += Std.string(sep);
551 s.b += Std.string(l[0]);
552 l = l[1];
553 }
554 return s.b;
555 }
556 ,toString: function() {
557 var s = new StringBuf();
558 var first = true;
559 var l = this.h;
560 s.b += "{";
561 while(l != null) {
562 if(first) first = false; else s.b += ", ";
563 s.b += Std.string(Std.string(l[0]));
564 l = l[1];
565 }
566 s.b += "}";
567 return s.b;
568 }
569 ,iterator: function() {
570 return { h : this.h, hasNext : function() {
571 return this.h != null;
572 }, next : function() {
573 if(this.h == null) return null;
574 var x = this.h[0];
575 this.h = this.h[1];
576 return x;
577 }};
578 }
579 ,remove: function(v) {
580 var prev = null;
581 var l = this.h;
582 while(l != null) {
583 if(l[0] == v) {
584 if(prev == null) this.h = l[1]; else prev[1] = l[1];
585 if(this.q == l) this.q = prev;
586 this.length--;
587 return true;
588 }
589 prev = l;
590 l = l[1];
591 }
592 return false;
593 }
594 ,clear: function() {
595 this.h = null;
596 this.q = null;
597 this.length = 0;
598 }
599 ,isEmpty: function() {
600 return this.h == null;
601 }
602 ,pop: function() {
603 if(this.h == null) return null;
604 var x = this.h[0];
605 this.h = this.h[1];
606 if(this.h == null) this.q = null;
607 this.length--;
608 return x;
609 }
610 ,last: function() {
611 return this.q == null?null:this.q[0];
612 }
613 ,first: function() {
614 return this.h == null?null:this.h[0];
615 }
616 ,push: function(item) {
617 var x = [item,this.h];
618 this.h = x;
619 if(this.q == null) this.q = x;
620 this.length++;
621 }
622 ,add: function(item) {
623 var x = [item];
624 if(this.h == null) this.h = x; else this.q[1] = x;
625 this.q = x;
626 this.length++;
627 }
628 ,length: null
629 ,q: null
630 ,h: null
631 ,__class__: List
632}
633var Reflect = $hxClasses["Reflect"] = function() { }
634Reflect.__name__ = ["Reflect"];
635Reflect.hasField = function(o,field) {
636 return Object.prototype.hasOwnProperty.call(o,field);
637}
638Reflect.field = function(o,field) {
639 var v = null;
640 try {
641 v = o[field];
642 } catch( e ) {
643 }
644 return v;
645}
646Reflect.setField = function(o,field,value) {
647 o[field] = value;
648}
649Reflect.getProperty = function(o,field) {
650 var tmp;
651 return o == null?null:o.__properties__ && (tmp = o.__properties__["get_" + field])?o[tmp]():o[field];
652}
653Reflect.setProperty = function(o,field,value) {
654 var tmp;
655 if(o.__properties__ && (tmp = o.__properties__["set_" + field])) o[tmp](value); else o[field] = value;
656}
657Reflect.callMethod = function(o,func,args) {
658 return func.apply(o,args);
659}
660Reflect.fields = function(o) {
661 var a = [];
662 if(o != null) {
663 var hasOwnProperty = Object.prototype.hasOwnProperty;
664 for( var f in o ) {
665 if(hasOwnProperty.call(o,f)) a.push(f);
666 }
667 }
668 return a;
669}
670Reflect.isFunction = function(f) {
671 return typeof(f) == "function" && !(f.__name__ || f.__ename__);
672}
673Reflect.compare = function(a,b) {
674 return a == b?0:a > b?1:-1;
675}
676Reflect.compareMethods = function(f1,f2) {
677 if(f1 == f2) return true;
678 if(!Reflect.isFunction(f1) || !Reflect.isFunction(f2)) return false;
679 return f1.scope == f2.scope && f1.method == f2.method && f1.method != null;
680}
681Reflect.isObject = function(v) {
682 if(v == null) return false;
683 var t = typeof(v);
684 return t == "string" || t == "object" && !v.__enum__ || t == "function" && (v.__name__ || v.__ename__);
685}
686Reflect.deleteField = function(o,f) {
687 if(!Reflect.hasField(o,f)) return false;
688 delete(o[f]);
689 return true;
690}
691Reflect.copy = function(o) {
692 var o2 = { };
693 var _g = 0, _g1 = Reflect.fields(o);
694 while(_g < _g1.length) {
695 var f = _g1[_g];
696 ++_g;
697 o2[f] = Reflect.field(o,f);
698 }
699 return o2;
700}
701Reflect.makeVarArgs = function(f) {
702 return function() {
703 var a = Array.prototype.slice.call(arguments);
704 return f(a);
705 };
706}
707var Std = $hxClasses["Std"] = function() { }
708Std.__name__ = ["Std"];
709Std["is"] = function(v,t) {
710 return js.Boot.__instanceof(v,t);
711}
712Std.string = function(s) {
713 return js.Boot.__string_rec(s,"");
714}
715Std["int"] = function(x) {
716 return x | 0;
717}
718Std.parseInt = function(x) {
719 var v = parseInt(x,10);
720 if(v == 0 && (HxOverrides.cca(x,1) == 120 || HxOverrides.cca(x,1) == 88)) v = parseInt(x);
721 if(isNaN(v)) return null;
722 return v;
723}
724Std.parseFloat = function(x) {
725 return parseFloat(x);
726}
727Std.random = function(x) {
728 return x <= 0?0:Math.floor(Math.random() * x);
729}
730var StringBuf = $hxClasses["StringBuf"] = function() {
731 this.b = "";
732};
733StringBuf.__name__ = ["StringBuf"];
734StringBuf.prototype = {
735 toString: function() {
736 return this.b;
737 }
738 ,addSub: function(s,pos,len) {
739 this.b += HxOverrides.substr(s,pos,len);
740 }
741 ,addChar: function(c) {
742 this.b += String.fromCharCode(c);
743 }
744 ,add: function(x) {
745 this.b += Std.string(x);
746 }
747 ,b: null
748 ,__class__: StringBuf
749}
750var StringTools = $hxClasses["StringTools"] = function() { }
751StringTools.__name__ = ["StringTools"];
752StringTools.urlEncode = function(s) {
753 return encodeURIComponent(s);
754}
755StringTools.urlDecode = function(s) {
756 return decodeURIComponent(s.split("+").join(" "));
757}
758StringTools.htmlEscape = function(s,quotes) {
759 s = s.split("&").join("&").split("<").join("<").split(">").join(">");
760 return quotes?s.split("\"").join(""").split("'").join("'"):s;
761}
762StringTools.htmlUnescape = function(s) {
763 return s.split(">").join(">").split("<").join("<").split(""").join("\"").split("'").join("'").split("&").join("&");
764}
765StringTools.startsWith = function(s,start) {
766 return s.length >= start.length && HxOverrides.substr(s,0,start.length) == start;
767}
768StringTools.endsWith = function(s,end) {
769 var elen = end.length;
770 var slen = s.length;
771 return slen >= elen && HxOverrides.substr(s,slen - elen,elen) == end;
772}
773StringTools.isSpace = function(s,pos) {
774 var c = HxOverrides.cca(s,pos);
775 return c >= 9 && c <= 13 || c == 32;
776}
777StringTools.ltrim = function(s) {
778 var l = s.length;
779 var r = 0;
780 while(r < l && StringTools.isSpace(s,r)) r++;
781 if(r > 0) return HxOverrides.substr(s,r,l - r); else return s;
782}
783StringTools.rtrim = function(s) {
784 var l = s.length;
785 var r = 0;
786 while(r < l && StringTools.isSpace(s,l - r - 1)) r++;
787 if(r > 0) return HxOverrides.substr(s,0,l - r); else return s;
788}
789StringTools.trim = function(s) {
790 return StringTools.ltrim(StringTools.rtrim(s));
791}
792StringTools.rpad = function(s,c,l) {
793 var sl = s.length;
794 var cl = c.length;
795 while(sl < l) if(l - sl < cl) {
796 s += HxOverrides.substr(c,0,l - sl);
797 sl = l;
798 } else {
799 s += c;
800 sl += cl;
801 }
802 return s;
803}
804StringTools.lpad = function(s,c,l) {
805 var ns = "";
806 var sl = s.length;
807 if(sl >= l) return s;
808 var cl = c.length;
809 while(sl < l) if(l - sl < cl) {
810 ns += HxOverrides.substr(c,0,l - sl);
811 sl = l;
812 } else {
813 ns += c;
814 sl += cl;
815 }
816 return ns + s;
817}
818StringTools.replace = function(s,sub,by) {
819 return s.split(sub).join(by);
820}
821StringTools.hex = function(n,digits) {
822 var s = "";
823 var hexChars = "0123456789ABCDEF";
824 do {
825 s = hexChars.charAt(n & 15) + s;
826 n >>>= 4;
827 } while(n > 0);
828 if(digits != null) while(s.length < digits) s = "0" + s;
829 return s;
830}
831StringTools.fastCodeAt = function(s,index) {
832 return s.cca(index);
833}
834StringTools.isEOF = function(c) {
835 return c != c;
836}
837var ValueType = $hxClasses["ValueType"] = { __ename__ : ["ValueType"], __constructs__ : ["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"] }
838ValueType.TNull = ["TNull",0];
839ValueType.TNull.toString = $estr;
840ValueType.TNull.__enum__ = ValueType;
841ValueType.TInt = ["TInt",1];
842ValueType.TInt.toString = $estr;
843ValueType.TInt.__enum__ = ValueType;
844ValueType.TFloat = ["TFloat",2];
845ValueType.TFloat.toString = $estr;
846ValueType.TFloat.__enum__ = ValueType;
847ValueType.TBool = ["TBool",3];
848ValueType.TBool.toString = $estr;
849ValueType.TBool.__enum__ = ValueType;
850ValueType.TObject = ["TObject",4];
851ValueType.TObject.toString = $estr;
852ValueType.TObject.__enum__ = ValueType;
853ValueType.TFunction = ["TFunction",5];
854ValueType.TFunction.toString = $estr;
855ValueType.TFunction.__enum__ = ValueType;
856ValueType.TClass = function(c) { var $x = ["TClass",6,c]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; }
857ValueType.TEnum = function(e) { var $x = ["TEnum",7,e]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; }
858ValueType.TUnknown = ["TUnknown",8];
859ValueType.TUnknown.toString = $estr;
860ValueType.TUnknown.__enum__ = ValueType;
861var Type = $hxClasses["Type"] = function() { }
862Type.__name__ = ["Type"];
863Type.getClass = function(o) {
864 if(o == null) return null;
865 return o.__class__;
866}
867Type.getEnum = function(o) {
868 if(o == null) return null;
869 return o.__enum__;
870}
871Type.getSuperClass = function(c) {
872 return c.__super__;
873}
874Type.getClassName = function(c) {
875 var a = c.__name__;
876 return a.join(".");
877}
878Type.getEnumName = function(e) {
879 var a = e.__ename__;
880 return a.join(".");
881}
882Type.resolveClass = function(name) {
883 var cl = $hxClasses[name];
884 if(cl == null || !cl.__name__) return null;
885 return cl;
886}
887Type.resolveEnum = function(name) {
888 var e = $hxClasses[name];
889 if(e == null || !e.__ename__) return null;
890 return e;
891}
892Type.createInstance = function(cl,args) {
893 switch(args.length) {
894 case 0:
895 return new cl();
896 case 1:
897 return new cl(args[0]);
898 case 2:
899 return new cl(args[0],args[1]);
900 case 3:
901 return new cl(args[0],args[1],args[2]);
902 case 4:
903 return new cl(args[0],args[1],args[2],args[3]);
904 case 5:
905 return new cl(args[0],args[1],args[2],args[3],args[4]);
906 case 6:
907 return new cl(args[0],args[1],args[2],args[3],args[4],args[5]);
908 case 7:
909 return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);
910 case 8:
911 return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);
912 default:
913 throw "Too many arguments";
914 }
915 return null;
916}
917Type.createEmptyInstance = function(cl) {
918 function empty() {}; empty.prototype = cl.prototype;
919 return new empty();
920}
921Type.createEnum = function(e,constr,params) {
922 var f = Reflect.field(e,constr);
923 if(f == null) throw "No such constructor " + constr;
924 if(Reflect.isFunction(f)) {
925 if(params == null) throw "Constructor " + constr + " need parameters";
926 return f.apply(e,params);
927 }
928 if(params != null && params.length != 0) throw "Constructor " + constr + " does not need parameters";
929 return f;
930}
931Type.createEnumIndex = function(e,index,params) {
932 var c = e.__constructs__[index];
933 if(c == null) throw index + " is not a valid enum constructor index";
934 return Type.createEnum(e,c,params);
935}
936Type.getInstanceFields = function(c) {
937 var a = [];
938 for(var i in c.prototype) a.push(i);
939 HxOverrides.remove(a,"__class__");
940 HxOverrides.remove(a,"__properties__");
941 return a;
942}
943Type.getClassFields = function(c) {
944 var a = Reflect.fields(c);
945 HxOverrides.remove(a,"__name__");
946 HxOverrides.remove(a,"__interfaces__");
947 HxOverrides.remove(a,"__properties__");
948 HxOverrides.remove(a,"__super__");
949 HxOverrides.remove(a,"prototype");
950 return a;
951}
952Type.getEnumConstructs = function(e) {
953 var a = e.__constructs__;
954 return a.slice();
955}
956Type["typeof"] = function(v) {
957 switch(typeof(v)) {
958 case "boolean":
959 return ValueType.TBool;
960 case "string":
961 return ValueType.TClass(String);
962 case "number":
963 if(Math.ceil(v) == v % 2147483648.0) return ValueType.TInt;
964 return ValueType.TFloat;
965 case "object":
966 if(v == null) return ValueType.TNull;
967 var e = v.__enum__;
968 if(e != null) return ValueType.TEnum(e);
969 var c = v.__class__;
970 if(c != null) return ValueType.TClass(c);
971 return ValueType.TObject;
972 case "function":
973 if(v.__name__ || v.__ename__) return ValueType.TObject;
974 return ValueType.TFunction;
975 case "undefined":
976 return ValueType.TNull;
977 default:
978 return ValueType.TUnknown;
979 }
980}
981Type.enumEq = function(a,b) {
982 if(a == b) return true;
983 try {
984 if(a[0] != b[0]) return false;
985 var _g1 = 2, _g = a.length;
986 while(_g1 < _g) {
987 var i = _g1++;
988 if(!Type.enumEq(a[i],b[i])) return false;
989 }
990 var e = a.__enum__;
991 if(e != b.__enum__ || e == null) return false;
992 } catch( e ) {
993 return false;
994 }
995 return true;
996}
997Type.enumConstructor = function(e) {
998 return e[0];
999}
1000Type.enumParameters = function(e) {
1001 return e.slice(2);
1002}
1003Type.enumIndex = function(e) {
1004 return e[1];
1005}
1006Type.allEnums = function(e) {
1007 var all = [];
1008 var cst = e.__constructs__;
1009 var _g = 0;
1010 while(_g < cst.length) {
1011 var c = cst[_g];
1012 ++_g;
1013 var v = Reflect.field(e,c);
1014 if(!Reflect.isFunction(v)) all.push(v);
1015 }
1016 return all;
1017}
1018var Xml = $hxClasses["Xml"] = function() {
1019};
1020Xml.__name__ = ["Xml"];
1021Xml.Element = null;
1022Xml.PCData = null;
1023Xml.CData = null;
1024Xml.Comment = null;
1025Xml.DocType = null;
1026Xml.Prolog = null;
1027Xml.Document = null;
1028Xml.parse = function(str) {
1029 return haxe.xml.Parser.parse(str);
1030}
1031Xml.createElement = function(name) {
1032 var r = new Xml();
1033 r.nodeType = Xml.Element;
1034 r._children = new Array();
1035 r._attributes = new Hash();
1036 r.set_nodeName(name);
1037 return r;
1038}
1039Xml.createPCData = function(data) {
1040 var r = new Xml();
1041 r.nodeType = Xml.PCData;
1042 r.set_nodeValue(data);
1043 return r;
1044}
1045Xml.createCData = function(data) {
1046 var r = new Xml();
1047 r.nodeType = Xml.CData;
1048 r.set_nodeValue(data);
1049 return r;
1050}
1051Xml.createComment = function(data) {
1052 var r = new Xml();
1053 r.nodeType = Xml.Comment;
1054 r.set_nodeValue(data);
1055 return r;
1056}
1057Xml.createDocType = function(data) {
1058 var r = new Xml();
1059 r.nodeType = Xml.DocType;
1060 r.set_nodeValue(data);
1061 return r;
1062}
1063Xml.createProlog = function(data) {
1064 var r = new Xml();
1065 r.nodeType = Xml.Prolog;
1066 r.set_nodeValue(data);
1067 return r;
1068}
1069Xml.createDocument = function() {
1070 var r = new Xml();
1071 r.nodeType = Xml.Document;
1072 r._children = new Array();
1073 return r;
1074}
1075Xml.prototype = {
1076 toString: function() {
1077 if(this.nodeType == Xml.PCData) return this._nodeValue;
1078 if(this.nodeType == Xml.CData) return "<![CDATA[" + this._nodeValue + "]]>";
1079 if(this.nodeType == Xml.Comment) return "<!--" + this._nodeValue + "-->";
1080 if(this.nodeType == Xml.DocType) return "<!DOCTYPE " + this._nodeValue + ">";
1081 if(this.nodeType == Xml.Prolog) return "<?" + this._nodeValue + "?>";
1082 var s = new StringBuf();
1083 if(this.nodeType == Xml.Element) {
1084 s.b += "<";
1085 s.b += Std.string(this._nodeName);
1086 var $it0 = this._attributes.keys();
1087 while( $it0.hasNext() ) {
1088 var k = $it0.next();
1089 s.b += " ";
1090 s.b += Std.string(k);
1091 s.b += "=\"";
1092 s.b += Std.string(this._attributes.get(k));
1093 s.b += "\"";
1094 }
1095 if(this._children.length == 0) {
1096 s.b += "/>";
1097 return s.b;
1098 }
1099 s.b += ">";
1100 }
1101 var $it1 = this.iterator();
1102 while( $it1.hasNext() ) {
1103 var x = $it1.next();
1104 s.b += Std.string(x.toString());
1105 }
1106 if(this.nodeType == Xml.Element) {
1107 s.b += "</";
1108 s.b += Std.string(this._nodeName);
1109 s.b += ">";
1110 }
1111 return s.b;
1112 }
1113 ,insertChild: function(x,pos) {
1114 if(this._children == null) throw "bad nodetype";
1115 if(x._parent != null) HxOverrides.remove(x._parent._children,x);
1116 x._parent = this;
1117 this._children.splice(pos,0,x);
1118 }
1119 ,removeChild: function(x) {
1120 if(this._children == null) throw "bad nodetype";
1121 var b = HxOverrides.remove(this._children,x);
1122 if(b) x._parent = null;
1123 return b;
1124 }
1125 ,addChild: function(x) {
1126 if(this._children == null) throw "bad nodetype";
1127 if(x._parent != null) HxOverrides.remove(x._parent._children,x);
1128 x._parent = this;
1129 this._children.push(x);
1130 }
1131 ,firstElement: function() {
1132 if(this._children == null) throw "bad nodetype";
1133 var cur = 0;
1134 var l = this._children.length;
1135 while(cur < l) {
1136 var n = this._children[cur];
1137 if(n.nodeType == Xml.Element) return n;
1138 cur++;
1139 }
1140 return null;
1141 }
1142 ,firstChild: function() {
1143 if(this._children == null) throw "bad nodetype";
1144 return this._children[0];
1145 }
1146 ,elementsNamed: function(name) {
1147 if(this._children == null) throw "bad nodetype";
1148 return { cur : 0, x : this._children, hasNext : function() {
1149 var k = this.cur;
1150 var l = this.x.length;
1151 while(k < l) {
1152 var n = this.x[k];
1153 if(n.nodeType == Xml.Element && n._nodeName == name) break;
1154 k++;
1155 }
1156 this.cur = k;
1157 return k < l;
1158 }, next : function() {
1159 var k = this.cur;
1160 var l = this.x.length;
1161 while(k < l) {
1162 var n = this.x[k];
1163 k++;
1164 if(n.nodeType == Xml.Element && n._nodeName == name) {
1165 this.cur = k;
1166 return n;
1167 }
1168 }
1169 return null;
1170 }};
1171 }
1172 ,elements: function() {
1173 if(this._children == null) throw "bad nodetype";
1174 return { cur : 0, x : this._children, hasNext : function() {
1175 var k = this.cur;
1176 var l = this.x.length;
1177 while(k < l) {
1178 if(this.x[k].nodeType == Xml.Element) break;
1179 k += 1;
1180 }
1181 this.cur = k;
1182 return k < l;
1183 }, next : function() {
1184 var k = this.cur;
1185 var l = this.x.length;
1186 while(k < l) {
1187 var n = this.x[k];
1188 k += 1;
1189 if(n.nodeType == Xml.Element) {
1190 this.cur = k;
1191 return n;
1192 }
1193 }
1194 return null;
1195 }};
1196 }
1197 ,iterator: function() {
1198 if(this._children == null) throw "bad nodetype";
1199 return { cur : 0, x : this._children, hasNext : function() {
1200 return this.cur < this.x.length;
1201 }, next : function() {
1202 return this.x[this.cur++];
1203 }};
1204 }
1205 ,attributes: function() {
1206 if(this.nodeType != Xml.Element) throw "bad nodeType";
1207 return this._attributes.keys();
1208 }
1209 ,exists: function(att) {
1210 if(this.nodeType != Xml.Element) throw "bad nodeType";
1211 return this._attributes.exists(att);
1212 }
1213 ,remove: function(att) {
1214 if(this.nodeType != Xml.Element) throw "bad nodeType";
1215 this._attributes.remove(att);
1216 }
1217 ,set: function(att,value) {
1218 if(this.nodeType != Xml.Element) throw "bad nodeType";
1219 this._attributes.set(att,value);
1220 }
1221 ,get: function(att) {
1222 if(this.nodeType != Xml.Element) throw "bad nodeType";
1223 return this._attributes.get(att);
1224 }
1225 ,get_parent: function() {
1226 return this._parent;
1227 }
1228 ,set_nodeValue: function(v) {
1229 if(this.nodeType == Xml.Element || this.nodeType == Xml.Document) throw "bad nodeType";
1230 return this._nodeValue = v;
1231 }
1232 ,get_nodeValue: function() {
1233 if(this.nodeType == Xml.Element || this.nodeType == Xml.Document) throw "bad nodeType";
1234 return this._nodeValue;
1235 }
1236 ,set_nodeName: function(n) {
1237 if(this.nodeType != Xml.Element) throw "bad nodeType";
1238 return this._nodeName = n;
1239 }
1240 ,get_nodeName: function() {
1241 if(this.nodeType != Xml.Element) throw "bad nodeType";
1242 return this._nodeName;
1243 }
1244 ,_parent: null
1245 ,_children: null
1246 ,_attributes: null
1247 ,_nodeValue: null
1248 ,_nodeName: null
1249 ,parent: null
1250 ,nodeType: null
1251 ,__class__: Xml
1252 ,__properties__: {set_nodeName:"set_nodeName",get_nodeName:"get_nodeName",set_nodeValue:"set_nodeValue",get_nodeValue:"get_nodeValue",get_parent:"get_parent"}
1253}
1254var haxe = haxe || {}
1255haxe.Http = $hxClasses["haxe.Http"] = function(url) {
1256 this.url = url;
1257 this.headers = new Hash();
1258 this.params = new Hash();
1259 this.async = true;
1260};
1261haxe.Http.__name__ = ["haxe","Http"];
1262haxe.Http.requestUrl = function(url) {
1263 var h = new haxe.Http(url);
1264 h.async = false;
1265 var r = null;
1266 h.onData = function(d) {
1267 r = d;
1268 };
1269 h.onError = function(e) {
1270 throw e;
1271 };
1272 h.request(false);
1273 return r;
1274}
1275haxe.Http.prototype = {
1276 onStatus: function(status) {
1277 }
1278 ,onError: function(msg) {
1279 }
1280 ,onData: function(data) {
1281 }
1282 ,request: function(post) {
1283 var me = this;
1284 var r = new js.XMLHttpRequest();
1285 var onreadystatechange = function() {
1286 if(r.readyState != 4) return;
1287 var s = (function($this) {
1288 var $r;
1289 try {
1290 $r = r.status;
1291 } catch( e ) {
1292 $r = null;
1293 }
1294 return $r;
1295 }(this));
1296 if(s == undefined) s = null;
1297 if(s != null) me.onStatus(s);
1298 if(s != null && s >= 200 && s < 400) me.onData(r.responseText); else switch(s) {
1299 case null: case undefined:
1300 me.onError("Failed to connect or resolve host");
1301 break;
1302 case 12029:
1303 me.onError("Failed to connect to host");
1304 break;
1305 case 12007:
1306 me.onError("Unknown host");
1307 break;
1308 default:
1309 me.onError("Http Error #" + r.status);
1310 }
1311 };
1312 if(this.async) r.onreadystatechange = onreadystatechange;
1313 var uri = this.postData;
1314 if(uri != null) post = true; else {
1315 var $it0 = this.params.keys();
1316 while( $it0.hasNext() ) {
1317 var p = $it0.next();
1318 if(uri == null) uri = ""; else uri += "&";
1319 uri += StringTools.urlEncode(p) + "=" + StringTools.urlEncode(this.params.get(p));
1320 }
1321 }
1322 try {
1323 if(post) r.open("POST",this.url,this.async); else if(uri != null) {
1324 var question = this.url.split("?").length <= 1;
1325 r.open("GET",this.url + (question?"?":"&") + uri,this.async);
1326 uri = null;
1327 } else r.open("GET",this.url,this.async);
1328 } catch( e ) {
1329 this.onError(e.toString());
1330 return;
1331 }
1332 if(this.headers.get("Content-Type") == null && post && this.postData == null) r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
1333 var $it1 = this.headers.keys();
1334 while( $it1.hasNext() ) {
1335 var h = $it1.next();
1336 r.setRequestHeader(h,this.headers.get(h));
1337 }
1338 r.send(uri);
1339 if(!this.async) onreadystatechange();
1340 }
1341 ,setPostData: function(data) {
1342 this.postData = data;
1343 }
1344 ,setParameter: function(param,value) {
1345 this.params.set(param,value);
1346 }
1347 ,setHeader: function(header,value) {
1348 this.headers.set(header,value);
1349 }
1350 ,params: null
1351 ,headers: null
1352 ,postData: null
1353 ,async: null
1354 ,url: null
1355 ,__class__: haxe.Http
1356}
1357haxe.Log = $hxClasses["haxe.Log"] = function() { }
1358haxe.Log.__name__ = ["haxe","Log"];
1359haxe.Log.trace = function(v,infos) {
1360 js.Boot.__trace(v,infos);
1361}
1362haxe.Log.clear = function() {
1363 js.Boot.__clear_trace();
1364}
1365haxe.Serializer = $hxClasses["haxe.Serializer"] = function() {
1366 this.buf = new StringBuf();
1367 this.cache = new Array();
1368 this.useCache = haxe.Serializer.USE_CACHE;
1369 this.useEnumIndex = haxe.Serializer.USE_ENUM_INDEX;
1370 this.shash = new Hash();
1371 this.scount = 0;
1372};
1373haxe.Serializer.__name__ = ["haxe","Serializer"];
1374haxe.Serializer.run = function(v) {
1375 var s = new haxe.Serializer();
1376 s.serialize(v);
1377 return s.toString();
1378}
1379haxe.Serializer.prototype = {
1380 serializeException: function(e) {
1381 this.buf.b += "x";
1382 this.serialize(e);
1383 }
1384 ,serialize: function(v) {
1385 var $e = (Type["typeof"](v));
1386 switch( $e[1] ) {
1387 case 0:
1388 this.buf.b += "n";
1389 break;
1390 case 1:
1391 if(v == 0) {
1392 this.buf.b += "z";
1393 return;
1394 }
1395 this.buf.b += "i";
1396 this.buf.b += Std.string(v);
1397 break;
1398 case 2:
1399 if(Math.isNaN(v)) this.buf.b += "k"; else if(!Math.isFinite(v)) this.buf.b += Std.string(v < 0?"m":"p"); else {
1400 this.buf.b += "d";
1401 this.buf.b += Std.string(v);
1402 }
1403 break;
1404 case 3:
1405 this.buf.b += Std.string(v?"t":"f");
1406 break;
1407 case 6:
1408 var c = $e[2];
1409 if(c == String) {
1410 this.serializeString(v);
1411 return;
1412 }
1413 if(this.useCache && this.serializeRef(v)) return;
1414 switch(c) {
1415 case Array:
1416 var ucount = 0;
1417 this.buf.b += "a";
1418 var l = v.length;
1419 var _g = 0;
1420 while(_g < l) {
1421 var i = _g++;
1422 if(v[i] == null) ucount++; else {
1423 if(ucount > 0) {
1424 if(ucount == 1) this.buf.b += "n"; else {
1425 this.buf.b += "u";
1426 this.buf.b += Std.string(ucount);
1427 }
1428 ucount = 0;
1429 }
1430 this.serialize(v[i]);
1431 }
1432 }
1433 if(ucount > 0) {
1434 if(ucount == 1) this.buf.b += "n"; else {
1435 this.buf.b += "u";
1436 this.buf.b += Std.string(ucount);
1437 }
1438 }
1439 this.buf.b += "h";
1440 break;
1441 case List:
1442 this.buf.b += "l";
1443 var v1 = v;
1444 var $it0 = v1.iterator();
1445 while( $it0.hasNext() ) {
1446 var i = $it0.next();
1447 this.serialize(i);
1448 }
1449 this.buf.b += "h";
1450 break;
1451 case Date:
1452 var d = v;
1453 this.buf.b += "v";
1454 this.buf.b += Std.string(HxOverrides.dateStr(d));
1455 break;
1456 case Hash:
1457 this.buf.b += "b";
1458 var v1 = v;
1459 var $it1 = v1.keys();
1460 while( $it1.hasNext() ) {
1461 var k = $it1.next();
1462 this.serializeString(k);
1463 this.serialize(v1.get(k));
1464 }
1465 this.buf.b += "h";
1466 break;
1467 case IntHash:
1468 this.buf.b += "q";
1469 var v1 = v;
1470 var $it2 = v1.keys();
1471 while( $it2.hasNext() ) {
1472 var k = $it2.next();
1473 this.buf.b += ":";
1474 this.buf.b += Std.string(k);
1475 this.serialize(v1.get(k));
1476 }
1477 this.buf.b += "h";
1478 break;
1479 case haxe.io.Bytes:
1480 var v1 = v;
1481 var i = 0;
1482 var max = v1.length - 2;
1483 var charsBuf = new StringBuf();
1484 var b64 = haxe.Serializer.BASE64;
1485 while(i < max) {
1486 var b1 = v1.b[i++];
1487 var b2 = v1.b[i++];
1488 var b3 = v1.b[i++];
1489 charsBuf.b += Std.string(b64.charAt(b1 >> 2));
1490 charsBuf.b += Std.string(b64.charAt((b1 << 4 | b2 >> 4) & 63));
1491 charsBuf.b += Std.string(b64.charAt((b2 << 2 | b3 >> 6) & 63));
1492 charsBuf.b += Std.string(b64.charAt(b3 & 63));
1493 }
1494 if(i == max) {
1495 var b1 = v1.b[i++];
1496 var b2 = v1.b[i++];
1497 charsBuf.b += Std.string(b64.charAt(b1 >> 2));
1498 charsBuf.b += Std.string(b64.charAt((b1 << 4 | b2 >> 4) & 63));
1499 charsBuf.b += Std.string(b64.charAt(b2 << 2 & 63));
1500 } else if(i == max + 1) {
1501 var b1 = v1.b[i++];
1502 charsBuf.b += Std.string(b64.charAt(b1 >> 2));
1503 charsBuf.b += Std.string(b64.charAt(b1 << 4 & 63));
1504 }
1505 var chars = charsBuf.b;
1506 this.buf.b += "s";
1507 this.buf.b += Std.string(chars.length);
1508 this.buf.b += ":";
1509 this.buf.b += Std.string(chars);
1510 break;
1511 default:
1512 this.cache.pop();
1513 if(v.hxSerialize != null) {
1514 this.buf.b += "C";
1515 this.serializeString(Type.getClassName(c));
1516 this.cache.push(v);
1517 v.hxSerialize(this);
1518 this.buf.b += "g";
1519 } else {
1520 this.buf.b += "c";
1521 this.serializeString(Type.getClassName(c));
1522 this.cache.push(v);
1523 this.serializeFields(v);
1524 }
1525 }
1526 break;
1527 case 4:
1528 if(this.useCache && this.serializeRef(v)) return;
1529 this.buf.b += "o";
1530 this.serializeFields(v);
1531 break;
1532 case 7:
1533 var e = $e[2];
1534 if(this.useCache && this.serializeRef(v)) return;
1535 this.cache.pop();
1536 this.buf.b += Std.string(this.useEnumIndex?"j":"w");
1537 this.serializeString(Type.getEnumName(e));
1538 if(this.useEnumIndex) {
1539 this.buf.b += ":";
1540 this.buf.b += Std.string(v[1]);
1541 } else this.serializeString(v[0]);
1542 this.buf.b += ":";
1543 var l = v.length;
1544 this.buf.b += Std.string(l - 2);
1545 var _g = 2;
1546 while(_g < l) {
1547 var i = _g++;
1548 this.serialize(v[i]);
1549 }
1550 this.cache.push(v);
1551 break;
1552 case 5:
1553 throw "Cannot serialize function";
1554 break;
1555 default:
1556 throw "Cannot serialize " + Std.string(v);
1557 }
1558 }
1559 ,serializeFields: function(v) {
1560 var _g = 0, _g1 = Reflect.fields(v);
1561 while(_g < _g1.length) {
1562 var f = _g1[_g];
1563 ++_g;
1564 this.serializeString(f);
1565 this.serialize(Reflect.field(v,f));
1566 }
1567 this.buf.b += "g";
1568 }
1569 ,serializeRef: function(v) {
1570 var vt = typeof(v);
1571 var _g1 = 0, _g = this.cache.length;
1572 while(_g1 < _g) {
1573 var i = _g1++;
1574 var ci = this.cache[i];
1575 if(typeof(ci) == vt && ci == v) {
1576 this.buf.b += "r";
1577 this.buf.b += Std.string(i);
1578 return true;
1579 }
1580 }
1581 this.cache.push(v);
1582 return false;
1583 }
1584 ,serializeString: function(s) {
1585 var x = this.shash.get(s);
1586 if(x != null) {
1587 this.buf.b += "R";
1588 this.buf.b += Std.string(x);
1589 return;
1590 }
1591 this.shash.set(s,this.scount++);
1592 this.buf.b += "y";
1593 s = StringTools.urlEncode(s);
1594 this.buf.b += Std.string(s.length);
1595 this.buf.b += ":";
1596 this.buf.b += Std.string(s);
1597 }
1598 ,toString: function() {
1599 return this.buf.b;
1600 }
1601 ,useEnumIndex: null
1602 ,useCache: null
1603 ,scount: null
1604 ,shash: null
1605 ,cache: null
1606 ,buf: null
1607 ,__class__: haxe.Serializer
1608}
1609haxe.Timer = $hxClasses["haxe.Timer"] = function(time_ms) {
1610 var me = this;
1611 this.id = setInterval(function() {
1612 me.run();
1613 },time_ms);
1614};
1615haxe.Timer.__name__ = ["haxe","Timer"];
1616haxe.Timer.delay = function(f,time_ms) {
1617 var t = new haxe.Timer(time_ms);
1618 t.run = function() {
1619 t.stop();
1620 f();
1621 };
1622 return t;
1623}
1624haxe.Timer.measure = function(f,pos) {
1625 var t0 = haxe.Timer.stamp();
1626 var r = f();
1627 haxe.Log.trace(haxe.Timer.stamp() - t0 + "s",pos);
1628 return r;
1629}
1630haxe.Timer.stamp = function() {
1631 return new Date().getTime() / 1000;
1632}
1633haxe.Timer.prototype = {
1634 run: function() {
1635 }
1636 ,stop: function() {
1637 if(this.id == null) return;
1638 clearInterval(this.id);
1639 this.id = null;
1640 }
1641 ,id: null
1642 ,__class__: haxe.Timer
1643}
1644haxe.Unserializer = $hxClasses["haxe.Unserializer"] = function(buf) {
1645 this.buf = buf;
1646 this.length = buf.length;
1647 this.pos = 0;
1648 this.scache = new Array();
1649 this.cache = new Array();
1650 var r = haxe.Unserializer.DEFAULT_RESOLVER;
1651 if(r == null) {
1652 r = Type;
1653 haxe.Unserializer.DEFAULT_RESOLVER = r;
1654 }
1655 this.setResolver(r);
1656};
1657haxe.Unserializer.__name__ = ["haxe","Unserializer"];
1658haxe.Unserializer.initCodes = function() {
1659 var codes = new Array();
1660 var _g1 = 0, _g = haxe.Unserializer.BASE64.length;
1661 while(_g1 < _g) {
1662 var i = _g1++;
1663 codes[haxe.Unserializer.BASE64.cca(i)] = i;
1664 }
1665 return codes;
1666}
1667haxe.Unserializer.run = function(v) {
1668 return new haxe.Unserializer(v).unserialize();
1669}
1670haxe.Unserializer.prototype = {
1671 unserialize: function() {
1672 switch(this.buf.cca(this.pos++)) {
1673 case 110:
1674 return null;
1675 case 116:
1676 return true;
1677 case 102:
1678 return false;
1679 case 122:
1680 return 0;
1681 case 105:
1682 return this.readDigits();
1683 case 100:
1684 var p1 = this.pos;
1685 while(true) {
1686 var c = this.buf.cca(this.pos);
1687 if(c >= 43 && c < 58 || c == 101 || c == 69) this.pos++; else break;
1688 }
1689 return Std.parseFloat(HxOverrides.substr(this.buf,p1,this.pos - p1));
1690 case 121:
1691 var len = this.readDigits();
1692 if(this.buf.cca(this.pos++) != 58 || this.length - this.pos < len) throw "Invalid string length";
1693 var s = HxOverrides.substr(this.buf,this.pos,len);
1694 this.pos += len;
1695 s = StringTools.urlDecode(s);
1696 this.scache.push(s);
1697 return s;
1698 case 107:
1699 return Math.NaN;
1700 case 109:
1701 return Math.NEGATIVE_INFINITY;
1702 case 112:
1703 return Math.POSITIVE_INFINITY;
1704 case 97:
1705 var buf = this.buf;
1706 var a = new Array();
1707 this.cache.push(a);
1708 while(true) {
1709 var c = this.buf.cca(this.pos);
1710 if(c == 104) {
1711 this.pos++;
1712 break;
1713 }
1714 if(c == 117) {
1715 this.pos++;
1716 var n = this.readDigits();
1717 a[a.length + n - 1] = null;
1718 } else a.push(this.unserialize());
1719 }
1720 return a;
1721 case 111:
1722 var o = { };
1723 this.cache.push(o);
1724 this.unserializeObject(o);
1725 return o;
1726 case 114:
1727 var n = this.readDigits();
1728 if(n < 0 || n >= this.cache.length) throw "Invalid reference";
1729 return this.cache[n];
1730 case 82:
1731 var n = this.readDigits();
1732 if(n < 0 || n >= this.scache.length) throw "Invalid string reference";
1733 return this.scache[n];
1734 case 120:
1735 throw this.unserialize();
1736 break;
1737 case 99:
1738 var name = this.unserialize();
1739 var cl = this.resolver.resolveClass(name);
1740 if(cl == null) throw "Class not found " + name;
1741 var o = Type.createEmptyInstance(cl);
1742 this.cache.push(o);
1743 this.unserializeObject(o);
1744 return o;
1745 case 119:
1746 var name = this.unserialize();
1747 var edecl = this.resolver.resolveEnum(name);
1748 if(edecl == null) throw "Enum not found " + name;
1749 var e = this.unserializeEnum(edecl,this.unserialize());
1750 this.cache.push(e);
1751 return e;
1752 case 106:
1753 var name = this.unserialize();
1754 var edecl = this.resolver.resolveEnum(name);
1755 if(edecl == null) throw "Enum not found " + name;
1756 this.pos++;
1757 var index = this.readDigits();
1758 var tag = Type.getEnumConstructs(edecl)[index];
1759 if(tag == null) throw "Unknown enum index " + name + "@" + index;
1760 var e = this.unserializeEnum(edecl,tag);
1761 this.cache.push(e);
1762 return e;
1763 case 108:
1764 var l = new List();
1765 this.cache.push(l);
1766 var buf = this.buf;
1767 while(this.buf.cca(this.pos) != 104) l.add(this.unserialize());
1768 this.pos++;
1769 return l;
1770 case 98:
1771 var h = new Hash();
1772 this.cache.push(h);
1773 var buf = this.buf;
1774 while(this.buf.cca(this.pos) != 104) {
1775 var s = this.unserialize();
1776 h.set(s,this.unserialize());
1777 }
1778 this.pos++;
1779 return h;
1780 case 113:
1781 var h = new IntHash();
1782 this.cache.push(h);
1783 var buf = this.buf;
1784 var c = this.buf.cca(this.pos++);
1785 while(c == 58) {
1786 var i = this.readDigits();
1787 h.set(i,this.unserialize());
1788 c = this.buf.cca(this.pos++);
1789 }
1790 if(c != 104) throw "Invalid IntHash format";
1791 return h;
1792 case 118:
1793 var d = HxOverrides.strDate(HxOverrides.substr(this.buf,this.pos,19));
1794 this.cache.push(d);
1795 this.pos += 19;
1796 return d;
1797 case 115:
1798 var len = this.readDigits();
1799 var buf = this.buf;
1800 if(this.buf.cca(this.pos++) != 58 || this.length - this.pos < len) throw "Invalid bytes length";
1801 var codes = haxe.Unserializer.CODES;
1802 if(codes == null) {
1803 codes = haxe.Unserializer.initCodes();
1804 haxe.Unserializer.CODES = codes;
1805 }
1806 var i = this.pos;
1807 var rest = len & 3;
1808 var size = (len >> 2) * 3 + (rest >= 2?rest - 1:0);
1809 var max = i + (len - rest);
1810 var bytes = haxe.io.Bytes.alloc(size);
1811 var bpos = 0;
1812 while(i < max) {
1813 var c1 = codes[buf.cca(i++)];
1814 var c2 = codes[buf.cca(i++)];
1815 bytes.b[bpos++] = (c1 << 2 | c2 >> 4) & 255;
1816 var c3 = codes[buf.cca(i++)];
1817 bytes.b[bpos++] = (c2 << 4 | c3 >> 2) & 255;
1818 var c4 = codes[buf.cca(i++)];
1819 bytes.b[bpos++] = (c3 << 6 | c4) & 255;
1820 }
1821 if(rest >= 2) {
1822 var c1 = codes[buf.cca(i++)];
1823 var c2 = codes[buf.cca(i++)];
1824 bytes.b[bpos++] = (c1 << 2 | c2 >> 4) & 255;
1825 if(rest == 3) {
1826 var c3 = codes[buf.cca(i++)];
1827 bytes.b[bpos++] = (c2 << 4 | c3 >> 2) & 255;
1828 }
1829 }
1830 this.pos += len;
1831 this.cache.push(bytes);
1832 return bytes;
1833 case 67:
1834 var name = this.unserialize();
1835 var cl = this.resolver.resolveClass(name);
1836 if(cl == null) throw "Class not found " + name;
1837 var o = Type.createEmptyInstance(cl);
1838 this.cache.push(o);
1839 o.hxUnserialize(this);
1840 if(this.buf.cca(this.pos++) != 103) throw "Invalid custom data";
1841 return o;
1842 default:
1843 }
1844 this.pos--;
1845 throw "Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos;
1846 }
1847 ,unserializeEnum: function(edecl,tag) {
1848 if(this.buf.cca(this.pos++) != 58) throw "Invalid enum format";
1849 var nargs = this.readDigits();
1850 if(nargs == 0) return Type.createEnum(edecl,tag);
1851 var args = new Array();
1852 while(nargs-- > 0) args.push(this.unserialize());
1853 return Type.createEnum(edecl,tag,args);
1854 }
1855 ,unserializeObject: function(o) {
1856 while(true) {
1857 if(this.pos >= this.length) throw "Invalid object";
1858 if(this.buf.cca(this.pos) == 103) break;
1859 var k = this.unserialize();
1860 if(!js.Boot.__instanceof(k,String)) throw "Invalid object key";
1861 var v = this.unserialize();
1862 o[k] = v;
1863 }
1864 this.pos++;
1865 }
1866 ,readDigits: function() {
1867 var k = 0;
1868 var s = false;
1869 var fpos = this.pos;
1870 while(true) {
1871 var c = this.buf.cca(this.pos);
1872 if(c != c) break;
1873 if(c == 45) {
1874 if(this.pos != fpos) break;
1875 s = true;
1876 this.pos++;
1877 continue;
1878 }
1879 if(c < 48 || c > 57) break;
1880 k = k * 10 + (c - 48);
1881 this.pos++;
1882 }
1883 if(s) k *= -1;
1884 return k;
1885 }
1886 ,get: function(p) {
1887 return this.buf.cca(p);
1888 }
1889 ,getResolver: function() {
1890 return this.resolver;
1891 }
1892 ,setResolver: function(r) {
1893 if(r == null) this.resolver = { resolveClass : function(_) {
1894 return null;
1895 }, resolveEnum : function(_) {
1896 return null;
1897 }}; else this.resolver = r;
1898 }
1899 ,resolver: null
1900 ,scache: null
1901 ,cache: null
1902 ,length: null
1903 ,pos: null
1904 ,buf: null
1905 ,__class__: haxe.Unserializer
1906}
1907if(!haxe.io) haxe.io = {}
1908haxe.io.Bytes = $hxClasses["haxe.io.Bytes"] = function(length,b) {
1909 this.length = length;
1910 this.b = b;
1911};
1912haxe.io.Bytes.__name__ = ["haxe","io","Bytes"];
1913haxe.io.Bytes.alloc = function(length) {
1914 var a = new Array();
1915 var _g = 0;
1916 while(_g < length) {
1917 var i = _g++;
1918 a.push(0);
1919 }
1920 return new haxe.io.Bytes(length,a);
1921}
1922haxe.io.Bytes.ofString = function(s) {
1923 var a = new Array();
1924 var _g1 = 0, _g = s.length;
1925 while(_g1 < _g) {
1926 var i = _g1++;
1927 var c = s.cca(i);
1928 if(c <= 127) a.push(c); else if(c <= 2047) {
1929 a.push(192 | c >> 6);
1930 a.push(128 | c & 63);
1931 } else if(c <= 65535) {
1932 a.push(224 | c >> 12);
1933 a.push(128 | c >> 6 & 63);
1934 a.push(128 | c & 63);
1935 } else {
1936 a.push(240 | c >> 18);
1937 a.push(128 | c >> 12 & 63);
1938 a.push(128 | c >> 6 & 63);
1939 a.push(128 | c & 63);
1940 }
1941 }
1942 return new haxe.io.Bytes(a.length,a);
1943}
1944haxe.io.Bytes.ofData = function(b) {
1945 return new haxe.io.Bytes(b.length,b);
1946}
1947haxe.io.Bytes.fastGet = function(b,pos) {
1948 return b[pos];
1949}
1950haxe.io.Bytes.prototype = {
1951 getData: function() {
1952 return this.b;
1953 }
1954 ,toHex: function() {
1955 var s = new StringBuf();
1956 var chars = [];
1957 var str = "0123456789abcdef";
1958 var _g1 = 0, _g = str.length;
1959 while(_g1 < _g) {
1960 var i = _g1++;
1961 chars.push(HxOverrides.cca(str,i));
1962 }
1963 var _g1 = 0, _g = this.length;
1964 while(_g1 < _g) {
1965 var i = _g1++;
1966 var c = this.b[i];
1967 s.b += String.fromCharCode(chars[c >> 4]);
1968 s.b += String.fromCharCode(chars[c & 15]);
1969 }
1970 return s.b;
1971 }
1972 ,toString: function() {
1973 return this.readString(0,this.length);
1974 }
1975 ,readString: function(pos,len) {
1976 if(pos < 0 || len < 0 || pos + len > this.length) throw haxe.io.Error.OutsideBounds;
1977 var s = "";
1978 var b = this.b;
1979 var fcc = String.fromCharCode;
1980 var i = pos;
1981 var max = pos + len;
1982 while(i < max) {
1983 var c = b[i++];
1984 if(c < 128) {
1985 if(c == 0) break;
1986 s += fcc(c);
1987 } else if(c < 224) s += fcc((c & 63) << 6 | b[i++] & 127); else if(c < 240) {
1988 var c2 = b[i++];
1989 s += fcc((c & 31) << 12 | (c2 & 127) << 6 | b[i++] & 127);
1990 } else {
1991 var c2 = b[i++];
1992 var c3 = b[i++];
1993 s += fcc((c & 15) << 18 | (c2 & 127) << 12 | c3 << 6 & 127 | b[i++] & 127);
1994 }
1995 }
1996 return s;
1997 }
1998 ,compare: function(other) {
1999 var b1 = this.b;
2000 var b2 = other.b;
2001 var len = this.length < other.length?this.length:other.length;
2002 var _g = 0;
2003 while(_g < len) {
2004 var i = _g++;
2005 if(b1[i] != b2[i]) return b1[i] - b2[i];
2006 }
2007 return this.length - other.length;
2008 }
2009 ,sub: function(pos,len) {
2010 if(pos < 0 || len < 0 || pos + len > this.length) throw haxe.io.Error.OutsideBounds;
2011 return new haxe.io.Bytes(len,this.b.slice(pos,pos + len));
2012 }
2013 ,blit: function(pos,src,srcpos,len) {
2014 if(pos < 0 || srcpos < 0 || len < 0 || pos + len > this.length || srcpos + len > src.length) throw haxe.io.Error.OutsideBounds;
2015 var b1 = this.b;
2016 var b2 = src.b;
2017 if(b1 == b2 && pos > srcpos) {
2018 var i = len;
2019 while(i > 0) {
2020 i--;
2021 b1[i + pos] = b2[i + srcpos];
2022 }
2023 return;
2024 }
2025 var _g = 0;
2026 while(_g < len) {
2027 var i = _g++;
2028 b1[i + pos] = b2[i + srcpos];
2029 }
2030 }
2031 ,set: function(pos,v) {
2032 this.b[pos] = v & 255;
2033 }
2034 ,get: function(pos) {
2035 return this.b[pos];
2036 }
2037 ,b: null
2038 ,length: null
2039 ,__class__: haxe.io.Bytes
2040}
2041haxe.io.Error = $hxClasses["haxe.io.Error"] = { __ename__ : ["haxe","io","Error"], __constructs__ : ["Blocked","Overflow","OutsideBounds","Custom"] }
2042haxe.io.Error.Blocked = ["Blocked",0];
2043haxe.io.Error.Blocked.toString = $estr;
2044haxe.io.Error.Blocked.__enum__ = haxe.io.Error;
2045haxe.io.Error.Overflow = ["Overflow",1];
2046haxe.io.Error.Overflow.toString = $estr;
2047haxe.io.Error.Overflow.__enum__ = haxe.io.Error;
2048haxe.io.Error.OutsideBounds = ["OutsideBounds",2];
2049haxe.io.Error.OutsideBounds.toString = $estr;
2050haxe.io.Error.OutsideBounds.__enum__ = haxe.io.Error;
2051haxe.io.Error.Custom = function(e) { var $x = ["Custom",3,e]; $x.__enum__ = haxe.io.Error; $x.toString = $estr; return $x; }
2052if(!haxe.remoting) haxe.remoting = {}
2053haxe.remoting.Connection = $hxClasses["haxe.remoting.Connection"] = function() { }
2054haxe.remoting.Connection.__name__ = ["haxe","remoting","Connection"];
2055haxe.remoting.Connection.prototype = {
2056 call: null
2057 ,resolve: null
2058 ,__class__: haxe.remoting.Connection
2059}
2060haxe.remoting.Context = $hxClasses["haxe.remoting.Context"] = function() {
2061 this.objects = new Hash();
2062};
2063haxe.remoting.Context.__name__ = ["haxe","remoting","Context"];
2064haxe.remoting.Context.share = function(name,obj) {
2065 var ctx = new haxe.remoting.Context();
2066 ctx.addObject(name,obj);
2067 return ctx;
2068}
2069haxe.remoting.Context.prototype = {
2070 call: function(path,params) {
2071 if(path.length < 2) throw "Invalid path '" + path.join(".") + "'";
2072 var inf = this.objects.get(path[0]);
2073 if(inf == null) throw "No such object " + path[0];
2074 var o = inf.obj;
2075 var m = Reflect.field(o,path[1]);
2076 if(path.length > 2) {
2077 if(!inf.rec) throw "Can't access " + path.join(".");
2078 var _g1 = 2, _g = path.length;
2079 while(_g1 < _g) {
2080 var i = _g1++;
2081 o = m;
2082 m = Reflect.field(o,path[i]);
2083 }
2084 }
2085 if(!Reflect.isFunction(m)) throw "No such method " + path.join(".");
2086 return m.apply(o,params);
2087 }
2088 ,addObject: function(name,obj,recursive) {
2089 this.objects.set(name,{ obj : obj, rec : recursive});
2090 }
2091 ,objects: null
2092 ,__class__: haxe.remoting.Context
2093}
2094haxe.remoting.ExternalConnection = $hxClasses["haxe.remoting.ExternalConnection"] = function(data,path) {
2095 this.__data = data;
2096 this.__path = path;
2097};
2098haxe.remoting.ExternalConnection.__name__ = ["haxe","remoting","ExternalConnection"];
2099haxe.remoting.ExternalConnection.__interfaces__ = [haxe.remoting.Connection];
2100haxe.remoting.ExternalConnection.escapeString = function(s) {
2101 return s;
2102}
2103haxe.remoting.ExternalConnection.doCall = function(name,path,params) {
2104 try {
2105 var cnx = haxe.remoting.ExternalConnection.connections.get(name);
2106 if(cnx == null) throw "Unknown connection : " + name;
2107 if(cnx.__data.ctx == null) throw "No context shared for the connection " + name;
2108 var params1 = new haxe.Unserializer(params).unserialize();
2109 var ret = cnx.__data.ctx.call(path.split("."),params1);
2110 var s = new haxe.Serializer();
2111 s.serialize(ret);
2112 return s.toString() + "#";
2113 } catch( e ) {
2114 var s = new haxe.Serializer();
2115 s.serializeException(e);
2116 return s.toString();
2117 }
2118}
2119haxe.remoting.ExternalConnection.flashConnect = function(name,flashObjectID,ctx) {
2120 var cnx = new haxe.remoting.ExternalConnection({ ctx : ctx, name : name, flash : flashObjectID},[]);
2121 haxe.remoting.ExternalConnection.connections.set(name,cnx);
2122 return cnx;
2123}
2124haxe.remoting.ExternalConnection.prototype = {
2125 call: function(params) {
2126 var s = new haxe.Serializer();
2127 s.serialize(params);
2128 var params1 = s.toString();
2129 var data = null;
2130 var fobj = window.document[this.__data.flash];
2131 if(fobj == null) fobj = window.document.getElementById(this.__data.flash);
2132 if(fobj == null) throw "Could not find flash object '" + this.__data.flash + "'";
2133 try {
2134 data = fobj.externalRemotingCall(this.__data.name,this.__path.join("."),params1);
2135 } catch( e ) {
2136 }
2137 if(data == null) {
2138 var domain, pageDomain;
2139 try {
2140 domain = fobj.src.split("/")[2];
2141 pageDomain = js.Lib.window.location.host;
2142 } catch( e ) {
2143 domain = null;
2144 pageDomain = null;
2145 }
2146 if(domain != pageDomain) throw "ExternalConnection call failure : SWF need allowDomain('" + pageDomain + "')";
2147 throw "Call failure : ExternalConnection is not " + "initialized in Flash";
2148 }
2149 return new haxe.Unserializer(data).unserialize();
2150 }
2151 ,close: function() {
2152 haxe.remoting.ExternalConnection.connections.remove(this.__data.name);
2153 }
2154 ,resolve: function(field) {
2155 var e = new haxe.remoting.ExternalConnection(this.__data,this.__path.slice());
2156 e.__path.push(field);
2157 return e;
2158 }
2159 ,__path: null
2160 ,__data: null
2161 ,__class__: haxe.remoting.ExternalConnection
2162}
2163haxe.remoting.FlashJsConnection = $hxClasses["haxe.remoting.FlashJsConnection"] = function() { }
2164haxe.remoting.FlashJsConnection.__name__ = ["haxe","remoting","FlashJsConnection"];
2165haxe.remoting.FlashJsConnection.flashCall = function(flashObj,name,path,params) {
2166 try {
2167 var fobj = window.document[flashObj];
2168 if(fobj == null) fobj = window.document.getElementById[flashObj];
2169 if(fobj == null) throw "Could not find flash object '" + flashObj + "'";
2170 var data = null;
2171 try {
2172 data = fobj.flashJsRemotingCall(name,path,params);
2173 } catch( e ) {
2174 }
2175 if(data == null) throw "Flash object " + flashObj + " does not have an active FlashJsConnection";
2176 return data;
2177 } catch( e ) {
2178 var s = new haxe.Serializer();
2179 s.serializeException(e);
2180 return s.toString();
2181 }
2182}
2183if(!haxe.xml) haxe.xml = {}
2184haxe.xml.Parser = $hxClasses["haxe.xml.Parser"] = function() { }
2185haxe.xml.Parser.__name__ = ["haxe","xml","Parser"];
2186haxe.xml.Parser.parse = function(str) {
2187 var doc = Xml.createDocument();
2188 haxe.xml.Parser.doParse(str,0,doc);
2189 return doc;
2190}
2191haxe.xml.Parser.doParse = function(str,p,parent) {
2192 if(p == null) p = 0;
2193 var xml = null;
2194 var state = 1;
2195 var next = 1;
2196 var aname = null;
2197 var start = 0;
2198 var nsubs = 0;
2199 var nbrackets = 0;
2200 var c = str.cca(p);
2201 while(!(c != c)) {
2202 switch(state) {
2203 case 0:
2204 switch(c) {
2205 case 10:case 13:case 9:case 32:
2206 break;
2207 default:
2208 state = next;
2209 continue;
2210 }
2211 break;
2212 case 1:
2213 switch(c) {
2214 case 60:
2215 state = 0;
2216 next = 2;
2217 break;
2218 default:
2219 start = p;
2220 state = 13;
2221 continue;
2222 }
2223 break;
2224 case 13:
2225 if(c == 60) {
2226 var child = Xml.createPCData(HxOverrides.substr(str,start,p - start));
2227 parent.addChild(child);
2228 nsubs++;
2229 state = 0;
2230 next = 2;
2231 }
2232 break;
2233 case 17:
2234 if(c == 93 && str.cca(p + 1) == 93 && str.cca(p + 2) == 62) {
2235 var child = Xml.createCData(HxOverrides.substr(str,start,p - start));
2236 parent.addChild(child);
2237 nsubs++;
2238 p += 2;
2239 state = 1;
2240 }
2241 break;
2242 case 2:
2243 switch(c) {
2244 case 33:
2245 if(str.cca(p + 1) == 91) {
2246 p += 2;
2247 if(HxOverrides.substr(str,p,6).toUpperCase() != "CDATA[") throw "Expected <![CDATA[";
2248 p += 5;
2249 state = 17;
2250 start = p + 1;
2251 } else if(str.cca(p + 1) == 68 || str.cca(p + 1) == 100) {
2252 if(HxOverrides.substr(str,p + 2,6).toUpperCase() != "OCTYPE") throw "Expected <!DOCTYPE";
2253 p += 8;
2254 state = 16;
2255 start = p + 1;
2256 } else if(str.cca(p + 1) != 45 || str.cca(p + 2) != 45) throw "Expected <!--"; else {
2257 p += 2;
2258 state = 15;
2259 start = p + 1;
2260 }
2261 break;
2262 case 63:
2263 state = 14;
2264 start = p;
2265 break;
2266 case 47:
2267 if(parent == null) throw "Expected node name";
2268 start = p + 1;
2269 state = 0;
2270 next = 10;
2271 break;
2272 default:
2273 state = 3;
2274 start = p;
2275 continue;
2276 }
2277 break;
2278 case 3:
2279 if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
2280 if(p == start) throw "Expected node name";
2281 xml = Xml.createElement(HxOverrides.substr(str,start,p - start));
2282 parent.addChild(xml);
2283 state = 0;
2284 next = 4;
2285 continue;
2286 }
2287 break;
2288 case 4:
2289 switch(c) {
2290 case 47:
2291 state = 11;
2292 nsubs++;
2293 break;
2294 case 62:
2295 state = 9;
2296 nsubs++;
2297 break;
2298 default:
2299 state = 5;
2300 start = p;
2301 continue;
2302 }
2303 break;
2304 case 5:
2305 if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
2306 var tmp;
2307 if(start == p) throw "Expected attribute name";
2308 tmp = HxOverrides.substr(str,start,p - start);
2309 aname = tmp;
2310 if(xml.exists(aname)) throw "Duplicate attribute";
2311 state = 0;
2312 next = 6;
2313 continue;
2314 }
2315 break;
2316 case 6:
2317 switch(c) {
2318 case 61:
2319 state = 0;
2320 next = 7;
2321 break;
2322 default:
2323 throw "Expected =";
2324 }
2325 break;
2326 case 7:
2327 switch(c) {
2328 case 34:case 39:
2329 state = 8;
2330 start = p;
2331 break;
2332 default:
2333 throw "Expected \"";
2334 }
2335 break;
2336 case 8:
2337 if(c == str.cca(start)) {
2338 var val = HxOverrides.substr(str,start + 1,p - start - 1);
2339 xml.set(aname,val);
2340 state = 0;
2341 next = 4;
2342 }
2343 break;
2344 case 9:
2345 p = haxe.xml.Parser.doParse(str,p,xml);
2346 start = p;
2347 state = 1;
2348 break;
2349 case 11:
2350 switch(c) {
2351 case 62:
2352 state = 1;
2353 break;
2354 default:
2355 throw "Expected >";
2356 }
2357 break;
2358 case 12:
2359 switch(c) {
2360 case 62:
2361 if(nsubs == 0) parent.addChild(Xml.createPCData(""));
2362 return p;
2363 default:
2364 throw "Expected >";
2365 }
2366 break;
2367 case 10:
2368 if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
2369 if(start == p) throw "Expected node name";
2370 var v = HxOverrides.substr(str,start,p - start);
2371 if(v != parent.get_nodeName()) throw "Expected </" + parent.get_nodeName() + ">";
2372 state = 0;
2373 next = 12;
2374 continue;
2375 }
2376 break;
2377 case 15:
2378 if(c == 45 && str.cca(p + 1) == 45 && str.cca(p + 2) == 62) {
2379 parent.addChild(Xml.createComment(HxOverrides.substr(str,start,p - start)));
2380 p += 2;
2381 state = 1;
2382 }
2383 break;
2384 case 16:
2385 if(c == 91) nbrackets++; else if(c == 93) nbrackets--; else if(c == 62 && nbrackets == 0) {
2386 parent.addChild(Xml.createDocType(HxOverrides.substr(str,start,p - start)));
2387 state = 1;
2388 }
2389 break;
2390 case 14:
2391 if(c == 63 && str.cca(p + 1) == 62) {
2392 p++;
2393 var str1 = HxOverrides.substr(str,start + 1,p - start - 2);
2394 parent.addChild(Xml.createProlog(str1));
2395 state = 1;
2396 }
2397 break;
2398 }
2399 c = str.cca(++p);
2400 }
2401 if(state == 1) {
2402 start = p;
2403 state = 13;
2404 }
2405 if(state == 13) {
2406 if(p != start || nsubs == 0) parent.addChild(Xml.createPCData(HxOverrides.substr(str,start,p - start)));
2407 return p;
2408 }
2409 throw "Unexpected end";
2410}
2411haxe.xml.Parser.isValidChar = function(c) {
2412 return c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45;
2413}
2414var js = js || {}
2415js.Lib = $hxClasses["js.Lib"] = function() { }
2416js.Lib.__name__ = ["js","Lib"];
2417js.Lib.document = null;
2418js.Lib.window = null;
2419js.Lib.debug = function() {
2420 debugger;
2421}
2422js.Lib.alert = function(v) {
2423 alert(js.Boot.__string_rec(v,""));
2424}
2425js.Lib.eval = function(code) {
2426 return eval(code);
2427}
2428js.Lib.setErrorHandler = function(f) {
2429 js.Lib.onerror = f;
2430}
2431var mt = mt || {}
2432if(!mt.js) mt.js = {}
2433mt.js.Tip = $hxClasses["mt.js.Tip"] = function() { }
2434mt.js.Tip.__name__ = ["mt","js","Tip"];
2435mt.js.Tip.lastRef = null;
2436mt.js.Tip.placeRef = null;
2437mt.js.Tip.initialized = null;
2438mt.js.Tip.tooltip = null;
2439mt.js.Tip.tooltipContent = null;
2440mt.js.Tip.mousePos = null;
2441mt.js.Tip.onHide = null;
2442mt.js.Tip.excludeList = null;
2443mt.js.Tip.show = function(refObj,contentHTML,cName,pRef) {
2444 mt.js.Tip.init();
2445 if(mt.js.Tip.tooltip == null) {
2446 mt.js.Tip.tooltip = js.Lib.document.getElementById(mt.js.Tip.tooltipId);
2447 if(mt.js.Tip.tooltip == null) {
2448 mt.js.Tip.tooltip = js.Lib.document.createElement("div");
2449 mt.js.Tip.tooltip.id = mt.js.Tip.tooltipId;
2450 js.Lib.document.body.insertBefore(mt.js.Tip.tooltip,js.Lib.document.body.firstChild);
2451 }
2452 mt.js.Tip.tooltip.style.top = "-1000px";
2453 mt.js.Tip.tooltip.style.position = "absolute";
2454 mt.js.Tip.tooltip.style.zIndex = mt.js.Tip.tipZIndex;
2455 }
2456 if(mt.js.Tip.tooltipContent == null) {
2457 mt.js.Tip.tooltipContent = js.Lib.document.getElementById(mt.js.Tip.tooltipContentId);
2458 if(mt.js.Tip.tooltipContent == null) {
2459 mt.js.Tip.tooltipContent = js.Lib.document.createElement("div");
2460 mt.js.Tip.tooltipContent.id = mt.js.Tip.tooltipContentId;
2461 mt.js.Tip.tooltip.appendChild(mt.js.Tip.tooltipContent);
2462 }
2463 }
2464 if(pRef == null) pRef = false;
2465 mt.js.Tip.placeRef = pRef;
2466 if(cName == null) mt.js.Tip.tooltip.className = mt.js.Tip.defaultClass; else mt.js.Tip.tooltip.className = cName;
2467 if(mt.js.Tip.lastRef != null && mt.js.Tip.onHide != null) {
2468 mt.js.Tip.onHide();
2469 mt.js.Tip.onHide = null;
2470 }
2471 mt.js.Tip.lastRef = refObj;
2472 mt.js.Tip.tooltipContent.innerHTML = contentHTML;
2473 if(mt.js.Tip.placeRef) mt.js.Tip.placeTooltipRef(); else mt.js.Tip.placeTooltip();
2474}
2475mt.js.Tip.exclude = function(id) {
2476 var e = js.Lib.document.getElementById(id);
2477 if(e == null) throw id + " not found";
2478 if(mt.js.Tip.excludeList == null) mt.js.Tip.excludeList = new List();
2479 mt.js.Tip.excludeList.add(e);
2480}
2481mt.js.Tip.placeTooltip = function() {
2482 if(mt.js.Tip.mousePos == null) return;
2483 var tts = mt.js.Tip.elementSize(mt.js.Tip.tooltip);
2484 var w = mt.js.Tip.windowSize();
2485 var top = 0;
2486 var left = 0;
2487 left = mt.js.Tip.mousePos.x + mt.js.Tip.xOffset;
2488 top = mt.js.Tip.mousePos.y + mt.js.Tip.yOffset;
2489 if(top + tts.height > w.height - 2 + w.scrollTop) {
2490 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;
2491 }
2492 if(left + tts.width > w.width - 22 + w.scrollLeft) {
2493 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;
2494 }
2495 if(top < 0) top = 0;
2496 if(left < 0) left = 0;
2497 if(mt.js.Tip.excludeList != null) {
2498 var $it0 = mt.js.Tip.excludeList.iterator();
2499 while( $it0.hasNext() ) {
2500 var e = $it0.next();
2501 var s = mt.js.Tip.elementSize(e);
2502 if(left > s.x + s.width || left + tts.width < s.x || top > s.y + s.height || top + tts.height < s.y) continue;
2503 var dx1 = left - (s.x + s.width);
2504 var dx2 = left + tts.width - s.x;
2505 var dx = Math.abs(dx1) > Math.abs(dx2)?dx2:dx1;
2506 var dy1 = top - (s.y + s.height);
2507 var dy2 = top + tts.height - s.y;
2508 var dy = Math.abs(dy1) > Math.abs(dy2)?dy2:dy1;
2509 var cx = left + tts.width / 2 - mt.js.Tip.mousePos.x;
2510 var cy = top + tts.height / 2 - mt.js.Tip.mousePos.y;
2511 if((cx - dx) * (cx - dx) + cy * cy > cx * cx + (cy - dy) * (cy - dy)) top -= dy; else left -= dx;
2512 }
2513 }
2514 mt.js.Tip.tooltip.style.left = left + "px";
2515 mt.js.Tip.tooltip.style.top = top + "px";
2516}
2517mt.js.Tip.placeTooltipRef = function() {
2518 var o = mt.js.Tip.elementSize(mt.js.Tip.lastRef);
2519 var tts = mt.js.Tip.elementSize(mt.js.Tip.tooltip);
2520 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";
2521 mt.js.Tip.tooltip.style.top = o.y + Math.max(mt.js.Tip.minOffsetY,o.height) + "px";
2522}
2523mt.js.Tip.showTip = function(refObj,title,contentBase) {
2524 contentBase = "<p>" + contentBase + "</p>";
2525 mt.js.Tip.show(refObj,"<div class=\"title\">" + title + "</div>" + contentBase);
2526}
2527mt.js.Tip.hide = function() {
2528 if(mt.js.Tip.lastRef == null) return;
2529 mt.js.Tip.lastRef = null;
2530 if(mt.js.Tip.onHide != null) {
2531 mt.js.Tip.onHide();
2532 mt.js.Tip.onHide = null;
2533 }
2534 mt.js.Tip.tooltip.style.top = "-1000px";
2535 mt.js.Tip.tooltip.style.width = "";
2536}
2537mt.js.Tip.clean = function() {
2538 if(mt.js.Tip.lastRef == null) return;
2539 if(mt.js.Tip.lastRef.parentNode == null) return mt.js.Tip.hide();
2540 if(mt.js.Tip.lastRef.id != null && mt.js.Tip.lastRef.id != "") {
2541 if(js.Lib.document.getElementById(mt.js.Tip.lastRef.id) != mt.js.Tip.lastRef) return mt.js.Tip.hide();
2542 }
2543 return;
2544}
2545mt.js.Tip.elementSize = function(o) {
2546 var ret = { x : 0, y : 0, width : o.clientWidth, height : o.clientHeight};
2547 var p = o;
2548 while(p != null) {
2549 if(p.offsetParent != null) {
2550 ret.x += p.offsetLeft - p.scrollLeft;
2551 ret.y += p.offsetTop - p.scrollTop;
2552 } else {
2553 ret.x += p.offsetLeft;
2554 ret.y += p.offsetTop;
2555 }
2556 p = p.offsetParent;
2557 }
2558 return ret;
2559}
2560mt.js.Tip.windowSize = function() {
2561 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};
2562 var isIE = document.all != null && window.opera == null;
2563 var body = isIE?js.Lib.document.documentElement:js.Lib.document.body;
2564 if(ret.width == null) ret.width = body.clientWidth;
2565 if(ret.height == null) ret.height = body.clientHeight;
2566 return ret;
2567}
2568mt.js.Tip.onMouseMove = function(evt) {
2569 try {
2570 var posx = 0;
2571 var posy = 0;
2572 if(evt == null) evt = js.Lib.window.event;
2573 var e = evt;
2574 if(e.pageX || e.pageY) {
2575 posx = e.pageX;
2576 posy = e.pageY;
2577 } else if(e.clientX || e.clientY) {
2578 posx = e.clientX + js.Lib.document.body.scrollLeft + js.Lib.document.documentElement.scrollLeft;
2579 posy = e.clientY + js.Lib.document.body.scrollTop + js.Lib.document.documentElement.scrollTop;
2580 }
2581 mt.js.Tip.mousePos = { x : posx, y : posy};
2582 if(mt.js.Tip.lastRef != null && !mt.js.Tip.placeRef) mt.js.Tip.placeTooltip();
2583 } catch( e ) {
2584 }
2585}
2586mt.js.Tip.trackMenu = function(elt,onOut) {
2587 mt.js.Tip.init();
2588 var ftrack = null;
2589 var body = js.Lib.document.body;
2590 ftrack = function(evt) {
2591 if(mt.js.Tip.mousePos == null) return;
2592 var size = mt.js.Tip.elementSize(elt);
2593 if(mt.js.Tip.mousePos.x < size.x || mt.js.Tip.mousePos.y < size.y || mt.js.Tip.mousePos.x > size.x + size.width || mt.js.Tip.mousePos.y > size.y + size.height) {
2594 if(body.attachEvent) body.detachEvent("onmousemove",ftrack); else body.removeEventListener("mousemove",ftrack,false);
2595 onOut();
2596 }
2597 };
2598 if(body.attachEvent) body.attachEvent("onmousemove",ftrack); else body.addEventListener("mousemove",ftrack,false);
2599}
2600mt.js.Tip.init = function() {
2601 if(mt.js.Tip.initialized) return;
2602 if(document.body != null) {
2603 mt.js.Tip.initialized = true;
2604 document.body.onmousemove = mt.js.Tip.onMouseMove;
2605 }
2606}
2607mt.js.Editor = $hxClasses["mt.js.Editor"] = function(name) {
2608 this.name = name;
2609 this.contentName = name + "_content";
2610 this.config = { buttons : new List(), icons : new List(), iconsUrl : "", autoLink : true, linkTarget : "_blank", uploadData : null, uploadColors : { bg : 0, fg : 16777215, fill : 32768}};
2611};
2612mt.js.Editor.__name__ = ["mt","js","Editor"];
2613mt.js.Editor.getElementPosition = function(o) {
2614 var ret = { x : 0, y : 0, width : o.clientWidth, height : o.clientHeight};
2615 if(ret.width == 0) ret.width = o.offsetWidth;
2616 if(ret.height == 0) ret.height = o.offsetHeight;
2617 var p = o;
2618 while(p != null) {
2619 if(p.offsetParent != null) {
2620 ret.x += p.offsetLeft - p.scrollLeft;
2621 ret.y += p.offsetTop - p.scrollTop;
2622 } else {
2623 ret.x += p.offsetLeft;
2624 ret.y += p.offsetTop;
2625 }
2626 p = p.offsetParent;
2627 }
2628 return ret;
2629}
2630mt.js.Editor.prototype = {
2631 initUpload: function(id,act,target) {
2632 if(this.config.uploadData == null) throw "No data domain";
2633 var cnxName = "edcnx_" + id + "_" + this.name;
2634 var me = this;
2635 var api = { uploadResult : function(url) {
2636 act(url);
2637 }, uploadError : function(e) {
2638 js.Lib.alert(me.config.uploadData.error + "\n(" + e + ")");
2639 }};
2640 var cnx = haxe.remoting.ExternalConnection.flashConnect(cnxName,null,haxe.remoting.Context.share("api",api));
2641 var params = [this.config.uploadData.url + "upload/upload.swf","swf_" + id,"100%","100%",9];
2642 var swfobj;
2643 try {
2644 swfobj = eval("js.SWFObject");
2645 if(swfobj == null) throw null;
2646 } catch( e ) {
2647 swfobj = eval("SWFObject");
2648 }
2649 var obj = Type.createInstance(swfobj,params);
2650 obj.addParam("AllowScriptAccess","always");
2651 var c = this.config.uploadColors;
2652 var colors = "&bgcolor=" + c.bg + "&fgcolor=" + c.fg + "&color=" + c.fill;
2653 obj.addParam("FlashVars","name=" + cnxName + "&site=" + this.config.uploadData.site + "&prefix=" + this.config.uploadData.uid + colors + (target != null?"&click=1":""));
2654 obj.addParam("wmode","transparent");
2655 obj.write(id);
2656 return false;
2657 }
2658 ,updatePreview: function(id) {
2659 var doc = js.Lib.document.getElementById(id);
2660 doc.innerHTML = this.format(this.getDocument().value);
2661 }
2662 ,quoteSelection: function(begin,end) {
2663 var doc = this.getDocument();
2664 var sel = new js.Selection(doc);
2665 sel.insert(begin,sel.get(),end);
2666 if(doc.onkeyup != null) doc.onkeyup(null);
2667 }
2668 ,insertImage: function(url) {
2669 this.insert("@" + url + "@");
2670 }
2671 ,insert: function(txt) {
2672 this.quoteSelection(txt,"");
2673 }
2674 ,execute: function(act) {
2675 var act1 = haxe.Unserializer.run(act);
2676 var $e = (act1);
2677 switch( $e[1] ) {
2678 case 0:
2679 var tag = $e[2];
2680 this.insert(tag);
2681 break;
2682 case 1:
2683 case 2:
2684 var tag = $e[2];
2685 this.quoteSelection("[" + tag + "]","[/" + tag + "]");
2686 break;
2687 case 3:
2688 var node = $e[4], text = $e[3], addr = $e[2];
2689 var url = js.Lib.window.prompt(addr,"http://");
2690 if(url == null || url.length == 0 || url == "http://") return false;
2691 var comment = js.Lib.window.prompt(text,url);
2692 if(comment.length == 0 || comment == url) this.insert("[" + node + "]" + url + "[/" + node + "]"); else this.insert("[" + node + "=" + url + "]" + comment + "[/" + node + "]");
2693 break;
2694 case 4:
2695 break;
2696 }
2697 return false;
2698 }
2699 ,loadConfig: function(str) {
2700 this.config = haxe.Unserializer.run(str);
2701 }
2702 ,getDocument: function() {
2703 return js.Lib.document.getElementsByName(this.contentName)[0];
2704 }
2705 ,setUploadButton: function(target,act) {
2706 var id = target + "_swf";
2707 var loaded = false;
2708 js.Lib.document.write("<div id=\"" + id + "\"></div>");
2709 var but = js.Lib.document.getElementById(target);
2710 var me = this;
2711 but.onmouseover = function(_) {
2712 if(loaded) return;
2713 loaded = true;
2714 var doc = js.Lib.document;
2715 var win = js.Lib.window;
2716 var swf = doc.getElementById(id);
2717 swf.style.position = "absolute";
2718 swf.style.left = "0px";
2719 swf.style.top = "0px";
2720 var p = mt.js.Editor.getElementPosition(but);
2721 swf.style.width = p.width + "px";
2722 swf.style.height = p.height + "px";
2723 swf.style.zIndex = 10;
2724 var p2 = mt.js.Editor.getElementPosition(swf);
2725 swf.style.top = p.y - p2.y + "px";
2726 swf.style.left = p.x - p2.x + "px";
2727 me.initUpload(id,act,but);
2728 };
2729 }
2730 ,format: function(txt) {
2731 if(txt == "" || txt == null) return "";
2732 this.sections = [];
2733 txt = StringTools.htmlEscape(txt);
2734 txt = txt.split("\r\n").join("\n");
2735 txt = txt.split("\r").join("\n");
2736 txt = StringTools.trim(txt);
2737 txt = txt.split("\\0")[0];
2738 if(txt == null) return "";
2739 var me = this;
2740 if(this.config.autoLink) {
2741 txt = new EReg("([^@=>\\]\"])(http://[a-zA-Z0-9/?;&=%_.#-]+)","").customReplace(txt,function(r) {
2742 return r.matched(1) + me.addSection("<a href=\"" + r.matched(2) + "\"" + me.linkTarget() + ">" + r.matched(2) + "</a>");
2743 });
2744 txt = new EReg("^(http://[a-zA-Z0-9/?;&=%_.#-]+)","").customReplace(txt,function(r) {
2745 var url = r.matched(1);
2746 return me.addSection("<a href=\"" + url + "\"" + me.linkTarget() + ">" + url + "</a>");
2747 });
2748 }
2749 if(this.config.uploadData != null) txt = new EReg("@([A-Za-z0-9/_.]+)@","").customReplace(txt,function(r) {
2750 return me.addSection("<img src=\"" + me.config.uploadData.url + r.matched(1) + "\"/>");
2751 });
2752 var icons = Lambda.array(this.config.icons);
2753 icons.sort($bind(this,this.compareIcons));
2754 var _g = 0;
2755 while(_g < icons.length) {
2756 var i = icons[_g];
2757 ++_g;
2758 txt = this.formatAction(txt,i.act);
2759 }
2760 var $it0 = this.config.buttons.iterator();
2761 while( $it0.hasNext() ) {
2762 var b = $it0.next();
2763 txt = this.formatAction(txt,b.act);
2764 }
2765 txt = new EReg("<s:([0-9]+)/>","").customReplace(txt,function(r) {
2766 return me.sections[Std.parseInt(r.matched(1))];
2767 });
2768 this.sections = null;
2769 txt = new EReg("<([a-z]+)></\\1>","i").replace(txt,"");
2770 var schar = "";
2771 txt = txt.split(schar).join("");
2772 txt = new EReg("<([a-zA-Z0-9]+[^>]*/>)","g").replace(txt,schar + "$1");
2773 var r = new EReg("<([a-zA-Z0-9]+)([^>]*>[^<]*)</\\1>","g");
2774 while(true) {
2775 var t = r.replace(txt,schar + "$1$2" + schar + "/$1>");
2776 if(t == txt) break;
2777 txt = t;
2778 }
2779 txt = new EReg("</?[a-zA-Z0-9]+[^>]*>","g").replace(txt,"");
2780 txt = txt.split(schar).join("<");
2781 var b = new StringBuf();
2782 this.wordify(b,(function($this) {
2783 var $r;
2784 try {
2785 $r = Xml.parse(txt);
2786 } catch( e ) {
2787 $r = (function($this) {
2788 var $r;
2789 throw "Invalid XML " + txt + " (" + Std.string(e) + ")";
2790 return $r;
2791 }($this));
2792 }
2793 return $r;
2794 }(this)));
2795 return b.b;
2796 }
2797 ,wordify: function(b,x) {
2798 switch(x.nodeType) {
2799 case Xml.Document:
2800 var $it0 = x.iterator();
2801 while( $it0.hasNext() ) {
2802 var x1 = $it0.next();
2803 this.wordify(b,x1);
2804 }
2805 break;
2806 case Xml.Element:
2807 b.b += Std.string("<" + x.get_nodeName());
2808 var $it1 = x.attributes();
2809 while( $it1.hasNext() ) {
2810 var a = $it1.next();
2811 b.b += Std.string(" " + a + "=\"" + x.get(a) + "\"");
2812 }
2813 if(x.firstChild() == null) b.b += "/>"; else {
2814 b.b += ">";
2815 var $it2 = x.iterator();
2816 while( $it2.hasNext() ) {
2817 var x1 = $it2.next();
2818 this.wordify(b,x1);
2819 }
2820 b.b += Std.string("</" + x.get_nodeName() + ">");
2821 }
2822 break;
2823 case Xml.PCData:case Xml.CData:
2824 var first = true;
2825 var _g = 0, _g1 = x.get_nodeValue().split(" ");
2826 while(_g < _g1.length) {
2827 var data = _g1[_g];
2828 ++_g;
2829 if(first) first = false; else b.b += " ";
2830 while(data.length > 40) {
2831 b.b += Std.string(HxOverrides.substr(data,0,40));
2832 b.b += " ";
2833 data = HxOverrides.substr(data,40,null);
2834 }
2835 b.b += Std.string(data);
2836 }
2837 break;
2838 default:
2839 }
2840 }
2841 ,formatAction: function(txt,act) {
2842 return (function($this) {
2843 var $r;
2844 var $e = (act);
2845 switch( $e[1] ) {
2846 case 0:
2847 var img = $e[3], tag = $e[2];
2848 $r = txt.split(tag).join("<img src=\"" + $this.image(img) + "\" alt=\"\"/>");
2849 break;
2850 case 1:
2851 var html = $e[3], node = $e[2];
2852 $r = $this.formatNode(txt,node,"<" + html + ">","</" + html + ">");
2853 break;
2854 case 2:
2855 var span = $e[3], node = $e[2];
2856 $r = $this.formatNode(txt,node,"<span class=\"" + span + "\">","</span>");
2857 break;
2858 case 3:
2859 var node = $e[4];
2860 $r = (function($this) {
2861 var $r;
2862 var r = new EReg("\\[" + node + "\\](https?://[^\"]*?)\\[\\/" + node + "\\]","ig");
2863 txt = r.replace(txt,"<a href=\"$1\"" + $this.linkTarget() + ">$1</a>");
2864 r = new EReg("\\[" + node + "=(https?://[^\"]*?)\\](.*?)\\[\\/" + node + "\\]","i");
2865 var me = $this;
2866 $r = r.customReplace(txt,function(r1) {
2867 return me.addSection("<a href=\"" + r1.matched(1) + "\"" + me.linkTarget() + ">") + r1.matched(2) + "</a>";
2868 });
2869 return $r;
2870 }($this));
2871 break;
2872 case 4:
2873 var replace = $e[3], ereg = $e[2];
2874 $r = (function($this) {
2875 var $r;
2876 var r = new EReg(ereg,"ig");
2877 $r = r.replace(txt,replace);
2878 return $r;
2879 }($this));
2880 break;
2881 }
2882 return $r;
2883 }(this));
2884 }
2885 ,compareIcons: function(a,b) {
2886 return (function($this) {
2887 var $r;
2888 var $e = (a.act);
2889 switch( $e[1] ) {
2890 case 0:
2891 var taga = $e[2];
2892 $r = (function($this) {
2893 var $r;
2894 var $e = (b.act);
2895 switch( $e[1] ) {
2896 case 0:
2897 var tagb = $e[2];
2898 $r = Reflect.compare(tagb,taga);
2899 break;
2900 default:
2901 $r = Reflect.compare(a,b);
2902 }
2903 return $r;
2904 }($this));
2905 break;
2906 default:
2907 $r = Reflect.compare(a,b);
2908 }
2909 return $r;
2910 }(this));
2911 }
2912 ,addSection: function(text) {
2913 var sid = this.sections.length;
2914 this.sections.push(text);
2915 return "<s:" + sid + "/>";
2916 }
2917 ,linkTarget: function() {
2918 return this.config.linkTarget == null?"":" target=\"" + this.config.linkTarget + "\"";
2919 }
2920 ,formatNode: function(txt,node,h1,h2) {
2921 return txt.split("[" + node + "]").join(h1).split("[/" + node + "]").join(h2);
2922 }
2923 ,image: function(img) {
2924 return this.config.iconsUrl.split("::img::").join(img);
2925 }
2926 ,config: null
2927 ,sections: null
2928 ,name: null
2929 ,contentName: null
2930 ,__class__: mt.js.Editor
2931}
2932mt.js.Timer = $hxClasses["mt.js.Timer"] = function(now,end,start) {
2933 this.t = now.getTime();
2934 this.start = start == null?now:start;
2935 this.end = end;
2936 if(mt.js.Timer.timer == null) {
2937 mt.js.Timer.timer = new haxe.Timer(1000);
2938 mt.js.Timer.timer.run = function() {
2939 var _g = 0, _g1 = mt.js.Timer.timers;
2940 while(_g < _g1.length) {
2941 var t = _g1[_g];
2942 ++_g;
2943 t.update();
2944 }
2945 };
2946 }
2947 mt.js.Timer.timers.push(this);
2948};
2949mt.js.Timer.__name__ = ["mt","js","Timer"];
2950mt.js.Timer.timer = null;
2951mt.js.Timer.alloc = function(now,end,prec,div) {
2952 if(div == null) {
2953 div = "timer_" + mt.js.Timer.timers.length;
2954 js.Lib.document.write("<div id=\"" + div + "\" class=\"timer\"></div>");
2955 }
2956 var t = new mt.js.Timer(HxOverrides.strDate(now),HxOverrides.strDate(end));
2957 t.textDiv = { id : div, prec : prec};
2958 t.update();
2959 return t;
2960}
2961mt.js.Timer.prototype = {
2962 onUpdate: function() {
2963 }
2964 ,onReady: function() {
2965 if(this.rem.time < -2) {
2966 js.Lib.window.location = js.Lib.window.location;
2967 this.onReady = function() {
2968 };
2969 }
2970 }
2971 ,update: function() {
2972 this.t += 1000;
2973 var remt = (this.end.getTime() - this.t) / 1000;
2974 var rt = remt < 0?0:remt;
2975 this.rem = { days : rt / 86400 | 0, hours : (rt / 3600 | 0) % 24, minutes : (rt / 60 | 0) % 60, seconds : rt % 60 | 0, time : remt};
2976 var et = this.end.getTime();
2977 var st = this.start.getTime();
2978 this.progress = this.t >= et?1:(this.t - st) / (et - st);
2979 if(this.textDiv != null) {
2980 var div = js.Lib.document.getElementById(this.textDiv.id);
2981 if(div != null) div.innerHTML = this.buildText();
2982 }
2983 if(this.progressDiv != null) {
2984 var div = js.Lib.document.getElementById(this.progressDiv.id);
2985 if(div != null) {
2986 var w = this.progressDiv.width * this.progress | 0;
2987 div.style.width = w + "px";
2988 }
2989 }
2990 if(remt <= 0) this.onReady();
2991 this.onUpdate();
2992 }
2993 ,buildText: function() {
2994 var str = "";
2995 var prec = this.textDiv.prec;
2996 var force = false;
2997 if(prec < 1) {
2998 var sep = this.rem.seconds % 2 == 0?":":"<span style=\"opacity : 0\">:</span>";
2999 if(this.rem.hours > 0) {
3000 var str1 = this.rem.hours + sep;
3001 if(this.rem.minutes < 10) str1 += "0";
3002 return str1 + this.rem.minutes;
3003 }
3004 var str1 = this.rem.minutes + sep;
3005 if(this.rem.seconds < 10) str1 += "0";
3006 return str1 + this.rem.seconds;
3007 }
3008 if(this.rem.days > 0) {
3009 str += this.rem.days + mt.js.Timer.TIMES.charAt(0) + " ";
3010 force = true;
3011 if(--prec == 0) return str;
3012 }
3013 if(force || this.rem.hours > 0) {
3014 str += this.rem.hours + mt.js.Timer.TIMES.charAt(1) + " ";
3015 force = true;
3016 if(--prec == 0) return str;
3017 }
3018 if(force || this.rem.minutes > 0) {
3019 if(force && this.rem.minutes < 10) str += "0";
3020 str += this.rem.minutes + mt.js.Timer.TIMES.charAt(2) + " ";
3021 force = true;
3022 if(--prec == 0) return str;
3023 }
3024 if(force && this.rem.seconds < 10) str += "0";
3025 str += this.rem.seconds + mt.js.Timer.TIMES.charAt(3) + " ";
3026 return str;
3027 }
3028 ,stop: function() {
3029 HxOverrides.remove(mt.js.Timer.timers,this);
3030 }
3031 ,progressDiv: null
3032 ,textDiv: null
3033 ,rem: null
3034 ,progress: null
3035 ,end: null
3036 ,start: null
3037 ,t: null
3038 ,__class__: mt.js.Timer
3039}
3040js.Scroll = $hxClasses["js.Scroll"] = function() { }
3041js.Scroll.__name__ = ["js","Scroll"];
3042js.Scroll.getTop = function() {
3043 var sy = window.pageYOffset;
3044 if(typeof(sy) == "number") return sy;
3045 if(document.body) {
3046 sy = document.body.scrollTop;
3047 if(sy) return sy;
3048 }
3049 return document.documentElement.scrollTop;
3050}
3051js.Scroll.getLeft = function() {
3052 var sx = window.pageXOffset;
3053 if(typeof(sx) == "number") return sx;
3054 if(document.body) {
3055 sx = document.body.scrollLeft;
3056 if(sx) return sx;
3057 }
3058 return document.documentElement.scrollLeft;
3059}
3060js.Scroll.set = function(left,top) {
3061 window.scroll(left,top);
3062}
3063js.Cookie = $hxClasses["js.Cookie"] = function() { }
3064js.Cookie.__name__ = ["js","Cookie"];
3065js.Cookie.set = function(name,value,expireDelay,path,domain) {
3066 var s = name + "=" + StringTools.urlEncode(value);
3067 if(expireDelay != null) {
3068 var d = DateTools.delta(new Date(),expireDelay * 1000);
3069 s += ";expires=" + d.toGMTString();
3070 }
3071 if(path != null) s += ";path=" + path;
3072 if(domain != null) s += ";domain=" + domain;
3073 js.Lib.document.cookie = s;
3074}
3075js.Cookie.all = function() {
3076 var h = new Hash();
3077 var a = js.Lib.document.cookie.split(";");
3078 var _g = 0;
3079 while(_g < a.length) {
3080 var e = a[_g];
3081 ++_g;
3082 e = StringTools.ltrim(e);
3083 var t = e.split("=");
3084 if(t.length < 2) continue;
3085 h.set(t[0],StringTools.urlDecode(t[1]));
3086 }
3087 return h;
3088}
3089js.Cookie.get = function(name) {
3090 return js.Cookie.all().get(name);
3091}
3092js.Cookie.exists = function(name) {
3093 return js.Cookie.all().exists(name);
3094}
3095js.Cookie.remove = function(name,path,domain) {
3096 js.Cookie.set(name,"",-10,path,domain);
3097}
3098mt.js.FB = $hxClasses["mt.js.FB"] = function() { }
3099mt.js.FB.__name__ = ["mt","js","FB"];
3100mt.js.FB.__properties__ = {get_FB:"getFB"}
3101mt.js.FB.FB = null;
3102mt.js.FB.getFB = function() {
3103 return FB;
3104}
3105mt.js.FB.init = function(locale,onLoad) {
3106 if(mt.js.FB.initDone) {
3107 if(mt.js.FB.todo == null) onLoad(); else mt.js.FB.todo.push(onLoad);
3108 } else {
3109 mt.js.FB.initDone = true;
3110 mt.js.FB.todo = [onLoad];
3111 var doc = js.Lib.document;
3112 if(doc.getElementById("fb-root") == null) {
3113 var d = doc.createElement("div");
3114 d.id = "fb-root";
3115 doc.body.appendChild(d);
3116 }
3117 js.Lib.window.fbAsyncInit = function() {
3118 var tmp = mt.js.FB.todo;
3119 mt.js.FB.todo = null;
3120 var _g = 0;
3121 while(_g < tmp.length) {
3122 var f = tmp[_g];
3123 ++_g;
3124 f();
3125 }
3126 };
3127 var e = doc.createElement("script");
3128 e.async = true;
3129 e.src = js.Lib.window.location.protocol + "//connect.facebook.net/" + locale + "/all.js";
3130 doc.body.appendChild(e);
3131 }
3132}
3133mt.js.FB.fanBox = function(id,profile,css,size) {
3134 var e = js.Lib.document.getElementById(id);
3135 if(size == null) size = { width : 170, height : 45};
3136 var html = "<fb:fan profile_id=\"" + profile + "\" stream=\"0\" connections=\"0\" logobar=\"0\" width=\"" + size.width + "\" height=\"" + size.height + "\"" + (css == null?"":"css=\"" + css + "\"") + "></fb:fan>";
3137 e.innerHTML = html;
3138 FB.XFBML.parse(e);
3139}
3140mt.js.FB.askPublish = function(appId,infos,onPublished) {
3141 infos.link = infos.link.split(";").join("&");
3142 FB.init({ appId : appId, status : true});
3143 FB.getLoginStatus(function(_) {
3144 var foundDiv = null;
3145 FB.ui({ method : "stream.publish", display : "dialog", user_message_prompt : infos.promptTitle, message : "", target_id : infos.targetUser, attachment : { name : infos.title, description : infos.desc, href : infos.link, media : infos.image == null?[]:[{ type : "image", src : "http://" + js.Lib.window.location.host + infos.image, href : infos.link}]}, action_links : infos.miniLink == null?[]:[{ text : infos.miniLink, href : infos.link}]},function(response) {
3146 if(response == null && foundDiv != null) foundDiv.innerHTML = "";
3147 onPublished(response != null);
3148 });
3149 var t = new haxe.Timer(100);
3150 var count = 0;
3151 t.run = function() {
3152 var frames = js.Lib.document.getElementsByTagName("iframe");
3153 var _g1 = 0, _g = frames.length;
3154 while(_g1 < _g) {
3155 var i = _g1++;
3156 var f = frames[i];
3157 if(f.className.indexOf("FB_UI_Dialog") == -1) continue;
3158 if(f.offsetHeight > 280) {
3159 var d = f.parentNode.parentNode;
3160 d.style.top = "0px";
3161 d.className += " _fb_dialog_loaded";
3162 foundDiv = d;
3163 t.stop();
3164 return;
3165 }
3166 }
3167 if(count++ > 100) t.stop();
3168 };
3169 });
3170 return false;
3171}
3172mt.js.FB.initFBML = function(appId,id) {
3173 FB.init({ appId : appId});
3174 FB.XFBML.parse(id == null?null:js.Lib.document.getElementById(id));
3175}
3176mt.js.FB.initIFrame = function(bodyMargin) {
3177 if(bodyMargin == null) bodyMargin = 0;
3178 try {
3179 var frame = js.Lib.window.top.document.getElementById("__canvas_frame");
3180 if(frame == null) {
3181 js.Lib.document.cookie = "fbc=;path=/";
3182 js.Lib.window.top.location = js.Lib.window.location;
3183 return;
3184 }
3185 return;
3186 } catch( e ) {
3187 }
3188 FB.Canvas.setAutoResize(true);
3189}
3190js.App = $hxClasses["js.App"] = function() { }
3191js.App.__name__ = ["js","App"];
3192js.App.get = function(id) {
3193 return js.Lib.document.getElementById(id);
3194}
3195js.App.autoButton = function(id) {
3196 var d = js.App.get(id);
3197 js.Lib.document.onkeydown = function(e) {
3198 if(e == null) e = event;
3199 if(e.keyCode == 27 || e.keyCode == 13) {
3200 js.Lib.document.onkeydown = function(e1) {
3201 };
3202 var d1 = js.App.get(id);
3203 if(d1 != null) {
3204 if(d1.onclick == null || d1.onclick() == true) haxe.Timer.delay(function() {
3205 js.Lib.document.location = d1.href;
3206 },10);
3207 }
3208 }
3209 };
3210}
3211js.App.findChild = function(parent,name) {
3212 if(parent == null) return null;
3213 name = name.toUpperCase();
3214 var c = parent.firstChild;
3215 while(c != null) {
3216 if(c.nodeName == name) return c;
3217 c = c.nextSibling;
3218 }
3219 return null;
3220}
3221js.App.getHeight = function(dom) {
3222 var h = dom.clientHeight;
3223 return dom.clientHeight == null?dom.offsetHeight:dom.clientHeight;
3224}
3225js.App.fill = function(e,html) {
3226 if(HxOverrides.substr(html,0,5) == "<!DOC") {
3227 var r = new EReg("<body[^>]*>([^¢]*)</body>","");
3228 js.App.getBody().innerHTML = r.match(html)?r.matched(1):html;
3229 var top = js.App.get("mxtop");
3230 if(top != null) top.style.display = "";
3231 } else e.innerHTML = html;
3232}
3233js.App.show = function(id) {
3234 js.App.get(id).style.display = "";
3235 return false;
3236}
3237js.App.getBody = function() {
3238 return js.Lib.document.getElementsByTagName("body")[0];
3239}
3240js.App.setOpacity = function(e,v) {
3241 e.style.opacity = v;
3242 e.style.filter = "alpha(opacity=" + (v * 100 | 0) + ")";
3243}
3244js.App.hideSwf = function(flag) {
3245 var b = js.App.getBody();
3246 if(flag) b.className += " hideSwf"; else b.className = b.className.split("hideSwf").join("");
3247}
3248js.App.hideMenu = function(content) {
3249 if(content != null && js.App.get(content) == null) return;
3250 var m = js.App.get("navMenu");
3251 m.innerHTML = "";
3252 m.className = "";
3253 if(js.App.prevMenu != null) js.App.prevMenu.className = js.App.prevMenu.className.split("mxactive").join("");
3254 js.App.prevMenu = null;
3255}
3256js.App.formatMenuContent = function(html) {
3257 html = html.split("href=\"/").join("target=\"_top\" href=\"http://" + js.App.muxxuHost + "/");
3258 html = html.split("src=\"/").join("src=\"http://" + js.App.muxxuHost + "/");
3259 return html;
3260}
3261js.App.initMenu = function(e,tag) {
3262 var n = js.App.get("navMenu");
3263 var content = "navMenuContent_" + tag;
3264 n.className = "mxnav_" + tag;
3265 var html = "<div class=\"mxnav\"><div class=\"mxnavbottom\"><div class=\"mxnavbg\"><div id=\"" + content + "\">";
3266 html += "</div><div class=\"clear\"></div></div></div>";
3267 var epos = mt.js.Tip.elementSize(e);
3268 var ppos = mt.js.Tip.elementSize(n.parentNode);
3269 var ex = epos.x - ppos.x;
3270 var width = (function($this) {
3271 var $r;
3272 switch(tag) {
3273 case "muxxu":case "user":case "token":
3274 $r = 162;
3275 break;
3276 default:
3277 $r = 314;
3278 }
3279 return $r;
3280 }(this));
3281 n.style.marginLeft = (ex < ppos.width / 2?ex:ex + epos.width - width) + "px";
3282 n.innerHTML = html;
3283 if(js.App.prevMenu != null) js.App.prevMenu.className = js.App.prevMenu.className.split("mxactive").join("");
3284 e.className += " mxactive";
3285 js.App.prevMenu = e;
3286 js.App.trackMenu([e,n],function() {
3287 js.App.hideMenu(content);
3288 });
3289 return content;
3290}
3291js.App.loadJS = function(url,params) {
3292 var e = js.Lib.document.createElement("script");
3293 e.async = true;
3294 var pstr = null;
3295 if(params != null) {
3296 var _g = 0, _g1 = Reflect.fields(params);
3297 while(_g < _g1.length) {
3298 var p = _g1[_g];
3299 ++_g;
3300 if(pstr == null) pstr = "?"; else pstr += ";";
3301 pstr += p + "=" + StringTools.urlEncode(Reflect.field(params,p));
3302 }
3303 }
3304 if(pstr == null) pstr = "";
3305 e.src = url + pstr;
3306 js.Lib.document.body.appendChild(e);
3307}
3308js.App.loadModule = function(url,data,chk) {
3309 var id = "__mx_mod_" + js.App.MUID++;
3310 js.Lib.document.write("<div id=\"" + id + "\"></div>");
3311 js.App.loadJS(url,{ callb : "_.showModule('" + id + "')", data : data, chk : chk});
3312}
3313js.App.showModule = function(id) {
3314 return function(html) {
3315 js.App.fill(js.App.get(id),html);
3316 js.App.evaluateJS(id);
3317 };
3318}
3319js.App.showMenu = function(e,tag,url) {
3320 var m = js.App.initMenu(e,tag);
3321 if(js.App.menuCache == null) js.App.menuCache = new Hash();
3322 var cache = js.App.menuCache.get(url);
3323 if(cache != null) {
3324 js.App.get(m).innerHTML = cache;
3325 return;
3326 }
3327 var wait = "<div class=\"reload\"></div>";
3328 js.App.menuCache.set(url,wait);
3329 js.App.get(m).innerHTML = wait;
3330 js.App.loadJS("http://" + js.App.muxxuHost + url,{ tag : m, url : url});
3331}
3332js.App.setMenuContent = function(tag,url,content) {
3333 content = js.App.formatMenuContent(content);
3334 js.App.menuCache.set(url,content);
3335 var e = js.App.get(tag);
3336 if(e != null) e.innerHTML = content;
3337}
3338js.App.showStaticMenu = function(e,tag,data) {
3339 var m = js.App.initMenu(e,tag);
3340 js.App.get(m).innerHTML = js.App.formatMenuContent(data);
3341}
3342js.App.showGamesMenu = function(e,gdata) {
3343 var games = (function($this) {
3344 var $r;
3345 try {
3346 $r = haxe.Unserializer.run(gdata);
3347 } catch( e1 ) {
3348 $r = null;
3349 }
3350 return $r;
3351 }(this));
3352 if(games == null) {
3353 js.App.showMenu(e,"games","/game/nav");
3354 return;
3355 }
3356 var html = "<ul class=\"mxgames\">";
3357 var _g = 0;
3358 while(_g < games.length) {
3359 var g = games[_g];
3360 ++_g;
3361 var url = "http://" + g.d + "." + js.App.muxxuHost;
3362 html += "<li><a href=\"" + url + "\" class=\"ali\"" + "\" target=\"_top\"" + (g.b?" class=\"beta\"":"") + "><img src=\"" + url + "/favicon.ico\"/> <span>" + g.n + "</span>" + "</a></li>";
3363 }
3364 html += "</ul>";
3365 var m = js.App.initMenu(e,"games");
3366 js.App.get(m).innerHTML = html;
3367}
3368js.App.initLoginFrame = function(host) {
3369 js.App.get("loginFrame").innerHTML = "<iframe src=\"http://" + host + "/user/loginBox\" class=\"iframe\" allowTransparency=\"true\" frameborder=\"0\"></iframe><div class=\"black\"/>";
3370 js.App.hideSwf(true);
3371 return false;
3372}
3373js.App.trackMenu = function(elts,onOut) {
3374 mt.js.Tip.init();
3375 var ftrack = null;
3376 var body = js.Lib.document.body;
3377 ftrack = function(evt) {
3378 var mousePos = mt.js.Tip.mousePos;
3379 if(mousePos == null) return;
3380 var found = false;
3381 var _g = 0;
3382 while(_g < elts.length) {
3383 var e = elts[_g];
3384 ++_g;
3385 var size = mt.js.Tip.elementSize(e);
3386 if(mousePos.x < size.x || mousePos.y < size.y || mousePos.x > size.x + size.width || mousePos.y > size.y + size.height) continue;
3387 found = true;
3388 break;
3389 }
3390 if(!found) {
3391 if(body.attachEvent) body.detachEvent("onmousemove",ftrack); else body.removeEventListener("mousemove",ftrack,false);
3392 onOut();
3393 }
3394 };
3395 if(body.attachEvent) body.attachEvent("onmousemove",ftrack); else body.addEventListener("mousemove",ftrack,false);
3396}
3397js.App.initFrame = function(inGame,allow) {
3398 var top = js.App.get("mxtop");
3399 var win = js.Lib.window.top;
3400 if(win != js.Lib.window) {
3401 if(inGame) {
3402 var links = js.Lib.document.getElementsByTagName("a");
3403 var _g1 = 0, _g = links.length;
3404 while(_g1 < _g) {
3405 var i = _g1++;
3406 var a = links[i];
3407 if(a.target == null || a.target == "") a.target = "_top";
3408 }
3409 if(!allow) {
3410 var b = js.App.getBody();
3411 b.className += " inframe";
3412 var up = js.App.get("mxcontent").parentNode.parentNode.parentNode;
3413 if(up.className == "mxtopmaincontent") up.innerHTML = "";
3414 }
3415 } else if(allow) {
3416 var b = js.App.getBody();
3417 b.className += " inframe";
3418 var bar = js.App.get("tid_bar");
3419 if(bar != null) bar.style.display = "none";
3420 var hash = "#" + js.Lib.window.location.pathname;
3421 if(win.location.hash != hash) {
3422 if(!js.JQuery.browser.webkit) win.location.hash = hash;
3423 }
3424 var t = new haxe.Timer(200);
3425 t.run = function() {
3426 var h = win.location.hash;
3427 if(h != hash && h != "" && h != "#") {
3428 t.stop();
3429 h = HxOverrides.substr(h,1,null);
3430 if(h.toLowerCase().split("javascript").length > 1) return;
3431 js.Lib.window.location = h + "#" + h;
3432 }
3433 };
3434 js.Lib.window.onunload = function(_) {
3435 t.stop();
3436 };
3437 } else {
3438 win.location = js.Lib.window.location;
3439 return;
3440 }
3441 }
3442 top.style.display = "";
3443}
3444js.App.hide = function(id) {
3445 js.App.get(id).style.display = "none";
3446 return false;
3447}
3448js.App.toggle = function(id) {
3449 var e = js.App.get(id);
3450 e.style.display = e.style.display == "none"?"":"none";
3451 return false;
3452}
3453js.App.refresh = function() {
3454 js.Lib.window.location.reload(true);
3455 return false;
3456}
3457js.App.hideNotification = function(hasNext) {
3458 if(hasNext) return js.App.refresh();
3459 js.App.get("notification").style.display = "none";
3460 js.App.hideSwf(false);
3461 return false;
3462}
3463js.App.evaluateJS = function(id) {
3464 var e = js.App.get(id);
3465 if(e == null) return;
3466 var scripts = js.Lib.document.getElementsByTagName("script");
3467 var body = js.App.getBody();
3468 var _g1 = 0, _g = scripts.length;
3469 while(_g1 < _g) {
3470 var i = _g1++;
3471 var s = scripts[i];
3472 var p = s.parentNode;
3473 if(s.innerHTML == "") continue;
3474 while(p != null && p != body) {
3475 if(p == e) {
3476 eval(s.innerHTML);
3477 break;
3478 }
3479 p = p.parentNode;
3480 }
3481 }
3482}
3483js.App.twinCheck = function() {
3484 try {
3485 if( typeof(_tid) != undefined ) _tid.onLoad();
3486 } catch( e ) {
3487 }
3488}
3489js.App.reload = function(id,url,reloadId) {
3490 var rel = js.App.get(reloadId == null?id:reloadId);
3491 if(rel != null) rel.innerHTML = "<div class=\"reload\"></div>";
3492 var doc = js.App.get(id);
3493 if(doc == null) throw "No such element '" + id + "'";
3494 var data = null, timer = rel == null;
3495 var h = new haxe.Http(url);
3496 var setData = function() {
3497 mt.js.Tip.hide();
3498 js.App.fill(doc,data);
3499 haxe.Timer.delay((function(f,id1) {
3500 return function() {
3501 return f(id1);
3502 };
3503 })(js.App.evaluateJS,id),50);
3504 js.App.twinCheck();
3505 };
3506 h.onData = function(d) {
3507 data = d;
3508 if(timer) setData();
3509 };
3510 if(!timer) haxe.Timer.delay(function() {
3511 timer = true;
3512 if(data != null) setData();
3513 },800);
3514 h.request(false);
3515 return false;
3516}
3517js.App.submitReload = function(form,id,reload) {
3518 var doc = js.App.get(id);
3519 if(doc == null) throw "No such element '" + id + "'";
3520 var reload1 = reload == null?doc:js.App.get(reload);
3521 var f = js.App.get(form);
3522 if(f == null) throw "No such form '" + form + "'";
3523 var h = new haxe.Http(f.action);
3524 var _g1 = 0, _g = f.elements.length;
3525 while(_g1 < _g) {
3526 var i = _g1++;
3527 var e = f.elements[i];
3528 h.setParameter(e.name,e.value);
3529 }
3530 h.onData = function(data) {
3531 if(reload1 != doc && reload1 != null) reload1.innerHTML = "";
3532 js.App.fill(doc,data);
3533 js.App.twinCheck();
3534 };
3535 h.request(true);
3536 if(reload1 != null) reload1.innerHTML = "<div class=\"reload\"></div>";
3537 return false;
3538}
3539js.App.submitJS = function(form,id,reload) {
3540 var doc = js.App.get(id);
3541 if(doc == null) throw "No such element '" + id + "'";
3542 var reload1 = reload == null?doc:js.App.get(reload);
3543 var f = js.App.get(form);
3544 if(f == null) throw "No such form '" + form + "'";
3545 var params = { };
3546 var _g1 = 0, _g = f.elements.length;
3547 while(_g1 < _g) {
3548 var i = _g1++;
3549 var e = f.elements[i];
3550 params[e.name] = e.value;
3551 }
3552 params.callb = "_.showModule('" + id + "')";
3553 if(reload1 != null) reload1.innerHTML = "<div class=\"reload\"></div>";
3554 js.App.loadJS(f.action,params);
3555 return false;
3556}
3557js.App.buildPagesSelect = function(page,pages,url) {
3558 if(pages <= 2) {
3559 js.Lib.document.write(Std.string(page));
3560 return;
3561 }
3562 var str = "<select onchange=\"document.location = '" + url + "?page='+this.value\">";
3563 var _g1 = 1, _g = pages + 1;
3564 while(_g1 < _g) {
3565 var i = _g1++;
3566 str += "<option value=\"" + i + "\"" + (i == page?" selected=\"selected\"":"") + ">" + i + "</option>";
3567 }
3568 str += "</select>";
3569 js.Lib.document.write(str);
3570}
3571js.App.startComment = function(idx) {
3572 js.App.toggle("fb_" + idx);
3573 try {
3574 js.App.toggle("cc_" + idx);
3575 } catch( e ) {
3576 }
3577 js.App.get("comment_" + idx).focus();
3578 return false;
3579}
3580js.App.showComments = function(idx) {
3581 js.App.toggle("hplus_" + idx);
3582 js.App.toggle("hmin_" + idx);
3583 js.App.toggle("hcom_" + idx);
3584 return false;
3585}
3586js.App.sendComment = function(idx,chk) {
3587 var fname = "fb_" + idx;
3588 var form = js.App.get(fname);
3589 form.action = js.App.commentsURL + "/comment?n=" + idx + ";chk=" + chk;
3590 js.App.toggle(fname);
3591 try {
3592 js.App.toggle("cc_" + idx);
3593 } catch( e ) {
3594 }
3595 js.App.submitReload(fname,"hcom_" + idx,"hn_" + idx);
3596 js.App.get("comment_" + idx).value = "";
3597 return false;
3598}
3599js.App.showGameInfos = function(idx) {
3600 js.App.toggle("gplus_" + idx);
3601 js.App.toggle("gmin_" + idx);
3602 js.App.toggle("ginf_" + idx);
3603 return false;
3604}
3605js.App.deleteComment = function(idx,c) {
3606 return js.App.reload("hcom_" + idx,js.App.commentsURL + "/deleteComment?n=" + idx + ";c=" + c,"c_" + idx + "_" + c);
3607}
3608js.App.showAllComments = function(idx) {
3609 var e = js.App.get("hcom_" + idx);
3610 if(e == null) e = js.App.get("c_" + idx + "_1").parentNode;
3611 e.className += " forceComments";
3612 return false;
3613}
3614js.App.deleteCommentJS = function(idx,c) {
3615 var com = js.App.get("c_" + idx + "_" + c);
3616 com.parentNode.removeChild(com);
3617 js.App.loadJS("http://" + js.App.muxxuHost + "/mod/deleteComment?gid=" + idx + ";c=" + c);
3618 return false;
3619}
3620js.App.grow = function(domId,show) {
3621 var speed = show?0.2:0.4;
3622 var id = domId.split("_")[1];
3623 var avatar = js.App.findChild(js.App.get("a_" + id),"img");
3624 var dom = js.App.get(domId);
3625 if(show) dom.style.display = "block";
3626 var maxHeight = 10 + (dom.clientHeight < 50?50:dom.clientHeight);
3627 var aMaxHeight = avatar.clientHeight < 40?40:avatar.clientHeight;
3628 var ratio = show?0.0:1.0;
3629 if(show) {
3630 dom.style.height = ratio * maxHeight + "px";
3631 dom.style.overflow = "hidden";
3632 js.App.setOpacity(avatar,0);
3633 }
3634 var t = new haxe.Timer(20);
3635 var last = haxe.Timer.stamp();
3636 t.run = function() {
3637 var now = haxe.Timer.stamp();
3638 var dt = (now - last) * 0.5;
3639 if(show) {
3640 ratio += dt * speed;
3641 if(ratio >= 1) t.stop();
3642 } else {
3643 ratio -= dt * speed;
3644 if(ratio <= 0) {
3645 dom.style.display = "none";
3646 t.stop();
3647 }
3648 }
3649 ratio = Math.min(1,Math.max(0,ratio));
3650 if(show) {
3651 dom.style.height = Math.round(ratio * maxHeight) + "px";
3652 avatar.style.height = Math.round(ratio * aMaxHeight) + "px";
3653 } else js.App.setOpacity(dom,ratio);
3654 js.App.setOpacity(avatar,ratio);
3655 };
3656}
3657js.App.flash = function(id,show) {
3658 var e = js.App.get(id);
3659 e.style.display = "";
3660 var alpha = show?0.0:1.0;
3661 var t = new haxe.Timer(20);
3662 var last = haxe.Timer.stamp();
3663 t.run = function() {
3664 var now = haxe.Timer.stamp();
3665 var dt = (now - last) * 0.5;
3666 if(show) {
3667 alpha += dt;
3668 if(alpha > 1) {
3669 alpha = 1;
3670 t.stop();
3671 }
3672 } else {
3673 alpha -= dt;
3674 if(alpha < 0) {
3675 alpha = 0;
3676 e.style.display = "none";
3677 t.stop();
3678 }
3679 }
3680 js.App.setOpacity(e,alpha);
3681 };
3682}
3683js.App.initHomeScroll = function(ids) {
3684 var cur = new Array();
3685 while(ids.length > 10 && cur.length < 5) {
3686 var id = ids.pop();
3687 cur.push(id);
3688 }
3689 var _g = 0;
3690 while(_g < ids.length) {
3691 var id = ids[_g];
3692 ++_g;
3693 js.App.get("h_" + id).style.display = "none";
3694 }
3695 var next = null;
3696 next = function() {
3697 var id = ids.pop();
3698 if(id == null) return;
3699 var old = cur.shift();
3700 js.App.grow("h_" + old,false);
3701 js.App.grow("h_" + id,true);
3702 cur.push(id);
3703 haxe.Timer.delay(next,Std.random(5500) + 500);
3704 };
3705 haxe.Timer.delay(next,2000);
3706}
3707js.App.saveMessage = function(uid,chk) {
3708 var tf = js.App.get("msgText");
3709 var h = new haxe.Http("/user/setMessage");
3710 h.setParameter("chk",chk);
3711 h.setParameter("msg",tf.value);
3712 js.App.toggle("msgField");
3713 js.App.toggle("msgReload");
3714 h.onData = function(data) {
3715 js.App.toggle("msgReload");
3716 js.App.toggle("msgBox");
3717 js.App.fill(js.App.get("msgContent"),data);
3718 js.App.reload("userHistory","/user/" + uid + "/getHistory");
3719 };
3720 haxe.Timer.delay(function() {
3721 h.request(true);
3722 },500);
3723}
3724js.App.nameToDomain = function(v) {
3725 v = mt.db.Phoneme.removeAccentsUTF8(v);
3726 v = new EReg("[^A-Za-z0-9]+","g").replace(v,"-").toLowerCase();
3727 if(StringTools.endsWith(v,"-")) v = HxOverrides.substr(v,0,-1);
3728 while(v.length > 0) {
3729 var c = HxOverrides.cca(v,0);
3730 if(c == 45 || c >= 48 && c <= 57) v = HxOverrides.substr(v,1,null); else break;
3731 }
3732 if(v.length > 20) v = HxOverrides.substr(v,0,20);
3733 return v;
3734}
3735js.App.initExternFrame = function(url) {
3736 var n = new js.JQuery("#notification");
3737 n.remove();
3738 new js.JQuery(".mxhead").remove();
3739 new js.JQuery(".mxbottom").remove();
3740 new js.JQuery("#mxtop").append(n).append("<iframe src=\"" + url + "\" class=\"mx_extern_frame\" onmouseover=\"_tid.hideMenu()\"></iframe>");
3741 return new js.JQuery("iframe.mx_extern_frame")[0];
3742}
3743js.App.startWrite = function(uid) {
3744 js.Lib.window.location.assign("http://" + js.App.muxxuHost + "/msg/write?uid=" + uid);
3745}
3746js.App.main = function() {
3747 _ = js.App;
3748}
3749js.Boot = $hxClasses["js.Boot"] = function() { }
3750js.Boot.__name__ = ["js","Boot"];
3751js.Boot.__unhtml = function(s) {
3752 return s.split("&").join("&").split("<").join("<").split(">").join(">");
3753}
3754js.Boot.__trace = function(v,i) {
3755 var msg = i != null?i.fileName + ":" + i.lineNumber + ": ":"";
3756 msg += js.Boot.__string_rec(v,"");
3757 var d;
3758 if(typeof(document) != "undefined" && (d = document.getElementById("haxe:trace")) != null) d.innerHTML += js.Boot.__unhtml(msg) + "<br/>"; else if(typeof(console) != "undefined" && console.log != null) console.log(msg);
3759}
3760js.Boot.__clear_trace = function() {
3761 var d = document.getElementById("haxe:trace");
3762 if(d != null) d.innerHTML = "";
3763}
3764js.Boot.isClass = function(o) {
3765 return o.__name__;
3766}
3767js.Boot.isEnum = function(e) {
3768 return e.__ename__;
3769}
3770js.Boot.getClass = function(o) {
3771 return o.__class__;
3772}
3773js.Boot.__string_rec = function(o,s) {
3774 if(o == null) return "null";
3775 if(s.length >= 5) return "<...>";
3776 var t = typeof(o);
3777 if(t == "function" && (o.__name__ || o.__ename__)) t = "object";
3778 switch(t) {
3779 case "object":
3780 if(o instanceof Array) {
3781 if(o.__enum__) {
3782 if(o.length == 2) return o[0];
3783 var str = o[0] + "(";
3784 s += "\t";
3785 var _g1 = 2, _g = o.length;
3786 while(_g1 < _g) {
3787 var i = _g1++;
3788 if(i != 2) str += "," + js.Boot.__string_rec(o[i],s); else str += js.Boot.__string_rec(o[i],s);
3789 }
3790 return str + ")";
3791 }
3792 var l = o.length;
3793 var i;
3794 var str = "[";
3795 s += "\t";
3796 var _g = 0;
3797 while(_g < l) {
3798 var i1 = _g++;
3799 str += (i1 > 0?",":"") + js.Boot.__string_rec(o[i1],s);
3800 }
3801 str += "]";
3802 return str;
3803 }
3804 var tostr;
3805 try {
3806 tostr = o.toString;
3807 } catch( e ) {
3808 return "???";
3809 }
3810 if(tostr != null && tostr != Object.toString) {
3811 var s2 = o.toString();
3812 if(s2 != "[object Object]") return s2;
3813 }
3814 var k = null;
3815 var str = "{\n";
3816 s += "\t";
3817 var hasp = o.hasOwnProperty != null;
3818 for( var k in o ) { ;
3819 if(hasp && !o.hasOwnProperty(k)) {
3820 continue;
3821 }
3822 if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
3823 continue;
3824 }
3825 if(str.length != 2) str += ", \n";
3826 str += s + k + " : " + js.Boot.__string_rec(o[k],s);
3827 }
3828 s = s.substring(1);
3829 str += "\n" + s + "}";
3830 return str;
3831 case "function":
3832 return "<function>";
3833 case "string":
3834 return o;
3835 default:
3836 return String(o);
3837 }
3838}
3839js.Boot.__interfLoop = function(cc,cl) {
3840 if(cc == null) return false;
3841 if(cc == cl) return true;
3842 var intf = cc.__interfaces__;
3843 if(intf != null) {
3844 var _g1 = 0, _g = intf.length;
3845 while(_g1 < _g) {
3846 var i = _g1++;
3847 var i1 = intf[i];
3848 if(i1 == cl || js.Boot.__interfLoop(i1,cl)) return true;
3849 }
3850 }
3851 return js.Boot.__interfLoop(cc.__super__,cl);
3852}
3853js.Boot.__instanceof = function(o,cl) {
3854 try {
3855 if(o instanceof cl) {
3856 if(cl == Array) return o.__enum__ == null;
3857 return true;
3858 }
3859 if(js.Boot.__interfLoop(o.__class__,cl)) return true;
3860 } catch( e ) {
3861 if(cl == null) return false;
3862 }
3863 switch(cl) {
3864 case Int:
3865 return Math.ceil(o%2147483648.0) === o;
3866 case Float:
3867 return typeof(o) == "number";
3868 case Bool:
3869 return o === true || o === false;
3870 case String:
3871 return typeof(o) == "string";
3872 case Dynamic:
3873 return true;
3874 default:
3875 if(o == null) return false;
3876 if(cl == Class && o.__name__ != null) return true; else null;
3877 if(cl == Enum && o.__ename__ != null) return true; else null;
3878 return o.__enum__ == cl;
3879 }
3880}
3881js.Boot.__cast = function(o,t) {
3882 if(js.Boot.__instanceof(o,t)) return o; else throw "Cannot cast " + Std.string(o) + " to " + Std.string(t);
3883}
3884js.Selection = $hxClasses["js.Selection"] = function(doc) {
3885 this.doc = doc;
3886};
3887js.Selection.__name__ = ["js","Selection"];
3888js.Selection.prototype = {
3889 insert: function(left,text,right) {
3890 this.doc.focus();
3891 if(this.doc.selectionStart != null) {
3892 var top = this.doc.scrollTop;
3893 var start = this.doc.selectionStart;
3894 var end = this.doc.selectionEnd;
3895 this.doc.value = Std.string(this.doc.value.substr(0,start)) + left + text + right + Std.string(this.doc.value.substr(end));
3896 this.doc.selectionStart = start + left.length;
3897 this.doc.selectionEnd = start + left.length + text.length;
3898 this.doc.scrollTop = top;
3899 return;
3900 }
3901 var range = js.Lib.document.selection.createRange();
3902 range.text = left + text + right;
3903 range.moveStart("character",-text.length - right.length);
3904 range.moveEnd("character",-right.length);
3905 range.select();
3906 }
3907 ,select: function(start,end) {
3908 this.doc.focus();
3909 if(this.doc.selectionStart != null) {
3910 this.doc.selectionStart = start;
3911 this.doc.selectionEnd = end;
3912 return;
3913 }
3914 var value = this.doc.value;
3915 var p = 0, delta = 0;
3916 while(true) {
3917 var i = value.indexOf("\r\n",p);
3918 if(i < 0 || i > start) break;
3919 delta++;
3920 p = i + 2;
3921 }
3922 start -= delta;
3923 while(true) {
3924 var i = value.indexOf("\r\n",p);
3925 if(i < 0 || i > end) break;
3926 delta++;
3927 p = i + 2;
3928 }
3929 end -= delta;
3930 var r = this.doc.createTextRange();
3931 r.moveEnd("textedit",-1);
3932 r.moveStart("character",start);
3933 r.moveEnd("character",end - start);
3934 r.select();
3935 }
3936 ,get: function() {
3937 if(this.doc.selectionStart != null) return this.doc.value.substring(this.doc.selectionStart,this.doc.selectionEnd);
3938 var range = js.Lib.document.selection.createRange();
3939 if(range.parentElement() != this.doc) return "";
3940 return range.text;
3941 }
3942 ,doc: null
3943 ,__class__: js.Selection
3944}
3945mt.ArrayStd = $hxClasses["mt.ArrayStd"] = function() { }
3946mt.ArrayStd.__name__ = ["mt","ArrayStd"];
3947mt.ArrayStd.size = function(ar) {
3948 return ar.length;
3949}
3950mt.ArrayStd.first = function(ar) {
3951 return ar[0];
3952}
3953mt.ArrayStd.last = function(ar) {
3954 return ar[ar.length - 1];
3955}
3956mt.ArrayStd.clear = function(ar) {
3957 ar.splice(0,ar.length);
3958 return ar;
3959}
3960mt.ArrayStd.set = function(ar,index,v) {
3961 ar[index] = v;
3962 return ar;
3963}
3964mt.ArrayStd.at = function(ar,index) {
3965 return ar[index];
3966}
3967mt.ArrayStd.indexOf = function(ar,elt) {
3968 var id = -1, i = -1;
3969 var _g = 0;
3970 while(_g < ar.length) {
3971 var e = ar[_g];
3972 ++_g;
3973 ++i;
3974 if(e == elt) {
3975 id = i;
3976 break;
3977 }
3978 }
3979 return id;
3980}
3981mt.ArrayStd.addFirst = function(ar,e) {
3982 ar.unshift(e);
3983 return ar;
3984}
3985mt.ArrayStd.addLast = function(ar,e) {
3986 ar.push(e);
3987 return ar;
3988}
3989mt.ArrayStd.removeFirst = function(ar) {
3990 return ar.shift();
3991}
3992mt.ArrayStd.removeLast = function(ar) {
3993 return ar.pop();
3994}
3995mt.ArrayStd.map = function(ar,f) {
3996 var output = [];
3997 var _g = 0;
3998 while(_g < ar.length) {
3999 var e = ar[_g];
4000 ++_g;
4001 output.push(f(e));
4002 }
4003 return output;
4004}
4005mt.ArrayStd.stripNull = function(ar) {
4006 while(HxOverrides.remove(ar,null)) {
4007 }
4008 return ar;
4009}
4010mt.ArrayStd.flatten = function(ar) {
4011 var out = new Array();
4012 var _g1 = 0, _g = ar.length;
4013 while(_g1 < _g) {
4014 var i = _g1++;
4015 var $it0 = $iterator(ar[i])();
4016 while( $it0.hasNext() ) {
4017 var x = $it0.next();
4018 out.push(x);
4019 out;
4020 }
4021 out;
4022 }
4023 return out;
4024}
4025mt.ArrayStd.append = function(ar,it) {
4026 var $it0 = $iterator(it)();
4027 while( $it0.hasNext() ) {
4028 var x = $it0.next();
4029 ar.push(x);
4030 ar;
4031 }
4032 return ar;
4033}
4034mt.ArrayStd.prepend = function(ar,it) {
4035 var a = Lambda.array(it);
4036 a.reverse();
4037 var _g = 0;
4038 while(_g < a.length) {
4039 var x = a[_g];
4040 ++_g;
4041 ar.unshift(x);
4042 ar;
4043 }
4044 return ar;
4045}
4046mt.ArrayStd.shuffle = function(ar,rand) {
4047 var rnd = rand != null?rand:Std.random;
4048 var size = ar.length;
4049 var _g1 = 0, _g = size << 1;
4050 while(_g1 < _g) {
4051 var i = _g1++;
4052 var id0 = rnd(size), id1 = rnd(size);
4053 var tmp = ar[id0];
4054 ar[id0] = ar[id1];
4055 ar[id1] = tmp;
4056 }
4057 return ar;
4058}
4059mt.ArrayStd.getRandom = function(ar,rnd) {
4060 var random = rnd != null?rnd:Std.random;
4061 var id = random(ar.length);
4062 return ar[id];
4063}
4064mt.ArrayStd.usort = function(t,f) {
4065 var a = t, i = 0, l = t.length;
4066 while(i < l) {
4067 var swap = false;
4068 var j = 0, max = l - i - 1;
4069 while(j < max) {
4070 if(f(a[j],a[j + 1]) > 0) {
4071 var tmp = a[j + 1];
4072 a[j + 1] = a[j];
4073 a[j] = tmp;
4074 swap = true;
4075 }
4076 j += 1;
4077 }
4078 if(!swap) break;
4079 i += 1;
4080 }
4081 return a;
4082}
4083mt.ListStd = $hxClasses["mt.ListStd"] = function() { }
4084mt.ListStd.__name__ = ["mt","ListStd"];
4085mt.ListStd.size = function(l) {
4086 return l.length;
4087}
4088mt.ListStd.at = function(l,index) {
4089 var ite = l.iterator();
4090 while(--index > -1) ite.next();
4091 return ite.next();
4092}
4093mt.ListStd.indexOf = function(l,elt) {
4094 var id = -1, i = -1;
4095 var $it0 = l.iterator();
4096 while( $it0.hasNext() ) {
4097 var e = $it0.next();
4098 ++i;
4099 if(e == elt) {
4100 id = i;
4101 break;
4102 }
4103 }
4104 return id;
4105}
4106mt.ListStd.addFirst = function(l,e) {
4107 l.push(e);
4108 return l;
4109}
4110mt.ListStd.addLast = function(l,e) {
4111 l.add(e);
4112 return l;
4113}
4114mt.ListStd.removeFirst = function(l) {
4115 return l.pop();
4116}
4117mt.ListStd.removeLast = function(l) {
4118 var cpy = Lambda.list(l);
4119 var ite = cpy.iterator();
4120 var last = l.last();
4121 l.clear();
4122 var _g1 = 0, _g = cpy.length - 1;
4123 while(_g1 < _g) {
4124 var i = _g1++;
4125 l.add(ite.next());
4126 }
4127 return last;
4128}
4129mt.ListStd.copy = function(l) {
4130 return Lambda.list(l);
4131}
4132mt.ListStd.flatten = function(l) {
4133 var out = new List();
4134 var _g1 = 0, _g = l.length;
4135 while(_g1 < _g) {
4136 var i = _g1++;
4137 var $it0 = $iterator(mt.ListStd.at(l,i))();
4138 while( $it0.hasNext() ) {
4139 var x = $it0.next();
4140 out.add(x);
4141 }
4142 out;
4143 }
4144 return out;
4145}
4146mt.ListStd.append = function(l,it) {
4147 var $it0 = $iterator(it)();
4148 while( $it0.hasNext() ) {
4149 var x = $it0.next();
4150 l.add(x);
4151 }
4152 return l;
4153}
4154mt.ListStd.prepend = function(l,it) {
4155 var a = Lambda.array(it);
4156 a.reverse();
4157 var _g = 0;
4158 while(_g < a.length) {
4159 var x = a[_g];
4160 ++_g;
4161 l.push(x);
4162 l;
4163 }
4164 return l;
4165}
4166mt.ListStd.reverse = function(l) {
4167 var cpy = [];
4168 while(l.length > 0) {
4169 cpy.unshift(l.pop());
4170 cpy;
4171 }
4172 while(cpy.length > 0) {
4173 l.push(cpy.pop());
4174 l;
4175 }
4176 return l;
4177}
4178mt.ListStd.shuffle = function(l,rand) {
4179 var ar = Lambda.array(l);
4180 mt.ArrayStd.shuffle(ar,rand);
4181 l.clear();
4182 var _g1 = 0, _g = ar.length;
4183 while(_g1 < _g) {
4184 var i = _g1++;
4185 l.add(ar[i]);
4186 l;
4187 }
4188 ar = null;
4189 return l;
4190}
4191mt.ListStd.slice = function(l,pos,end) {
4192 var out = new List();
4193 if(end == null) end = l.length;
4194 var _g = pos;
4195 while(_g < end) {
4196 var i = _g++;
4197 out.add(mt.ListStd.at(l,i));
4198 out;
4199 }
4200 return out;
4201}
4202mt.ListStd.splice = function(l,pos,len) {
4203 var out = new List();
4204 var copy = Lambda.list(l);
4205 l.clear();
4206 var i = 0;
4207 var $it0 = copy.iterator();
4208 while( $it0.hasNext() ) {
4209 var e = $it0.next();
4210 if(i < pos) {
4211 l.add(e);
4212 l;
4213 } else if(i >= pos + len) {
4214 l.add(e);
4215 l;
4216 } else {
4217 out.add(e);
4218 out;
4219 }
4220 i++;
4221 }
4222 return out;
4223}
4224mt.ListStd.stripNull = function(l) {
4225 while(l.remove(null)) {
4226 }
4227 return l;
4228}
4229mt.ListStd.getRandom = function(l,rnd) {
4230 var random = rnd != null?rnd:Std.random;
4231 var id = random(l.length);
4232 return mt.ListStd.at(l,id);
4233}
4234mt.ListStd.usort = function(l,f) {
4235 var a = Lambda.array(l);
4236 a = mt.ArrayStd.usort(a,f);
4237 l.clear();
4238 var _g = 0;
4239 while(_g < a.length) {
4240 var e = a[_g];
4241 ++_g;
4242 l.add(e);
4243 l;
4244 }
4245 return l;
4246}
4247if(!mt.db) mt.db = {}
4248mt.db.Phoneme = $hxClasses["mt.db.Phoneme"] = function() {
4249 if(mt.db.Phoneme.tables == null) mt.db.Phoneme.initTables();
4250};
4251mt.db.Phoneme.__name__ = ["mt","db","Phoneme"];
4252mt.db.Phoneme.tables = null;
4253mt.db.Phoneme.initTables = function() {
4254 mt.db.Phoneme.tables = [{ terminal : null, table : []}];
4255 mt.db.Phoneme.repl("EAU","O");
4256 mt.db.Phoneme.repl("AU","O");
4257 mt.db.Phoneme.repl("OU","U");
4258 mt.db.Phoneme.repl("EU","e");
4259 mt.db.Phoneme.repl("AI","e");
4260 mt.db.Phoneme.repl("ER","e");
4261 mt.db.Phoneme.repl("CH","sh");
4262 mt.db.Phoneme.repl("OE","e");
4263 mt.db.Phoneme.repl("PH","F");
4264 mt.db.Phoneme.repl("H","");
4265 mt.db.Phoneme.repl("S$","$");
4266 mt.db.Phoneme.repl("T$","$");
4267 mt.db.Phoneme.repl("TS$","$");
4268 mt.db.Phoneme.repl("E$","$");
4269 mt.db.Phoneme.repl("ES$","$");
4270 mt.db.Phoneme.repl("P$","$");
4271 mt.db.Phoneme.repl("X$","$");
4272 mt.db.Phoneme.repl("ER$","e$");
4273 mt.db.Phoneme.repl("EE","e");
4274 mt.db.Phoneme.repl("AA","A");
4275 mt.db.Phoneme.repl("OO","O");
4276 mt.db.Phoneme.repl("UU","U");
4277 mt.db.Phoneme.repl("II","I");
4278 mt.db.Phoneme.repl("LL","L");
4279 mt.db.Phoneme.repl("TT","T");
4280 mt.db.Phoneme.repl("SS","S");
4281 mt.db.Phoneme.repl("NN","N");
4282 mt.db.Phoneme.repl("MM","N");
4283 mt.db.Phoneme.repl("RR","R");
4284 mt.db.Phoneme.repl("PP","P");
4285 mt.db.Phoneme.repl("FF","F");
4286 mt.db.Phoneme.repl("C","K");
4287 mt.db.Phoneme.repl("CE","SE");
4288 mt.db.Phoneme.repl("CS","X");
4289 mt.db.Phoneme.repl("CK","K");
4290 mt.db.Phoneme.repl("SK","K");
4291 mt.db.Phoneme.repl("QU","K");
4292 mt.db.Phoneme.repl("GU","G");
4293 mt.db.Phoneme.repl("GE","J");
4294 mt.db.Phoneme.repl("Y","I");
4295 mt.db.Phoneme.repl("Z","S");
4296 mt.db.Phoneme.repl("TIO","SIO");
4297 mt.db.Phoneme.repl("TIA","SIA");
4298 mt.db.Phoneme.repl("ERT","ert");
4299 mt.db.Phoneme.repl("EN","n");
4300 mt.db.Phoneme.repl("ON","n");
4301 mt.db.Phoneme.repl("ION","ioN");
4302 mt.db.Phoneme.repl("IN","n");
4303 mt.db.Phoneme.repl("INE","iNE");
4304 mt.db.Phoneme.repl("AIN","n");
4305 mt.db.Phoneme.repl("AN","n");
4306 mt.db.Phoneme.repl("AM","n");
4307 mt.db.Phoneme.repl("EM","n");
4308 mt.db.Phoneme.repl("OM","n");
4309 mt.db.Phoneme.repl("EMM","em");
4310 mt.db.Phoneme.repl("AMM","am");
4311 mt.db.Phoneme.repl("OMM","om");
4312}
4313mt.db.Phoneme.repl = function(a,b) {
4314 var state = 0;
4315 var _g1 = 0, _g = a.length;
4316 while(_g1 < _g) {
4317 var i = _g1++;
4318 var t = mt.db.Phoneme.tables[state].table;
4319 var c = HxOverrides.cca(a,i);
4320 state = t[c];
4321 if(state == null) {
4322 state = mt.db.Phoneme.tables.length;
4323 t[c] = state;
4324 mt.db.Phoneme.tables.push({ terminal : null, table : new Array()});
4325 }
4326 }
4327 var t = mt.db.Phoneme.tables[state];
4328 if(t.terminal != null) throw "Duplicate replace " + a;
4329 if(a.length < b.length) throw "Invalid replace " + a + ":" + b;
4330 t.terminal = haxe.io.Bytes.ofString(b);
4331}
4332mt.db.Phoneme.removeAccentsUTF8 = function(s) {
4333 var b = new StringBuf();
4334 var _g1 = 0, _g = s.length;
4335 while(_g1 < _g) {
4336 var i = _g1++;
4337 var c = HxOverrides.cca(s,i);
4338 switch(c) {
4339 case 233:case 232:case 234:case 235:
4340 b.b += "e";
4341 break;
4342 case 201:case 200:case 202:case 203:
4343 b.b += "E";
4344 break;
4345 case 224:case 226:case 228:case 225:
4346 b.b += "a";
4347 break;
4348 case 192:case 194:case 196:case 193:
4349 b.b += "A";
4350 break;
4351 case 249:case 251:case 252:case 250:
4352 b.b += "u";
4353 break;
4354 case 217:case 219:case 220:case 218:
4355 b.b += "U";
4356 break;
4357 case 238:case 239:case 237:
4358 b.b += "i";
4359 break;
4360 case 206:case 207:case 205:
4361 b.b += "I";
4362 break;
4363 case 244:case 243:case 246:case 245:
4364 b.b += "o";
4365 break;
4366 case 212:case 211:case 214:
4367 b.b += "O";
4368 break;
4369 case 230:case 198:
4370 b.b += "a";
4371 b.b += "e";
4372 break;
4373 case 339:case 338:
4374 b.b += "o";
4375 b.b += "e";
4376 break;
4377 case 231:
4378 b.b += "c";
4379 break;
4380 case 199:
4381 b.b += "C";
4382 break;
4383 case 241:
4384 b.b += "n";
4385 break;
4386 case 209:
4387 b.b += "N";
4388 break;
4389 default:
4390 b.b += String.fromCharCode(c);
4391 }
4392 }
4393 return b.b;
4394}
4395mt.db.Phoneme.levenshtein = function(a,b) {
4396 var d = [];
4397 var k = a.length + 1;
4398 var k2 = b.length + 1;
4399 var _g = 0;
4400 while(_g < k) {
4401 var i = _g++;
4402 d[i] = i;
4403 }
4404 var _g = 0;
4405 while(_g < k2) {
4406 var j = _g++;
4407 d[j * k] = j;
4408 }
4409 var _g = 1;
4410 while(_g < k) {
4411 var i = _g++;
4412 var _g1 = 1;
4413 while(_g1 < k2) {
4414 var j = _g1++;
4415 var v = a.cca(i - 1) == b.cca(j - 1)?0:1;
4416 var er = d[i - 1 + j * k] + 1;
4417 var ins = d[i + (j - 1) * k] + 1;
4418 var sub = d[i - 1 + (j - 1) * k] + v;
4419 d[i + j * k] = er < ins?er < sub?er:sub:ins < sub?ins:sub;
4420 }
4421 }
4422 return d[a.length + b.length * k];
4423}
4424mt.db.Phoneme.prototype = {
4425 make: function(s) {
4426 s = mt.db.Phoneme.removeAccentsUTF8(s);
4427 s = s.toUpperCase();
4428 var buf = new StringBuf();
4429 var b = haxe.io.Bytes.ofString("$" + new EReg("[^A-Z]+","g").split(s).join("$") + "$");
4430 var i = 0;
4431 var max = b.length;
4432 var tables = mt.db.Phoneme.tables;
4433 var t, state;
4434 var lastpos = 0, last, startpos;
4435 while(i < max) {
4436 last = null;
4437 startpos = i;
4438 t = tables[0];
4439 do {
4440 state = t.table[b.b[i]];
4441 if(state == null) break;
4442 t = tables[state];
4443 ++i;
4444 if(t.terminal != null) {
4445 last = t.terminal;
4446 lastpos = i;
4447 }
4448 } while(i < max);
4449 if(last == null) {
4450 i = startpos;
4451 var c = b.b[i];
4452 if(c >= 97 && c <= 122) c += -32;
4453 buf.b += String.fromCharCode(c);
4454 i++;
4455 } else {
4456 var len = last.length;
4457 i = lastpos - len;
4458 b.blit(i,last,0,len);
4459 }
4460 }
4461 return buf.b;
4462 }
4463 ,get: function(at) {
4464 return HxOverrides.cca(this.s,at);
4465 }
4466 ,s: null
4467 ,__class__: mt.db.Phoneme
4468}
4469mt.js.EditorAction = $hxClasses["mt.js.EditorAction"] = { __ename__ : ["mt","js","EditorAction"], __constructs__ : ["AImage","ANode","ASpan","ALink","AReg"] }
4470mt.js.EditorAction.AImage = function(tag,url) { var $x = ["AImage",0,tag,url]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
4471mt.js.EditorAction.ANode = function(node,html) { var $x = ["ANode",1,node,html]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
4472mt.js.EditorAction.ASpan = function(node,span) { var $x = ["ASpan",2,node,span]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
4473mt.js.EditorAction.ALink = function(text1,text2,node) { var $x = ["ALink",3,text1,text2,node]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
4474mt.js.EditorAction.AReg = function(ereg,replace) { var $x = ["AReg",4,ereg,replace]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
4475mt.js.Twinoid = $hxClasses["mt.js.Twinoid"] = function() { }
4476mt.js.Twinoid.__name__ = ["mt","js","Twinoid"];
4477mt.js.Twinoid.call = function(method,args,callb) {
4478 if(mt.js.Twinoid.boot != null) {
4479 var m = Reflect.field(mt.js.Twinoid.boot,method);
4480 if(m == null) throw "No such method '" + method + "'";
4481 var r = m.apply(mt.js.Twinoid.boot,args);
4482 if(callb != null) callb(r);
4483 return;
4484 }
4485 var calls = (function($this) {
4486 var $r;
4487 try {
4488 $r = js.Lib.window._tid_calls;
4489 } catch( e ) {
4490 $r = null;
4491 }
4492 return $r;
4493 }(this));
4494 if(calls == null) {
4495 var t = new haxe.Timer(100);
4496 t.run = function() {
4497 var tid = null;
4498 try {
4499 tid = _tid;
4500 } catch( e ) {
4501 }
4502 if(tid == null || !tid.isReady) return;
4503 mt.js.Twinoid.boot = tid;
4504 t.stop();
4505 var _g = 0;
4506 while(_g < calls.length) {
4507 var c = calls[_g];
4508 ++_g;
4509 var r = mt.js.Twinoid.call(c.m,c.a);
4510 if(c.c != null) c.c(r);
4511 }
4512 js.Lib.window._tid_calls = null;
4513 };
4514 calls = js.Lib.window._tid_calls = [];
4515 }
4516 calls.push({ m : method, a : args, c : callb});
4517}
4518mt.js.Twinoid.isConnected = function(proc) {
4519 mt.js.Twinoid.call("isConnected",[proc]);
4520}
4521mt.js.Twinoid.onLoad = function() {
4522 mt.js.Twinoid.call("onLoad",[]);
4523}
4524mt.js.Twinoid.quickNotice = function(msg,error) {
4525 mt.js.Twinoid.call("quickNotice",[msg,error]);
4526}
4527mt.js.Twinoid.notice = function(msg,error) {
4528 mt.js.Twinoid.call("notice",[msg,error]);
4529}
4530mt.js.Twinoid.lockBar = function() {
4531 mt.js.Twinoid.call("lockBar",[]);
4532}
4533mt.js.Twinoid.point = function(e,html) {
4534 mt.js.Twinoid.call("point",[e,html]);
4535}
4536mt.js.Twinoid.hidePointer = function() {
4537 mt.js.Twinoid.call("hidePointer",[]);
4538}
4539mt.js.Twinoid.onCssReady = function(cb) {
4540 mt.js.Twinoid.call("isCssReady",[],function(b) {
4541 if(b) cb(); else haxe.Timer.delay((function(f,cb1) {
4542 return function() {
4543 return f(cb1);
4544 };
4545 })(mt.js.Twinoid.onCssReady,cb),100);
4546 });
4547}
4548mt.js.Twinoid.popImage = function(url,title) {
4549 mt.js.Twinoid.call("popImage",[url,title]);
4550}
4551mt.js.Twinoid.wallAutoShareUrl = function(url) {
4552 mt.js.Twinoid.call("wallAutoShareUrl",[url]);
4553}
4554mt.js.Twinoid.askCashFrame = function(params,onClose) {
4555 mt.js.Twinoid.call("askCashFrame",[params,onClose]);
4556}
4557mt.js.Twinoid.addLoadListener = function(callb) {
4558 mt.js.Twinoid.call("addLoadListener",[callb]);
4559}
4560function $iterator(o) { if( o instanceof Array ) return function() { return HxOverrides.iter(o); }; return typeof(o.iterator) == 'function' ? $bind(o,o.iterator) : o.iterator; };
4561var $_;
4562function $bind(o,m) { var f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; return f; };
4563if(Array.prototype.indexOf) HxOverrides.remove = function(a,o) {
4564 var i = a.indexOf(o);
4565 if(i == -1) return false;
4566 a.splice(i,1);
4567 return true;
4568}; else null;
4569if(String.prototype.cca == null) String.prototype.cca = String.prototype.charCodeAt;
4570Math.__name__ = ["Math"];
4571Math.NaN = Number.NaN;
4572Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
4573Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
4574$hxClasses.Math = Math;
4575Math.isFinite = function(i) {
4576 return isFinite(i);
4577};
4578Math.isNaN = function(i) {
4579 return isNaN(i);
4580};
4581String.prototype.__class__ = $hxClasses.String = String;
4582String.__name__ = ["String"];
4583Array.prototype.__class__ = $hxClasses.Array = Array;
4584Array.__name__ = ["Array"];
4585Date.prototype.__class__ = $hxClasses.Date = Date;
4586Date.__name__ = ["Date"];
4587var Int = $hxClasses.Int = { __name__ : ["Int"]};
4588var Dynamic = $hxClasses.Dynamic = { __name__ : ["Dynamic"]};
4589var Float = $hxClasses.Float = Number;
4590Float.__name__ = ["Float"];
4591var Bool = $hxClasses.Bool = Boolean;
4592Bool.__ename__ = ["Bool"];
4593var Class = $hxClasses.Class = { __name__ : ["Class"]};
4594var Enum = { };
4595var Void = $hxClasses.Void = { __ename__ : ["Void"]};
4596Xml.Element = "element";
4597Xml.PCData = "pcdata";
4598Xml.CData = "cdata";
4599Xml.Comment = "comment";
4600Xml.DocType = "doctype";
4601Xml.Prolog = "prolog";
4602Xml.Document = "document";
4603if(typeof document != "undefined") js.Lib.document = document;
4604if(typeof window != "undefined") {
4605 js.Lib.window = window;
4606 js.Lib.window.onerror = function(msg,url,line) {
4607 var f = js.Lib.onerror;
4608 if(f == null) return false;
4609 return f(msg,[url + ":" + line]);
4610 };
4611}
4612mt.js.Tip.init();
4613js.SWFObject = deconcept.SWFObject;
4614var q = window.jQuery;
4615js.JQuery = q;
4616q.fn.iterator = function() {
4617 return { pos : 0, j : this, hasNext : function() {
4618 return this.pos < this.j.length;
4619 }, next : function() {
4620 return $(this.j[this.pos++]);
4621 }};
4622};
4623js.XMLHttpRequest = window.XMLHttpRequest?XMLHttpRequest:window.ActiveXObject?function() {
4624 try {
4625 return new ActiveXObject("Msxml2.XMLHTTP");
4626 } catch( e ) {
4627 try {
4628 return new ActiveXObject("Microsoft.XMLHTTP");
4629 } catch( e1 ) {
4630 throw "Unable to create XMLHttpRequest object.";
4631 }
4632 }
4633}:(function($this) {
4634 var $r;
4635 throw "Unable to create XMLHttpRequest object.";
4636 return $r;
4637}(this));
4638DateTools.DAYS_OF_MONTH = [31,28,31,30,31,30,31,31,30,31,30,31];
4639haxe.Serializer.USE_CACHE = false;
4640haxe.Serializer.USE_ENUM_INDEX = false;
4641haxe.Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
4642haxe.Unserializer.DEFAULT_RESOLVER = Type;
4643haxe.Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
4644haxe.Unserializer.CODES = null;
4645haxe.remoting.ExternalConnection.connections = new Hash();
4646js.Lib.onerror = null;
4647mt.js.Tip.xOffset = 3;
4648mt.js.Tip.yOffset = 22;
4649mt.js.Tip.defaultClass = "normalTip";
4650mt.js.Tip.tooltipId = "tooltip";
4651mt.js.Tip.tooltipContentId = "tooltipContent";
4652mt.js.Tip.minOffsetY = 23;
4653mt.js.Tip.tipZIndex = 10;
4654mt.js.Timer.timers = new Array();
4655mt.js.Timer.TIMES = "jhms";
4656mt.js.FB.initDone = false;
4657mt.js.FB.todo = null;
4658js.App.ref = [haxe.remoting.ExternalConnection,mt.js.Tip,mt.js.Editor,js.SWFObject,mt.js.Timer,haxe.remoting.FlashJsConnection,js.Scroll,js.Cookie,mt.js.FB,js.JQuery];
4659js.App.muxxuHost = js.Lib.window.location.host.indexOf("local.") == -1?"muxxu.com":"local.muxxu.com";
4660js.App.menuCache = null;
4661js.App.prevMenu = null;
4662js.App.MUID = 0;
4663js.App.commentsURL = "/user";
4664mt.js.Twinoid.boot = null;
4665js.App.main();