$estr = function() { return js.Boot.__string_rec(this,''); }
if(typeof js=='undefined') js = {}
if(!js.fx) js.fx = {}
js.fx.Tip = function(e,titleSeparator,maxTitleLength) { if( e === $_ ) return; {
	if(titleSeparator == null) titleSeparator = "::";
	this.element = e;
	var arg = this.element.getAttribute("title");
	if(arg == null) return;
	var pos = arg.indexOf(titleSeparator);
	if(pos != -1) {
		this.title = arg.substr(0,pos);
		this.content = arg.substr(pos + titleSeparator.length);
	}
	else {
		this.content = arg;
		if(this.element.nodeName == "A" && this.element.getAttribute("href") != null && this.element.getAttribute("href").indexOf("://") != -1) this.title = this.element.getAttribute("href");
		else if(this.element.getAttribute("rel") != null) this.title = this.element.getAttribute("rel");
	}
	if(this.title != null && maxTitleLength != null && this.title.length > maxTitleLength) this.title = this.title.substr(0,maxTitleLength - 1) + "&hellip;";
	this.element.removeAttribute("title");
	e.onmouseover = function(f) {
		return function(a1) {
			return f(a1);
		}
	}($closure(this,"show"));
}}
js.fx.Tip.__name__ = ["js","fx","Tip"];
js.fx.Tip.windowSize = function() {
	var result = { width : js.Lib.window.innerWidth, height : js.Lib.window.innerHeight, scrollLeft : js.Lib.document.body.scrollLeft + js.Lib.document.documentElement.scrollLeft, scrollTop : js.Lib.document.body.scrollTop + js.Lib.document.documentElement.scrollTop}
	var body = (js.Lib.isIE?js.Lib.document.documentElement:js.Lib.document.body);
	if(result.width == null) {
		result.width = body.clientWidth;
		result.height = body.clientHeight;
	}
	return result;
}
js.fx.Tip.prototype.content = null;
js.fx.Tip.prototype.destroyTip = function() {
	js.Lib.document.body.removeChild(this.tip);
}
js.fx.Tip.prototype.element = null;
js.fx.Tip.prototype.generateHtml = function(title,content) {
	return (title != null?((("<div class='tip-title'>" + title) + "</div><div class='tip-content'>") + content) + "</div><div class='tip-footer'></div>":("<div class='tip-content'>" + content) + "</div><div class='tip-footer'></div>");
}
js.fx.Tip.prototype.hide = function(event) {
	this.onHide();
	this.tip = null;
	this.element.onmouseout = null;
	this.element.onmousemove = null;
	this.element.onmouseover = function(f) {
		return function(a1) {
			return f(a1);
		}
	}($closure(this,"show"));
}
js.fx.Tip.prototype.move = function(event) {
	if(this.tip == null) return;
	this.updatePosition(event);
}
js.fx.Tip.prototype.onHide = function() {
	this.destroyTip();
}
js.fx.Tip.prototype.onShow = function() {
	js.fx.Style.setStyles(this.tip,{ opacity : 1});
}
js.fx.Tip.prototype.show = function(event) {
	if(this.tip != null) return;
	this.tip = js.Lib.document.createElement("DIV");
	this.tip.className = "tip";
	this.tip.innerHTML = this.generateHtml(this.title,this.content);
	this.updatePosition(event);
	js.fx.Style.setStyles(this.tip,{ position : "absolute", zIndex : 99999, opacity : 0.0});
	js.Lib.document.body.appendChild(this.tip);
	this.onShow();
	this.element.onmouseover = null;
	this.element.onmouseout = function(f) {
		return function(a1) {
			return f(a1);
		}
	}($closure(this,"hide"));
	this.element.onmousemove = function(f) {
		return function(a1) {
			return f(a1);
		}
	}($closure(this,"move"));
	this.move(event);
}
js.fx.Tip.prototype.tip = null;
js.fx.Tip.prototype.title = null;
js.fx.Tip.prototype.updatePosition = function(event) {
	var window = js.fx.Tip.windowSize();
	var t = { w : this.tip.offsetWidth, h : this.tip.offsetHeight}
	if(t.w == 0 || t.w == null) t.w = js.fx.Tip.minWidth;
	if(t.h == 0 || t.h == null) t.h = js.fx.Tip.minHeight;
	var m = js.fx.Mouse.get(event);
	m.x += js.fx.Tip.offsetX;
	m.y += js.fx.Tip.offsetY;
	if((((m.y + t.h) + js.fx.Tip.offsetY) + 5) >= (window.height - 2) + window.scrollTop) m.y = (m.y - 2 * js.fx.Tip.offsetY) - t.h;
	if((((m.x + t.w) + js.fx.Tip.offsetX) + 5) >= (window.width - 2) + window.scrollLeft) m.x = (m.x - 2 * js.fx.Tip.offsetX) - t.w;
	js.fx.Coordinate.set(this.tip,m);
}
js.fx.Tip.prototype.__class__ = js.fx.Tip;
js.fx.FadingTip = function(e) { if( e === $_ ) return; {
	js.fx.Tip.apply(this,[e]);
}}
js.fx.FadingTip.__name__ = ["js","fx","FadingTip"];
js.fx.FadingTip.__super__ = js.fx.Tip;
for(var k in js.fx.Tip.prototype ) js.fx.FadingTip.prototype[k] = js.fx.Tip.prototype[k];
js.fx.FadingTip.prototype.fx = null;
js.fx.FadingTip.prototype.onHide = function() {
	var tmp = this.tip;
	this.fx.cancel();
	this.fx = new js.fx.Morph(tmp,{ opacity : 0.0});
	this.fx.onComplete = function() {
		js.Lib.document.body.removeChild(tmp);
	}
	this.fx.start();
	this.tip = null;
}
js.fx.FadingTip.prototype.onShow = function() {
	this.fx = new js.fx.Morph(this.tip,{ opacity : 1.0});
	this.fx.start();
}
js.fx.FadingTip.prototype.__class__ = js.fx.FadingTip;
js.Selection = function(doc) { if( doc === $_ ) return; {
	this.doc = doc;
}}
js.Selection.__name__ = ["js","Selection"];
js.Selection.prototype.doc = null;
js.Selection.prototype.get = function() {
	if(this.doc.selectionStart != null) return this.doc.value.substring(this.doc.selectionStart,this.doc.selectionEnd);
	var range = js.Lib.document.selection.createRange();
	if(range.parentElement() != this.doc) return "";
	return range.text;
}
js.Selection.prototype.insert = function(left,text,right) {
	this.doc.focus();
	if(this.doc.selectionStart != null) {
		var top = this.doc.scrollTop;
		var start = this.doc.selectionStart;
		var end = this.doc.selectionEnd;
		this.doc.value = (((this.doc.value.substr(0,start) + left) + text) + right) + this.doc.value.substr(end);
		this.doc.selectionStart = start + left.length;
		this.doc.selectionEnd = (start + left.length) + text.length;
		this.doc.scrollTop = top;
		return;
	}
	var range = js.Lib.document.selection.createRange();
	range.text = (left + text) + right;
	range.moveStart("character",-text.length - right.length);
	range.moveEnd("character",-right.length);
	range.select();
}
js.Selection.prototype.__class__ = js.Selection;
FormChecker = function(p) { if( p === $_ ) return; {
	this.complexity = 0.0;
	this.isMatching = false;
	this.complexityDisplay = js.Lib.document.getElementById("complexityDisplay");
	this.matchingDisplay = js.Lib.document.getElementById("matchingDisplay");
	this.password = js.Lib.document.getElementById("password_input");
	this.passconf = js.Lib.document.getElementById("passconf_input");
	this.password.onchange = $closure(this,"onPasswordChange");
	this.password.onkeyup = $closure(this,"onPasswordChange");
	this.passconf.onchange = $closure(this,"onPassconfChange");
	this.passconf.onkeyup = $closure(this,"onPassconfChange");
}}
FormChecker.__name__ = ["FormChecker"];
FormChecker.prototype.complexity = null;
FormChecker.prototype.complexityDisplay = null;
FormChecker.prototype.isMatching = null;
FormChecker.prototype.matchingDisplay = null;
FormChecker.prototype.onPassconfChange = function(_) {
	this.isMatching = (this.passconf.value == this.password.value);
	this.update();
}
FormChecker.prototype.onPasswordChange = function(_) {
	this.isMatching = false;
	this.onPassconfChange(null);
	this.updateComplexity(this.password.value);
	this.update();
}
FormChecker.prototype.passconf = null;
FormChecker.prototype.password = null;
FormChecker.prototype.update = function() {
	var pct = Std["int"]((Math.min(this.complexity,16) * 100) / 16);
	if(pct < 20) this.complexityDisplay.className = "poor";
	else if(pct < 70) this.complexityDisplay.className = "medium";
	else if(pct < 100) this.complexityDisplay.className = "good";
	else this.complexityDisplay.className = "perfect";
	this.matchingDisplay.className = (this.isMatching?"true":"false");
}
FormChecker.prototype.updateComplexity = function(value) {
	this.complexity = 0;
	this.complexity += Std["int"](Math.min(value.length,11));
	var a = new Array();
	{
		var _g1 = 0, _g = value.length;
		while(_g1 < _g) {
			var i = _g1++;
			var c = value.charAt(i);
			var found = false;
			{
				var _g2 = 0;
				while(_g2 < a.length) {
					var ac = a[_g2];
					++_g2;
					if(ac == c) found = true;
				}
			}
			if(!found) {
				this.complexity += 1;
				a.push(c);
				if(new EReg("[^A-Z0-9]","i").match(c)) this.complexity += 1;
			}
		}
	}
	if(new EReg("^[a-z]+$","").match(value) || new EReg("^[A-Z]+$","").match(value) || new EReg("^[0-9]+$","").match(value)) {
		this.complexity -= 6;
		this.complexity = Math.min(8,this.complexity);
	}
	else if(new EReg("^[a-z0-9]+$","").match(value) || new EReg("^[A-Z0-9]+$","").match(value) || new EReg("^[A-Za-z]+$","").match(value)) {
		this.complexity -= 2;
		this.complexity = Math.min(14,this.complexity);
	}
	this.complexity = Math.max(this.complexity,Math.min(10,value.length) / 2);
}
FormChecker.prototype.__class__ = FormChecker;
StringTools = function() { }
StringTools.__name__ = ["StringTools"];
StringTools.urlEncode = function(s) {
	return encodeURIComponent(s);
}
StringTools.urlDecode = function(s) {
	return decodeURIComponent(s.split("+").join(" "));
}
StringTools.htmlEscape = function(s) {
	return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
StringTools.htmlUnescape = function(s) {
	return s.split("&gt;").join(">").split("&lt;").join("<").split("&amp;").join("&");
}
StringTools.startsWith = function(s,start) {
	return (s.length >= start.length && s.substr(0,start.length) == start);
}
StringTools.endsWith = function(s,end) {
	var elen = end.length;
	var slen = s.length;
	return (slen >= elen && s.substr(slen - elen,elen) == end);
}
StringTools.isSpace = function(s,pos) {
	var c = s.charCodeAt(pos);
	return (c >= 9 && c <= 13) || c == 32;
}
StringTools.ltrim = function(s) {
	var l = s.length;
	var r = 0;
	while(r < l && StringTools.isSpace(s,r)) {
		r++;
	}
	if(r > 0) return s.substr(r,l - r);
	else return s;
}
StringTools.rtrim = function(s) {
	var l = s.length;
	var r = 0;
	while(r < l && StringTools.isSpace(s,(l - r) - 1)) {
		r++;
	}
	if(r > 0) {
		return s.substr(0,l - r);
	}
	else {
		return s;
	}
}
StringTools.trim = function(s) {
	return StringTools.ltrim(StringTools.rtrim(s));
}
StringTools.rpad = function(s,c,l) {
	var sl = s.length;
	var cl = c.length;
	while(sl < l) {
		if(l - sl < cl) {
			s += c.substr(0,l - sl);
			sl = l;
		}
		else {
			s += c;
			sl += cl;
		}
	}
	return s;
}
StringTools.lpad = function(s,c,l) {
	var ns = "";
	var sl = s.length;
	if(sl >= l) return s;
	var cl = c.length;
	while(sl < l) {
		if(l - sl < cl) {
			ns += c.substr(0,l - sl);
			sl = l;
		}
		else {
			ns += c;
			sl += cl;
		}
	}
	return ns + s;
}
StringTools.replace = function(s,sub,by) {
	return s.split(sub).join(by);
}
StringTools.hex = function(n,digits) {
	var s = "";
	var hexChars = "0123456789ABCDEF";
	do {
		s = hexChars.charAt(n & 15) + s;
		n >>>= 4;
	} while(n > 0);
	if(digits != null) while(s.length < digits) s = "0" + s;
	return s;
}
StringTools.prototype.__class__ = StringTools;
EReg = function(r,opt) { if( r === $_ ) return; {
	opt = opt.split("u").join("");
	this.r = new RegExp(r,opt);
}}
EReg.__name__ = ["EReg"];
EReg.prototype.customReplace = function(s,f) {
	var buf = new StringBuf();
	while(true) {
		if(!this.match(s)) break;
		buf.b[buf.b.length] = this.matchedLeft();
		buf.b[buf.b.length] = f(this);
		s = this.matchedRight();
	}
	buf.b[buf.b.length] = s;
	return buf.b.join("");
}
EReg.prototype.match = function(s) {
	this.r.m = this.r.exec(s);
	this.r.s = s;
	this.r.l = RegExp.leftContext;
	this.r.r = RegExp.rightContext;
	return (this.r.m != null);
}
EReg.prototype.matched = function(n) {
	return (this.r.m != null && n >= 0 && n < this.r.m.length?this.r.m[n]:(function($this) {
		var $r;
		throw "EReg::matched";
		return $r;
	}(this)));
}
EReg.prototype.matchedLeft = function() {
	if(this.r.m == null) throw "No string matched";
	if(this.r.l == null) return this.r.s.substr(0,this.r.m.index);
	return this.r.l;
}
EReg.prototype.matchedPos = function() {
	if(this.r.m == null) throw "No string matched";
	return { pos : this.r.m.index, len : this.r.m[0].length}
}
EReg.prototype.matchedRight = function() {
	if(this.r.m == null) throw "No string matched";
	if(this.r.r == null) {
		var sz = this.r.m.index + this.r.m[0].length;
		return this.r.s.substr(sz,this.r.s.length - sz);
	}
	return this.r.r;
}
EReg.prototype.r = null;
EReg.prototype.replace = function(s,by) {
	return s.replace(this.r,by);
}
EReg.prototype.split = function(s) {
	var d = "#__delim__#";
	return s.replace(this.r,d).split(d);
}
EReg.prototype.__class__ = EReg;
Xml = function(p) { if( p === $_ ) return; {
	null;
}}
Xml.__name__ = ["Xml"];
Xml.Element = null;
Xml.PCData = null;
Xml.CData = null;
Xml.Comment = null;
Xml.DocType = null;
Xml.Prolog = null;
Xml.Document = null;
Xml.parse = function(str) {
	var rules = [Xml.enode,Xml.epcdata,Xml.eend,Xml.ecdata,Xml.edoctype,Xml.ecomment,Xml.eprolog];
	var nrules = rules.length;
	var current = Xml.createDocument();
	var stack = new List();
	while(str.length > 0) {
		var i = 0;
		try {
			while(i < nrules) {
				var r = rules[i];
				if(r.match(str)) {
					switch(i) {
					case 0:{
						var x = Xml.createElement(r.matched(1));
						current.addChild(x);
						str = r.matchedRight();
						while(Xml.eattribute.match(str)) {
							x.set(Xml.eattribute.matched(1),Xml.eattribute.matched(3));
							str = Xml.eattribute.matchedRight();
						}
						if(!Xml.eclose.match(str)) {
							i = nrules;
							throw "__break__";
						}
						if(Xml.eclose.matched(1) == ">") {
							stack.push(current);
							current = x;
						}
						str = Xml.eclose.matchedRight();
					}break;
					case 1:{
						var x = Xml.createPCData(r.matched(0));
						current.addChild(x);
						str = r.matchedRight();
					}break;
					case 2:{
						if(current._children != null && current._children.length == 0) {
							var e = Xml.createPCData("");
							current.addChild(e);
						}
						else null;
						if(r.matched(1) != current._nodeName || stack.isEmpty()) {
							i = nrules;
							throw "__break__";
						}
						else null;
						current = stack.pop();
						str = r.matchedRight();
					}break;
					case 3:{
						str = r.matchedRight();
						if(!Xml.ecdata_end.match(str)) throw "End of CDATA section not found";
						var x = Xml.createCData(Xml.ecdata_end.matchedLeft());
						current.addChild(x);
						str = Xml.ecdata_end.matchedRight();
					}break;
					case 4:{
						var pos = 0;
						var count = 0;
						var old = str;
						try {
							while(true) {
								if(!Xml.edoctype_elt.match(str)) throw "End of DOCTYPE section not found";
								var p = Xml.edoctype_elt.matchedPos();
								pos += p.pos + p.len;
								str = Xml.edoctype_elt.matchedRight();
								switch(Xml.edoctype_elt.matched(0)) {
								case "[":{
									count++;
								}break;
								case "]":{
									count--;
									if(count < 0) throw "Invalid ] found in DOCTYPE declaration";
								}break;
								default:{
									if(count == 0) throw "__break__";
								}break;
								}
							}
						} catch( e ) { if( e != "__break__" ) throw e; }
						var x = Xml.createDocType(old.substr(10,pos - 11));
						current.addChild(x);
					}break;
					case 5:{
						if(!Xml.ecomment_end.match(str)) throw "Unclosed Comment";
						var p = Xml.ecomment_end.matchedPos();
						var x = Xml.createComment(str.substr(4,(p.pos + p.len) - 7));
						current.addChild(x);
						str = Xml.ecomment_end.matchedRight();
					}break;
					case 6:{
						var prolog = r.matched(0);
						var x = Xml.createProlog(prolog.substr(2,prolog.length - 4));
						current.addChild(x);
						str = r.matchedRight();
					}break;
					}
					throw "__break__";
				}
				i += 1;
			}
		} catch( e ) { if( e != "__break__" ) throw e; }
		if(i == nrules) {
			if(str.length > 10) throw (("Xml parse error : Unexpected " + str.substr(0,10)) + "...");
			else throw ("Xml parse error : Unexpected " + str);
		}
	}
	if(!stack.isEmpty()) throw "Xml parse error : Unclosed " + stack.last().getNodeName();
	return current;
}
Xml.createElement = function(name) {
	var r = new Xml();
	r.nodeType = Xml.Element;
	r._children = new Array();
	r._attributes = new Hash();
	r.setNodeName(name);
	return r;
}
Xml.createPCData = function(data) {
	var r = new Xml();
	r.nodeType = Xml.PCData;
	r.setNodeValue(data);
	return r;
}
Xml.createCData = function(data) {
	var r = new Xml();
	r.nodeType = Xml.CData;
	r.setNodeValue(data);
	return r;
}
Xml.createComment = function(data) {
	var r = new Xml();
	r.nodeType = Xml.Comment;
	r.setNodeValue(data);
	return r;
}
Xml.createDocType = function(data) {
	var r = new Xml();
	r.nodeType = Xml.DocType;
	r.setNodeValue(data);
	return r;
}
Xml.createProlog = function(data) {
	var r = new Xml();
	r.nodeType = Xml.Prolog;
	r.setNodeValue(data);
	return r;
}
Xml.createDocument = function() {
	var r = new Xml();
	r.nodeType = Xml.Document;
	r._children = new Array();
	return r;
}
Xml.prototype._attributes = null;
Xml.prototype._children = null;
Xml.prototype._nodeName = null;
Xml.prototype._nodeValue = null;
Xml.prototype._parent = null;
Xml.prototype.addChild = function(x) {
	if(this._children == null) throw "bad nodetype";
	if(x._parent != null) x._parent._children.remove(x);
	x._parent = this;
	this._children.push(x);
}
Xml.prototype.attributes = function() {
	if(this.nodeType != Xml.Element) throw "bad nodeType";
	return this._attributes.keys();
}
Xml.prototype.elements = function() {
	if(this._children == null) throw "bad nodetype";
	return { cur : 0, x : this._children, hasNext : function() {
		var k = this.cur;
		var l = this.x.length;
		while(k < l) {
			if(this.x[k].nodeType == Xml.Element) break;
			k += 1;
		}
		this.cur = k;
		return k < l;
	}, next : function() {
		var k = this.cur;
		var l = this.x.length;
		while(k < l) {
			var n = this.x[k];
			k += 1;
			if(n.nodeType == Xml.Element) {
				this.cur = k;
				return n;
			}
		}
		return null;
	}}
}
Xml.prototype.elementsNamed = function(name) {
	if(this._children == null) throw "bad nodetype";
	return { cur : 0, x : this._children, hasNext : function() {
		var k = this.cur;
		var l = this.x.length;
		while(k < l) {
			var n = this.x[k];
			if(n.nodeType == Xml.Element && n._nodeName == name) break;
			k++;
		}
		this.cur = k;
		return k < l;
	}, next : function() {
		var k = this.cur;
		var l = this.x.length;
		while(k < l) {
			var n = this.x[k];
			k++;
			if(n.nodeType == Xml.Element && n._nodeName == name) {
				this.cur = k;
				return n;
			}
		}
		return null;
	}}
}
Xml.prototype.exists = function(att) {
	if(this.nodeType != Xml.Element) throw "bad nodeType";
	return this._attributes.exists(att);
}
Xml.prototype.firstChild = function() {
	if(this._children == null) throw "bad nodetype";
	return this._children[0];
}
Xml.prototype.firstElement = function() {
	if(this._children == null) throw "bad nodetype";
	var cur = 0;
	var l = this._children.length;
	while(cur < l) {
		var n = this._children[cur];
		if(n.nodeType == Xml.Element) return n;
		cur++;
	}
	return null;
}
Xml.prototype.get = function(att) {
	if(this.nodeType != Xml.Element) throw "bad nodeType";
	return this._attributes.get(att);
}
Xml.prototype.getNodeName = function() {
	if(this.nodeType != Xml.Element) throw "bad nodeType";
	return this._nodeName;
}
Xml.prototype.getNodeValue = function() {
	if(this.nodeType == Xml.Element || this.nodeType == Xml.Document) throw "bad nodeType";
	return this._nodeValue;
}
Xml.prototype.getParent = function() {
	return this._parent;
}
Xml.prototype.insertChild = function(x,pos) {
	if(this._children == null) throw "bad nodetype";
	if(x._parent != null) x._parent._children.remove(x);
	x._parent = this;
	this._children.insert(pos,x);
}
Xml.prototype.iterator = function() {
	if(this._children == null) throw "bad nodetype";
	return { cur : 0, x : this._children, hasNext : function() {
		return this.cur < this.x.length;
	}, next : function() {
		return this.x[this.cur++];
	}}
}
Xml.prototype.nodeName = null;
Xml.prototype.nodeType = null;
Xml.prototype.nodeValue = null;
Xml.prototype.parent = null;
Xml.prototype.remove = function(att) {
	if(this.nodeType != Xml.Element) throw "bad nodeType";
	this._attributes.remove(att);
}
Xml.prototype.removeChild = function(x) {
	if(this._children == null) throw "bad nodetype";
	var b = this._children.remove(x);
	if(b) x._parent = null;
	return b;
}
Xml.prototype.set = function(att,value) {
	if(this.nodeType != Xml.Element) throw "bad nodeType";
	this._attributes.set(att,value);
}
Xml.prototype.setNodeName = function(n) {
	if(this.nodeType != Xml.Element) throw "bad nodeType";
	return this._nodeName = n;
}
Xml.prototype.setNodeValue = function(v) {
	if(this.nodeType == Xml.Element || this.nodeType == Xml.Document) throw "bad nodeType";
	return this._nodeValue = v;
}
Xml.prototype.toString = function() {
	if(this.nodeType == Xml.PCData) return this._nodeValue;
	if(this.nodeType == Xml.CData) return ("<![CDATA[" + this._nodeValue) + "]]>";
	if(this.nodeType == Xml.Comment) return ("<!--" + this._nodeValue) + "-->";
	if(this.nodeType == Xml.DocType) return ("<!DOCTYPE " + this._nodeValue) + ">";
	if(this.nodeType == Xml.Prolog) return ("<?" + this._nodeValue) + "?>";
	var s = new StringBuf();
	if(this.nodeType == Xml.Element) {
		s.b[s.b.length] = "<";
		s.b[s.b.length] = this._nodeName;
		{ var $it0 = this._attributes.keys();
		while( $it0.hasNext() ) { var k = $it0.next();
		{
			s.b[s.b.length] = " ";
			s.b[s.b.length] = k;
			s.b[s.b.length] = "=\"";
			s.b[s.b.length] = this._attributes.get(k);
			s.b[s.b.length] = "\"";
		}
		}}
		if(this._children.length == 0) {
			s.b[s.b.length] = "/>";
			return s.b.join("");
		}
		s.b[s.b.length] = ">";
	}
	{ var $it1 = this.iterator();
	while( $it1.hasNext() ) { var x = $it1.next();
	s.b[s.b.length] = x.toString();
	}}
	if(this.nodeType == Xml.Element) {
		s.b[s.b.length] = "</";
		s.b[s.b.length] = this._nodeName;
		s.b[s.b.length] = ">";
	}
	return s.b.join("");
}
Xml.prototype.__class__ = Xml;
Reflect = function() { }
Reflect.__name__ = ["Reflect"];
Reflect.hasField = function(o,field) {
	if(o.hasOwnProperty != null) return o.hasOwnProperty(field);
	var arr = Reflect.fields(o);
	{ var $it0 = arr.iterator();
	while( $it0.hasNext() ) { var t = $it0.next();
	if(t == field) return true;
	}}
	return false;
}
Reflect.field = function(o,field) {
	var v = null;
	try {
		v = o[field];
	}
	catch( $e0 ) {
		{
			var e = $e0;
			null;
		}
	}
	return v;
}
Reflect.setField = function(o,field,value) {
	o[field] = value;
}
Reflect.callMethod = function(o,func,args) {
	return func.apply(o,args);
}
Reflect.fields = function(o) {
	if(o == null) return new Array();
	var a = new Array();
	if(o.hasOwnProperty) {
		
				for(var i in o)
					if( o.hasOwnProperty(i) )
						a.push(i);
			;
	}
	else {
		var t;
		try {
			t = o.__proto__;
		}
		catch( $e0 ) {
			{
				var e = $e0;
				{
					t = null;
				}
			}
		}
		if(t != null) o.__proto__ = null;
		
				for(var i in o)
					if( i != "__proto__" )
						a.push(i);
			;
		if(t != null) o.__proto__ = t;
	}
	return a;
}
Reflect.isFunction = function(f) {
	return typeof(f) == "function" && f.__name__ == null;
}
Reflect.compare = function(a,b) {
	return ((a == b)?0:((((a) > (b))?1:-1)));
}
Reflect.compareMethods = function(f1,f2) {
	if(f1 == f2) return true;
	if(!Reflect.isFunction(f1) || !Reflect.isFunction(f2)) return false;
	return f1.scope == f2.scope && f1.method == f2.method && f1.method != null;
}
Reflect.isObject = function(v) {
	if(v == null) return false;
	var t = typeof(v);
	return (t == "string" || (t == "object" && !v.__enum__) || (t == "function" && v.__name__ != null));
}
Reflect.deleteField = function(o,f) {
	if(!Reflect.hasField(o,f)) return false;
	delete(o[f]);
	return true;
}
Reflect.copy = function(o) {
	var o2 = { }
	{
		var _g = 0, _g1 = Reflect.fields(o);
		while(_g < _g1.length) {
			var f = _g1[_g];
			++_g;
			o2[f] = Reflect.field(o,f);
		}
	}
	return o2;
}
Reflect.makeVarArgs = function(f) {
	return function() {
		var a = new Array();
		{
			var _g1 = 0, _g = arguments.length;
			while(_g1 < _g) {
				var i = _g1++;
				a.push(arguments[i]);
			}
		}
		return f(a);
	}
}
Reflect.prototype.__class__ = Reflect;
js.fx.TransitionParam = { __ename__ : ["js","fx","TransitionParam"], __constructs__ : ["In","Out","InOut"] }
js.fx.TransitionParam.In = ["In",0];
js.fx.TransitionParam.In.toString = $estr;
js.fx.TransitionParam.In.__enum__ = js.fx.TransitionParam;
js.fx.TransitionParam.InOut = ["InOut",2];
js.fx.TransitionParam.InOut.toString = $estr;
js.fx.TransitionParam.InOut.__enum__ = js.fx.TransitionParam;
js.fx.TransitionParam.Out = ["Out",1];
js.fx.TransitionParam.Out.toString = $estr;
js.fx.TransitionParam.Out.__enum__ = js.fx.TransitionParam;
if(typeof haxe=='undefined') haxe = {}
haxe.Log = function() { }
haxe.Log.__name__ = ["haxe","Log"];
haxe.Log.trace = function(v,infos) {
	js.Boot.__trace(v,infos);
}
haxe.Log.clear = function() {
	js.Boot.__clear_trace();
}
haxe.Log.prototype.__class__ = haxe.Log;
Prompt = function() { }
Prompt.__name__ = ["Prompt"];
Prompt.run = function(title,def,cb) {
	if(js.Lib.window.navigator.userAgent.indexOf("MSIE 7") == -1) {
		cb(js.Lib.window.prompt(title,def));
		return;
	}
	var bg = js.Lib.document.createElement("div");
	js.Lib.document.body.appendChild(bg);
	var all = js.Lib.document.createElement("div");
	js.Lib.document.body.appendChild(all);
	bg.style.opacity = "0.9";
	bg.style.position = "absolute";
	bg.style.top = "0px";
	bg.style.left = "0px";
	bg.style.display = "block";
	bg.style.backgroundColor = "#777777";
	bg.style.filter = "alpha(opacity=90)";
	bg.style.height = (js.Lib.document.body.offsetHeight < js.Lib.window.screen.height?js.Lib.window.screen.height + "px":(js.Lib.document.body.offsetHeight + 20) + "px");
	bg.style.width = "100%";
	bg.style.zIndex = 5000;
	all.style.border = "2px solid black";
	all.style.backgroundColor = "#DDDDDD";
	all.style.position = "absolute";
	all.style.display = "block";
	all.style.width = "300px";
	all.style.height = "100px";
	all.style.zIndex = 5001;
	var stop = js.Lib.document.documentElement.scrollTop;
	if(stop == null) stop = 0;
	var scrh = js.Lib.window.screen.height;
	if(scrh == null) scrh = 0;
	all.style.top = Math.round(stop + (scrh / 3)) + "px";
	all.style.left = Math.round((js.Lib.document.body.offsetWidth - 315) / 2) + "px";
	all.style.textAlign = "center";
	var h3 = js.Lib.document.createElement("div");
	h3.style.fontWeight = "bold";
	h3.innerHTML = title;
	all.appendChild(h3);
	var result = js.Lib.document.createElement("input");
	result.type = "text";
	result.value = def;
	all.appendChild(result);
	var row = js.Lib.document.createElement("div");
	row.style.marginTop = "10px";
	all.appendChild(row);
	var input = js.Lib.document.createElement("button");
	input.className = "cancel";
	input.innerHTML = "Cancel";
	input.onclick = function(e) {
		cb(null);
		js.Lib.document.body.removeChild(all);
		js.Lib.document.body.removeChild(bg);
	}
	row.appendChild(input);
	var input1 = js.Lib.document.createElement("button");
	input1.innerHTML = "OK";
	input1.onclick = function(e) {
		cb(result.value);
		js.Lib.document.body.removeChild(all);
		js.Lib.document.body.removeChild(bg);
	}
	row.appendChild(input1);
	result.focus();
}
Prompt.prototype.__class__ = Prompt;
List = function(p) { if( p === $_ ) return; {
	this.length = 0;
}}
List.__name__ = ["List"];
List.prototype.add = function(item) {
	var x = [item];
	if(this.h == null) this.h = x;
	else this.q[1] = x;
	this.q = x;
	this.length++;
}
List.prototype.clear = function() {
	this.h = null;
	this.q = null;
	this.length = 0;
}
List.prototype.filter = function(f) {
	var l2 = new List();
	var l = this.h;
	while(l != null) {
		var v = l[0];
		l = l[1];
		if(f(v)) l2.add(v);
	}
	return l2;
}
List.prototype.first = function() {
	return (this.h == null?null:this.h[0]);
}
List.prototype.h = null;
List.prototype.isEmpty = function() {
	return (this.h == null);
}
List.prototype.iterator = function() {
	return { h : this.h, hasNext : function() {
		return (this.h != null);
	}, next : function() {
		if(this.h == null) return null;
		var x = this.h[0];
		this.h = this.h[1];
		return x;
	}}
}
List.prototype.join = function(sep) {
	var s = new StringBuf();
	var first = true;
	var l = this.h;
	while(l != null) {
		if(first) first = false;
		else s.b[s.b.length] = sep;
		s.b[s.b.length] = l[0];
		l = l[1];
	}
	return s.b.join("");
}
List.prototype.last = function() {
	return (this.q == null?null:this.q[0]);
}
List.prototype.length = null;
List.prototype.map = function(f) {
	var b = new List();
	var l = this.h;
	while(l != null) {
		var v = l[0];
		l = l[1];
		b.add(f(v));
	}
	return b;
}
List.prototype.pop = function() {
	if(this.h == null) return null;
	var x = this.h[0];
	this.h = this.h[1];
	if(this.h == null) this.q = null;
	this.length--;
	return x;
}
List.prototype.push = function(item) {
	var x = [item,this.h];
	this.h = x;
	if(this.q == null) this.q = x;
	this.length++;
}
List.prototype.q = null;
List.prototype.remove = function(v) {
	var prev = null;
	var l = this.h;
	while(l != null) {
		if(l[0] == v) {
			if(prev == null) this.h = l[1];
			else prev[1] = l[1];
			if(this.q == l) this.q = prev;
			this.length--;
			return true;
		}
		prev = l;
		l = l[1];
	}
	return false;
}
List.prototype.toString = function() {
	var s = new StringBuf();
	var first = true;
	var l = this.h;
	s.b[s.b.length] = "{";
	while(l != null) {
		if(first) first = false;
		else s.b[s.b.length] = ", ";
		s.b[s.b.length] = Std.string(l[0]);
		l = l[1];
	}
	s.b[s.b.length] = "}";
	return s.b.join("");
}
List.prototype.__class__ = List;
Js = function() { }
Js.__name__ = ["Js"];
Js.foreach = function(l,f) {
	{ var $it0 = l.iterator();
	while( $it0.hasNext() ) { var t = $it0.next();
	f(t);
	}}
}
Js.findElementsWithClassName = function(parent,tag,className) {
	if(parent == null) parent = js.Lib.document.body;
	if(tag == null) tag = "*";
	var elements = (tag == "*" && parent.all != null?parent.all:parent.getElementsByTagName(tag));
	var results = new List();
	var regexp = new EReg(("(^|\\s)" + className) + "(\\s|$)","");
	{
		var _g1 = 0, _g = elements.length;
		while(_g1 < _g) {
			var i = _g1++;
			if(Std.string(elements[i].className) == "") continue;
			if(regexp.match("" + elements[i].className)) results.push(elements[i]);
		}
	}
	return results;
}
Js.findElementsWithAttribute = function(parent,tag,attribute) {
	if(parent == null) parent = js.Lib.document.body;
	if(tag == null) tag = "*";
	var elements = (tag == "*" && parent.all != null?parent.all:parent.getElementsByTagName(tag));
	var results = new List();
	{
		var _g1 = 0, _g = elements.length;
		while(_g1 < _g) {
			var i = _g1++;
			var att = elements[i].getAttribute(attribute);
			if(att != null && att != "") results.push(elements[i]);
		}
	}
	return results;
}
Js.tipHtmlMaker = function(title,content) {
	return ((("\t\n\t\t\t<div class=\"tip-wrap\">\n\t\t\t\t<div class=\"tip-star\"></div>\n\t\t\t\t<div class=\"tip-inner\">" + ((title == null?"":("<div class=\"tip-title\">" + title) + "</div>"))) + "\n\t\t\t\t\t<div class=\"tip-content\"><p>") + content) + "</p></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"tip-foot\"></div>\n\t\t\t";
}
Js.applyTips = function(element) {
	if(element != null) { var $it0 = Js.findElementsWithAttribute(element,"*","title").iterator();
	while( $it0.hasNext() ) { var e = $it0.next();
	{
		var tip = new js.fx.Tip(e," : ");
		tip.generateHtml = $closure(Js,"tipHtmlMaker");
	}
	}}
}
Js.init = function() {
	Js.applyTips(js.Lib.document.getElementById("statBar"));
	Js.applyTips(js.Lib.document.getElementById("mainBar"));
	Js.applyTips(js.Lib.document.getElementById("mainContainer"));
}
Js.editClanMemberStatus = function(id) {
	var res = Prompt.run("Entrez le nouveau statut :",StringTools.htmlUnescape(js.Lib.document.getElementById("status" + id).innerHTML),function(res) {
		if(res == null) return;
		var req = new haxe.Http("/clan/editMemberStatus");
		req.async = false;
		req.setParameter("id",Std.string(id));
		req.setParameter("st",res);
		req.request(true);
		js.Lib.window.location.reload();
	});
	return false;
}
Js.insertContractObjective = function(contract,prize) {
	var o = { id : Js.objectives.length + 1, score : contract, done : false}
	Js.objectives.push(o);
	Js.objectives.sort(function(a,b) {
		return (a.score == b.score?0:(a.score < b.score?1:-1));
	});
	var next = null;
	{
		var _g1 = 0, _g = Js.objectives.length;
		while(_g1 < _g) {
			var i = _g1++;
			if((Js.objectives[i] == o) && (i + 1 < Js.objectives.length) && (Js.objectives[i + 1] != null)) {
				next = Js.objectives[i + 1].id;
				break;
			}
		}
	}
	var next1 = (next == null?null:js.Lib.document.getElementById("line" + next));
	var newNode = js.Lib.document.createElement("tr");
	newNode.id = "line" + o.id;
	if(js.Lib.document.getElementById("contractObjectiveTip") != null) newNode.setAttribute("title",js.Lib.document.getElementById("contractObjectiveTip").innerHTML);
	var tip = new js.fx.Tip(newNode," : ");
	tip.generateHtml = $closure(Js,"tipHtmlMaker");
	var td = js.Lib.document.createElement("td");
	td.className = "icon";
	td.innerHTML = ("<img style=\"display:none;\" id=\"target" + o.id) + "\" src=\"/gfx/icons/here.gif\" alt=\"objectif\"/>";
	newNode.appendChild(td);
	var td1 = js.Lib.document.createElement("td");
	td1.className = "left";
	td1.innerHTML = ("<img src=\"/gfx/icons/contract.gif\" alt=\"Contrat\"/> <span class=\"num2img\">" + Js.numberToImage("/gfx/typo/sred",o.score)) + "</span>";
	newNode.appendChild(td1);
	var td2 = js.Lib.document.createElement("td");
	td2.className = "right";
	td2.innerHTML = ("<span class=\"smallKpoints\">" + Js.numberToImage("/gfx/typo/skpt",prize)) + "</span>";
	newNode.appendChild(td2);
	var table = js.Lib.document.getElementById("objectives");
	if(next1 != null) table.insertBefore(newNode,next1);
	else table.appendChild(newNode);
	{
		var _g1 = 0, _g = Js.objectives.length;
		while(_g1 < _g) {
			var i = _g1++;
			if(Js.objectives[i] != null) js.Lib.document.getElementById("line" + Js.objectives[i].id).className = ((i + 1) % 2 == 0?"even":"odd");
		}
	}
}
Js.addChrono = function(divId,seconds) {
	Js.chronos.push({ div : js.Lib.document.getElementById(divId), seconds : seconds});
}
Js.loopChronos = function() {
	{ var $it0 = Js.chronos.iterator();
	while( $it0.hasNext() ) { var chrono = $it0.next();
	{
		chrono.seconds--;
		chrono.div.innerHTML = Common.chrono(chrono.seconds);
		if(chrono.seconds <= 0) Js.chronos.remove(chrono);
	}
	}}
	haxe.Timer.delay($closure(Js,"loopChronos"),999);
}
Js.bookmarkGame = function(id) {
	haxe.Http.requestUrl(("/game/" + id) + "/bookmark.xml");
	Js.toggleVisible("gameBookmark");
	Js.toggleVisible("gameUnbookmark");
	var mygames = js.Lib.document.getElementById("mygames");
	if(mygames != null && mygames.style.display == "none") js.Lib.document.getElementById("mygames").style.display = "block";
}
Js.unbookmarkGame = function(id) {
	haxe.Http.requestUrl(("/game/" + id) + "/unbookmark.xml");
	Js.toggleVisible("gameBookmark");
	Js.toggleVisible("gameUnbookmark");
}
Js.toggleVisible = function(id) {
	var e = js.Lib.document.getElementById(id);
	if(e == null) return false;
	if(e.style.display == "none") e.style.display = "block";
	else e.style.display = "none";
	return false;
}
Js.load = function(url,id) {
	var request = new haxe.Http(url);
	request.onData = function(data) {
		js.Lib.document.getElementById(id).innerHTML = data;
	}
	request.request(null);
}
Js.selectJumpsTo = function(id,url) {
	var box = js.Lib.document.getElementById(id);
	js.Lib.window.location.href = url + (box.options[box.selectedIndex]).value;
}
Js.loadForm = function(form,id) {
	var h = new Hash();
	var l = form.elements;
	{
		var _g1 = 0, _g = l.length;
		while(_g1 < _g) {
			var i = _g1++;
			var e = l[i];
			if(e.name == null || e.name == "") continue;
			if((e.type != "checkbox" && e.type != "radio") || e.checked) h.set(e.name,e.value);
		}
	}
	var r = new haxe.Http(form.action);
	{ var $it0 = h.keys();
	while( $it0.hasNext() ) { var k = $it0.next();
	r.setParameter(k,h.get(k));
	}}
	form.onsubmit = function(e) {
		return false;
	}
	var dat = null;
	r.onData = function(d) {
		dat = d;
		form.onsubmit = function(e) {
			return Js.loadForm(form,id);
		}
	}
	r.onError = function(e) {
		throw e;
	}
	r.async = false;
	r.request(true);
	Js.setTokens(dat);
	js.Lib.document.getElementById(id).innerHTML = dat;
	return false;
}
Js.setTokens = function(data) {
	var mark = "class=\"setTokens";
	var start = data.indexOf(mark);
	if(start == -1) return;
	start += mark.length;
	var end = data.indexOf("\"",start);
	var val = data.substr(start,end - start);
	js.Lib.document.getElementById("redGems").innerHTML = Js.numberToImage("/gfx/typo/red",Std.parseInt(val));
}
Js.gameStart = function(remainGreen,remainRed,contract,prize) {
	Js.updateTokens(remainGreen,remainRed);
	if(contract != null) Js.insertContractObjective(contract,prize);
	var link = js.Lib.document.getElementById("rankingLink");
	if(link != null) link.style.display = "none";
}
Js.updateTokens = function(green,red) {
	js.Lib.document.getElementById("greenGems").innerHTML = Js.numberToImage("/gfx/typo/green",green);
	js.Lib.document.getElementById("redGems").innerHTML = Js.numberToImage("/gfx/typo/red",red);
}
Js.updateKpoints = function(value) {
	js.Lib.document.getElementById("kpoints").innerHTML = Js.numberToImage("/gfx/typo/skpoints",value);
}
Js.number = function(n) {
	if(n == null) return "";
	if(n < 1000) return Std.string(n);
	var r = Std.string(n);
	var i = r.length - 3;
	var p = new List();
	while(i > 0) {
		p.push(r.substr(i,3));
		i = i - 3;
	}
	if(i <= 0) p.push(r.substr(0,i + 3));
	return p.join(".");
}
Js.numberToImage = function(fonts,n) {
	var str = Js.number(n);
	var res = new StringBuf();
	{
		var _g1 = 0, _g = str.length;
		while(_g1 < _g) {
			var i = _g1++;
			var c = str.charAt(i);
			res.b[res.b.length] = "<img alt=\"";
			res.b[res.b.length] = c;
			res.b[res.b.length] = "\" src=\"";
			res.b[res.b.length] = fonts;
			res.b[res.b.length] = "/";
			if(c == ".") {
				res.b[res.b.length] = "dot";
			}
			else {
				res.b[res.b.length] = c;
			}
			res.b[res.b.length] = ".gif\"/>";
		}
	}
	return res.b.join("");
}
Js.getPreferedTab = function() {
	var value = js.Cookie.get("preferedTab");
	if(value == null) return "info";
	return value;
}
Js.setPreferedTab = function(str) {
	js.Cookie.set("preferedTab",str,31104000,"/");
}
Js.prototype.__class__ = Js;
Toc = function() { }
Toc.__name__ = ["Toc"];
Toc.generateTableOfContent = function(contentId,tocId) {
	var content = js.Lib.document.getElementById(contentId);
	if(content == null) throw ("Unable to find element with id '" + contentId) + "'";
	var createLink = function(base,dest,id,lvl) {
		var a = Xml.createElement("a");
		dest.addChild(a);
		if(base.getAttribute("id") != null && base.getAttribute("id") != "") {
			a.set("href","#" + base.getAttribute("id"));
		}
		else {
			a.set("href","#" + id);
			base.id = id;
		}
		var text = Xml.createPCData(base.innerHTML);
		a.addChild(text);
		base.innerHTML = ((("<a href='#'>" + lvl.join(".")) + ". ") + base.innerHTML) + "</a>";
		base.innerHTML = base.innerHTML;
	}
	var h1i = 0;
	var xh1 = null;
	var h2i = 0;
	var xh2 = null;
	var baseh2 = null;
	var h3i = 0;
	var xh3 = null;
	var baseh3 = null;
	var result = Xml.createElement("ol");
	var node = content.firstChild;
	while(node != null) {
		switch(node.nodeName) {
		case "H2":{
			xh1 = Xml.createElement("li");
			result.addChild(xh1);
			createLink(node,xh1,"h1n" + (++h1i),[h1i]);
			h2i = 0;
			baseh2 = null;
			h3i = 0;
			baseh3 = null;
		}break;
		case "H3":{
			if(baseh2 == null) {
				baseh2 = Xml.createElement("ol");
				if(xh1 != null) xh1.addChild(baseh2);
			}
			xh2 = Xml.createElement("li");
			baseh2.addChild(xh2);
			createLink(node,xh2,(("h2n" + (h1i)) + "n") + (++h2i),[h1i,h2i]);
			h3i = 0;
			baseh3 = null;
		}break;
		case "H4":{
			if(baseh3 == null) {
				baseh3 = Xml.createElement("ol");
				if(xh2 != null) xh2.addChild(baseh3);
			}
			xh3 = Xml.createElement("li");
			baseh3.addChild(xh3);
			createLink(node,xh3,(((("h3n" + (h1i)) + "n") + (h2i)) + "n") + (++h3i),[h1i,h2i,h3i]);
		}break;
		}
		node = node.nextSibling;
	}
	var tocDiv = js.Lib.document.getElementById(tocId);
	if(tocDiv != null) {
		tocDiv.innerHTML = result.toString();
	}
	else {
		content.innerHTML = (((("<div id='" + tocId) + "'>") + result.toString()) + "</div>") + content.innerHTML;
	}
	return result.toString();
}
Toc.prototype.__class__ = Toc;
Common = function() { }
Common.__name__ = ["Common"];
Common.pointsToScore = function(baseScore,baseFactor,points) {
	if(points == 0) return 0;
	if(points < 1000) return Math.ceil((points * baseScore) / 1000);
	var p = (points - 1) + 0.999;
	var s = ((((p / 1000) - 1) * baseScore) / baseFactor) + baseScore;
	return Math.ceil(s);
}
Common.scoreToPoints = function(baseScore,baseFactor,score) {
	if(score == null || score == 0) return 0;
	if(baseScore == null) return 0;
	var factor = (score < baseScore?1:baseFactor);
	var points = Math.floor((((score - baseScore) / baseScore) * factor + 1) * 1000.0);
	return Std["int"](Math.min(points,1500));
}
Common.scoreStar = function(baseScore,baseFactor,score) {
	var points = Common.scoreToPoints(baseScore,baseFactor,score);
	return (points < 1000?"":(points < 1100?"green":(points < 1150?"orange":"red")));
}
Common.chrono = function(s) {
	if(s <= 0) return "--:--:--";
	var h = Math.floor(s / 3600);
	s = s % 3600;
	var m = Math.floor(s / 60);
	s = s % 60;
	return (((h <= 0?"":(h < 10?("0" + h) + "h ":h + "h "))) + ((h <= 0 && m <= 0?"":(m < 10?("0" + m) + "m ":m + "m ")))) + ((s < 10?("0" + s) + "s":s + "s"));
}
Common.prototype.__class__ = Common;
StringBuf = function(p) { if( p === $_ ) return; {
	this.b = new Array();
}}
StringBuf.__name__ = ["StringBuf"];
StringBuf.prototype.add = function(x) {
	this.b[this.b.length] = x;
}
StringBuf.prototype.addChar = function(c) {
	this.b[this.b.length] = String.fromCharCode(c);
}
StringBuf.prototype.addSub = function(s,pos,len) {
	this.b[this.b.length] = s.substr(pos,len);
}
StringBuf.prototype.b = null;
StringBuf.prototype.toString = function() {
	return this.b.join("");
}
StringBuf.prototype.__class__ = StringBuf;
js.fx.Coordinate = function() { }
js.fx.Coordinate.__name__ = ["js","fx","Coordinate"];
js.fx.Coordinate.getAbsoluteDiff = function(e) {
	var p = e;
	while(p != null) {
		if(p.style != null) {
			var s = js.fx.Style.getStyles(p,{ position : "", left : "", right : "", top : "", bottom : ""});
			if(s.left != "auto" || s.top != "auto" || s.right != "auto" || s.bottom != "auto") {
				return (e == p?js.fx.Coordinate.of(e.offsetParent):js.fx.Coordinate.of(p));
			}
		}
		p = p.parentNode;
	}
	return { x : 0, y : 0, w : 0, h : 0}
}
js.fx.Coordinate.of = function(e) {
	var p = e;
	var x = 0;
	var y = 0;
	var h = e.clientHeight;
	var w = e.clientWidth;
	x = e.offsetLeft;
	y = e.offsetTop;
	var off = e.offsetParent;
	while(off != null) {
		x += off.offsetLeft;
		y += off.offsetTop;
		off = off.offsetParent;
	}
	return { x : x, y : y, h : h, w : w}
}
js.fx.Coordinate.set = function(e,c) {
	e.style.left = c.x + "px";
	e.style.top = c.y + "px";
}
js.fx.Coordinate.prototype.__class__ = js.fx.Coordinate;
if(!haxe.remoting) haxe.remoting = {}
haxe.remoting.Connection = function() { }
haxe.remoting.Connection.__name__ = ["haxe","remoting","Connection"];
haxe.remoting.Connection.prototype.call = null;
haxe.remoting.Connection.prototype.resolve = null;
haxe.remoting.Connection.prototype.__class__ = haxe.remoting.Connection;
Hash = function(p) { if( p === $_ ) return; {
	this.h = {}
	if(this.h.__proto__ != null) {
		this.h.__proto__ = null;
		delete(this.h.__proto__);
	}
	else null;
}}
Hash.__name__ = ["Hash"];
Hash.prototype.exists = function(key) {
	try {
		key = "$" + key;
		return this.hasOwnProperty.call(this.h,key);
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				
				for(var i in this.h)
					if( i == key ) return true;
			;
				return false;
			}
		}
	}
}
Hash.prototype.get = function(key) {
	return this.h["$" + key];
}
Hash.prototype.h = null;
Hash.prototype.iterator = function() {
	return { ref : this.h, it : this.keys(), hasNext : function() {
		return this.it.hasNext();
	}, next : function() {
		var i = this.it.next();
		return this.ref["$" + i];
	}}
}
Hash.prototype.keys = function() {
	var a = new Array();
	
			for(var i in this.h)
				a.push(i.substr(1));
		;
	return a.iterator();
}
Hash.prototype.remove = function(key) {
	if(!this.exists(key)) return false;
	delete(this.h["$" + key]);
	return true;
}
Hash.prototype.set = function(key,value) {
	this.h["$" + key] = value;
}
Hash.prototype.toString = function() {
	var s = new StringBuf();
	s.b[s.b.length] = "{";
	var it = this.keys();
	{ var $it0 = it;
	while( $it0.hasNext() ) { var i = $it0.next();
	{
		s.b[s.b.length] = i;
		s.b[s.b.length] = " => ";
		s.b[s.b.length] = Std.string(this.get(i));
		if(it.hasNext()) s.b[s.b.length] = ", ";
	}
	}}
	s.b[s.b.length] = "}";
	return s.b.join("");
}
Hash.prototype.__class__ = Hash;
haxe.remoting.ExternalConnection = function(data,path) { if( data === $_ ) return; {
	this.__data = data;
	this.__path = path;
}}
haxe.remoting.ExternalConnection.__name__ = ["haxe","remoting","ExternalConnection"];
haxe.remoting.ExternalConnection.escapeString = function(s) {
	return s;
}
haxe.remoting.ExternalConnection.doCall = function(name,path,params) {
	try {
		var cnx = haxe.remoting.ExternalConnection.connections.get(name);
		if(cnx == null) throw "Unknown connection : " + name;
		if(cnx.__data.ctx == null) throw "No context shared for the connection " + name;
		var params1 = new haxe.Unserializer(params).unserialize();
		var ret = cnx.__data.ctx.call(path.split("."),params1);
		var s = new haxe.Serializer();
		s.serialize(ret);
		return s.toString() + "#";
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				var s = new haxe.Serializer();
				s.serializeException(e);
				return s.toString();
			}
		}
	}
}
haxe.remoting.ExternalConnection.flashConnect = function(name,flashObjectID,ctx) {
	var cnx = new haxe.remoting.ExternalConnection({ ctx : ctx, name : name, flash : flashObjectID},[]);
	haxe.remoting.ExternalConnection.connections.set(name,cnx);
	return cnx;
}
haxe.remoting.ExternalConnection.prototype.__data = null;
haxe.remoting.ExternalConnection.prototype.__path = null;
haxe.remoting.ExternalConnection.prototype.call = function(params) {
	var s = new haxe.Serializer();
	s.serialize(params);
	var params1 = s.toString();
	var data = null;
	var fobj = window.document[this.__data.flash];
	if(fobj == null) fobj = window.document.getElementById[this.__data.flash];
	if(fobj == null) throw ("Could not find flash object '" + this.__data.flash) + "'";
	try {
		data = fobj.externalRemotingCall(this.__data.name,this.__path.join("."),params1);
	}
	catch( $e0 ) {
		{
			var e = $e0;
			null;
		}
	}
	if(data == null) {
		var domain, pageDomain;
		try {
			domain = fobj.src.split("/")[2];
			pageDomain = js.Lib.window.location.host;
		}
		catch( $e1 ) {
			{
				var e = $e1;
				{
					domain = null;
					pageDomain = null;
				}
			}
		}
		if(domain != pageDomain) throw ("ExternalConnection call failure : SWF need allowDomain('" + pageDomain) + "')";
		throw "Call failure : ExternalConnection is not " + "initialized in Flash";
	}
	return new haxe.Unserializer(data).unserialize();
}
haxe.remoting.ExternalConnection.prototype.close = function() {
	haxe.remoting.ExternalConnection.connections.remove(this.__data.name);
}
haxe.remoting.ExternalConnection.prototype.resolve = function(field) {
	var e = new haxe.remoting.ExternalConnection(this.__data,this.__path.copy());
	e.__path.push(field);
	return e;
}
haxe.remoting.ExternalConnection.prototype.__class__ = haxe.remoting.ExternalConnection;
haxe.remoting.ExternalConnection.__interfaces__ = [haxe.remoting.Connection];
HelpUI = function() { }
HelpUI.__name__ = ["HelpUI"];
HelpUI.next = null;
HelpUI.setIndex = function(i) {
	HelpUI.currentIndex = i;
	if(i >= HelpUI.links.length - 1) {
		HelpUI.next.style.display = "none";
	}
	else {
		HelpUI.next.style.display = "";
	}
}
HelpUI.getLocationId = function() {
	var reg = new EReg("#([0-9a-zA-Z_]+)","i");
	if(reg.match(js.Lib.window.location.href)) return reg.matched(1);
	return null;
}
HelpUI.init = function() {
	HelpUI.generateTableOfContent("helpBoxCont","toc");
	HelpUI.next = js.Lib.document.getElementById("next");
	HelpUI.next.onclick = function(_) {
		if(HelpUI.links[HelpUI.currentIndex + 1] != null) HelpUI.links[HelpUI.currentIndex + 1].onclick(null);
		return false;
	}
	var locationId = HelpUI.getLocationId();
	HelpUI.links = js.Lib.document.getElementById("toc").getElementsByTagName("a");
	var box = js.Lib.document.getElementById("helpBoxCont");
	{
		var _g1 = 0, _g = HelpUI.links.length;
		while(_g1 < _g) {
			var i = _g1++;
			var link = HelpUI.links[i];
			var pos = [i];
			var id = link.getAttribute("href").substr(link.getAttribute("href").lastIndexOf("#") + 1);
			if(id == locationId) HelpUI.currentIndex = pos[0];
			var target = [js.Lib.document.getElementById(id)];
			if(target[0] == null) {
				continue;
			}
			link.onclick = function(target,pos) {
				return function(_) {
					var c = { x : target[0].offsetLeft, y : target[0].offsetTop}
					var fx = new js.fx.Scroll(box,c);
					fx.duration = 300;
					fx.start();
					HelpUI.setIndex(pos[0]);
					return false;
				}
			}(target,pos);
		}
	}
}
HelpUI.generateTableOfContent = function(contentId,tocId) {
	var content = js.Lib.document.getElementById(contentId);
	if(content == null) throw ("Unable to find element with id '" + contentId) + "'";
	var createLink = function(base,dest,id,lvl) {
		var a = Xml.createElement("a");
		dest.addChild(a);
		if(base.getAttribute("id") != null && base.getAttribute("id") != "") {
			a.set("href","#" + base.getAttribute("id"));
		}
		else {
			a.set("href","#" + id);
			base.id = id;
		}
		var text = Xml.createPCData(base.innerHTML);
		a.addChild(text);
	}
	var h1i = 0;
	var xh1 = null;
	var h2i = 0;
	var xh2 = null;
	var baseh2 = null;
	var h3i = 0;
	var xh3 = null;
	var baseh3 = null;
	var result = Xml.createElement("ol");
	var node = content.firstChild;
	var container = null;
	var createContainer = function(title) {
		var tmp = js.Lib.document.createElement("DIV");
		tmp.className = "helpSection";
		tmp.id = title.id;
		title.id = null;
		title.parentNode.insertBefore(tmp,title);
		return tmp;
	}
	while(node != null) {
		switch(node.nodeName) {
		case "H2":{
			xh1 = Xml.createElement("li");
			result.addChild(xh1);
			createLink(node,xh1,"h1n" + (++h1i),[h1i]);
			h2i = 0;
			baseh2 = null;
			h3i = 0;
			baseh3 = null;
			container = createContainer(node);
		}break;
		case "H3":{
			if(baseh2 == null) {
				baseh2 = Xml.createElement("ol");
				if(xh1 != null) xh1.addChild(baseh2);
			}
			xh2 = Xml.createElement("li");
			baseh2.addChild(xh2);
			createLink(node,xh2,(("h2n" + (h1i)) + "n") + (++h2i),[h1i,h2i]);
			h3i = 0;
			baseh3 = null;
			container = createContainer(node);
		}break;
		case "H4":{
			if(baseh3 == null) {
				baseh3 = Xml.createElement("ol");
				if(xh2 != null) xh2.addChild(baseh3);
			}
			xh3 = Xml.createElement("li");
			baseh3.addChild(xh3);
			createLink(node,xh3,(((("h3n" + (h1i)) + "n") + (h2i)) + "n") + (++h3i),[h1i,h2i,h3i]);
			container = createContainer(node);
		}break;
		}
		var next = node.nextSibling;
		if(container != null) {
			node.parentNode.removeChild(node);
			container.appendChild(node);
		}
		node = next;
	}
	var tocDiv = js.Lib.document.getElementById(tocId);
	if(tocDiv != null) {
		tocDiv.innerHTML = result.toString();
	}
	else {
		content.innerHTML = (((("<div id='" + tocId) + "'>") + result.toString()) + "</div>") + content.innerHTML;
	}
	return result.toString();
}
HelpUI.prototype.__class__ = HelpUI;
js.fx.Anim = function(p) { if( p === $_ ) return; {
	this.fps = 60;
	this.duration = 250;
	this.transition = js.fx.TransitionFunctions.get(js.fx.Transition.Linear);
}}
js.fx.Anim.__name__ = ["js","fx","Anim"];
js.fx.Anim.prototype.cancel = function() {
	if(this.stopTimer() && this.onCancel != null) this.onCancel();
}
js.fx.Anim.prototype.complete = function() {
	if(this.stopTimer()) {
		if(this.onComplete != null) this.onComplete();
		return true;
	}
	return false;
}
js.fx.Anim.prototype.duration = null;
js.fx.Anim.prototype.fps = null;
js.fx.Anim.prototype.next = function() {
	var now = Date.now().getTime();
	if(now < this.time + this.duration) {
		var delta = this.transition((now - this.time) / this.duration);
		this.set(delta);
	}
	else {
		this.set(1);
		this.complete();
	}
}
js.fx.Anim.prototype.onCancel = null;
js.fx.Anim.prototype.onComplete = null;
js.fx.Anim.prototype.onStart = null;
js.fx.Anim.prototype.pause = function() {
	this.stopTimer();
}
js.fx.Anim.prototype.resume = function() {
	this.startTimer();
}
js.fx.Anim.prototype.set = function(delta) {
	throw "set(delta:Float) not implemented";
}
js.fx.Anim.prototype.setTransition = function(t) {
	this.transition = js.fx.TransitionFunctions.get(t);
}
js.fx.Anim.prototype.start = function() {
	this.time = 0;
	this.startTimer();
	if(this.onStart != null) this.onStart();
}
js.fx.Anim.prototype.startTimer = function() {
	if(this.timer != null) return false;
	this.time = Date.now().getTime() - this.time;
	this.timer = js.fx.Timer.periodical(function(f) {
		return function() {
			return f();
		}
	}($closure(this,"next")),Math.round(1000 / this.fps));
	return true;
}
js.fx.Anim.prototype.stopTimer = function() {
	if(this.timer == null) return false;
	this.time = Date.now().getTime() - this.time;
	this.timer = js.fx.Timer.clear(this.timer);
	return true;
}
js.fx.Anim.prototype.time = null;
js.fx.Anim.prototype.timer = null;
js.fx.Anim.prototype.transition = null;
js.fx.Anim.prototype.__class__ = js.fx.Anim;
if(!haxe.io) haxe.io = {}
haxe.io.Bytes = function(length,b) { if( length === $_ ) return; {
	this.length = length;
	this.b = b;
}}
haxe.io.Bytes.__name__ = ["haxe","io","Bytes"];
haxe.io.Bytes.alloc = function(length) {
	var a = new Array();
	{
		var _g = 0;
		while(_g < length) {
			var i = _g++;
			a.push(0);
		}
	}
	return new haxe.io.Bytes(length,a);
}
haxe.io.Bytes.ofString = function(s) {
	var a = new Array();
	{
		var _g1 = 0, _g = s.length;
		while(_g1 < _g) {
			var i = _g1++;
			var c = s["cca"](i);
			if(c <= 127) a.push(c);
			else if(c <= 2047) {
				a.push(192 | (c >> 6));
				a.push(128 | (c & 63));
			}
			else if(c <= 65535) {
				a.push(224 | (c >> 12));
				a.push(128 | ((c >> 6) & 63));
				a.push(128 | (c & 63));
			}
			else {
				a.push(240 | (c >> 18));
				a.push(128 | ((c >> 12) & 63));
				a.push(128 | ((c >> 6) & 63));
				a.push(128 | (c & 63));
			}
		}
	}
	return new haxe.io.Bytes(a.length,a);
}
haxe.io.Bytes.ofData = function(b) {
	return new haxe.io.Bytes(b.length,b);
}
haxe.io.Bytes.prototype.b = null;
haxe.io.Bytes.prototype.blit = function(pos,src,srcpos,len) {
	if(pos < 0 || srcpos < 0 || len < 0 || pos + len > this.length || srcpos + len > src.length) throw haxe.io.Error.OutsideBounds;
	var b1 = this.b;
	var b2 = src.b;
	if(b1 == b2 && pos > srcpos) {
		var i = len;
		while(i > 0) {
			i--;
			b1[i + pos] = b2[i + srcpos];
		}
		return;
	}
	{
		var _g = 0;
		while(_g < len) {
			var i = _g++;
			b1[i + pos] = b2[i + srcpos];
		}
	}
}
haxe.io.Bytes.prototype.compare = function(other) {
	var b1 = this.b;
	var b2 = other.b;
	var len = ((this.length < other.length)?this.length:other.length);
	{
		var _g = 0;
		while(_g < len) {
			var i = _g++;
			if(b1[i] != b2[i]) return b1[i] - b2[i];
		}
	}
	return this.length - other.length;
}
haxe.io.Bytes.prototype.get = function(pos) {
	return this.b[pos];
}
haxe.io.Bytes.prototype.getData = function() {
	return this.b;
}
haxe.io.Bytes.prototype.length = null;
haxe.io.Bytes.prototype.readString = function(pos,len) {
	if(pos < 0 || len < 0 || pos + len > this.length) throw haxe.io.Error.OutsideBounds;
	var s = "";
	var b = this.b;
	var fcc = $closure(String,"fromCharCode");
	var i = pos;
	var max = pos + len;
	while(i < max) {
		var c = b[i++];
		if(c < 128) {
			if(c == 0) break;
			s += fcc(c);
		}
		else if(c < 224) s += fcc(((c & 63) << 6) | (b[i++] & 127));
		else if(c < 240) {
			var c2 = b[i++];
			s += fcc((((c & 31) << 12) | ((c2 & 127) << 6)) | (b[i++] & 127));
		}
		else {
			var c2 = b[i++];
			var c3 = b[i++];
			s += fcc(((((c & 15) << 18) | ((c2 & 127) << 12)) | ((c3 << 6) & 127)) | (b[i++] & 127));
		}
	}
	return s;
}
haxe.io.Bytes.prototype.set = function(pos,v) {
	this.b[pos] = (v & 255);
}
haxe.io.Bytes.prototype.sub = function(pos,len) {
	if(pos < 0 || len < 0 || pos + len > this.length) throw haxe.io.Error.OutsideBounds;
	return new haxe.io.Bytes(len,this.b.slice(pos,pos + len));
}
haxe.io.Bytes.prototype.toString = function() {
	return this.readString(0,this.length);
}
haxe.io.Bytes.prototype.__class__ = haxe.io.Bytes;
js.fx.Morph = function(e,toStyle) { if( e === $_ ) return; {
	js.fx.Anim.apply(this,[]);
	this.element = e;
	this.targetStyle = toStyle;
	this.originStyle = js.fx.Style.getStyles(this.element,toStyle);
}}
js.fx.Morph.__name__ = ["js","fx","Morph"];
js.fx.Morph.__super__ = js.fx.Anim;
for(var k in js.fx.Anim.prototype ) js.fx.Morph.prototype[k] = js.fx.Anim.prototype[k];
js.fx.Morph.prototype.element = null;
js.fx.Morph.prototype.originStyle = null;
js.fx.Morph.prototype.set = function(delta) {
	js.fx.Style.setStyles(this.element,js.fx.Delta.styles(this.originStyle,this.targetStyle,delta));
}
js.fx.Morph.prototype.targetStyle = null;
js.fx.Morph.prototype.__class__ = js.fx.Morph;
haxe.Firebug = function() { }
haxe.Firebug.__name__ = ["haxe","Firebug"];
haxe.Firebug.detect = function() {
	try {
		return console != null && console.error != null;
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				return false;
			}
		}
	}
}
haxe.Firebug.redirectTraces = function() {
	haxe.Log.trace = $closure(haxe.Firebug,"trace");
	js.Lib.setErrorHandler($closure(haxe.Firebug,"onError"));
}
haxe.Firebug.onError = function(err,stack) {
	var buf = err + "\n";
	{
		var _g = 0;
		while(_g < stack.length) {
			var s = stack[_g];
			++_g;
			buf += ("Called from " + s) + "\n";
		}
	}
	haxe.Firebug.trace(buf,null);
	return true;
}
haxe.Firebug.trace = function(v,inf) {
	var type = (inf != null && inf.customParams != null?inf.customParams[0]:null);
	if(type != "warn" && type != "info" && type != "debug" && type != "error") type = (inf == null?"error":"log");
	console[type](((inf == null?"":((inf.fileName + ":") + inf.lineNumber) + " : ")) + Std.string(v));
}
haxe.Firebug.prototype.__class__ = haxe.Firebug;
haxe.Timer = function(time_ms) { if( time_ms === $_ ) return; {
	this.id = haxe.Timer.arr.length;
	haxe.Timer.arr[this.id] = this;
	this.timerId = window.setInterval(("haxe.Timer.arr[" + this.id) + "].run();",time_ms);
}}
haxe.Timer.__name__ = ["haxe","Timer"];
haxe.Timer.delay = function(f,time_ms) {
	var t = new haxe.Timer(time_ms);
	t.run = function() {
		t.stop();
		f();
	}
	return t;
}
haxe.Timer.stamp = function() {
	return Date.now().getTime() / 1000;
}
haxe.Timer.prototype.id = null;
haxe.Timer.prototype.run = function() {
	null;
}
haxe.Timer.prototype.stop = function() {
	if(this.id == null) return;
	window.clearInterval(this.timerId);
	haxe.Timer.arr[this.id] = null;
	if(this.id > 100 && this.id == haxe.Timer.arr.length - 1) {
		var p = this.id - 1;
		while(p >= 0 && haxe.Timer.arr[p] == null) p--;
		haxe.Timer.arr = haxe.Timer.arr.slice(0,p + 1);
	}
	this.id = null;
}
haxe.Timer.prototype.timerId = null;
haxe.Timer.prototype.__class__ = haxe.Timer;
IntIter = function(min,max) { if( min === $_ ) return; {
	this.min = min;
	this.max = max;
}}
IntIter.__name__ = ["IntIter"];
IntIter.prototype.hasNext = function() {
	return this.min < this.max;
}
IntIter.prototype.max = null;
IntIter.prototype.min = null;
IntIter.prototype.next = function() {
	return this.min++;
}
IntIter.prototype.__class__ = IntIter;
haxe.io.Error = { __ename__ : ["haxe","io","Error"], __constructs__ : ["Blocked","Overflow","OutsideBounds","Custom"] }
haxe.io.Error.Blocked = ["Blocked",0];
haxe.io.Error.Blocked.toString = $estr;
haxe.io.Error.Blocked.__enum__ = haxe.io.Error;
haxe.io.Error.Custom = function(e) { var $x = ["Custom",3,e]; $x.__enum__ = haxe.io.Error; $x.toString = $estr; return $x; }
haxe.io.Error.OutsideBounds = ["OutsideBounds",2];
haxe.io.Error.OutsideBounds.toString = $estr;
haxe.io.Error.OutsideBounds.__enum__ = haxe.io.Error;
haxe.io.Error.Overflow = ["Overflow",1];
haxe.io.Error.Overflow.toString = $estr;
haxe.io.Error.Overflow.__enum__ = haxe.io.Error;
Type = function() { }
Type.__name__ = ["Type"];
Type.getClass = function(o) {
	if(o == null) return null;
	if(o.__enum__ != null) return null;
	return o.__class__;
}
Type.getEnum = function(o) {
	if(o == null) return null;
	return o.__enum__;
}
Type.getSuperClass = function(c) {
	return c.__super__;
}
Type.getClassName = function(c) {
	var a = c.__name__;
	return a.join(".");
}
Type.getEnumName = function(e) {
	var a = e.__ename__;
	return a.join(".");
}
Type.resolveClass = function(name) {
	var cl;
	try {
		cl = eval(name);
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				cl = null;
			}
		}
	}
	if(cl == null || cl.__name__ == null) return null;
	return cl;
}
Type.resolveEnum = function(name) {
	var e;
	try {
		e = eval(name);
	}
	catch( $e0 ) {
		{
			var err = $e0;
			{
				e = null;
			}
		}
	}
	if(e == null || e.__ename__ == null) return null;
	return e;
}
Type.createInstance = function(cl,args) {
	if(args.length <= 3) return new cl(args[0],args[1],args[2]);
	if(args.length > 8) throw "Too many arguments";
	return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);
}
Type.createEmptyInstance = function(cl) {
	return new cl($_);
}
Type.createEnum = function(e,constr,params) {
	var f = Reflect.field(e,constr);
	if(f == null) throw "No such constructor " + constr;
	if(Reflect.isFunction(f)) {
		if(params == null) throw ("Constructor " + constr) + " need parameters";
		return f.apply(e,params);
	}
	if(params != null && params.length != 0) throw ("Constructor " + constr) + " does not need parameters";
	return f;
}
Type.createEnumIndex = function(e,index,params) {
	var c = Type.getEnumConstructs(e)[index];
	if(c == null) throw index + " is not a valid enum constructor index";
	return Type.createEnum(e,c,params);
}
Type.getInstanceFields = function(c) {
	var a = Reflect.fields(c.prototype);
	a.remove("__class__");
	return a;
}
Type.getClassFields = function(c) {
	var a = Reflect.fields(c);
	a.remove("__name__");
	a.remove("__interfaces__");
	a.remove("__super__");
	a.remove("prototype");
	return a;
}
Type.getEnumConstructs = function(e) {
	return e.__constructs__;
}
Type["typeof"] = function(v) {
	switch(typeof(v)) {
	case "boolean":{
		return ValueType.TBool;
	}break;
	case "string":{
		return ValueType.TClass(String);
	}break;
	case "number":{
		if(Math.ceil(v) == v % 2147483648.0) return ValueType.TInt;
		return ValueType.TFloat;
	}break;
	case "object":{
		if(v == null) return ValueType.TNull;
		var e = v.__enum__;
		if(e != null) return ValueType.TEnum(e);
		var c = v.__class__;
		if(c != null) return ValueType.TClass(c);
		return ValueType.TObject;
	}break;
	case "function":{
		if(v.__name__ != null) return ValueType.TObject;
		return ValueType.TFunction;
	}break;
	case "undefined":{
		return ValueType.TNull;
	}break;
	default:{
		return ValueType.TUnknown;
	}break;
	}
}
Type.enumEq = function(a,b) {
	if(a == b) return true;
	try {
		if(a[0] != b[0]) return false;
		{
			var _g1 = 2, _g = a.length;
			while(_g1 < _g) {
				var i = _g1++;
				if(!Type.enumEq(a[i],b[i])) return false;
			}
		}
		var e = a.__enum__;
		if(e != b.__enum__ || e == null) return false;
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				return false;
			}
		}
	}
	return true;
}
Type.enumConstructor = function(e) {
	return e[0];
}
Type.enumParameters = function(e) {
	return e.slice(2);
}
Type.enumIndex = function(e) {
	return e[1];
}
Type.prototype.__class__ = Type;
haxe.Unserializer = function(buf) { if( buf === $_ ) return; {
	this.buf = buf;
	this.length = buf.length;
	this.pos = 0;
	this.scache = new Array();
	this.cache = new Array();
	this.setResolver(haxe.Unserializer.DEFAULT_RESOLVER);
}}
haxe.Unserializer.__name__ = ["haxe","Unserializer"];
haxe.Unserializer.initCodes = function() {
	var codes = new Array();
	{
		var _g1 = 0, _g = haxe.Unserializer.BASE64.length;
		while(_g1 < _g) {
			var i = _g1++;
			codes[haxe.Unserializer.BASE64.cca(i)] = i;
		}
	}
	return codes;
}
haxe.Unserializer.run = function(v) {
	return new haxe.Unserializer(v).unserialize();
}
haxe.Unserializer.prototype.buf = null;
haxe.Unserializer.prototype.cache = null;
haxe.Unserializer.prototype.get = function(p) {
	return this.buf.cca(p);
}
haxe.Unserializer.prototype.getResolver = function() {
	return this.resolver;
}
haxe.Unserializer.prototype.length = null;
haxe.Unserializer.prototype.pos = null;
haxe.Unserializer.prototype.readDigits = function() {
	var k = 0;
	var s = false;
	var fpos = this.pos;
	while(true) {
		var c = this.buf.cca(this.pos);
		if(Math.isNaN(c)) break;
		if(c == 45) {
			if(this.pos != fpos) break;
			s = true;
			this.pos++;
			continue;
		}
		if(c < 48 || c > 57) break;
		k = k * 10 + (c - 48);
		this.pos++;
	}
	if(s) k *= -1;
	return k;
}
haxe.Unserializer.prototype.resolver = null;
haxe.Unserializer.prototype.scache = null;
haxe.Unserializer.prototype.setResolver = function(r) {
	if(r == null) this.resolver = { resolveClass : function(_) {
		return null;
	}, resolveEnum : function(_) {
		return null;
	}}
	else this.resolver = r;
}
haxe.Unserializer.prototype.unserialize = function() {
	switch(this.buf.cca(this.pos++)) {
	case 110:{
		return null;
	}break;
	case 116:{
		return true;
	}break;
	case 102:{
		return false;
	}break;
	case 122:{
		return 0;
	}break;
	case 105:{
		return this.readDigits();
	}break;
	case 100:{
		var p1 = this.pos;
		while(true) {
			var c = this.buf.cca(this.pos);
			if((c >= 43 && c < 58) || c == 101 || c == 69) this.pos++;
			else break;
		}
		return Std.parseFloat(this.buf.substr(p1,this.pos - p1));
	}break;
	case 121:{
		var len = this.readDigits();
		if(this.buf.cca(this.pos++) != 58 || this.length - this.pos < len) throw "Invalid string length";
		var s = this.buf.substr(this.pos,len);
		this.pos += len;
		s = StringTools.urlDecode(s);
		this.scache.push(s);
		return s;
	}break;
	case 107:{
		return Math.NaN;
	}break;
	case 109:{
		return Math.NEGATIVE_INFINITY;
	}break;
	case 112:{
		return Math.POSITIVE_INFINITY;
	}break;
	case 97:{
		var buf = this.buf;
		var a = new Array();
		this.cache.push(a);
		while(true) {
			var c = this.buf.cca(this.pos);
			if(c == 104) {
				this.pos++;
				break;
			}
			if(c == 117) {
				this.pos++;
				var n = this.readDigits();
				a[(a.length + n) - 1] = null;
			}
			else a.push(this.unserialize());
		}
		return a;
	}break;
	case 111:{
		var o = { }
		this.cache.push(o);
		this.unserializeObject(o);
		return o;
	}break;
	case 114:{
		var n = this.readDigits();
		if(n < 0 || n >= this.cache.length) throw "Invalid reference";
		return this.cache[n];
	}break;
	case 82:{
		var n = this.readDigits();
		if(n < 0 || n >= this.scache.length) throw "Invalid string reference";
		return this.scache[n];
	}break;
	case 120:{
		throw this.unserialize();
	}break;
	case 99:{
		var name = this.unserialize();
		var cl = this.resolver.resolveClass(name);
		if(cl == null) throw "Class not found " + name;
		var o = Type.createEmptyInstance(cl);
		this.cache.push(o);
		this.unserializeObject(o);
		return o;
	}break;
	case 119:{
		var name = this.unserialize();
		var edecl = this.resolver.resolveEnum(name);
		if(edecl == null) throw "Enum not found " + name;
		return this.unserializeEnum(edecl,this.unserialize());
	}break;
	case 106:{
		var name = this.unserialize();
		var edecl = this.resolver.resolveEnum(name);
		if(edecl == null) throw "Enum not found " + name;
		this.pos++;
		var index = this.readDigits();
		var tag = Type.getEnumConstructs(edecl)[index];
		if(tag == null) throw (("Unknown enum index " + name) + "@") + index;
		return this.unserializeEnum(edecl,tag);
	}break;
	case 108:{
		var l = new List();
		this.cache.push(l);
		var buf = this.buf;
		while(this.buf.cca(this.pos) != 104) l.add(this.unserialize());
		this.pos++;
		return l;
	}break;
	case 98:{
		var h = new Hash();
		this.cache.push(h);
		var buf = this.buf;
		while(this.buf.cca(this.pos) != 104) {
			var s = this.unserialize();
			h.set(s,this.unserialize());
		}
		this.pos++;
		return h;
	}break;
	case 113:{
		var h = new IntHash();
		this.cache.push(h);
		var buf = this.buf;
		var c = this.buf.cca(this.pos++);
		while(c == 58) {
			var i = this.readDigits();
			h.set(i,this.unserialize());
			c = this.buf.cca(this.pos++);
		}
		if(c != 104) throw "Invalid IntHash format";
		return h;
	}break;
	case 118:{
		var d = Date.fromString(this.buf.substr(this.pos,19));
		this.cache.push(d);
		this.pos += 19;
		return d;
	}break;
	case 115:{
		var len = this.readDigits();
		var buf = this.buf;
		if(this.buf.cca(this.pos++) != 58 || this.length - this.pos < len) throw "Invalid bytes length";
		var codes = haxe.Unserializer.CODES;
		if(codes == null) {
			codes = haxe.Unserializer.initCodes();
			haxe.Unserializer.CODES = codes;
		}
		var i = this.pos;
		var rest = len & 3;
		var size = (len >> 2) * 3 + (((rest >= 2)?rest - 1:0));
		var max = i + (len - rest);
		var bytes = haxe.io.Bytes.alloc(size);
		var bpos = 0;
		while(i < max) {
			var c1 = codes[buf.cca(i++)];
			var c2 = codes[buf.cca(i++)];
			bytes.b[bpos++] = (((c1 << 2) | (c2 >> 4)) & 255);
			var c3 = codes[buf.cca(i++)];
			bytes.b[bpos++] = (((c2 << 4) | (c3 >> 2)) & 255);
			var c4 = codes[buf.cca(i++)];
			bytes.b[bpos++] = (((c3 << 6) | c4) & 255);
		}
		if(rest >= 2) {
			var c1 = codes[buf.cca(i++)];
			var c2 = codes[buf.cca(i++)];
			bytes.b[bpos++] = (((c1 << 2) | (c2 >> 4)) & 255);
			if(rest == 3) {
				var c3 = codes[buf.cca(i++)];
				bytes.b[bpos++] = (((c2 << 4) | (c3 >> 2)) & 255);
			}
		}
		this.pos += len;
		this.cache.push(bytes);
		return bytes;
	}break;
	case 67:{
		var name = this.unserialize();
		var cl = this.resolver.resolveClass(name);
		if(cl == null) throw "Class not found " + name;
		var o = Type.createEmptyInstance(cl);
		this.cache.push(o);
		o.hxUnserialize(this);
		if(this.buf.cca(this.pos++) != 103) throw "Invalid custom data";
		return o;
	}break;
	default:{
		null;
	}break;
	}
	this.pos--;
	throw ((("Invalid char " + this.buf.charAt(this.pos)) + " at position ") + this.pos);
}
haxe.Unserializer.prototype.unserializeEnum = function(edecl,tag) {
	var constr = Reflect.field(edecl,tag);
	if(constr == null) throw (("Unknown enum tag " + Type.getEnumName(edecl)) + ".") + tag;
	if(this.buf.cca(this.pos++) != 58) throw "Invalid enum format";
	var nargs = this.readDigits();
	if(nargs == 0) {
		this.cache.push(constr);
		return constr;
	}
	var args = new Array();
	while(nargs > 0) {
		args.push(this.unserialize());
		nargs -= 1;
	}
	var e = constr.apply(edecl,args);
	this.cache.push(e);
	return e;
}
haxe.Unserializer.prototype.unserializeObject = function(o) {
	while(true) {
		if(this.pos >= this.length) throw "Invalid object";
		if(this.buf.cca(this.pos) == 103) break;
		var k = this.unserialize();
		if(!Std["is"](k,String)) throw "Invalid object key";
		var v = this.unserialize();
		o[k] = v;
	}
	this.pos++;
}
haxe.Unserializer.prototype.__class__ = haxe.Unserializer;
haxe.remoting.Context = function(p) { if( p === $_ ) return; {
	this.objects = new Hash();
}}
haxe.remoting.Context.__name__ = ["haxe","remoting","Context"];
haxe.remoting.Context.share = function(name,obj) {
	var ctx = new haxe.remoting.Context();
	ctx.addObject(name,obj);
	return ctx;
}
haxe.remoting.Context.prototype.addObject = function(name,obj,recursive) {
	this.objects.set(name,{ obj : obj, rec : recursive});
}
haxe.remoting.Context.prototype.call = function(path,params) {
	if(path.length < 2) throw ("Invalid path '" + path.join(".")) + "'";
	var inf = this.objects.get(path[0]);
	if(inf == null) throw "No such object " + path[0];
	var o = inf.obj;
	var m = Reflect.field(o,path[1]);
	if(path.length > 2) {
		if(!inf.rec) throw "Can't access " + path.join(".");
		{
			var _g1 = 2, _g = path.length;
			while(_g1 < _g) {
				var i = _g1++;
				o = m;
				m = Reflect.field(o,path[i]);
			}
		}
	}
	if(!Reflect.isFunction(m)) throw "No such method " + path.join(".");
	return m.apply(o,params);
}
haxe.remoting.Context.prototype.objects = null;
haxe.remoting.Context.prototype.__class__ = haxe.remoting.Context;
Std = function() { }
Std.__name__ = ["Std"];
Std["is"] = function(v,t) {
	return js.Boot.__instanceof(v,t);
}
Std.string = function(s) {
	return js.Boot.__string_rec(s,"");
}
Std["int"] = function(x) {
	if(x < 0) return Math.ceil(x);
	return Math.floor(x);
}
Std.parseInt = function(x) {
	var v = parseInt(x);
	if(Math.isNaN(v)) return null;
	return v;
}
Std.parseFloat = function(x) {
	return parseFloat(x);
}
Std.random = function(x) {
	return Math.floor(Math.random() * x);
}
Std.prototype.__class__ = Std;
js.fx.Scroll = function(e,coords) { if( e === $_ ) return; {
	js.fx.Anim.apply(this,[]);
	this.element = e;
	this.origin = js.fx.Scroll.getScroll(e);
	this.target = coords;
}}
js.fx.Scroll.__name__ = ["js","fx","Scroll"];
js.fx.Scroll.__super__ = js.fx.Anim;
for(var k in js.fx.Anim.prototype ) js.fx.Scroll.prototype[k] = js.fx.Anim.prototype[k];
js.fx.Scroll.to = function(scrollable,target) {
	if(scrollable == null) scrollable = js.Lib.document.body;
	if(scrollable == js.Lib.document) scrollable = js.Lib.document.body;
	var coords = { x : target.offsetLeft, y : target.offsetTop}
	if(!js.Lib.isIE && scrollable != js.Lib.document.body) {
		coords.x -= scrollable.offsetLeft;
		coords.y -= scrollable.offsetTop;
	}
	return new js.fx.Scroll(scrollable,coords);
}
js.fx.Scroll.setScroll = function(e,c) {
	if(e == js.Lib.document.body) js.Lib.window.scrollTo(c.x,c.y);
	else {
		e.scrollTop = c.y;
		e.scrollLeft = c.x;
	}
}
js.fx.Scroll.getScroll = function(e) {
	if(e == js.Lib.document.body) {
		if(js.Lib.window.pageYOffset != null) return { y : js.Lib.window.pageYOffset, x : js.Lib.window.pageXOffset}
		var d = js.Lib.document.documentElement;
		if(d != null && d.scrollTop != null) return { y : d.scrollTop, x : d.scrollLeft}
		if(e.scrollTop != null) return { y : e.scrollTop, x : e.scrollLeft}
	}
	return { x : e.scrollLeft, y : e.scrollTop}
}
js.fx.Scroll.prototype.element = null;
js.fx.Scroll.prototype.getDelta = function() {
	return { x : this.target.x - this.origin.x, y : this.target.y - this.origin.y}
}
js.fx.Scroll.prototype.origin = null;
js.fx.Scroll.prototype.set = function(delta) {
	js.fx.Scroll.setScroll(this.element,{ x : js.fx.Delta["int"](this.origin.x,this.target.x,delta), y : js.fx.Delta["int"](this.origin.y,this.target.y,delta)});
}
js.fx.Scroll.prototype.target = null;
js.fx.Scroll.prototype.__class__ = js.fx.Scroll;
haxe.Serializer = function(p) { if( p === $_ ) return; {
	this.buf = new StringBuf();
	this.cache = new Array();
	this.useCache = haxe.Serializer.USE_CACHE;
	this.useEnumIndex = haxe.Serializer.USE_ENUM_INDEX;
	this.shash = new Hash();
	this.scount = 0;
}}
haxe.Serializer.__name__ = ["haxe","Serializer"];
haxe.Serializer.run = function(v) {
	var s = new haxe.Serializer();
	s.serialize(v);
	return s.toString();
}
haxe.Serializer.prototype.buf = null;
haxe.Serializer.prototype.cache = null;
haxe.Serializer.prototype.scount = null;
haxe.Serializer.prototype.serialize = function(v) {
	var $e = (Type["typeof"](v));
	switch( $e[1] ) {
	case 0:
	{
		this.buf.add("n");
	}break;
	case 1:
	{
		if(v == 0) {
			this.buf.add("z");
			return;
		}
		this.buf.add("i");
		this.buf.add(v);
	}break;
	case 2:
	{
		if(Math.isNaN(v)) this.buf.add("k");
		else if(!Math.isFinite(v)) this.buf.add((v < 0?"m":"p"));
		else {
			this.buf.add("d");
			this.buf.add(v);
		}
	}break;
	case 3:
	{
		this.buf.add((v?"t":"f"));
	}break;
	case 6:
	var c = $e[2];
	{
		if(c == String) {
			this.serializeString(v);
			return;
		}
		if(this.useCache && this.serializeRef(v)) return;
		switch(c) {
		case Array:{
			var ucount = 0;
			this.buf.add("a");
			var l = v["length"];
			{
				var _g = 0;
				while(_g < l) {
					var i = _g++;
					if(v[i] == null) ucount++;
					else {
						if(ucount > 0) {
							if(ucount == 1) this.buf.add("n");
							else {
								this.buf.add("u");
								this.buf.add(ucount);
							}
							ucount = 0;
						}
						this.serialize(v[i]);
					}
				}
			}
			if(ucount > 0) {
				if(ucount == 1) this.buf.add("n");
				else {
					this.buf.add("u");
					this.buf.add(ucount);
				}
			}
			this.buf.add("h");
		}break;
		case List:{
			this.buf.add("l");
			var v1 = v;
			{ var $it0 = v1.iterator();
			while( $it0.hasNext() ) { var i = $it0.next();
			this.serialize(i);
			}}
			this.buf.add("h");
		}break;
		case Date:{
			var d = v;
			this.buf.add("v");
			this.buf.add(d.toString());
		}break;
		case Hash:{
			this.buf.add("b");
			var v1 = v;
			{ var $it1 = v1.keys();
			while( $it1.hasNext() ) { var k = $it1.next();
			{
				this.serializeString(k);
				this.serialize(v1.get(k));
			}
			}}
			this.buf.add("h");
		}break;
		case IntHash:{
			this.buf.add("q");
			var v1 = v;
			{ var $it2 = v1.keys();
			while( $it2.hasNext() ) { var k = $it2.next();
			{
				this.buf.add(":");
				this.buf.add(k);
				this.serialize(v1.get(k));
			}
			}}
			this.buf.add("h");
		}break;
		case haxe.io.Bytes:{
			var v1 = v;
			var i = 0;
			var max = v1.length - 2;
			var chars = "";
			var b64 = haxe.Serializer.BASE64;
			while(i < max) {
				var b1 = v1.b[i++];
				var b2 = v1.b[i++];
				var b3 = v1.b[i++];
				chars += ((b64.charAt(b1 >> 2) + b64.charAt(((b1 << 4) | (b2 >> 4)) & 63)) + b64.charAt(((b2 << 2) | (b3 >> 6)) & 63)) + b64.charAt(b3 & 63);
			}
			if(i == max) {
				var b1 = v1.b[i++];
				var b2 = v1.b[i++];
				chars += (b64.charAt(b1 >> 2) + b64.charAt(((b1 << 4) | (b2 >> 4)) & 63)) + b64.charAt((b2 << 2) & 63);
			}
			else if(i == max + 1) {
				var b1 = v1.b[i++];
				chars += b64.charAt(b1 >> 2) + b64.charAt((b1 << 4) & 63);
			}
			this.buf.add("s");
			this.buf.add(chars.length);
			this.buf.add(":");
			this.buf.add(chars);
		}break;
		default:{
			this.cache.pop();
			if(v.hxSerialize != null) {
				this.buf.add("C");
				this.serializeString(Type.getClassName(c));
				this.cache.push(v);
				v.hxSerialize(this);
				this.buf.add("g");
			}
			else {
				this.buf.add("c");
				this.serializeString(Type.getClassName(c));
				this.cache.push(v);
				this.serializeFields(v);
			}
		}break;
		}
	}break;
	case 4:
	{
		if(this.useCache && this.serializeRef(v)) return;
		this.buf.add("o");
		this.serializeFields(v);
	}break;
	case 7:
	var e = $e[2];
	{
		if(this.useCache && this.serializeRef(v)) return;
		this.cache.pop();
		this.buf.add((this.useEnumIndex?"j":"w"));
		this.serializeString(Type.getEnumName(e));
		if(this.useEnumIndex) {
			this.buf.add(":");
			this.buf.add(v[1]);
		}
		else this.serializeString(v[0]);
		this.buf.add(":");
		var l = v["length"];
		this.buf.add(l - 2);
		{
			var _g = 2;
			while(_g < l) {
				var i = _g++;
				this.serialize(v[i]);
			}
		}
		this.cache.push(v);
	}break;
	case 5:
	{
		throw "Cannot serialize function";
	}break;
	default:{
		throw "Cannot serialize " + Std.string(v);
	}break;
	}
}
haxe.Serializer.prototype.serializeException = function(e) {
	this.buf.add("x");
	this.serialize(e);
}
haxe.Serializer.prototype.serializeFields = function(v) {
	{
		var _g = 0, _g1 = Reflect.fields(v);
		while(_g < _g1.length) {
			var f = _g1[_g];
			++_g;
			this.serializeString(f);
			this.serialize(Reflect.field(v,f));
		}
	}
	this.buf.add("g");
}
haxe.Serializer.prototype.serializeRef = function(v) {
	var vt = typeof(v);
	{
		var _g1 = 0, _g = this.cache.length;
		while(_g1 < _g) {
			var i = _g1++;
			var ci = this.cache[i];
			if(typeof(ci) == vt && ci == v) {
				this.buf.add("r");
				this.buf.add(i);
				return true;
			}
		}
	}
	this.cache.push(v);
	return false;
}
haxe.Serializer.prototype.serializeString = function(s) {
	var x = this.shash.get(s);
	if(x != null) {
		this.buf.add("R");
		this.buf.add(x);
		return;
	}
	this.shash.set(s,this.scount++);
	this.buf.add("y");
	s = StringTools.urlEncode(s);
	this.buf.add(s.length);
	this.buf.add(":");
	this.buf.add(s);
}
haxe.Serializer.prototype.shash = null;
haxe.Serializer.prototype.toString = function() {
	return this.buf.b.join("");
}
haxe.Serializer.prototype.useCache = null;
haxe.Serializer.prototype.useEnumIndex = null;
haxe.Serializer.prototype.__class__ = haxe.Serializer;
js.Lib = function() { }
js.Lib.__name__ = ["js","Lib"];
js.Lib.isIE = null;
js.Lib.isOpera = null;
js.Lib.document = null;
js.Lib.window = null;
js.Lib.alert = function(v) {
	alert(js.Boot.__string_rec(v,""));
}
js.Lib.eval = function(code) {
	return eval(code);
}
js.Lib.setErrorHandler = function(f) {
	js.Lib.onerror = f;
}
js.Lib.prototype.__class__ = js.Lib;
js.fx.Style = function() { }
js.fx.Style.__name__ = ["js","fx","Style"];
js.fx.Style.getDocumentStyles = function(selector) {
	var result = { }
	var found = false;
	{
		var _g1 = 0, _g = js.Lib.document.styleSheets.length;
		while(_g1 < _g) {
			var i = _g1++;
			var sheet = js.Lib.document.styleSheets[i];
			if(sheet.href != null && sheet.href.indexOf("://") != -1 && sheet.href.indexOf(js.Lib.document.domain) == -1) continue;
			var rules = (sheet.rules != null?sheet.rules:sheet.cssRules);
			{
				var _g3 = 0, _g2 = rules.length;
				while(_g3 < _g2) {
					var j = _g3++;
					var rule = rules[j];
					if(rule.style == null || rule.selectorText == null || rule.selectorText != selector) {
						continue;
					}
					found = true;
					if(js.Lib.isIE) {
						{
							var _g4 = 0, _g5 = Reflect.fields(rule.style);
							while(_g4 < _g5.length) {
								var f = _g5[_g4];
								++_g4;
								var value = Reflect.field(rule.style,f);
								if(value == null || value == "") continue;
								var value1 = js.fx.Style.parseStyle(value);
								if(value1 != null && value1 != "") {
									result[f] = value1;
								}
							}
						}
					}
					else {
						var _g5 = 0, _g4 = rule.style.length;
						while(_g5 < _g4) {
							var s = _g5++;
							var style = rule.style[s];
							var camel = js.fx.Style.camel(style);
							var value = Reflect.field(rule.style,camel);
							if(value != null && value != "") result[camel] = js.fx.Style.parseStyle(value);
						}
					}
				}
			}
		}
	}
	if(!found) return null;
	return result;
}
js.fx.Style.getStyles = function(e,template) {
	var getter = null;
	if(e.currentStyle != null) {
		getter = function(key) {
			return e.currentStyle[key];
		}
	}
	if(getter == null) {
		var window = (js.Lib.document.defaultView?js.Lib.document.defaultView:js.Lib.document.parentWindow);
		if(window != null && window.getComputedStyle != null) {
			var cs = window.getComputedStyle(e,null);
			if(cs != null) getter = function(key) {
				return cs.getPropertyValue(js.fx.Style.hyphen(key));
			}
		}
	}
	if(getter == null) {
		getter = function(key) {
			return Reflect.field(e,key);
		}
	}
	var result = { }
	{
		var _g = 0, _g1 = Reflect.fields(template);
		while(_g < _g1.length) {
			var f = _g1[_g];
			++_g;
			var currentValue = (f == "opacity"?Std.string(js.fx.Style.getOpacity(e)):getter(f));
			var expectedType = Reflect.field(template,f);
			if(Std["is"](expectedType,js.fx.RGBA)) {
				var value = js.fx.RGBA.parse(currentValue);
				if(value == null) value = new js.fx.RGBA(0,0,0,0);
				result[f] = value;
				continue;
			}
			if(Std["is"](expectedType,js.fx.RGB)) {
				var value = js.fx.RGB.parse(currentValue);
				if(value == null) value = new js.fx.RGB(0,0,0);
				result[f] = value;
				continue;
			}
			if(Std["is"](expectedType,js.fx.Unit)) {
				var value = js.fx.Unit.parse(currentValue);
				if(value == null) value = new js.fx.Unit((expectedType).kind,0);
				if(value.kind != expectedType.kind) throw (("Unit kind mismatch " + value) + " != ") + expectedType;
				result[f] = value;
				continue;
			}
			if(Std["is"](expectedType,String)) {
				result[f] = currentValue;
			}
			var type = Type["typeof"](expectedType);
			if(type == ValueType.TFloat || f == "opacity") {
				var value = Std.parseFloat(Std.string(currentValue)) + 0.000000001;
				if(value == null) value = 0.000000001;
				result[f] = value;
			}
			else if(type == ValueType.TInt) {
				var value = Std.parseInt(Std.string(currentValue));
				if(value == null) value = 0;
				result[f] = value;
			}
		}
	}
	return result;
}
js.fx.Style.setStyles = function(e,styles) {
	var _g = 0, _g1 = Reflect.fields(styles);
	while(_g < _g1.length) {
		var f = _g1[_g];
		++_g;
		js.fx.Style.setStyle(e,f,Reflect.field(styles,f));
	}
}
js.fx.Style.setStyle = function(e,property,value) {
	switch(property) {
	case "opacity":{
		js.fx.Style.setOpacity(e,value);
		return;
	}break;
	case "float":{
		property = (js.fx.Style.REQUIRES_FILTERS?"styleFloat":"cssFloat");
	}break;
	case "zIndex":{
		value = Std.string(value);
	}break;
	}
	e.style[property] = js.fx.Style.styleValueToString(value);
}
js.fx.Style.setOpacity = function(e,opacity) {
	e.style.visibility = (opacity == 0.0?"hidden":"visible");
	if(js.fx.Style.REQUIRES_FILTERS) e.style.filter = (opacity == 1.0?"":("alpha(opacity=" + opacity * 100) + ")");
	e.style.opacity = opacity;
	e.style._opacity = opacity;
}
js.fx.Style.getOpacity = function(element) {
	var v = element.style._opacity;
	if(v == null) {
		return (function($this) {
			var $r;
			switch(element.style.visibility) {
			case "visible":{
				$r = 1.0;
			}break;
			case "hidden":{
				$r = 0.0;
			}break;
			case "":{
				$r = (element.style.display == "none"?0.0:1.0);
			}break;
			default:{
				$r = null;
			}break;
			}
			return $r;
		}(this));
	}
	return v;
}
js.fx.Style.styleValueToString = function(v) {
	return (function($this) {
		var $r;
		var $e = (Type["typeof"](v));
		switch( $e[1] ) {
		case 6:
		var c = $e[2];
		{
			$r = Std.string(v);
		}break;
		case 1:
		{
			$r = v + "px";
		}break;
		case 2:
		{
			$r = Std.string(v);
		}break;
		case 0:
		{
			$r = "";
		}break;
		default:{
			$r = (function($this) {
				var $r;
				throw "Unsupported js.fx.Style value " + Type["typeof"](v);
				return $r;
			}($this));
		}break;
		}
		return $r;
	}(this));
}
js.fx.Style.parseStyle = function(s) {
	var rgba = js.fx.RGBA.parse(s);
	if(rgba != null) return rgba;
	var rgb = js.fx.RGB.parse(s);
	if(rgb != null) return rgb;
	var unit = js.fx.Unit.parse(s);
	if(unit != null) return unit;
	return s;
}
js.fx.Style.camel = function(hyphen) {
	return new EReg("(-[a-z])","").customReplace(hyphen,function(reg) {
		return reg.matched(1).charAt(1).toUpperCase();
	});
}
js.fx.Style.hyphen = function(camel) {
	return new EReg("([A-Z])","").customReplace(camel,function(reg) {
		return "-" + reg.matched(1).toLowerCase();
	});
}
js.fx.Style.prototype.__class__ = js.fx.Style;
js.fx.RGBA = function(r,g,b,a) { if( r === $_ ) return; {
	this.r = r;
	this.g = g;
	this.b = g;
	this.a = a;
}}
js.fx.RGBA.__name__ = ["js","fx","RGBA"];
js.fx.RGBA.hexToInt = function(str) {
	str = str.toLowerCase();
	if(str.length == 0) return 0;
	if(str.length == 1) {
		var c = str.charCodeAt(0);
		var a = "a".charCodeAt(0);
		if(c >= a) return (10 + c) - a;
		var z = "0".charCodeAt(0);
		if(c >= z) return c - z;
	}
	if(str.length == 2) return 16 * js.fx.RGBA.hexToInt(str.charAt(0)) + js.fx.RGBA.hexToInt(str.charAt(1));
	return 0;
}
js.fx.RGBA.parse = function(value) {
	var reg = new EReg("^#?([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$","i");
	if(reg.match(value)) {
		var result = new js.fx.RGBA(js.fx.RGBA.hexToInt(reg.matched(1)),js.fx.RGBA.hexToInt(reg.matched(2)),js.fx.RGBA.hexToInt(reg.matched(3)),js.fx.RGBA.hexToInt(reg.matched(4)));
		return result;
	}
	var reg1 = new EReg("rgba\\(\\s*(\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)\\s*\\)","");
	if(reg1.match(value)) return new js.fx.RGBA(Std.parseInt(reg1.matched(1)),Std.parseInt(reg1.matched(2)),Std.parseInt(reg1.matched(3)),Std.parseInt(reg1.matched(4)));
	return null;
}
js.fx.RGBA.prototype.a = null;
js.fx.RGBA.prototype.b = null;
js.fx.RGBA.prototype.g = null;
js.fx.RGBA.prototype.r = null;
js.fx.RGBA.prototype.toString = function() {
	return ((((((("rgba(" + this.r) + ",") + this.g) + ",") + this.b) + ",") + this.a) + ")";
}
js.fx.RGBA.prototype.__class__ = js.fx.RGBA;
js.fx.RGB = function(r,g,b) { if( r === $_ ) return; {
	this.r = r;
	this.g = g;
	this.b = g;
}}
js.fx.RGB.__name__ = ["js","fx","RGB"];
js.fx.RGB.hexToInt = function(str) {
	str = str.toLowerCase();
	if(str.length == 0) return 0;
	if(str.length == 1) {
		var c = str.charCodeAt(0);
		var a = "a".charCodeAt(0);
		if(c >= a) return (10 + c) - a;
		var z = "0".charCodeAt(0);
		if(c >= z) return c - z;
	}
	if(str.length == 2) return 16 * js.fx.RGB.hexToInt(str.charAt(0)) + js.fx.RGB.hexToInt(str.charAt(1));
	return 0;
}
js.fx.RGB.parse = function(value) {
	var reg = new EReg("^#?([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$","i");
	if(reg.match(value)) {
		var result = new js.fx.RGB(js.fx.RGB.hexToInt(reg.matched(1)),js.fx.RGB.hexToInt(reg.matched(2)),js.fx.RGB.hexToInt(reg.matched(3)));
		return result;
	}
	var reg1 = new EReg("rgb\\(\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)\\s*\\)","");
	if(reg1.match(value)) return new js.fx.RGB(Std.parseInt(reg1.matched(1)),Std.parseInt(reg1.matched(2)),Std.parseInt(reg1.matched(3)));
	return null;
}
js.fx.RGB.prototype.b = null;
js.fx.RGB.prototype.g = null;
js.fx.RGB.prototype.r = null;
js.fx.RGB.prototype.toString = function() {
	return ((((("rgb(" + this.r) + ",") + this.g) + ",") + this.b) + ")";
}
js.fx.RGB.prototype.__class__ = js.fx.RGB;
js.fx.UnitKind = { __ename__ : ["js","fx","UnitKind"], __constructs__ : ["KEm","KPt","KPc","KPx"] }
js.fx.UnitKind.KEm = ["KEm",0];
js.fx.UnitKind.KEm.toString = $estr;
js.fx.UnitKind.KEm.__enum__ = js.fx.UnitKind;
js.fx.UnitKind.KPc = ["KPc",2];
js.fx.UnitKind.KPc.toString = $estr;
js.fx.UnitKind.KPc.__enum__ = js.fx.UnitKind;
js.fx.UnitKind.KPt = ["KPt",1];
js.fx.UnitKind.KPt.toString = $estr;
js.fx.UnitKind.KPt.__enum__ = js.fx.UnitKind;
js.fx.UnitKind.KPx = ["KPx",3];
js.fx.UnitKind.KPx.toString = $estr;
js.fx.UnitKind.KPx.__enum__ = js.fx.UnitKind;
js.fx.Unit = function(k,v) { if( k === $_ ) return; {
	this.kind = k;
	this.value = v;
	this.toString = (function($this) {
		var $r;
		var $e = (k);
		switch( $e[1] ) {
		case 0:
		{
			$r = $closure($this,"emToString");
		}break;
		case 1:
		{
			$r = $closure($this,"ptToString");
		}break;
		case 2:
		{
			$r = $closure($this,"pcToString");
		}break;
		case 3:
		{
			$r = $closure($this,"pxToString");
		}break;
		default:{
			$r = null;
		}break;
		}
		return $r;
	}(this));
}}
js.fx.Unit.__name__ = ["js","fx","Unit"];
js.fx.Unit.parse = function(value) {
	var reg = new EReg("^(\\-?[0-9.]+)(em|pt|%|px|)$","i");
	if(!reg.match(value)) return null;
	var val = Std.parseFloat(reg.matched(1));
	var kst = reg.matched(2);
	return (function($this) {
		var $r;
		switch(kst) {
		case "em":{
			$r = new js.fx.Unit(js.fx.UnitKind.KEm,val);
		}break;
		case "pt":{
			$r = new js.fx.Unit(js.fx.UnitKind.KPt,val);
		}break;
		case "px":{
			$r = new js.fx.Unit(js.fx.UnitKind.KPx,val);
		}break;
		case "%":{
			$r = new js.fx.Unit(js.fx.UnitKind.KPc,val);
		}break;
		default:{
			$r = new js.fx.Unit(js.fx.UnitKind.KPx,val);
		}break;
		}
		return $r;
	}(this));
}
js.fx.Unit.prototype.emToString = function() {
	return (Math.round(this.value * 10) / 10) + "em";
}
js.fx.Unit.prototype.kind = null;
js.fx.Unit.prototype.pcToString = function() {
	return (Math.round(this.value * 10) / 10) + "%";
}
js.fx.Unit.prototype.ptToString = function() {
	return (Math.round(this.value * 10) / 10) + "pt";
}
js.fx.Unit.prototype.pxToString = function() {
	return Math.round(this.value) + "px";
}
js.fx.Unit.prototype.toString = null;
js.fx.Unit.prototype.value = null;
js.fx.Unit.prototype.__class__ = js.fx.Unit;
js.fx.Delta = function() { }
js.fx.Delta.__name__ = ["js","fx","Delta"];
js.fx.Delta.getDeltaFunc = function(from,to) {
	return (Std["is"](a,js.fx.RGB)?$closure(js.fx.Delta,"rgb"):(Std["is"](a,js.fx.RGBA)?$closure(js.fx.Delta,"rgba"):(Std["is"](a,js.fx.Unit)?$closure(js.fx.Delta,"unit"):(Std["is"](a,String)?$closure(js.fx.Delta,"string"):(Type["typeof"](a) == ValueType.TFloat?$closure(js.fx.Delta,"float"):(Type["typeof"](a) == ValueType.TInt?$closure(js.fx.Delta,"int"):$closure(js.fx.Delta,"unknown")))))));
}
js.fx.Delta.styles = function(from,to,delta) {
	var result = { }
	{
		var _g = 0, _g1 = Reflect.fields(from);
		while(_g < _g1.length) {
			var f = _g1[_g];
			++_g;
			result[f] = js.fx.Delta.any(Reflect.field(from,f),Reflect.field(to,f),delta);
		}
	}
	return result;
}
js.fx.Delta.unknown = function(from,to,delta) {
	return (delta < 0.5?from:to);
}
js.fx.Delta.any = function(a,b,delta) {
	return (Std["is"](a,js.fx.RGB)?$closure(js.fx.Delta,"rgb"):(Std["is"](a,js.fx.RGBA)?$closure(js.fx.Delta,"rgba"):(Std["is"](a,js.fx.Unit)?$closure(js.fx.Delta,"unit"):(Std["is"](a,String)?$closure(js.fx.Delta,"string"):(Type["typeof"](a) == ValueType.TFloat?$closure(js.fx.Delta,"float"):(Type["typeof"](a) == ValueType.TInt?$closure(js.fx.Delta,"int"):$closure(js.fx.Delta,"unknown")))))))(a,b,delta);
}
js.fx.Delta.rgb = function(from,to,delta) {
	return new js.fx.RGB(js.fx.Delta["int"](from.r,to.r,delta),js.fx.Delta["int"](from.g,to.g,delta),js.fx.Delta["int"](from.b,to.b,delta));
}
js.fx.Delta.rgba = function(from,to,delta) {
	return new js.fx.RGBA(js.fx.Delta["int"](from.r,to.r,delta),js.fx.Delta["int"](from.g,to.g,delta),js.fx.Delta["int"](from.b,to.b,delta),js.fx.Delta["int"](from.a,to.a,delta));
}
js.fx.Delta.unit = function(from,to,delta) {
	return new js.fx.Unit(from.kind,js.fx.Delta["float"](from.value,to.value,delta));
}
js.fx.Delta.string = function(from,to,delta) {
	return (delta < 0.5?from:to);
}
js.fx.Delta["int"] = function(from,to,delta) {
	return Std["int"](Math.floor((to - from) * delta + from));
}
js.fx.Delta["float"] = function(from,to,delta) {
	return (to - from) * delta + from;
}
js.fx.Delta.prototype.__class__ = js.fx.Delta;
haxe.Http = function(url) { if( url === $_ ) return; {
	this.url = url;
	this.headers = new Hash();
	this.params = new Hash();
	this.async = true;
}}
haxe.Http.__name__ = ["haxe","Http"];
haxe.Http.requestUrl = function(url) {
	var h = new haxe.Http(url);
	h.async = false;
	var r = null;
	h.onData = function(d) {
		r = d;
	}
	h.onError = function(e) {
		throw e;
	}
	h.request(false);
	return r;
}
haxe.Http.prototype.async = null;
haxe.Http.prototype.headers = null;
haxe.Http.prototype.onData = function(data) {
	null;
}
haxe.Http.prototype.onError = function(msg) {
	null;
}
haxe.Http.prototype.onStatus = function(status) {
	null;
}
haxe.Http.prototype.params = null;
haxe.Http.prototype.postData = null;
haxe.Http.prototype.request = function(post) {
	var me = this;
	var r = new js.XMLHttpRequest();
	var onreadystatechange = function() {
		if(r.readyState != 4) return;
		var s = (function($this) {
			var $r;
			try {
				$r = r.status;
			}
			catch( $e0 ) {
				{
					var e = $e0;
					$r = null;
				}
			}
			return $r;
		}(this));
		if(s == undefined) s = null;
		if(s != null) me.onStatus(s);
		if(s != null && s >= 200 && s < 400) me.onData(r.responseText);
		else switch(s) {
		case null:{
			me.onError("Failed to connect or resolve host");
		}break;
		case 12029:{
			me.onError("Failed to connect to host");
		}break;
		case 12007:{
			me.onError("Unknown host");
		}break;
		default:{
			me.onError("Http Error #" + r.status);
		}break;
		}
	}
	if(this.async) r.onreadystatechange = onreadystatechange;
	var uri = this.postData;
	if(uri != null) post = true;
	else { var $it1 = this.params.keys();
	while( $it1.hasNext() ) { var p = $it1.next();
	{
		if(uri == null) uri = "";
		else uri += "&";
		uri += (StringTools.urlDecode(p) + "=") + StringTools.urlEncode(this.params.get(p));
	}
	}}
	try {
		if(post) r.open("POST",this.url,this.async);
		else if(uri != null) {
			var question = this.url.split("?").length <= 1;
			r.open("GET",(this.url + ((question?"?":"&"))) + uri,this.async);
			uri = null;
		}
		else r.open("GET",this.url,this.async);
	}
	catch( $e2 ) {
		{
			var e = $e2;
			{
				this.onError(e.toString());
				return;
			}
		}
	}
	if(this.headers.get("Content-Type") == null && post && this.postData == null) r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	{ var $it3 = this.headers.keys();
	while( $it3.hasNext() ) { var h = $it3.next();
	r.setRequestHeader(h,this.headers.get(h));
	}}
	r.send(uri);
	if(!this.async) onreadystatechange();
}
haxe.Http.prototype.setHeader = function(header,value) {
	this.headers.set(header,value);
}
haxe.Http.prototype.setParameter = function(param,value) {
	this.params.set(param,value);
}
haxe.Http.prototype.setPostData = function(data) {
	this.postData = data;
}
haxe.Http.prototype.url = null;
haxe.Http.prototype.__class__ = haxe.Http;
if(typeof mt=='undefined') mt = {}
if(!mt.js) mt.js = {}
mt.js.EditorAction = { __ename__ : ["mt","js","EditorAction"], __constructs__ : ["AImage","ANode","ASpan","ALink","AReg"] }
mt.js.EditorAction.AImage = function(tag,url) { var $x = ["AImage",0,tag,url]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
mt.js.EditorAction.ALink = function(text1,text2,node) { var $x = ["ALink",3,text1,text2,node]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
mt.js.EditorAction.ANode = function(node,html) { var $x = ["ANode",1,node,html]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
mt.js.EditorAction.AReg = function(ereg,replace) { var $x = ["AReg",4,ereg,replace]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
mt.js.EditorAction.ASpan = function(node,span) { var $x = ["ASpan",2,node,span]; $x.__enum__ = mt.js.EditorAction; $x.toString = $estr; return $x; }
mt.js.Editor = function(name) { if( name === $_ ) return; {
	this.name = name;
	this.contentName = name + "_content";
	this.config = { buttons : new List(), icons : new List(), iconsUrl : "", autoLink : true, linkTarget : "_blank", uploadData : null, uploadColors : { bg : 0, fg : 16777215, fill : 32768}}
}}
mt.js.Editor.__name__ = ["mt","js","Editor"];
mt.js.Editor.getElementPosition = function(o) {
	var ret = { x : 0, y : 0, width : o.clientWidth, height : o.clientHeight}
	if(ret.width == 0) ret.width = o.offsetWidth;
	if(ret.height == 0) ret.height = o.offsetHeight;
	var p = o;
	while(p != null) {
		if(p.offsetParent != null) {
			ret.x += p.offsetLeft - p.scrollLeft;
			ret.y += p.offsetTop - p.scrollTop;
		}
		else {
			ret.x += p.offsetLeft;
			ret.y += p.offsetTop;
		}
		p = p.offsetParent;
	}
	return ret;
}
mt.js.Editor.prototype.config = null;
mt.js.Editor.prototype.contentName = null;
mt.js.Editor.prototype.execute = function(act) {
	var act1 = haxe.Unserializer.run(act);
	var $e = (act1);
	switch( $e[1] ) {
	case 0:
	var tag = $e[2];
	{
		this.insert(tag);
	}break;
	case 1:
	case 2:
	var tag = $e[2];
	{
		this.quoteSelection(("[" + tag) + "]",("[/" + tag) + "]");
	}break;
	case 3:
	var node = $e[4], text = $e[3], addr = $e[2];
	{
		var url = js.Lib.window.prompt(addr,"http://");
		if(url == null || url.length == 0 || url == "http://") return false;
		var comment = js.Lib.window.prompt(text,url);
		if(comment.length == 0 || comment == url) this.insert(((((("[" + node) + "]") + url) + "[/") + node) + "]");
		else this.insert(((((((("[" + node) + "=") + url) + "]") + comment) + "[/") + node) + "]");
	}break;
	case 4:
	{
		null;
	}break;
	}
	return false;
}
mt.js.Editor.prototype.format = function(txt) {
	if(txt == "" || txt == null) return "";
	txt = StringTools.htmlEscape(txt);
	txt = txt.split("\r\n").join("\n");
	txt = txt.split("\r").join("\n");
	txt = StringTools.trim(txt);
	txt = txt.split("\\0")[0];
	if(txt == null) return "";
	if(this.config.autoLink) {
		txt = new EReg("([^@=>\\]\"])(http://[a-zA-Z0-9/?;&=%_.#-]+)","g").replace(txt,("$1<a href=\"$2\"" + this.linkTarget()) + ">$2</a>");
		txt = new EReg("^(http://[a-zA-Z0-9/?;&=%_.#-]+)","g").replace(txt,("<a href=\"$1\"" + this.linkTarget()) + ">$1</a>");
	}
	if(this.config.uploadData != null) txt = new EReg("@([A-Za-z0-9/_.]+)@","g").replace(txt,("<img src=\"" + this.config.uploadData.url) + "$1\"/>");
	{ var $it0 = this.config.icons.iterator();
	while( $it0.hasNext() ) { var i = $it0.next();
	txt = this.formatAction(txt,i.act);
	}}
	{ var $it1 = this.config.buttons.iterator();
	while( $it1.hasNext() ) { var b = $it1.next();
	txt = this.formatAction(txt,b.act);
	}}
	txt = new EReg("<([a-z]+)></\\1>","i").replace(txt,"");
	var schar = String.fromCharCode(1);
	txt = txt.split(schar).join("");
	txt = new EReg("<([a-zA-Z0-9]+[^>]*/>)","g").replace(txt,schar + "$1");
	var r = new EReg("<([a-zA-Z0-9]+)([^>]*>[^<]*)</\\1>","g");
	while(true) {
		var t = r.replace(txt,((schar + "$1$2") + schar) + "/$1>");
		if(t == txt) break;
		txt = t;
	}
	txt = new EReg("</?[a-zA-Z0-9]+[^>]*>","g").replace(txt,"");
	txt = txt.split(schar).join("<");
	var b = new StringBuf();
	this.wordify(b,Xml.parse(txt));
	return b.b.join("");
}
mt.js.Editor.prototype.formatAction = function(txt,act) {
	return (function($this) {
		var $r;
		var $e = (act);
		switch( $e[1] ) {
		case 0:
		var img = $e[3], tag = $e[2];
		{
			$r = txt.split(tag).join(("<img src=\"" + $this.image(img)) + "\" alt=\"\"/>");
		}break;
		case 1:
		var html = $e[3], node = $e[2];
		{
			$r = $this.formatNode(txt,node,("<" + html) + ">",("</" + html) + ">");
		}break;
		case 2:
		var span = $e[3], node = $e[2];
		{
			$r = $this.formatNode(txt,node,("<span class=\"" + span) + "\">","</span>");
		}break;
		case 3:
		var node = $e[4];
		{
			$r = (function($this) {
				var $r;
				var r = new EReg(((("\\[" + node) + "\\](https?://[^\"]*?)\\[\\/") + node) + "\\]","ig");
				txt = r.replace(txt,("<a href=\"$1\"" + $this.linkTarget()) + ">$1</a>");
				r = new EReg(((("\\[" + node) + "=(https?://[^\"]*?)\\](.*?)\\[\\/") + node) + "\\]","ig");
				$r = r.replace(txt,("<a href=\"$1\"" + $this.linkTarget()) + ">$2</a>");
				return $r;
			}($this));
		}break;
		case 4:
		var replace = $e[3], ereg = $e[2];
		{
			$r = (function($this) {
				var $r;
				var r = new EReg(ereg,"ig");
				$r = r.replace(txt,replace);
				return $r;
			}($this));
		}break;
		default:{
			$r = null;
		}break;
		}
		return $r;
	}(this));
}
mt.js.Editor.prototype.formatNode = function(txt,node,h1,h2) {
	return txt.split(("[" + node) + "]").join(h1).split(("[/" + node) + "]").join(h2);
}
mt.js.Editor.prototype.getDocument = function() {
	return js.Lib.document.getElementsByName(this.contentName)[0];
}
mt.js.Editor.prototype.image = function(img) {
	return this.config.iconsUrl.split("::img::").join(img);
}
mt.js.Editor.prototype.initUpload = function(id,act,target) {
	if(this.config.uploadData == null) throw "No data domain";
	var cnxName = (("edcnx_" + id) + "_") + this.name;
	var me = this;
	var api = { uploadResult : function(url) {
		act(url);
	}, uploadError : function(e) {
		js.Lib.alert(((me.config.uploadData.error + "\n(") + e) + ")");
	}}
	var cnx = haxe.remoting.ExternalConnection.flashConnect(cnxName,null,haxe.remoting.Context.share("api",api));
	var params = [this.config.uploadData.url + "upload/upload.swf","swf_" + id,"100%","100%",9];
	var swfobj;
	try {
		swfobj = js.Lib.eval("js.SWFObject");
		if(swfobj == null) throw null;
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				swfobj = js.Lib.eval("SWFObject");
			}
		}
	}
	var obj = Type.createInstance(swfobj,params);
	obj.addParam("AllowScriptAccess","always");
	var c = this.config.uploadColors;
	var colors = (((("&bgcolor=" + c.bg) + "&fgcolor=") + c.fg) + "&color=") + c.fill;
	obj.addParam("FlashVars",(((((("name=" + cnxName) + "&site=") + this.config.uploadData.site) + "&prefix=") + this.config.uploadData.uid) + colors) + (((target != null)?"&click=1":"")));
	obj.addParam("wmode","transparent");
	obj.write(id);
	return false;
}
mt.js.Editor.prototype.insert = function(txt) {
	this.quoteSelection(txt,"");
}
mt.js.Editor.prototype.insertImage = function(url) {
	this.insert(("@" + url) + "@");
}
mt.js.Editor.prototype.linkTarget = function() {
	return (this.config.linkTarget == null?"":(" target=\"" + this.config.linkTarget) + "\"");
}
mt.js.Editor.prototype.loadConfig = function(str) {
	this.config = haxe.Unserializer.run(str);
}
mt.js.Editor.prototype.name = null;
mt.js.Editor.prototype.quoteSelection = function(begin,end) {
	var doc = this.getDocument();
	var sel = new js.Selection(doc);
	sel.insert(begin,sel.get(),end);
	if(doc.onkeyup != null) doc.onkeyup(null);
}
mt.js.Editor.prototype.setUploadButton = function(target,act) {
	var id = target + "_swf";
	var loaded = false;
	js.Lib.document.write(("<div id=\"" + id) + "\"></div>");
	var but = js.Lib.document.getElementById(target);
	var me = this;
	but.onmouseover = function(_) {
		if(loaded) return;
		loaded = true;
		var doc = js.Lib.document;
		var win = js.Lib.window;
		var swf = doc.getElementById(id);
		swf.style.position = "absolute";
		swf.style.left = "0px";
		swf.style.top = "0px";
		var p = mt.js.Editor.getElementPosition(but);
		swf.style.width = p.width + "px";
		swf.style.height = p.height + "px";
		swf.style.zIndex = 10;
		var p2 = mt.js.Editor.getElementPosition(swf);
		swf.style.top = (p.y - p2.y) + "px";
		swf.style.left = (p.x - p2.x) + "px";
		me.initUpload(id,act,but);
	}
}
mt.js.Editor.prototype.updatePreview = function(id) {
	var doc = js.Lib.document.getElementById(id);
	doc.innerHTML = this.format(this.getDocument().value);
}
mt.js.Editor.prototype.wordify = function(b,x) {
	switch(x.nodeType) {
	case Xml.Document:{
		{ var $it0 = x.iterator();
		while( $it0.hasNext() ) { var x1 = $it0.next();
		this.wordify(b,x1);
		}}
	}break;
	case Xml.Element:{
		b.b[b.b.length] = "<" + x.getNodeName();
		{ var $it1 = x.attributes();
		while( $it1.hasNext() ) { var a = $it1.next();
		b.b[b.b.length] = (((" " + a) + "=\"") + x.get(a)) + "\"";
		}}
		if(x.firstChild() == null) b.b[b.b.length] = "/>";
		else {
			b.b[b.b.length] = ">";
			{ var $it2 = x.iterator();
			while( $it2.hasNext() ) { var x1 = $it2.next();
			this.wordify(b,x1);
			}}
			b.b[b.b.length] = ("</" + x.getNodeName()) + ">";
		}
	}break;
	case Xml.PCData:case Xml.CData:{
		var first = true;
		{
			var _g = 0, _g1 = x.getNodeValue().split(" ");
			while(_g < _g1.length) {
				var data = _g1[_g];
				++_g;
				if(first) first = false;
				else b.b[b.b.length] = " ";
				while(data.length > 40) {
					b.b[b.b.length] = data.substr(0,40);
					b.b[b.b.length] = " ";
					data = data.substr(40);
				}
				b.b[b.b.length] = data;
			}
		}
	}break;
	default:{
		null;
	}break;
	}
}
mt.js.Editor.prototype.__class__ = mt.js.Editor;
js.fx.Transition = { __ename__ : ["js","fx","Transition"], __constructs__ : ["Linear","Quad","Cubic","Quart","Quint","Pow","Expo","Circ","Sine","Back","Bounce","Elastic"] }
js.fx.Transition.Back = function(p,pa) { var $x = ["Back",9,p,pa]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Bounce = function(p) { var $x = ["Bounce",10,p]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Circ = function(p) { var $x = ["Circ",7,p]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Cubic = function(p) { var $x = ["Cubic",2,p]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Elastic = function(p,pa) { var $x = ["Elastic",11,p,pa]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Expo = function(p) { var $x = ["Expo",6,p]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Linear = ["Linear",0];
js.fx.Transition.Linear.toString = $estr;
js.fx.Transition.Linear.__enum__ = js.fx.Transition;
js.fx.Transition.Pow = function(pa) { var $x = ["Pow",5,pa]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Quad = function(p) { var $x = ["Quad",1,p]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Quart = function(p) { var $x = ["Quart",3,p]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Quint = function(p) { var $x = ["Quint",4,p]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
js.fx.Transition.Sine = function(p) { var $x = ["Sine",8,p]; $x.__enum__ = js.fx.Transition; $x.toString = $estr; return $x; }
ValueType = { __ename__ : ["ValueType"], __constructs__ : ["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"] }
ValueType.TBool = ["TBool",3];
ValueType.TBool.toString = $estr;
ValueType.TBool.__enum__ = ValueType;
ValueType.TClass = function(c) { var $x = ["TClass",6,c]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; }
ValueType.TEnum = function(e) { var $x = ["TEnum",7,e]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; }
ValueType.TFloat = ["TFloat",2];
ValueType.TFloat.toString = $estr;
ValueType.TFloat.__enum__ = ValueType;
ValueType.TFunction = ["TFunction",5];
ValueType.TFunction.toString = $estr;
ValueType.TFunction.__enum__ = ValueType;
ValueType.TInt = ["TInt",1];
ValueType.TInt.toString = $estr;
ValueType.TInt.__enum__ = ValueType;
ValueType.TNull = ["TNull",0];
ValueType.TNull.toString = $estr;
ValueType.TNull.__enum__ = ValueType;
ValueType.TObject = ["TObject",4];
ValueType.TObject.toString = $estr;
ValueType.TObject.__enum__ = ValueType;
ValueType.TUnknown = ["TUnknown",8];
ValueType.TUnknown.toString = $estr;
ValueType.TUnknown.__enum__ = ValueType;
js.Boot = function() { }
js.Boot.__name__ = ["js","Boot"];
js.Boot.__unhtml = function(s) {
	return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
js.Boot.__trace = function(v,i) {
	var msg = (i != null?((i.fileName + ":") + i.lineNumber) + ": ":"");
	msg += js.Boot.__unhtml(js.Boot.__string_rec(v,"")) + "<br/>";
	var d = document.getElementById("haxe:trace");
	if(d == null) alert("No haxe:trace element defined\n" + msg);
	else d.innerHTML += msg;
}
js.Boot.__clear_trace = function() {
	var d = document.getElementById("haxe:trace");
	if(d != null) d.innerHTML = "";
	else null;
}
js.Boot.__closure = function(o,f) {
	var m = o[f];
	if(m == null) return null;
	var f1 = function() {
		return m.apply(o,arguments);
	}
	f1.scope = o;
	f1.method = m;
	return f1;
}
js.Boot.__string_rec = function(o,s) {
	if(o == null) return "null";
	if(s.length >= 5) return "<...>";
	var t = typeof(o);
	if(t == "function" && (o.__name__ != null || o.__ename__ != null)) t = "object";
	switch(t) {
	case "object":{
		if(o instanceof Array) {
			if(o.__enum__ != null) {
				if(o.length == 2) return o[0];
				var str = o[0] + "(";
				s += "\t";
				{
					var _g1 = 2, _g = o.length;
					while(_g1 < _g) {
						var i = _g1++;
						if(i != 2) str += "," + js.Boot.__string_rec(o[i],s);
						else str += js.Boot.__string_rec(o[i],s);
					}
				}
				return str + ")";
			}
			var l = o.length;
			var i;
			var str = "[";
			s += "\t";
			{
				var _g = 0;
				while(_g < l) {
					var i1 = _g++;
					str += ((i1 > 0?",":"")) + js.Boot.__string_rec(o[i1],s);
				}
			}
			str += "]";
			return str;
		}
		var tostr;
		try {
			tostr = o.toString;
		}
		catch( $e0 ) {
			{
				var e = $e0;
				{
					return "???";
				}
			}
		}
		if(tostr != null && tostr != Object.toString) {
			var s2 = o.toString();
			if(s2 != "[object Object]") return s2;
		}
		var k = null;
		var str = "{\n";
		s += "\t";
		var hasp = (o.hasOwnProperty != null);
		for( var k in o ) { ;
		if(hasp && !o.hasOwnProperty(k)) continue;
		if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__") continue;
		if(str.length != 2) str += ", \n";
		str += ((s + k) + " : ") + js.Boot.__string_rec(o[k],s);
		}
		s = s.substring(1);
		str += ("\n" + s) + "}";
		return str;
	}break;
	case "function":{
		return "<function>";
	}break;
	case "string":{
		return o;
	}break;
	default:{
		return String(o);
	}break;
	}
}
js.Boot.__interfLoop = function(cc,cl) {
	if(cc == null) return false;
	if(cc == cl) return true;
	var intf = cc.__interfaces__;
	if(intf != null) {
		var _g1 = 0, _g = intf.length;
		while(_g1 < _g) {
			var i = _g1++;
			var i1 = intf[i];
			if(i1 == cl || js.Boot.__interfLoop(i1,cl)) return true;
		}
	}
	return js.Boot.__interfLoop(cc.__super__,cl);
}
js.Boot.__instanceof = function(o,cl) {
	try {
		if(o instanceof cl) {
			if(cl == Array) return (o.__enum__ == null);
			return true;
		}
		if(js.Boot.__interfLoop(o.__class__,cl)) return true;
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				if(cl == null) return false;
			}
		}
	}
	switch(cl) {
	case Int:{
		return Math.ceil(o%2147483648.0) === o;
	}break;
	case Float:{
		return typeof(o) == "number";
	}break;
	case Bool:{
		return o === true || o === false;
	}break;
	case String:{
		return typeof(o) == "string";
	}break;
	case Dynamic:{
		return true;
	}break;
	default:{
		if(o == null) return false;
		return o.__enum__ == cl || (cl == Class && o.__name__ != null) || (cl == Enum && o.__ename__ != null);
	}break;
	}
}
js.Boot.__init = function() {
	js.Lib.isIE = (typeof document!='undefined' && document.all != null && typeof window!='undefined' && window.opera == null);
	js.Lib.isOpera = (typeof window!='undefined' && window.opera != null);
	Array.prototype.copy = Array.prototype.slice;
	Array.prototype.insert = function(i,x) {
		this.splice(i,0,x);
	}
	Array.prototype.remove = (Array.prototype.indexOf?function(obj) {
		var idx = this.indexOf(obj);
		if(idx == -1) return false;
		this.splice(idx,1);
		return true;
	}:function(obj) {
		var i = 0;
		var l = this.length;
		while(i < l) {
			if(this[i] == obj) {
				this.splice(i,1);
				return true;
			}
			i++;
		}
		return false;
	});
	Array.prototype.iterator = function() {
		return { cur : 0, arr : this, hasNext : function() {
			return this.cur < this.arr.length;
		}, next : function() {
			return this.arr[this.cur++];
		}}
	}
	var cca = String.prototype.charCodeAt;
	String.prototype.cca = cca;
	String.prototype.charCodeAt = function(i) {
		var x = cca.call(this,i);
		if(isNaN(x)) return null;
		return x;
	}
	var oldsub = String.prototype.substr;
	String.prototype.substr = function(pos,len) {
		if(pos != null && pos != 0 && len != null && len < 0) return "";
		if(len == null) len = this.length;
		if(pos < 0) {
			pos = this.length + pos;
			if(pos < 0) pos = 0;
		}
		else if(len < 0) {
			len = (this.length + len) - pos;
		}
		return oldsub.apply(this,[pos,len]);
	}
	$closure = js.Boot.__closure;
}
js.Boot.prototype.__class__ = js.Boot;
IntHash = function(p) { if( p === $_ ) return; {
	this.h = {}
	if(this.h.__proto__ != null) {
		this.h.__proto__ = null;
		delete(this.h.__proto__);
	}
	else null;
}}
IntHash.__name__ = ["IntHash"];
IntHash.prototype.exists = function(key) {
	return this.h[key] != null;
}
IntHash.prototype.get = function(key) {
	return this.h[key];
}
IntHash.prototype.h = null;
IntHash.prototype.iterator = function() {
	return { ref : this.h, it : this.keys(), hasNext : function() {
		return this.it.hasNext();
	}, next : function() {
		var i = this.it.next();
		return this.ref[i];
	}}
}
IntHash.prototype.keys = function() {
	var a = new Array();
	
			for( x in this.h )
				a.push(x);
		;
	return a.iterator();
}
IntHash.prototype.remove = function(key) {
	if(this.h[key] == null) return false;
	delete(this.h[key]);
	return true;
}
IntHash.prototype.set = function(key,value) {
	this.h[key] = value;
}
IntHash.prototype.toString = function() {
	var s = new StringBuf();
	s.b[s.b.length] = "{";
	var it = this.keys();
	{ var $it0 = it;
	while( $it0.hasNext() ) { var i = $it0.next();
	{
		s.b[s.b.length] = i;
		s.b[s.b.length] = " => ";
		s.b[s.b.length] = Std.string(this.get(i));
		if(it.hasNext()) s.b[s.b.length] = ", ";
	}
	}}
	s.b[s.b.length] = "}";
	return s.b.join("");
}
IntHash.prototype.__class__ = IntHash;
DateTools = function() { }
DateTools.__name__ = ["DateTools"];
DateTools.__format_get = function(d,e) {
	return (function($this) {
		var $r;
		switch(e) {
		case "%":{
			$r = "%";
		}break;
		case "C":{
			$r = StringTools.lpad(Std.string(Std["int"](d.getFullYear() / 100)),"0",2);
		}break;
		case "d":{
			$r = StringTools.lpad(Std.string(d.getDate()),"0",2);
		}break;
		case "D":{
			$r = DateTools.__format(d,"%m/%d/%y");
		}break;
		case "e":{
			$r = Std.string(d.getDate());
		}break;
		case "H":case "k":{
			$r = StringTools.lpad(Std.string(d.getHours()),(e == "H"?"0":" "),2);
		}break;
		case "I":case "l":{
			$r = (function($this) {
				var $r;
				var hour = d.getHours() % 12;
				$r = StringTools.lpad(Std.string((hour == 0?12:hour)),(e == "I"?"0":" "),2);
				return $r;
			}($this));
		}break;
		case "m":{
			$r = StringTools.lpad(Std.string(d.getMonth() + 1),"0",2);
		}break;
		case "M":{
			$r = StringTools.lpad(Std.string(d.getMinutes()),"0",2);
		}break;
		case "n":{
			$r = "\n";
		}break;
		case "p":{
			$r = (d.getHours() > 11?"PM":"AM");
		}break;
		case "r":{
			$r = DateTools.__format(d,"%I:%M:%S %p");
		}break;
		case "R":{
			$r = DateTools.__format(d,"%H:%M");
		}break;
		case "s":{
			$r = Std.string(Std["int"](d.getTime() / 1000));
		}break;
		case "S":{
			$r = StringTools.lpad(Std.string(d.getSeconds()),"0",2);
		}break;
		case "t":{
			$r = "\t";
		}break;
		case "T":{
			$r = DateTools.__format(d,"%H:%M:%S");
		}break;
		case "u":{
			$r = (function($this) {
				var $r;
				var t = d.getDay();
				$r = (t == 0?"7":Std.string(t));
				return $r;
			}($this));
		}break;
		case "w":{
			$r = Std.string(d.getDay());
		}break;
		case "y":{
			$r = StringTools.lpad(Std.string(d.getFullYear() % 100),"0",2);
		}break;
		case "Y":{
			$r = Std.string(d.getFullYear());
		}break;
		default:{
			$r = (function($this) {
				var $r;
				throw ("Date.format %" + e) + "- not implemented yet.";
				return $r;
			}($this));
		}break;
		}
		return $r;
	}(this));
}
DateTools.__format = function(d,f) {
	var r = new StringBuf();
	var p = 0;
	while(true) {
		var np = f.indexOf("%",p);
		if(np < 0) break;
		r.b[r.b.length] = f.substr(p,np - p);
		r.b[r.b.length] = DateTools.__format_get(d,f.substr(np + 1,1));
		p = np + 2;
	}
	r.b[r.b.length] = f.substr(p,f.length - p);
	return r.b.join("");
}
DateTools.format = function(d,f) {
	return DateTools.__format(d,f);
}
DateTools.delta = function(d,t) {
	return Date.fromTime(d.getTime() + t);
}
DateTools.getMonthDays = function(d) {
	var month = d.getMonth();
	var year = d.getFullYear();
	if(month != 1) return DateTools.DAYS_OF_MONTH[month];
	var isB = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
	return (isB?29:28);
}
DateTools.seconds = function(n) {
	return n * 1000.0;
}
DateTools.minutes = function(n) {
	return (n * 60.0) * 1000.0;
}
DateTools.hours = function(n) {
	return ((n * 60.0) * 60.0) * 1000.0;
}
DateTools.days = function(n) {
	return (((n * 24.0) * 60.0) * 60.0) * 1000.0;
}
DateTools.parse = function(t) {
	var s = t / 1000;
	var m = s / 60;
	var h = m / 60;
	return { ms : t % 1000, seconds : Std["int"](s % 60), minutes : Std["int"](m % 60), hours : Std["int"](h % 24), days : Std["int"](h / 24)}
}
DateTools.make = function(o) {
	return o.ms + 1000.0 * (o.seconds + 60.0 * (o.minutes + 60.0 * (o.hours + 24.0 * o.days)));
}
DateTools.prototype.__class__ = DateTools;
js.Cookie = function() { }
js.Cookie.__name__ = ["js","Cookie"];
js.Cookie.set = function(name,value,expireDelay,path,domain) {
	var s = (name + "=") + StringTools.urlEncode(value);
	if(expireDelay != null) {
		var d = DateTools.delta(Date.now(),expireDelay * 1000);
		s += ";expires=" + d.toGMTString();
	}
	if(path != null) {
		s += ";path=" + path;
	}
	if(domain != null) {
		s += ";domain=" + domain;
	}
	js.Lib.document.cookie = s;
}
js.Cookie.all = function() {
	var h = new Hash();
	var a = js.Lib.document.cookie.split(";");
	{
		var _g = 0;
		while(_g < a.length) {
			var e = a[_g];
			++_g;
			e = StringTools.ltrim(e);
			var t = e.split("=");
			if(t.length < 2) continue;
			h.set(t[0],StringTools.urlDecode(t[1]));
		}
	}
	return h;
}
js.Cookie.get = function(name) {
	return js.Cookie.all().get(name);
}
js.Cookie.exists = function(name) {
	return js.Cookie.all().exists(name);
}
js.Cookie.remove = function(name,path,domain) {
	js.Cookie.set(name,"",-10,path,domain);
}
js.Cookie.prototype.__class__ = js.Cookie;
js.fx.Mouse = function() { }
js.fx.Mouse.__name__ = ["js","fx","Mouse"];
js.fx.Mouse.last = null;
js.fx.Mouse.get = function(event) {
	var posx = 0;
	var posy = 0;
	if(event == null) event = js.Lib.window.event;
	var e = event;
	if(e.pageX != null) {
		posx = e.pageX;
		posy = e.pageY;
	}
	else if(e.clientX != null) {
		posx = (e.clientX + js.Lib.document.body.scrollLeft) + js.Lib.document.documentElement.scrollLeft;
		posy = (e.clientY + js.Lib.document.body.scrollTop) + js.Lib.document.documentElement.scrollTop;
	}
	js.fx.Mouse.last = { x : posx, y : posy}
	return js.fx.Mouse.last;
}
js.fx.Mouse.prototype.__class__ = js.fx.Mouse;
Geo = function() { }
Geo.__name__ = ["Geo"];
Geo.get = function(ip,cb) {
	if(Geo.cache.exists(ip)) {
		cb(Geo.cache.get(ip));
		return;
	}
	var rq = new haxe.Http("http://www.geoiptool.com/fr/");
	rq.setParameter("IP",ip);
	rq.onError = function(err) {
		haxe.Firebug.trace("ERR " + Std.string(err),{ fileName : "Geo.hx", lineNumber : 21, className : "Geo", methodName : "get"});
	}
	rq.onData = function(str) {
		haxe.Firebug.trace("RCV data",{ fileName : "Geo.hx", lineNumber : 24, className : "Geo", methodName : "get"});
		var regCountry = new EReg("Code de pays:.*?\">(.*?)</td>","g");
		var regRegion = new EReg("gion:.*?_blank\">(.*?)</a>","g");
		var regCity = new EReg("Ville:.*?\">(.*?)</td>","g");
		var result = { ip : ip, country : null, region : null, city : null}
		if(regCountry.match(str)) result.country = regCountry.matched(1);
		if(regRegion.match(str)) result.region = regRegion.matched(1);
		if(regCity.match(str)) result.city = regCity.matched(1);
		Geo.cache.set(ip,result);
		cb(result);
	}
	rq.request(false);
	haxe.Firebug.trace("GET http://www.geoiptool.com/fr/?IP=" + ip,{ fileName : "Geo.hx", lineNumber : 44, className : "Geo", methodName : "get"});
}
Geo.prototype.__class__ = Geo;
js.fx.TransitionFunctions = function() { }
js.fx.TransitionFunctions.__name__ = ["js","fx","TransitionFunctions"];
js.fx.TransitionFunctions.transitionParam = function(p,f) {
	return (function($this) {
		var $r;
		var $e = (p);
		switch( $e[1] ) {
		case 0:
		{
			$r = f;
		}break;
		case 1:
		{
			$r = function(pos) {
				return 1 - f(1 - pos);
			}
		}break;
		case 2:
		{
			$r = function(pos) {
				return (pos <= 0.5?f(2 * pos) / 2:(2 - f(2 * (1 - pos)) / 2));
			}
		}break;
		default:{
			$r = null;
		}break;
		}
		return $r;
	}(this));
}
js.fx.TransitionFunctions.get = function(t) {
	return (function($this) {
		var $r;
		var $e = (t);
		switch( $e[1] ) {
		case 0:
		{
			$r = $closure(js.fx.TransitionFunctions,"linear");
		}break;
		case 1:
		var p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,$closure(js.fx.TransitionFunctions,"quad"));
		}break;
		case 2:
		var p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,$closure(js.fx.TransitionFunctions,"cubic"));
		}break;
		case 3:
		var p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,$closure(js.fx.TransitionFunctions,"quart"));
		}break;
		case 4:
		var p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,$closure(js.fx.TransitionFunctions,"quint"));
		}break;
		case 5:
		var p = $e[2];
		{
			$r = function(f,a1) {
				return function(a2) {
					return f(a1,a2);
				}
			}($closure(js.fx.TransitionFunctions,"pow"),p);
		}break;
		case 6:
		var p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,$closure(js.fx.TransitionFunctions,"expo"));
		}break;
		case 7:
		var p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,$closure(js.fx.TransitionFunctions,"circ"));
		}break;
		case 8:
		var p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,$closure(js.fx.TransitionFunctions,"sine"));
		}break;
		case 9:
		var pa = $e[3], p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,function(f,a1) {
				return function(a2) {
					return f(a1,a2);
				}
			}($closure(js.fx.TransitionFunctions,"back"),pa));
		}break;
		case 10:
		var p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,$closure(js.fx.TransitionFunctions,"bounce"));
		}break;
		case 11:
		var pa = $e[3], p = $e[2];
		{
			$r = js.fx.TransitionFunctions.transitionParam(p,function(f,a1) {
				return function(a2) {
					return f(a1,a2);
				}
			}($closure(js.fx.TransitionFunctions,"elastic"),pa));
		}break;
		default:{
			$r = null;
		}break;
		}
		return $r;
	}(this));
}
js.fx.TransitionFunctions.linear = function(p) {
	return p;
}
js.fx.TransitionFunctions.pow = function(x,p) {
	if(x == null) x = 6.0;
	return Math.pow(p,x);
}
js.fx.TransitionFunctions.expo = function(p) {
	return Math.pow(2,8 * (p - 1));
}
js.fx.TransitionFunctions.circ = function(p) {
	return 1 - Math.sin(Math.acos(p));
}
js.fx.TransitionFunctions.sine = function(p) {
	return 1 - Math.sin(((1 - p) * Math.PI) / 2);
}
js.fx.TransitionFunctions.back = function(pa,p) {
	if(pa == null) pa = 1.618;
	return Math.pow(p,2) * ((pa + 1) * p - pa);
}
js.fx.TransitionFunctions.bounce = function(p) {
	var value = null;
	var a = 0.0;
	var b = 1.0;
	while(true) {
		if(p >= (7 - 4 * a) / 11) {
			value = -Math.pow(((11 - 6 * a) - 11 * p) / 4,2) + b * b;
			break;
		}
		a += b;
		b /= 2.0;
	}
	return value;
}
js.fx.TransitionFunctions.elastic = function(pa,p) {
	if(pa == null) pa = 1.0;
	return Math.pow(2,10 * --p) * Math.cos((((20 * p) * Math.PI) * pa) / 3);
}
js.fx.TransitionFunctions.quad = function(p) {
	return Math.pow(p,2);
}
js.fx.TransitionFunctions.cubic = function(p) {
	return Math.pow(p,3);
}
js.fx.TransitionFunctions.quart = function(p) {
	return Math.pow(p,4);
}
js.fx.TransitionFunctions.quint = function(p) {
	return Math.pow(p,5);
}
js.fx.TransitionFunctions.prototype.__class__ = js.fx.TransitionFunctions;
js.fx.Timer = function(p) { if( p === $_ ) return; {
	null;
}}
js.fx.Timer.__name__ = ["js","fx","Timer"];
js.fx.Timer.timeout = function(cb,delay) {
	var t = new js.fx.Timer();
	t.data = setTimeout(cb,delay);
	return t;
}
js.fx.Timer.periodical = function(cb,delay) {
	var t = new js.fx.Timer();
	t.data = setInterval(cb,delay);
	return t;
}
js.fx.Timer.clear = function(t) {
	clearTimeout(t.data);
	clearInterval(t.data);
	return null;
}
js.fx.Timer.prototype.data = null;
js.fx.Timer.prototype.__class__ = js.fx.Timer;
$_ = {}
js.Boot.__res = {}
js.Boot.__init();
{
	
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
;
	js.SWFObject = deconcept.SWFObject;
}
{
	Xml.Element = "element";
	Xml.PCData = "pcdata";
	Xml.CData = "cdata";
	Xml.Comment = "comment";
	Xml.DocType = "doctype";
	Xml.Prolog = "prolog";
	Xml.Document = "document";
}
{
	var d = Date;
	d.now = function() {
		return new Date();
	}
	d.fromTime = function(t) {
		var d1 = new Date();
		d1["setTime"](t);
		return d1;
	}
	d.fromString = function(s) {
		switch(s.length) {
		case 8:{
			var k = s.split(":");
			var d1 = new Date();
			d1["setTime"](0);
			d1["setUTCHours"](k[0]);
			d1["setUTCMinutes"](k[1]);
			d1["setUTCSeconds"](k[2]);
			return d1;
		}break;
		case 10:{
			var k = s.split("-");
			return new Date(k[0],k[1] - 1,k[2],0,0,0);
		}break;
		case 19:{
			var k = s.split(" ");
			var y = k[0].split("-");
			var t = k[1].split(":");
			return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
		}break;
		default:{
			throw "Invalid date format : " + s;
		}break;
		}
	}
	d.prototype["toString"] = function() {
		var date = this;
		var m = date.getMonth() + 1;
		var d1 = date.getDate();
		var h = date.getHours();
		var mi = date.getMinutes();
		var s = date.getSeconds();
		return (((((((((date.getFullYear() + "-") + ((m < 10?"0" + m:"" + m))) + "-") + ((d1 < 10?"0" + d1:"" + d1))) + " ") + ((h < 10?"0" + h:"" + h))) + ":") + ((mi < 10?"0" + mi:"" + mi))) + ":") + ((s < 10?"0" + s:"" + s));
	}
	d.prototype.__class__ = d;
	d.__name__ = ["Date"];
}
{
	String.prototype.__class__ = String;
	String.__name__ = ["String"];
	Array.prototype.__class__ = Array;
	Array.__name__ = ["Array"];
	Int = { __name__ : ["Int"]}
	Dynamic = { __name__ : ["Dynamic"]}
	Float = Number;
	Float.__name__ = ["Float"];
	Bool = { __ename__ : ["Bool"]}
	Class = { __name__ : ["Class"]}
	Enum = { }
	Void = { __ename__ : ["Void"]}
}
{
	Math.__name__ = ["Math"];
	Math.NaN = Number["NaN"];
	Math.NEGATIVE_INFINITY = Number["NEGATIVE_INFINITY"];
	Math.POSITIVE_INFINITY = Number["POSITIVE_INFINITY"];
	Math.isFinite = function(i) {
		return isFinite(i);
	}
	Math.isNaN = function(i) {
		return isNaN(i);
	}
}
{
	js.Lib.document = document;
	js.Lib.window = window;
	onerror = function(msg,url,line) {
		var f = js.Lib.onerror;
		if( f == null )
			return false;
		return f(msg,[url+":"+line]);
	}
}
{
	js["XMLHttpRequest"] = (window.XMLHttpRequest?XMLHttpRequest:(window.ActiveXObject?function() {
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch( $e0 ) {
			{
				var e = $e0;
				{
					try {
						return new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch( $e1 ) {
						{
							var e1 = $e1;
							{
								throw "Unable to create XMLHttpRequest object.";
							}
						}
					}
				}
			}
		}
	}:(function($this) {
		var $r;
		throw "Unable to create XMLHttpRequest object.";
		return $r;
	}(this))));
}
js.fx.Tip.minWidth = 100;
js.fx.Tip.minHeight = 40;
js.fx.Tip.offsetX = 10;
js.fx.Tip.offsetY = 10;
Xml.enode = new EReg("^<([a-zA-Z0-9:_-]+)","");
Xml.ecdata = new EReg("^<!\\[CDATA\\[","i");
Xml.edoctype = new EReg("^<!DOCTYPE ","i");
Xml.eend = new EReg("^</([a-zA-Z0-9:_-]+)>","");
Xml.epcdata = new EReg("^[^<]+","");
Xml.ecomment = new EReg("^<!--","");
Xml.eprolog = new EReg("^<\\?[^\\?]+\\?>","");
Xml.eattribute = new EReg("^\\s*([a-zA-Z0-9:_-]+)\\s*=\\s*([\"'])([^\\2]*?)\\2","");
Xml.eclose = new EReg("^[ \\r\\n\\t]*(>|(/>))","");
Xml.ecdata_end = new EReg("\\]\\]>","");
Xml.edoctype_elt = new EReg("[\\[|\\]>]","");
Xml.ecomment_end = new EReg("-->","");
Js.chronos = new List();
Js.objectives = new Array();
haxe.remoting.ExternalConnection.connections = new Hash();
HelpUI.links = null;
HelpUI.currentIndex = 0;
haxe.Timer.arr = new Array();
haxe.Unserializer.DEFAULT_RESOLVER = Type;
haxe.Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
haxe.Unserializer.CODES = null;
haxe.Serializer.USE_CACHE = false;
haxe.Serializer.USE_ENUM_INDEX = false;
haxe.Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
js.Lib.onerror = null;
js.fx.Style.REQUIRES_FILTERS = js.Lib.window.ActiveXObject != null;
DateTools.DAYS_OF_MONTH = [31,28,31,30,31,30,31,31,30,31,30,31];
Geo.cache = new Hash();
