/* DOM convenience */
var _$elemCache = new Object();
function $(id, reload) {if(!_$elemCache[id]||reload){var e = document.getElementById(id);_$elemCache[id] = e;return e;} else return _$elemCache[id];}
function x$(id){_$elemCache[id]=null;}
function $$(id){return $(id,true)}
function _pos(e,m){e=_c(e);if(!m)m={x:0,y:0};var x=0,y=0;while(e){x+=e.offsetLeft;y+=e.offsetTop;try{e=e.offsetParent;}catch(ex){e=null;}}return{x:x+m.x,y:y+m.y};}
function _modpos(p,t) {return {x:p.x+t.x,y:p.y+t.y};}
function _cpos(d) {var vp = _vp();return {x:((vp.w/2)-((d.w)/2)+vp.x), y:((vp.h/2)-((d.h)/2)+vp.y),w:d.w,h:d.h};}
function _dim(e){e=_c(e);return (!e||!e.offsetWidth)?{w:0,h:0}:{w:e.offsetWidth,h:e.offsetHeight};};
function _absolute(e){e=_c(e);if(e.style.position=='absolute')return;var p=_pos(e);var w=e.clientWidth;var h=e.clientHeight;e.style.position='absolute';e.style.left=(document.all?p.x+1:p.x)+'px';e.style.top=(document.all?p.y+1:p.y)+'px';}

/* Object convenience */
function _inject(d,s){for(var p in s)d[p]=s[p];return d;}
function _extend(d,s){for(var p in s)if(!d[p])d[p]=s[p];return d;}

var $obj = _inject(new Object(),{
	count: 0,
	ects: new Object(),
	timeout: function(o,f,t){var id=$chr.fromNum(this.count++);this.ects[id]=o;setTimeout('$obj.cb("'+id+'","'+f+'")',t);},
	cb:  function(i,f){var o=$obj.ects[i];if(o!=null){o[f]();this.ects[i]=null;}}
});

var $try = _inject(new Object(),{these: function(){for(var i=0,a=arguments;i<a.length;i++){try{return(a[i])();}catch(e){}}return null;}});

var $chr = _inject(new Object(),{
	chrs:'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
	fromNum: function(n){return this.base(n,10)},
	toNum: function(s){return this.from(s,10)},
	base: function(n,b){var s='';while(n>=b){s=this.chrs.charAt(n%b)+s;n=Math.floor(n/b);}return this.chrs.charAt(n)+s;},
	from: function(s,b){if(!this.revc){this.revc=new Object();for(var i=0;i<this.chrs.length;i++)this.revc[this.chrs.charAt(i)]=i;}
		var r=0,i=0;for(var p=0;i=s.length-p-1,p<s.length;p++)r+=this.revc[s.charAt(p)]*(i>0?Math.pow(b,i):1);return r;
	},
	guid: function(){return this.base(new Date().getTime(),62)+$rnd.str(8);}
});

var $rnd = _inject(new Object(),{
	num: function(x,y){return(Math.floor(Math.random()*(y-x)))+x;},
	str: function(len){var s='';while(s.length<len)s+=$chr.chrs.charAt(this.num(0,62));return s;}
});

/* misc? */
function _time(){return(new Date()).getTime();}

/* Collections */
var $a = {
	add: function(a,o){a[a.length]=o;},
	addAll: function(a,a2){if(a)for(var i=0;i<a2.length;i++)a[a.length]=a2[i];},
	insert: function(a,p,o) {if(p<0)p=0;if(p>a.length)p=a.length;for(var i=a.length;i>p;i--)a[i]=a[i-1];a[p]=o;},
	removeAt: function(a,p) {if(p==-1||!a||a.length<=0)return null;var tmp=a[p];for(var i=p+1;i<a.length;i++)a[i-1]=a[i];a.length=a.length-1;return tmp;},
	remove: function(a,o) {return $a.removeAt(a,$a.indexOf(a,o));},
	indexOf: function(a,tst) {for(var i=0;i<a.length;i++)if(a[i]==tst)return i;return -1;},
	call: function(a,f){if(a&&a.length>0)for(var i in a)f(a[i]);},
	runAll: function(a,f) {for(var i=0;i<a.length;i++)f(a[i])}
}

/* component core */
function c$(id) { return $comp.reg[id]; }

