var GetXmlHttpObject=function(){var xmlHttp;try{xmlHttp=new XMLHttpRequest();}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){/* No xmlHttp */}}}return xmlHttp;};
var SendXmlHttpRequest = function(xmlHttp, url, callback, data, XML) {
	if (!xmlHttp) return;
	xmlHttp.open((data)?"POST":"GET",url,true);
	xmlHttp.setRequestHeader('User-Agent','XMLHTTP/1.0');
	if (data) {
		xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xmlHttp.setRequestHeader("Content-length", data.length);
		xmlHttp.setRequestHeader("Connection", "close");
	}
	xmlHttp.onreadystatechange = function(){
				if (xmlHttp.readyState != 4||(xmlHttp.status != 200 && xmlHttp.status != 304)) return;
				if (XML)callback(xmlHttp.responseXML);
				else callback(xmlHttp.responseText);
	}
	if (xmlHttp.readyState==4) return;
	xmlHttp.send(data.replace(/~/g,'%7E').replace(/%20/g,'+'));
};
var AJAX = function(o){return {
	xmlHttp:GetXmlHttpObject(),
	url:o.url,
	hash:null,
	reqURL:null,
	data:o.data||'',
	addData:function(p,v){this.data=(this.data)?this.data+'&'+p+'='+v:p+'='+v;},
	clearData:function(){this.data='';},
	addHeader:function(p,v){this.xmlHttp.setRequestHeader(p,v);},
	onrequest:o.onrequest||_blank,
	onsuccess:o.success||_blank,
	onfail:o.onfail||_blank,
	oncomplete:o.oncomplete||_blank,
	request:function request(hURL){
		this.hash = hURL || '';
		this.reqURL = this.url + this.hash;
		this.onrequest();
		SendXmlHttpRequest(this.xmlHttp, this.reqURL, this.oncomplete, this.data, this.xml);
		},
	xml:o.xml||false
};};

var _blank=function(){};
/* Event Functions */
var addEvent=function(o,e,f) {if(document.addEventListener)o.addEventListener(e,f,false);else if(document.attachEvent)o.attachEvent('on'+e,f);};
var removeEvent=function(o,e,f) {if(document.addEventListener)o.removeEventListener(e,f,false);else if(document.attachEvent)o.detachEvent('on'+e,f);};
var $e=function(e) {
	if(! e)var e=window.event;
	var caller = (e.target ? e.target : (e.srcElement ? e.srcElement : document.body));
	return ({
		event: e,
		caller: (caller.nodeType==3 ? caller.parentNode : caller),
		code: (e.keyCode ? e.keyCode : (e.which ? e.which : null)),
		rclick:(e.button ? e.button==2 : (e.which ? e.which==3 : false)),
		delta: (e.wheelDelta ? ((window.opera?-1:1)*e.wheelDelta/120) : (e.detail ? -e.detail/3 : 0)),
		x: (e.pageX ? e.pageX : (e.clientX ? e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft : 0)),
		y: (e.pageY ? e.pageY : (e.clientY ? e.clientY+document.body.scrollTop+document.documentElement.scrollTop : 0))
	});
};
var returnFalse=function(e){if(e.event)e=e.event;if(e.preventDefault)e.preventDefault();else e.returnValue=false;};

var $ = function(find, node, arr) {
	var f,i=0,len=0,e,p,ret=[];
	find=explode(',', find);
	
	if (node && !node.tagName) {
		var arr = node;
		node = document;
	}
	else if (! node) var node = document;
	while(f=find[i++]) {
		f=explode(/\s+/,$trim(f));
		p=explode('#',f.shift());
		len = p.length-1;
		p[len] = explode('.', p[len]);
	
		var j=0,list,tag=( len ? p[0] : p[len][0]) || '*';
		list = ( len ? [document.getElementById(p[len][0])] : node.getElementsByTagName(tag) );
		
		if (list[0]) while (e=list[j++])
			if ( (tag=='*' || e.tagName==tag.toUpperCase()) && (!p[len][1] || e.hasClass(p[len][1])) ) {
				e = (f.length > 0) ? $(f.join(' '),e) : e;
				e = $Element(e);
				ret=( ret[0] ? ret.concat(e) : [e]);
			}
	}
	return (ret.length==1 && arr!==true) ? ret[0] : norm(ret);
};

var explode=function(d,o){return(typeof(o=o.split(d))=='string')?[o]:o;};
var norm=function(arr){var a=[],l=arr.length;for(var i=0;i<l;i++){for(var j=i+1;j<l;j++)if(arr[i]===arr[j])j=++i;a.push(arr[i]);}return a;};
var $trim=function(str,chr){chr=chr||'\\s';var str=str.replace(new RegExp("^["+chr+"]+", "g"),''),ws=new RegExp("["+chr+"]"),i=str.length;while(ws.test(str.charAt(--i)));return str.slice(0,i+1);};

