$import=function(s){
	var css=/\.css$/.test(s);
	$.ajax(css||/\.js/.test(s)?s:s.replace(/\./g,'/')+'.js',{async:0,onload:function(e){
		if(css){
			var a = e.text.replace(/\}/g,function(c,i,s){return /,|\'|\"/.test(s.charAt(i+1))?c:';'+c}).split(';}');
			a.each(function(s){if(s){var i=s.indexOf('*/');$.addRule(s.slice(i<0?0:i+2)+'}')}});
		}else eval(e.text);
	}});
};
var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};

Object.each=function(o,f){for(var i in o)f(i,o[i])};
Object.extend=function(o,t){if(typeof o=='string'){var a=o.split('.'),o=window;a.each(function(t,l){if(a[l+1]=='prototype')o[t]=Class.create();	o[t]=o[t]||{};o=o[t]})}for(var i in t)o[i]=t[i];return o};

Function.prototype.bind=function(){var t=this,o=arguments[0];return function(){var a=$A(arguments);a.push(window.event);return t.apply(o,a)}};

var $A=function(a){var t=[];for(var i=0;i<a.length;i++)t.push(a[i]);return t};
Object.extend(Array.prototype,{
	each:function(o){for(var i=0;i<this.length;i++)o(this[i],i)},
	remove:function(o){for(var i=0;i<this.length;i++)if(this[i]=o)return this.removeAt(i)},
	removeAt:function(i){var t=this,i=i||0,a=t[i];t.splice(i,1);return a},
	add:function(o){this.push(o)},
	addAt:function(index,o){var t=this;for(var i=t.length;i>index;i--)t[i]=t[i-1];t[index]=o}
});

Object.extend(String.prototype,{
	isInt:function(){return isNaN(parseInt(this,10))?false:true;},
	toInt:function(){return this.isInt()?parseInt(this,10):0}
});
Object.extend('Try',{
	these:function(){for(var i=0;i<arguments.length;i++)try{return arguments[i]()}catch(e){}}
});

Object.extend('Event.dispatcher',{
	addEventListener:function(event, handler){var name="__q_"+event;this[name]=this[name]||[];this[name].push(handler)},
	dispatchEvent:function(o){this.dispatchQueue(o)},
	dispatchQueue:function(o){var q=this["__q_"+o.type]||[];q.each(function(v){typeof v=="object"?v[o.type||'handleEvent'](o):v.apply(this,[o])})}
});

Object.extend('Ajax',{
	getTransoprt:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false},
	getXmlDocument:function(){return Try.these(function(){return new ActiveXObject('Msxml2.XMLDOM')},function(){return new ActiveXObject('Microsoft.XmlDom')},function(){return document.implementation.createDocument("","",null)})||false}
});
Object.extend(Object.extend('Ajax.Request.prototype',Event.dispatcher),{
	initialize:function(url,o){var t=this;t.transport=Ajax.getTransoprt();t.options=Object.extend({method:'get',async:true,parameters:'',mimeType:'text'},o||{});t.request(url)},
	request:function(u){
		var t=this,o=t.options,p=t.transport;
		u?u+=(u.indexOf('?')>-1?'&':'?')+'rn='+Math.random():'';
		p.open(o.method,encodeURI(u),o.async);
		$.ie?p.onreadystatechange = t.onState.bind(t):p.onload=function(){this.onState(200)}.bind(t);
		p.send(o.parameters);
	},
	onState:function(status){
		var t = this.transport;
		if(status==200){
			var o=this.options,r=t.responseText,e={type:'onload',text:r};this.text=r;
			if(o.mimeType=='xml'){r=Ajax.getXmlDocument();$.ie?r.loadXML(t.responseText):$.whitespace(r=t.responseXML);t.xml=e.xml=r}
			if(o.onload)o.onload(e);
			if(o.container)$(o.container).innerHTML=r;
			this.dispatchEvent(e);
		}else if(typeof status =='number')this.dispatchEvent({type:'onfailure'});
		else if(t.readyState==4)this.onState(t.status);
	}
});