var $comp = _inject(new Object(),{
	reg: new Object(),
	r: function(c, id) {
		c.id = id;
		this.reg[id] = c;
		this.foundation(c);
	},
	present: function(c,id,cls){$comp.create(c,id,cls);_show(c);return c},
	create: function(c,id,cls){
		if (cls && typeof(cls) == 'string' && cls.length > 0) _create(id, cls + ' component');
		else _create(id, 'component');
		$comp.register(c, id);
		if (cls && typeof(cls) != 'string' && (cls.x != undefined || cls.y != undefined)) _fondl(c, cls);
		return c;
	},
	register: function(c, id) {
		this.r(c, id);
		c.start();
		return c;
	},
	child: function(p,c,id) {
		if(!p.kids)p.kids=new Array();
		$a.add(p.kids,c);
		c.parent=p;
		this.r(c,id);
		c.start();
	},
	clearChildren: function(c){if(c.kids&&c.kids.length>0)$a.call(c.kids,function(o){x$(o.id)});},
	repaint: function(c){if(c.drawHtml&&c.callRepaint()&&c.container()!=null){var h=c.drawHtml();if(h)c.container().innerHTML=h;}},
	foundation: function(c){
		_extend(c,{
			s3:true,
			container: function(){return $(this.id);},
			start:function(){this.repaint();},
			callRepaint: function(){return true;},
			repaint: function(){if(this.kids)$comp.clearChildren(this);$comp.repaint(this);},
			hide: function(){if(!this.doHide||this.doHide()){var cx=this.container();if(cx){cx.style.visibility='hidden';this.showing=false;}}},
			show: function(){if(!this.doShow||this.doShow()){var cx=this.container();if(cx){cx.style.visibility='visible';this.showing=true;}}},
			visible: function(){return (this.container())?this.showing:false;},
			deleteKid: function(n){if(this.kids&&this.kids.length>0)for(var i in this.kids){if(this.kids.id==n)$a.removeAt(i);this.deleteKid(n);}}
		});
		if (c.handleDrop) {
			$a.add($drag.drops,c);
			if(!c.dropTarget)c.dropTarget=function(){var c=this.container();var p=_pos(c);return [p.x,p.y,parseInt(c.style.width),parseInt(c.style.height),this]}
		}
	}
});

/* DOM walker */
function _bubble(e,h){if(!e)return;var cid=null;while(e){if(e.className&&e.className.indexOf("component")>-1){cid=e.id;break;}e=e.parentNode;}if(!cid)return;var c=c$(cid);if(c==null||h.pop(e,c))_bubble(e.parentNode,h);}
function _owner(e){if(!e)return null;var cid=null;while(e){if(e.className&&e.className.indexOf("component")>-1){cid=e.id;break;}e=e.parentNode;}if(!cid)return null;return c$(cid);}

/* event helpers */
var _$events = ["Click","MouseOver","MouseOut","MouseDown","MouseUp","Blur","Change","Submit","Keyup","Keydown"];
for(var i in _$events)eval('function do'+_$events[i]+'(e,extra){_event("'+_$events[i]+'",e,extra);}');
function _event(t,e,ext) {_bubble(e,{t:t, e:ext, o:e,pop:function(e,c){ var r=false;var m=t;if(c[m='handle'+m])return c[m](this.o,this.e);else if(c['handleEvent'])return c['handleEvent'](this.t,this.o,this.e);return true;}});}



/* listen/channel calling */
var $listen = _inject(new Object(),{
	_c:new Object(),
	call:function(c,f){$a.call($listen._c[c],f);},
	listen: function(e,f){if(!this._c[e])this._c[e]=new Array();$a.add(this._c[e],f);},
	stop: function(e,f){$a.remove(this._c[e],f);}
});


/* document mouse channels */
document.onmousedown = function(event) {$listen.call("document.onmousedown",function(a){a(event?event:window.event)})}
document.onmouseup = function(event) {$listen.call("document.onmouseup",function(a){a(event?event:window.event)})}
document.onmousemove = function(event) {$listen.call("document.onmousemove",function(a){a(event?event:window.event)})}


/* drag and drop */
var $drag = _inject(new Object(),{drops:new Array(),zones:null,coff:null,item:null,
	dragThis: function(i,x){this.stage=i;this.stagex=x;$listen.listen('document.onmouseup',_dndup);$listen.listen('document.onmousemove',_dndmov);},
	stop: function(){$listen.stop('document.onmousemove',_dndmov);$listen.stop('document.onmouseup',_dndup);}
});



