$estr = function() { return js.Boot.__string_rec(this,''); }
if(typeof js=='undefined') js = {}
js.Boot = function() { }
js.Boot.__name__ = ["js","Boot"];
js.Boot.__unhtml = function(s) {
	return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
js.Boot.__trace = function(v,i) {
	var msg = i != null?i.fileName + ":" + i.lineNumber + ": ":"";
	msg += js.Boot.__unhtml(js.Boot.__string_rec(v,"")) + "<br/>";
	var d = document.getElementById("haxe:trace");
	if(d == null) alert("No haxe:trace element defined\n" + msg);
	else d.innerHTML += msg;
}
js.Boot.__clear_trace = function() {
	var d = document.getElementById("haxe:trace");
	if(d != null) d.innerHTML = "";
	else null;
}
js.Boot.__closure = function(o,f) {
	var m = o[f];
	if(m == null) return null;
	var f1 = function() {
		return m.apply(o,arguments);
	}
	f1.scope = o;
	f1.method = m;
	return f1;
}
js.Boot.__string_rec = function(o,s) {
	if(o == null) return "null";
	if(s.length >= 5) return "<...>";
	var t = typeof(o);
	if(t == "function" && (o.__name__ != null || o.__ename__ != null)) t = "object";
	switch(t) {
	case "object":{
		if(o instanceof Array) {
			if(o.__enum__ != null) {
				if(o.length == 2) return o[0];
				var str = o[0] + "(";
				s += "\t";
				{
					var _g1 = 2, _g = o.length;
					while(_g1 < _g) {
						var i = _g1++;
						if(i != 2) str += "," + js.Boot.__string_rec(o[i],s);
						else str += js.Boot.__string_rec(o[i],s);
					}
				}
				return str + ")";
			}
			var l = o.length;
			var i;
			var str = "[";
			s += "\t";
			{
				var _g = 0;
				while(_g < l) {
					var i1 = _g++;
					str += (i1 > 0?",":"") + js.Boot.__string_rec(o[i1],s);
				}
			}
			str += "]";
			return str;
		}
		var tostr;
		try {
			tostr = o.toString;
		}
		catch( $e0 ) {
			{
				var e = $e0;
				{
					return "???";
				}
			}
		}
		if(tostr != null && tostr != Object.toString) {
			var s2 = o.toString();
			if(s2 != "[object Object]") return s2;
		}
		var k = null;
		var str = "{\n";
		s += "\t";
		var hasp = o.hasOwnProperty != null;
		for( var k in o ) { ;
		if(hasp && !o.hasOwnProperty(k)) continue;
		if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__") continue;
		if(str.length != 2) str += ", \n";
		str += s + k + " : " + js.Boot.__string_rec(o[k],s);
		}
		s = s.substring(1);
		str += "\n" + s + "}";
		return str;
	}break;
	case "function":{
		return "<function>";
	}break;
	case "string":{
		return o;
	}break;
	default:{
		return String(o);
	}break;
	}
}
js.Boot.__interfLoop = function(cc,cl) {
	if(cc == null) return false;
	if(cc == cl) return true;
	var intf = cc.__interfaces__;
	if(intf != null) {
		var _g1 = 0, _g = intf.length;
		while(_g1 < _g) {
			var i = _g1++;
			var i1 = intf[i];
			if(i1 == cl || js.Boot.__interfLoop(i1,cl)) return true;
		}
	}
	return js.Boot.__interfLoop(cc.__super__,cl);
}
js.Boot.__instanceof = function(o,cl) {
	try {
		if(o instanceof cl) {
			if(cl == Array) return o.__enum__ == null;
			return true;
		}
		if(js.Boot.__interfLoop(o.__class__,cl)) return true;
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				if(cl == null) return false;
			}
		}
	}
	switch(cl) {
	case Int:{
		return Math.ceil(o%2147483648.0) === o;
	}break;
	case Float:{
		return typeof(o) == "number";
	}break;
	case Bool:{
		return o === true || o === false;
	}break;
	case String:{
		return typeof(o) == "string";
	}break;
	case Dynamic:{
		return true;
	}break;
	default:{
		if(o == null) return false;
		return o.__enum__ == cl || cl == Class && o.__name__ != null || cl == Enum && o.__ename__ != null;
	}break;
	}
}
js.Boot.__init = function() {
	js.Lib.isIE = typeof document!='undefined' && document.all != null && typeof window!='undefined' && window.opera == null;
	js.Lib.isOpera = typeof window!='undefined' && window.opera != null;
	Array.prototype.copy = Array.prototype.slice;
	Array.prototype.insert = function(i,x) {
		this.splice(i,0,x);
	}
	Array.prototype.remove = Array.prototype.indexOf?function(obj) {
		var idx = this.indexOf(obj);
		if(idx == -1) return false;
		this.splice(idx,1);
		return true;
	}:function(obj) {
		var i = 0;
		var l = this.length;
		while(i < l) {
			if(this[i] == obj) {
				this.splice(i,1);
				return true;
			}
			i++;
		}
		return false;
	}
	Array.prototype.iterator = function() {
		return { cur : 0, arr : this, hasNext : function() {
			return this.cur < this.arr.length;
		}, next : function() {
			return this.arr[this.cur++];
		}};
	}
	if(String.prototype.cca == null) String.prototype.cca = String.prototype.charCodeAt;
	String.prototype.charCodeAt = function(i) {
		var x = this.cca(i);
		if(x != 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;
if(typeof haxe=='undefined') haxe = {}
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.Public = function() { }
haxe.Public.__name__ = ["haxe","Public"];
haxe.Public.prototype.__class__ = haxe.Public;
if(typeof feffects=='undefined') feffects = {}
if(!feffects.easing) feffects.easing = {}
feffects.easing.Linear = function() { }
feffects.easing.Linear.__name__ = ["feffects","easing","Linear"];
feffects.easing.Linear.easeNone = function(t,b,c,d) {
	return c * t / d + b;
}
feffects.easing.Linear.easeIn = function(t,b,c,d) {
	return c * t / d + b;
}
feffects.easing.Linear.easeOut = function(t,b,c,d) {
	return c * t / d + b;
}
feffects.easing.Linear.easeInOut = function(t,b,c,d) {
	return c * t / d + b;
}
feffects.easing.Linear.prototype.__class__ = feffects.easing.Linear;
feffects.easing.Linear.__interfaces__ = [haxe.Public];
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.url = null;
haxe.Http.prototype.async = null;
haxe.Http.prototype.postData = null;
haxe.Http.prototype.headers = null;
haxe.Http.prototype.params = null;
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.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: case undefined:{
			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.onData = function(data) {
	null;
}
haxe.Http.prototype.onError = function(msg) {
	null;
}
haxe.Http.prototype.onStatus = function(status) {
	null;
}
haxe.Http.prototype.__class__ = haxe.Http;
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;
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;
haxe.FastList = function(p) { if( p === $_ ) return; {
	null;
}}
haxe.FastList.__name__ = ["haxe","FastList"];
haxe.FastList.prototype.head = null;
haxe.FastList.prototype.add = function(item) {
	this.head = new haxe.FastCell(item,this.head);
}
haxe.FastList.prototype.first = function() {
	return this.head == null?null:this.head.elt;
}
haxe.FastList.prototype.pop = function() {
	var k = this.head;
	if(k == null) return null;
	else {
		this.head = k.next;
		return k.elt;
	}
}
haxe.FastList.prototype.isEmpty = function() {
	return this.head == null;
}
haxe.FastList.prototype.remove = function(v) {
	var prev = null;
	var l = this.head;
	while(l != null) {
		if(l.elt == v) {
			if(prev == null) this.head = l.next;
			else prev.next = l.next;
			break;
		}
		prev = l;
		l = l.next;
	}
	return l != null;
}
haxe.FastList.prototype.iterator = function() {
	var l = this.head;
	return { hasNext : function() {
		return l != null;
	}, next : function() {
		var k = l;
		l = k.next;
		return k.elt;
	}};
}
haxe.FastList.prototype.toString = function() {
	var a = new Array();
	var l = this.head;
	while(l != null) {
		a.push(l.elt);
		l = l.next;
	}
	return "{" + a.join(",") + "}";
}
haxe.FastList.prototype.__class__ = haxe.FastList;
feffects.Tween = function(init,end,dur,obj,prop,easing) { if( init === $_ ) return; {
	this.initVal = init;
	this.endVal = end;
	this.duration = dur;
	this.offsetTime = 0;
	this.obj = obj;
	this.prop = prop;
	if(easing != null) this.easingF = easing;
	else if(Reflect.isFunction(obj)) this.easingF = obj;
	else this.easingF = $closure(this,"easingEquation");
	this.isPlaying = false;
}}
feffects.Tween.__name__ = ["feffects","Tween"];
feffects.Tween.timer = null;
feffects.Tween.AddTween = function(tween) {
	feffects.Tween.aTweens.add(tween);
	feffects.Tween.timer.run = $closure(feffects.Tween,"DispatchTweens");
}
feffects.Tween.RemoveTween = function(tween) {
	if(tween == null || feffects.Tween.timer == null) return;
	feffects.Tween.aTweens.remove(tween);
	if(feffects.Tween.aTweens.head == null && feffects.Tween.aPaused.head == null) {
		feffects.Tween.timer.stop();
		feffects.Tween.timer = null;
	}
}
feffects.Tween.getActiveTweens = function() {
	return feffects.Tween.aTweens;
}
feffects.Tween.getPausedTweens = function() {
	return feffects.Tween.aPaused;
}
feffects.Tween.setTweenPaused = function(tween) {
	if(tween == null || feffects.Tween.timer == null) return;
	feffects.Tween.aPaused.add(tween);
	feffects.Tween.aTweens.remove(tween);
}
feffects.Tween.setTweenActive = function(tween) {
	if(tween == null || feffects.Tween.timer == null) return;
	feffects.Tween.aTweens.add(tween);
	feffects.Tween.aPaused.remove(tween);
}
feffects.Tween.DispatchTweens = function() {
	{ var $it0 = feffects.Tween.aTweens.iterator();
	while( $it0.hasNext() ) { var i = $it0.next();
	i.doInterval();
	}}
}
feffects.Tween.prototype.duration = null;
feffects.Tween.prototype.position = null;
feffects.Tween.prototype.reversed = null;
feffects.Tween.prototype.isPlaying = null;
feffects.Tween.prototype.initVal = null;
feffects.Tween.prototype.endVal = null;
feffects.Tween.prototype.startTime = null;
feffects.Tween.prototype.pauseTime = null;
feffects.Tween.prototype.offsetTime = null;
feffects.Tween.prototype.reverseTime = null;
feffects.Tween.prototype.updateFunc = null;
feffects.Tween.prototype.endFunc = null;
feffects.Tween.prototype.easingF = null;
feffects.Tween.prototype.obj = null;
feffects.Tween.prototype.prop = null;
feffects.Tween.prototype.start = function() {
	if(feffects.Tween.timer != null) feffects.Tween.timer.stop();
	feffects.Tween.timer = new haxe.Timer(feffects.Tween.interval);
	this.startTime = Date.now().getTime() - feffects.Tween.jsDate;
	if(this.duration == 0) this.endTween();
	else feffects.Tween.AddTween(this);
	this.isPlaying = true;
	this.position = 0;
	this.reverseTime = this.startTime;
	this.reversed = false;
}
feffects.Tween.prototype.pause = function() {
	this.pauseTime = Date.now().getTime() - feffects.Tween.jsDate;
	feffects.Tween.setTweenPaused(this);
	this.isPlaying = false;
}
feffects.Tween.prototype.resume = function() {
	this.startTime += Date.now().getTime() - feffects.Tween.jsDate - this.pauseTime;
	this.reverseTime += Date.now().getTime() - feffects.Tween.jsDate - this.pauseTime;
	feffects.Tween.setTweenActive(this);
	this.isPlaying = true;
}
feffects.Tween.prototype.seek = function(ms) {
	this.offsetTime = ms;
}
feffects.Tween.prototype.reverse = function() {
	this.reversed = !this.reversed;
	if(!this.reversed) this.startTime += Date.now().getTime() - feffects.Tween.jsDate - this.reverseTime << 1;
	this.reverseTime = Date.now().getTime() - feffects.Tween.jsDate;
}
feffects.Tween.prototype.stop = function() {
	feffects.Tween.RemoveTween(this);
	this.isPlaying = false;
}
feffects.Tween.prototype.doInterval = function() {
	var stamp = Date.now().getTime() - feffects.Tween.jsDate;
	var curTime = 0;
	{
		if(this.reversed) curTime = (this.reverseTime << 1) - stamp - this.startTime + this.offsetTime;
		else curTime = stamp - this.startTime + this.offsetTime;
	}
	var curVal = this.easingF(curTime,this.initVal,this.endVal - this.initVal,this.duration);
	if(curTime >= this.duration || curTime <= 0) this.endTween();
	else {
		if(this.updateFunc != null) this.updateFunc(curVal);
		if(this.prop != null) this.obj[this.prop] = curVal;
	}
	this.position = curTime;
}
feffects.Tween.prototype.getCurVal = function(curTime) {
	return this.easingF(curTime,this.initVal,this.endVal - this.initVal,this.duration);
}
feffects.Tween.prototype.endTween = function() {
	feffects.Tween.RemoveTween(this);
	var val = 0.0;
	if(this.reversed) val = this.initVal;
	else val = this.endVal;
	if(this.updateFunc != null) this.updateFunc(val);
	if(this.endFunc != null) this.endFunc(val);
	if(this.prop != null) this.obj[this.prop] = val;
}
feffects.Tween.prototype.setTweenHandlers = function(update,end) {
	this.updateFunc = update;
	this.endFunc = end;
}
feffects.Tween.prototype.setEasing = function(easingFunc) {
	if(easingFunc != null) this.easingF = easingFunc;
}
feffects.Tween.prototype.easingEquation = function(t,b,c,d) {
	return c / 2 * (Math.sin(Math.PI * (t / d - 0.5)) + 1) + b;
}
feffects.Tween.prototype.__class__ = feffects.Tween;
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,10);
	if(v == 0 && x.charCodeAt(1) == 120) v = parseInt(x);
	if(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;
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.measure = function(f,pos) {
	var t0 = haxe.Timer.stamp();
	var r = f();
	haxe.Log.trace(haxe.Timer.stamp() - t0 + "s",pos);
	return r;
}
haxe.Timer.stamp = function() {
	return Date.now().getTime() / 1000;
}
haxe.Timer.prototype.id = null;
haxe.Timer.prototype.timerId = 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.run = function() {
	null;
}
haxe.Timer.prototype.__class__ = haxe.Timer;
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.h = null;
Hash.prototype.set = function(key,value) {
	this.h["$" + key] = value;
}
Hash.prototype.get = function(key) {
	return this.h["$" + key];
}
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.remove = function(key) {
	if(!this.exists(key)) return false;
	delete(this.h["$" + key]);
	return true;
}
Hash.prototype.keys = function() {
	var a = new Array();
	
			for(var i in this.h)
				a.push(i.substr(1));
		;
	return a.iterator();
}
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.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;
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.fastCodeAt = function(s,index) {
	return s.cca(index);
}
StringTools.isEOF = function(c) {
	return c != c;
}
StringTools.prototype.__class__ = StringTools;
ManageProj = function() { }
ManageProj.__name__ = ["ManageProj"];
ManageProj.main = function() {
	null;
}
ManageProj.focus = function(id) {
	var x = js.Lib.document.getElementById(id);
	ManageProj.oldValue = x.value;
	x.style.border = "2px dashed #999";
	x.style.background = "#ccc";
	x.removeAttribute("readonly");
}
ManageProj.blur = function(id) {
	var x = js.Lib.document.getElementById(id);
	x.style.border = "";
	x.style.background = "";
	x.setAttribute("readonly","true");
}
ManageProj.OC = function(id,dom) {
	var x = js.Lib.document.getElementById(id);
	var disp = x.style.display;
	x.style.display = disp == "none"?"block":"none";
	dom.innerHTML = disp == "none"?"-":"+";
}
ManageProj.savecat = function(dom) {
	if(js.Lib.window.confirm("Wanna change it ?")) {
		ManageProj.newValue = dom.value;
		haxe.Http.requestUrl("lib/UXML.php?action=savecat&oldTitle=" + ManageProj.oldValue + "&newTitle=" + ManageProj.newValue);
		js.Lib.window.location.href = "index.php?p=manage_proj";
	}
}
ManageProj.savesscat = function(dom) {
	if(js.Lib.window.confirm("Wanna change it ?")) {
		ManageProj.newValue = dom.value;
		haxe.Http.requestUrl("lib/UXML.php?action=savesscat&oldTitle=" + ManageProj.oldValue + "&newTitle=" + ManageProj.newValue);
		js.Lib.window.location.href = "index.php?p=manage_proj";
	}
}
ManageProj.saveproj = function(dom,part,title) {
	if(js.Lib.window.confirm("Wanna change it ?")) {
		ManageProj.newValue = StringTools.replace(dom.value,"\\r","__");
		ManageProj.newValue = StringTools.replace(ManageProj.newValue,"\n","---");
		haxe.Http.requestUrl("lib/UXML.php?action=saveproj&part=" + part + "&oldValue=" + ManageProj.oldValue + "&newValue=" + ManageProj.newValue + "&title=" + title);
	}
}
ManageProj.delCat = function(id,node) {
	if(js.Lib.window.confirm("Wanna del it ?")) {
		haxe.Http.requestUrl("lib/UXML.php?action=delCat&id=" + id + "&node=" + node);
	}
}
ManageProj.delProj = function(id) {
	if(js.Lib.window.confirm("Wanna del it ?")) {
		haxe.Http.requestUrl("/lib/UXML.php?action=delProj&id=" + id);
	}
}
ManageProj.sendMail = function(from,message) {
	var ajax = haxe.Http.requestUrl("/lib/sendMail.php?from=" + from + "&message=" + message);
	js.Lib.window.alert(ajax);
	js.Lib.window.location.href = "http://razaina.fr/contact";
}
ManageProj.finished = function(e) {
	null;
}
ManageProj.register = function(login,pwd,mail) {
	var ajax = haxe.Http.requestUrl("/lib/register.php?login=" + login + "&pwd=" + pwd + "&mail=" + mail);
	js.Lib.window.alert(ajax);
}
ManageProj.deco = function() {
	var ajax = haxe.Http.requestUrl("/lib/deconnecter.php");
	js.Lib.window.location.href = "http://razaina.fr/accueil";
}
ManageProj.connecter = function(login,pwd) {
	var ajax = haxe.Http.requestUrl("/lib/connexion.php?login=" + login + "&pwd=" + pwd);
	js.Lib.window.alert(ajax);
	js.Lib.window.location.href = "http://razaina.fr/accueil";
}
ManageProj.addItemsEditor = function(id) {
	var obj = js.Lib.document.getElementById(id);
	var w_obj = obj.offsetWidth;
}
ManageProj.closeLightBox = function() {
	js.Lib.document.getElementById("filter").style.display = "none";
	js.Lib.document.getElementById("box").style.display = "none";
}
ManageProj.setLangue = function(lng) {
	var ajax = haxe.Http.requestUrl("/lib/setLangue.php?lng=" + lng + "");
	js.Lib.window.location.href = "./";
	return false;
}
ManageProj.src_incr = function(langue,title) {
	var ajax = haxe.Http.requestUrl("/lib/update_src.php?lng=" + langue + "&t=" + title);
	return false;
}
ManageProj.insertBBCode = function(n) {
	var textarea = js.Lib.document.getElementsByTagName("textarea")[0];
	textarea.focus();
	var btn = ManageProj.buttons[n];
	var nodeValue = textarea.value;
	var result = "";
	if(typeof document.selection != 'undefined') {
		var range = document.selection.createRange();
									var insText = range.text;
									range.text = btn[0] + insText + btn[1]; 
									range = document.selection.createRange();
									if (insText.length == 0) {
									  range.move('character', -btn[1].length);
									} else {
									  range.moveStart('character', btn[0].length + insText.length + btn[1].length);
									}
									range.select();;
	}
	else {
		if(textarea.selectionStart == textarea.selectionEnd) {
			var startText = nodeValue.substring(0,textarea.selectionStart);
			var endText = nodeValue.substring(textarea.selectionEnd,nodeValue.length);
			switch(n) {
			case 0:{
				result = startText + btn[0] + btn[1] + btn[2] + endText;
			}break;
			case 7:{
				result = startText + btn[0] + btn[1] + btn[2] + endText;
			}break;
			default:{
				result = startText + btn[0] + btn[1] + endText;
			}break;
			}
		}
		else {
			var startText = nodeValue.substring(0,textarea.selectionStart);
			var endText = nodeValue.substring(textarea.selectionEnd,nodeValue.length);
			var textSelected = nodeValue.substring(textarea.selectionStart,textarea.selectionEnd);
			haxe.Log.clear();
			switch(n) {
			case 0:{
				var url = prompt("URL :","");
				result = startText + btn[0] + url + btn[1] + textSelected + btn[2] + endText;
			}break;
			case 7:{
				var mailto = prompt("Mailto :","");
				result = startText + btn[0] + mailto + btn[1] + textSelected + btn[2] + endText;
			}break;
			default:{
				result = startText + btn[0] + textSelected + btn[1] + endText;
			}break;
			}
		}
		textarea.value = result;
	}
}
ManageProj.prototype.__class__ = ManageProj;
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;
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.addSub = function(s,pos,len) {
	this.b[this.b.length] = s.substr(pos,len);
}
StringBuf.prototype.addChar = function(c) {
	this.b[this.b.length] = String.fromCharCode(c);
}
StringBuf.prototype.toString = function() {
	return this.b.join("");
}
StringBuf.prototype.b = null;
StringBuf.prototype.__class__ = StringBuf;
haxe.FastCell = function(elt,next) { if( elt === $_ ) return; {
	this.elt = elt;
	this.next = next;
}}
haxe.FastCell.__name__ = ["haxe","FastCell"];
haxe.FastCell.prototype.elt = null;
haxe.FastCell.prototype.next = null;
haxe.FastCell.prototype.__class__ = haxe.FastCell;
IntIter = function(min,max) { if( min === $_ ) return; {
	this.min = min;
	this.max = max;
}}
IntIter.__name__ = ["IntIter"];
IntIter.prototype.min = null;
IntIter.prototype.max = null;
IntIter.prototype.hasNext = function() {
	return this.min < this.max;
}
IntIter.prototype.next = function() {
	return this.min++;
}
IntIter.prototype.__class__ = IntIter;
$_ = {}
js.Boot.__res = {}
js.Boot.__init();
{
	var d = Date;
	d.now = function() {
		return new Date();
	}
	d.fromTime = function(t) {
		var d1 = new Date();
		d1["setTime"](t);
		return d1;
	}
	d.fromString = function(s) {
		switch(s.length) {
		case 8:{
			var k = s.split(":");
			var d1 = new Date();
			d1["setTime"](0);
			d1["setUTCHours"](k[0]);
			d1["setUTCMinutes"](k[1]);
			d1["setUTCSeconds"](k[2]);
			return d1;
		}break;
		case 10:{
			var k = s.split("-");
			return new Date(k[0],k[1] - 1,k[2],0,0,0);
		}break;
		case 19:{
			var k = s.split(" ");
			var y = k[0].split("-");
			var t = k[1].split(":");
			return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
		}break;
		default:{
			throw "Invalid date format : " + s;
		}break;
		}
	}
	d.prototype["toString"] = function() {
		var date = this;
		var m = date.getMonth() + 1;
		var d1 = date.getDate();
		var h = date.getHours();
		var mi = date.getMinutes();
		var s = date.getSeconds();
		return date.getFullYear() + "-" + (m < 10?"0" + m:"" + m) + "-" + (d1 < 10?"0" + d1:"" + d1) + " " + (h < 10?"0" + h:"" + h) + ":" + (mi < 10?"0" + mi:"" + mi) + ":" + (s < 10?"0" + s:"" + s);
	}
	d.prototype.__class__ = d;
	d.__name__ = ["Date"];
}
{
	js.Lib.document = document;
	js.Lib.window = window;
	onerror = function(msg,url,line) {
		var f = js.Lib.onerror;
		if( f == null )
			return false;
		return f(msg,[url+":"+line]);
	}
}
{
	String.prototype.__class__ = String;
	String.__name__ = ["String"];
	Array.prototype.__class__ = Array;
	Array.__name__ = ["Array"];
	Int = { __name__ : ["Int"]};
	Dynamic = { __name__ : ["Dynamic"]};
	Float = Number;
	Float.__name__ = ["Float"];
	Bool = { __ename__ : ["Bool"]};
	Class = { __name__ : ["Class"]};
	Enum = { };
	Void = { __ename__ : ["Void"]};
}
{
	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["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.Lib.onerror = null;
feffects.Tween.aTweens = new haxe.FastList();
feffects.Tween.aPaused = new haxe.FastList();
feffects.Tween.jsDate = Date.now().getTime();
feffects.Tween.interval = 10;
haxe.Timer.arr = new Array();
ManageProj.oldValue = "";
ManageProj.newValue = "";
ManageProj.buttons = [["[url=","]","[/url]"],["[quote]","[/quote]"],["[code]","[/code]"],["[b]","[/b]"],["[u]","[/u]"],["[i]","[/i]"],["[s]","[/s]"],["[mail=","]","[/mail]"]];
ManageProj.main()