function $(o){var d=document,o=d.getElementById(o)||o;return typeof o=='object'&&o!=d.body&&o!=d?o:this.initialize?this.initialize(o):new $(o)};
$.prototype={
	initialize:function(o){
		var t = this;
		if(!t.load)t._addEvent(['load','size','click','mousedown','mouseup','mouseover','mouseout','change']);
		typeof o!='string'?this.elements=[o||'']:o.split(' ').each(function(o){t.find(o).elements});
	},
	each:function(o){this.elements.each(o);return this},
	find:function(o){
		var t=this,a=t.elements||[document];
		t.elements=[];
		typeof o!='string'?this.elements=[o||'']:o.split(',').each(function(o){
			if(/^#/.exec(o))t.elements.push($(o.replace(/^#/,'')));
			else if(o.isInt())a.each(function(a){t.elements.push(a.childNodes[o])});
			else{
				var obj=/^\./.exec(o)?{key:'className',value:o.replace(/^\./,'')}:{key:'tagName',value:o.toUpperCase()};
				a.each(function(o){$A(o.getElementsByTagName('*')).each(function(o){if(o[obj.key]==obj.value)t.elements.push(o)})});
			}
		});
		return t;
	},
	id:function(t){return t?this.each(function(o){o.id=t}):this.elements[0].id},
	css:function(t){return this.each(function(o){Object.each(t,function(k,v){o.style[k]=v})})},
	style:function(k,v){
		var n=this.elements[0],f=k,k=$.ie?k:k.replace(/[A-Z]/g,function(c){return "-"+c});
		return v?this.each(function(o){o.style[k]=v}):Try.these(function(){return n.currentStyle[k]},function(){return document.defaultView.getComputedStyle(n, null).getPropertyValue(k)},function(){return n.style[f]})
	},
	html:function(t){return t?this.each(function(o){o.innerHTML = t}):this.elements[0]?this.elements[0].innerHTML:null},
	append:function(m,t){n=[];if(t)this.find(t);this.each(function(o){n.push(o.appendChild(typeof m=='string'?document.createElement(m):m))});this.elements = n;return this},
	removeChild:function(){this.each(function(n){$A(n.childNodes||[]).each(function(n){n.parentNode.removeChild(n)})})},
	remove:function(){this.each(function(n){n.parentNode.removeChild(n)})},
	parent:function(){this.elements=[this.last().parentNode];return this},
	first:function(){return this.elements[0]},
	last:function(){return this.elements[this.elements.length-1]},
	attr:function(k,v){return v?this.each(function(n){n[k]=v}):this.first()[k]},
	addClass:function(t){var t=t;return this.each(function(o){o.className=t})},
	imageAlpha:function(u){
		var c={cssText:"float:left;"};
		if(!$.w3){this.append('div').css({cssText:";float:left;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+u+"',sizingMethod='scale')"});c.filter="alpha(opacity=0)"}
		return this.append('img').css(c).attr('src',u);
	},
	whitespace:function(){this.elements.each(function(o){$A(o.childNodes||[]).each(function(o){o.nodeType==3 && !/\S/.test(o.nodeValue)?$.remove(o):$.whitespace(o)})})},
	_addEvent:function(a){var t=this;a.each(function(i){t[i]=function(f){return t.each(function(n){$.ie?n.attachEvent('on'+i,f.bind(n)):n.addEventListener(i,f.bind(n),false)})}});}
};
Object.extend('$',{
	ie:document.all?true:false,
	w3:window.XMLHttpRequest?true:false,
	mouseX:function(e){return e.pageX||e.clientX},
	mouseY:function(e){return e.pageY||e.clientY},
	getXY:function(o){var x,y;for(x=0,y=0;o;x+=o.offsetLeft,y+=o.offsetTop,o=o.offsetParent);return {x:x,y:y}},
	getRule:function(t){var t=t,s=null;$A(document.styleSheets).each(function(o){$A(o.rules||o.cssRules).each(function(o){if(o.selectorText == t)s=o.style})});return s},
	addRule:function(t,i){var i=i||0,s=document.styleSheets[i],a=t.split('{');$.ie?s.addRule(a[0],a[1].replace(/}$/gm,'')):s.insertRule(t,s.cssRules.length)},
	loadImage:function(t){var l=0,m=t.images;m.each(function(o,i){var img=new Image();img.src=o;var r=function(){m[i]=img;l++;if(l==m.length)t.onload(m)};img.width>0?r():img.onload=r})},
	ajax:function(t,o){return new Ajax.Request(t,o)},
	ready:function(o){var d=document;if($.ie&&!d.isReady){d.isReady=o;(function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,0);return}o()})()}else d.addEventListener("DOMContentLoaded",o,false)}
});
Object.each($.prototype,function(t){$[t]=function(){var a=$A(arguments),n=a.removeAt(0),n=n.tagName?n:$(n),o=new $().find(n);return o[t].apply(o,a)}});