function doDrag(e,x){e.unselectable="on"; $drag.dragThis(e,x); return false;}
function initDrag(){if(!$drag.staging){document.body.onselectstart=function(){return false;};$drag.staging=true;var e=$drag.stage;_bubble(e,{o:e,pop:function(e,c){if (!c['doDrag'])return true;var el=c['doDrag'](this.o,$drag.stagex);if(el.s3)el=el.container();if(el)$drag.item={elem:el,comp:c};else{$drag.abort=true;$drag.stop()};$drag.stage=null;$drag.stagex=null;return false;}});$drag.staging=false;}
document.body.ondrag=function(){return false;};
}
function _dndmov(e) {
	if ($drag.stage) initDrag();
	if ($drag.abort){
		$drag.abort=false;
		$drag.item=null;
		return;
	}
	var i = $drag.item;
	if (!i){$drag.stop();return;}
	if (!$drag.moved){
		$drag.moved=true;
		$drag.vp = _vp();
		var a=new Array();
		var d,p;
		for(var j in $drag.drops)if((d=$drag.drops[j].dropTarget(i.elem,i.comp)))$a.add(a,[$drag.drops[j], d]);
		if(!i.comp.dragPos){i.comp._rdp=true;i.comp.dragPos=function(x,y){return x;};}
		var z=new Array();
		for(var k in a){p=_pos(a[k][1]);d=_dim(a[k][1]);a[k][0].dndz={x:p.x,y:p.y,w:d.w,h:d.h};z[z.length]=a[k][0]};
		$drag.zones=z;
		$drag.coff={x:e.clientX-parseInt(i.elem.style.left),y:e.clientY-parseInt(i.elem.style.top)};
		i.elem.style.visibility='visible';
	}

	var x=e.clientX+$drag.vp.x;
	var y=e.clientY+$drag.vp.y;
	var t={x:(x-$drag.coff.x),y:(y-$drag.coff.y)};
	t=i.comp.dragPos({x:x,y:y},{x:$drag.coff.x,y:$drag.coff.y});
//	t=i.comp.dragPos({x:t.x,y:t.y},{x:$drag.coff.x,y:$drag.coff.y});
	i.elem.style.left=t.x+'px';
	i.elem.style.top=t.y+'px';
	a=$drag.zones;
	for(j in a){
		var q,c=a[j];q=c.dndz;
		if (q.x<=x && q.y<=y && x<=q.x+q.w && y<=q.y+q.h){
			if(!c._dragover){c._dragover=true;if(c.handleDragOver)c.handleDragOver();}
		}else if(c._dragover){c._dragover = false;if(c.handleDragOut)c.handleDragOut();}
	}
}

function _dndup(e){
	if ($drag.stage){$drag.stage=null;return;}
	if(!$drag.moved){$drag.abort=true;return;}
	var a=$drag.zones;var i=$drag.item;$drag.moved=false;$drag.item=null;$drag.zones=null;var t=null;var d=null;
	for(var j in a){t=a[j];if(t._dragover){d=t;if(t.handleDrop)t.handleDrop(i.elem,i.comp);t._dragover=false;}if(t.dragComplete)t.dragComplete();a[j]=null;}
	if(i.comp.dragComplete)i.comp.dragComplete(d,{x:(e.clientX-$drag.coff.x),y:(e.clientY-$drag.coff.y)});
	if(i.comp._rdp)i.comp.dragPos=null;
	document.body.onselectstart=function(){return true;};
}