var $Element = function(t,o) {
	var ret=(t.tagName?t:document.createElement(t));
	if(o) {
		if (o['insert']) delete(o['append']);
		if (o['className']) o['class']=o['className'];
		if (o['enctype']) o['encoding']=o['enctype'];
		for(a in o)switch(a) {
			case 'style':for(s in o[a])ret.style[s]=o[a][s];break;
			case 'events':for(e in o[a])addEvent(ret,e,(o[a][e]));break;
			case 'insert':o[a].parentNode.insertBefore(ret,o[a]);break;
			case 'append':o[a].appendChild(ret);break;
			case 'innerHTML':ret.innerHTML=o[a];break;
			default: ret.setAttribute(a,o[a]);break;
		}
	}
	if (ret.parentNode && ret.hasClass) { 
		ret.$style=function(s,v){return $style(this,s,v);},
		ret.classes=function(){return classes(this);},
		ret.hasClass=function(c){return hasClass(this,c);},
		ret.classLike=function(c){return classLike(this,c);},
		ret.addClass=function(c){return addClass(this,c);},
		ret.removeClass=function(c){return removeclass(this,c);},
		ret.addEvent=function(e,f){return addEvent(this,e,f);},
		ret.removeEvent=function(e,f){return removeEvent(this,e,f);},
		ret.update=function(o){return $Element(this,o);},
		ret.children=function(){var ch=$('*',this, true),c,i=0;while(c=ch[i++])if(c.parentNode==this)ret.push(c);return ret;},
		ret.allChildren=function(){return $('*',this, true);},
		ret.ancestors=function(){var ret=[],a=this;while((a=a.parentNode)&&a.tagName)ret.push($Element(a));return ret;},
		ret.descendsFrom=function(e){var a=this;while(a=a.parentNode)if(a==e)return true;return false;}
	}
	return ret;
};

var $style=function(e,s,v){var f;if(!v){if(f=e.currentStyle)return f[CSStoJS(s)];if(f=window.getComputedStyle)return f(e,"").getPropertyValue(s);}s.style[CSStoJS(s)]=v;};

var classes=function(e){return explode(' ',e.className);};
var hasClass=function(e,c){var i=0,cl=null,cls=classes(e);while(cl=cls[i++])if(cl==c)return true;return false;};
var classLike= function(e,c) {var i=0,cl=null,cls=classes(e),reg=new RegExp(c),ret=[];while(cl=cls[i++])if(reg.test(cl)) ret[ret.length]=cl;if(ret.length)return ret;return false;};
var addClass=function(e,c){if(!hasClass(e,c))e.className=e.className+' '+c;};
var removeClass=function(e,c){var i=0,cl=null,cls=classes(e);while(cl=cls[i++])if(cl==c)cls[i-1]='';e.className=cls.join(' ');};


var CSStoJS=function(css){return css.replace(/\-(.)/g,function(m,l){return l.toUpperCase();});};
var JStoCSS=function(js){return js.replace(/[A-Z]/,function(m){return '-'+m.toLowerCase();});};

var getElementsByRole=function(r,n){
	if(!n)var n=document;
	var ret=[],a,e,i=0,all=n.getElementsByTagName('*');
	while(e=all[i++]){
		a=e.getAttribute('role');
		if(a)
		  if(a.indexOf(r)!==-1){
			  ret[ret.length]=e;
		}
	}
	return ret;
};
var getElementsWithRole=function(n){return getElementsByRole('');};

// This fixes PNG transparency in IE < 7. Optomized for use with this file. Auth: http://24ways.org/2007/supersleight-transparent-png-in-ie6
if (document.all&&!window.opera) var supersleight=function(){var root=false;
	var shim='img/x.gif';
	var fnLoadPngs=function(){if(!(root))root=document;var obj,i=root.all.length-1;
		while(obj=root.all[i--]){
			var bg=obj.currentStyle.backgroundImage;
			if (bg.match(/\.png/i) &&((parseInt(obj.currentStyle.backgroundPositionX)||0)==0)){fnSetAlpha(obj,bg.substring(5,bg.length-2),(obj.currentStyle.backgroundRepeat=='no-repeat'?'crop':'scale'));obj.style.backgroundImage='url('+shim+')';}
			if (obj.tagName=='IMG' && obj.src.match(/\.png$/i)){obj.style.width=obj.width+"px";obj.style.height=obj.height+"px";fnSetAlpha(obj,obj.src,'scale');obj.src=shim;}
			if ((obj.tagName=='A'||obj.tagName=='INPUT')&&obj.style.position==='')obj.style.position='relative';
		}
	};
	var fnSetAlpha=function(obj,src,mode){obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='"+mode+"')";};
	return {init:function(){window.attachEvent('onload',fnLoadPngs);},limitTo:function(e){root=e;},run:function(){fnLoadPngs();}};
}();
if(supersleight)supersleight.init();