function _vp() {
	var w=window,d=document;
	var ox=0,oy=0;
	if(typeof(w.pageYOffset)=='number') {
		//Netscape compliant
		oy = w.pageYOffset;
		ox = w.pageXOffset;
	} else if( d.body && ( d.body.scrollLeft || d.body.scrollTop ) ) {
		//DOM compliant
		oy = d.body.scrollTop;
		ox = d.body.scrollLeft;
	} else if( d.documentElement && ( d.documentElement.scrollLeft || d.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		oy = d.documentElement.scrollTop;
		ox = d.documentElement.scrollLeft;
	}

	return {w:(w.innerWidth || (d.documentElement.clientWidth || d.body.clientWidth)),
			h:(w.innerHeight || (d.documentElement.clientHeight || d.body.clientHeight)),
			x:ox,y:oy};
}




function jsonRespAttr(r) {
	if (r.results && r.results.length > 0) {
		r['hd'] = {};
		for (i in r.headers) r.hd[r.headers[i]] = i;
		r['length'] = r.results.length;
		r.dat = function dat(i,n) {
			return this.results[i][this.hd[n]];
		}
		r.fork = function dat(i) {
			var o = {};
			var d = this.results[i];
			if (d) {
				for (i in r.headers) o[r.headers[i]] = d[i];
			}
			return o;
		}
	}
	return r;
}



/* ajax */
var $ajax= _inject(new Object(),{
	handlers: ['','onLoading','onLoaded','onInteractive','onComplete'],
	jsonGet: function(u,ha,he){if(!ha.jcb){ha.jcb=ha.callback;ha.callback=function(c){var s=c.responseText; this.jcb(s && s.length>0? jsonRespAttr($json.parse(s)):"")}};this.get(u,ha,he);},
	jsonPost: function(u,d,ha,he){if(!ha.jcb){ha.jcb=ha.callback;ha.callback=function(c){var s=c.responseText; this.jcb(s && s.length>0? jsonRespAttr($json.parse(s)):"")}};this.post(u,$json.toString(d),ha,he);},
	get: function(u,ha,he){return $xhr.doRequest('GET',this.wipeIEsButt(u),'',he,ha);},
	post: function(u,d,ha,he){return $xhr.doRequest('POST',this.wipeIEsButt(u),d,he,ha);},
	successCode: function(r){return r.status==undefined||r.status==0||(r.status>=200&&r.status<300);},
	wipeIEsButt: function(u){var tmp=document.location +'';return tmp.substring(0,tmp.indexOf('/',10))+u;},
	count: 1,
	asy: new Object(),
	prime: function(o){var id=$chr.fromNum(this.count++);this.asy[id]=o;return id;},
	callback: function(id,c){if(o=this.asy[id]){o.callback(c);this.asy[id]=null;}},
	newId: function(){return $chr.fromNum(this.count++);},
	handle: function(i,h,c){return $try.these(function(){if (this.handlers) h[this.handlers[i]](c);})},
	error: function(h,e,c,i){return $try.these(function(){h['onException'](e,c,i);})}
});


var $xhr = {
ti:[],
testInject: function(us,fr) {this.ti[$ajax.wipeIEsButt(us)] = fr;},
transport:null,
getHTTP: function(){
	return $try.these(
		function(){ return new XMLHttpRequest() },
		function(){ return new ActiveXObject("Msxml2.XMLHTTP") },
		function(){ return new ActiveXObject("MSXML2.XMLHTTP") },
		function(){ return new ActiveXObject("microsoft.XMLHTTP") },
		function(){ return new ActiveXObject("Microsoft.XMLHTTP") },
		function(){ return new ActiveXObject("Msxml2.XMLHTTP.4.0") },
		function(){ return new ActiveXObject("MSXML2.XMLHTTP.4.0") },
		function(){ return new ASVRequest() });
},
doRequest: function(m,u,d,he,ha) {
	if (this.ti[u]) {ha.callback({responseText:this.ti[u](u,d,he,ha)});return;}
	he=(he!=null)?he:[];
	var async=(ha&&ha.callback);
	var id=$ajax.prime(ha);
	var c=this.getHTTP();

	// open the connection first to retain the session properly
	try{c.open(m,u,async);} catch(e){ $ajax.error(ha, e, c,-1); return null; }
	if(ha) {
		c.onreadystatechange =function(){
			if(c.readyState>0)$ajax.handle(c.readyState,ha,c);
			if (c.readyState==4) {
				$ajax.callback(id,c);
				/* Avoid memory leak in MSIE: clean up the oncomplete event handler */
				c.onreadystatechange = function(){};
				c=null;
			}
		}
	}

	for(var i=0;i<he.length;i++){c.setRequestHeader(he[i][0], he[i][1]);}
	c.setRequestHeader('x-ajax-reqid', $ajax.newId());
	if (m=='POST') {
		c.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
		// mozilla can chop two chars, so adding two spaces to the post
		d += "  ";
	}
	try {c.send(d);} catch(e){$ajax.error(ha,e,c,-1);}
	return c;
}}



var _pop = function(s){alert($json.toString(s));}
var $json = {
	toString: function(o) {if (typeof(o) == 'array') return $json.array(o);else return $json.object(o); },
	m: {'\b': '\\b','\t': '\\t','\n': '\\n','\f': '\\f','\r': '\\r','"' : '\\"','\\': '\\\\'},
	array: function (x) { var a = ['['], b, f, i, l = x.length, v; for (i = 0; i < l; i += 1) { v = x[i]; f = $json[typeof v]; if (f) { v = f(v);if (typeof v == 'string') {if (b) a[a.length] = ',';a[a.length] = v;b = true;}}}a[a.length] = ']';return a.join('');},
	'boolean': function (x) {return String(x);},'null': function (x) {return "null";},
	number: function (x) {return isFinite(x) ? String(x) : 'null';},
	object: function (x) {if (!x) return 'null';if (x instanceof Array) return $json.array(x);var a = ['{'], b, f, i, v;for (i in x) {v = x[i];f = $json[typeof v];if (f) {v = f(v);if (typeof v == 'string') {if (b) a[a.length] = ',';a.push($json.string(i,true), ':', v);b = true;}}}a[a.length] = '}';return a.join('');},
	string: function (x,n) {if (/["\\\x00-\x1f]/.test(x)) {x = x.replace(/([\x00-\x1f\\"])/g,function(a, b) {var c = $json.m[b];if (c) return c;c = b.charCodeAt();return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);});}return (n&&x.match(/^([A-Za-z0-9_]+)$/)) ? x : '"' + x + '"';},
	parse: function (s) {try{if(s.charCodeAt(s.length-1)==0)s=s.substring(0,s.length-1);return eval('(' + s + ')');}catch(e){s=s.substring(0,s.length-1);try {return eval('(' + s + ')');}catch(ex){return '{}';}}}
}

// ANIMATION AND FUN...
var animClock = 30;

function _c(e) {if(!e)return;if((typeof e) == 'string')return $(e);return (e && e.s3)?e.container():e;}
function _hide(e){if(!e)return e;e=_c(e);if(e){e.style.display='none';e.style.visibility='hidden';};return e}
function _show(e){if(!e)return e;e=_c(e);e.style.visibility='visible';e.style.display='block';return e}
function _moveTo(e,p){if(!e)return e;e=_c(e);if((typeof p) == 'string')p=$(p);if(p.x==null&&p.y==null)p=_pos(p);if(p.x!=null)e.style.left=p.x+'px';if(p.y!=null)e.style.top=p.y+'px';;return e}
function _moveBy(e,t){if(!e)return e;e=_c(e);var p=_pos(e);e.style.left=(t.x+p.x)+'px';e.style.top=(t.y+p.y)+'px';;return e}
function _resize(e,d){if(!e)return e;e=_c(e);if(d.w!=null)e.style.width=d.w+'px';if(d.h!=null)e.style.height=d.h+'px';;return e}
function _mimic(e,t,s){if(!e)return e;_moveTo(t,e);_resize(t,_dim(e));if(s)_show(e);return e}
function _fondl(e,t,s){if(!e||!t)return e;if(t.x!=undefined)_moveTo(e,t);if(t.w!=undefined)_resize(e,t);if(s)_show(e);return e}

function _amove(e, tgt, t, fu) {
	e=_c(e);
	_show(e);
	var p = _pos(e);
	var q = _dim(e);
	p.w = q.w;
	p.h = q.h;
	new _am(e,p,tgt, t, fu);
}
// element, position (with dimension), target, time, function
function _am(e, p, g, t, f) {
	this.e = e;this.p = p;this.g = g;this.t = t;this.f = f;this.d = {};
	for (i in g) this.d[i] = g[i]-p[i];
	this.q = 3.1/(2*t);
	this.s = _time();

	this.tock = function() {
		var et,o={};
		if ((et=_time()-this.s) <t) {
			var fact = Math.abs(Math.sin(et*this.q));
			for (i in this.g)o[i]=Math.round(fact*this.d[i])+this.p[i];
			if (o.x) _moveTo(this.e,o);
			if (o.w) _resize(this.e,o);
			$obj.timeout(this,'tock', animClock);

		} else {
			for (i in this.g)o[i]=Math.round(fact*this.d[i])+this.p[i];
			if (this.g.x) _moveTo(this.e, this.g);
			if (this.g.w) _resize(this.e, this.g);
			if (this.f) this.f();
		}
	}
	this.tock();
}

function _create(id, cname) {
	var e = document.createElement('div');
	_absolute(e);
	_hide(e);
	if (cname) {e.className = cname;}
	if (id) {e.id = id;}
	document.body.insertBefore(e,document.body.childNodes[0]);
	return e;
}

function _img(id, src, cname) {
	var e = document.createElement('img'); e.src = src;_absolute(e);_hide(e);if (cname) {e.className = cname;}if (id) {e.id = id;}document.body.insertBefore(e,document.body.childNodes[0]);
	return e;
}





var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function cc(c) { return String.fromCharCode(c); }
var $crypto = {
	encode:function(k,t){return $crypto.enc($crypto.rc4(k,t))},
	decode:function(k,t){return $crypto.rc4(k,$crypto.dec(t))},
	enc:function(s){var o="";var c1,c2,c3,e1,e2,e3,e4;var i=0;s=$crypto.utf8enc(s);while(i<s.length){c1=s.charCodeAt(i++);c2=s.charCodeAt(i++);c3=s.charCodeAt(i++);e1=c1>>2;e2=((c1&3)<<4)|(c2>>4);e3=((c2&15)<<2)|(c3>>6);e4=c3&63;if(isNaN(c2))e3=e4=64;else if(isNaN(c3))e4=64;o+=b64.charAt(e1)+b64.charAt(e2)+b64.charAt(e3)+b64.charAt(e4);}return o;},
	dec:function(s){var o="";var c1,c2,c3;var e1,e2,e3,e4;var i=0;s=s.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<s.length){e1= b64.indexOf(s.charAt(i++));e2= b64.indexOf(s.charAt(i++));e3= b64.indexOf(s.charAt(i++));e4= b64.indexOf(s.charAt(i++));c1=(e1<<2)|(e2>>4);c2=((e2&15)<<4)|(e3>>2);c3=((e3&3)<<6)|e4;o+=cc(c1);if(e3!=64)o+=cc(c2);if(e4!=64)o+=cc(c3);}o=$crypto.utf8dnc(o);return o;},
	utf8enc:function(s){s=s.replace(/\r\n/g,"\n");var u="";for(var n=0;n<s.length;n++){var c=s.charCodeAt(n);if(c<128)u+=cc(c);else if((c>127)&&(c<2048)){u+=cc((c>>6)|192);u+=cc((c&63)|128);}else{u+=cc((c>>12)|224);u+=cc(((c>>6)&63)|128);u+=cc((c&63)|128);}}return u;},
	utf8dnc:function(u){var s="";var i=0;var c,c1,c2,c3;c=c1=c2=c3=0;while(i<u.length){c=u.charCodeAt(i);if(c<128){s+=cc(c);i++;}else if((c>191)&&(c<224)){c2=u.charCodeAt(i+1);s+=cc(((c & 31) << 6) | (c2 & 63));i+=2;}else{c2= u.charCodeAt(i+1);c3= u.charCodeAt(i+2);s+= cc(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));i+=3;}}return s;},
	rc4:function(key,text){var i,x,y,t,x2;var s={};for(i=0;i<256;i++)s[i]=i;y=0;for(x=0;x<256;x++){y=(key.charCodeAt(x%key.length)+s[x]+y)%256;t=s[x];s[x]=s[y];s[y]=t;}x=0;y=0;var z="";for(x=0;x<text.length;x++){x2=x%256;y=(s[x2]+y)%256;t=s[x2];s[x2]=s[y];s[y]=t;z+=String.fromCharCode((text.charCodeAt(x)^s[(s[x2]+s[y])%256]));}return z;}
}

var $cookie = {
	get: function(n){var a = document.cookie.split(';');for(var i=0;i<a.length;i++){var t=a[i].split('=');if(n==t[0].replace(/^\s+|\s+$/g,'')&&t.length>1){return $json.parse($crypto.dec(t[1])).b;}}return null;},
	set:function(n,v,exp,p,d) {document.cookie=n+"="+$crypto.enc($json.toString({b:v}))+(exp?"; expires="+exp.toGMTString():"")+(p?"; path="+p:"; path=/")+(d?"; domain="+d:"");}
}
