﻿/*
2011/4/2 10:14:42
 code by Apoalypse 
  */
 var HOME = '/';
 var CURRENTTEMPLATE = 'obsolete';

(function($,cacheid){
	var Uxll=function(selector,context,callback,argus){
		if(arguments.length==2){
			if(!Uxll.checkNode(context)){callback=context;context=document;}
		}else if(arguments.length==3){
			if(!Uxll.checkNode(context)){argus=callback;callback=context;context=document;}
		}
		return new Uxll.fn.init( selector, context , callback , argus );
	};
	var browser=ver();
	Uxll.isIE6=/^ie6/.test(browser);
	Uxll.isIE=/^ie/.test(browser);
	Uxll.countObject=function(obj){
		var i=0;
		for(var x in obj)i++;
		return i;
	};
	Uxll.cache={};
	Uxll.attPatterns={
		operateExp:/[ >\+~\^:\<`]/g,
		IDEXP:/^#[\w_-]+$/,
		TAGNAMEEXP:/^[a-zA-Z]+$/,
		CLASSNAMEEXP:/^\.[\w_-]+$/,
		ALLEXP:/^\*$/,
		NEWATTRIBUTEEXP:/^\&[\w_-]+$/,
		ATTRIBUTEEXP:/^\[(\w+)(?:([\=\!\^\$\*])=([\w-_]+))?\]$/		
	};
	Uxll.events="blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error";
	
	
/*functions
************/	
	function addslashes(str){
		return str.replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
	}
	function filterFn(elem,filter){
		if(elem.nodeType!=1){return false;}
		var ft=-1;
		if(Uxll.attPatterns.TAGNAMEEXP.test(filter)){ft=1;}
		if(Uxll.attPatterns.CLASSNAMEEXP.test(filter)){ft=2;}
		if(Uxll.attPatterns.ALLEXP.test(filter)){ft=3;}
		if(Uxll.attPatterns.NEWATTRIBUTEEXP.test(filter)){ft=4;}
		switch(ft){
			case 1:
			return elem.tagName.toLowerCase()==filter.toLowerCase();
			case 2:
			return Uxll.arr.has(elem.className.toLowerCase().split(" "),filter.substr(1).toLowerCase());
			/*return (new RegExp('\\b'+filter.substr(1).toLowerCase()+'\\b')).test(elem.className.toLowerCase());*/
			case 3:
			return true;
			case 4:
			return elem.getAttribute(filter.substr(1));	
		}
		return false;
		
	}
	function fixatt(att){
		if((att==='min-width'||att==='min-height')){
			if(Uxll.isIE6)return att.substr(4);
			return att.replace(/-([a-z])/,function(a,b){return b.toUpperCase();});	
		}
		return att;
	}
	function fixpx(att,val,elem){
		/*alert(fixatt(att)+" "+val)*/
		if(/^(top|left|width|height|min\-height|min\-width|)$/.test(att.toString().toLowerCase())){
			var val=val.toString().toLowerCase();
			if(Uxll.str.right(val,2)!='px')val += "px";			
		}
		att=fixatt(att);
		if(elem){elem.style[att] = val;}
		return val;
	}		
	function getElementsByAtt(selector,ATT,context){
		ATT=ATT||1;
		context=context||document;
		switch(ATT*1){
			case 1:
			return Uxll.makeArray(context.getElementsByTagName(selector));
			case 3:
			case 2:
			case 4:
			var elements=context.getElementsByTagName("*");
			if(ATT-0==3){return elements;}
			var t=[];
			for(var i=0;i<elements.length;i++){
				if(ATT==2&&filterFn(elements[i],selector)){
					t.push(elements[i]);	
				}else if(ATT==4&&elements[i].getAttribute(selector.substr(1))){
					t.push(elements[i]);
				}
			}
			return t;
		}	
	}
	function getX(e){  
		e=e||window.event;  
		return e.pageX||e.clientX+document.body.scrollLeft;  
	}
	function getY(e){  
		e=e||window.event;  
		return e.pageY||e.clientY+document.body.scrollTop;  
	}
	function getElementX(e){  
		return (e&&e.layerX)||window.event.offsetX;  
	}  
	function getElementY(e){  
		return (e&&e.layerY)||window.event.offsetY;  
	}	
	function html_entity_decode(string,quote_style) {
		var optTemp = 0,i = 0,noquotes = false;
		if (typeof quote_style === 'undefined') {
			quote_style = 2;
		}
		string = string.toString().replace(/&lt;/g, '<').replace(/&gt;/g, '>');
		var OPTS = {
			'ENT_NOQUOTES': 0,
			'ENT_HTML_QUOTE_SINGLE': 1,
			'ENT_HTML_QUOTE_DOUBLE': 2,
			'ENT_COMPAT': 2,
			'ENT_QUOTES': 3,
			'ENT_IGNORE': 4
		};
		if (quote_style === 0) {
			noquotes = true;
		}
		if (typeof quote_style !== 'number') {
			quote_style = [].concat(quote_style);
			for (i = 0; i < quote_style.length; i++) {
				if (OPTS[quote_style[i]] === 0) {
					noquotes = true;
				} else if (OPTS[quote_style[i]]) {
					optTemp = optTemp | OPTS[quote_style[i]];
				}
			}
			quote_style = optTemp;
		}
		if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) {
			string = string.replace(/&#0*39;/g, "'");
		}
		if (!noquotes) {
			string = string.replace(/&quot;/g, '"');
		}
		string = string.replace(/&amp;/g, '&');
		return string;
	}	
	function htmlentities(string,quote_style,charset,double_encode) {
		var optTemp = 0,i = 0,noquotes = false;
		if (typeof quote_style === 'undefined' || quote_style === null) {
			quote_style = 2;
		}
		string = string.toString();
		if (double_encode !== false) {
			string = string.replace(/&/g, '&amp;');
		}
		string = string.replace(/</g, '&lt;').replace(/>/g, '&gt;');
		var OPTS = {
			'ENT_NOQUOTES': 0,
			'ENT_HTML_QUOTE_SINGLE': 1,
			'ENT_HTML_QUOTE_DOUBLE': 2,
			'ENT_COMPAT': 2,
			'ENT_QUOTES': 3,
			'ENT_IGNORE': 4
		};
		if (quote_style === 0) {
			noquotes = true;
		}
		if (typeof quote_style !== 'number') {
			quote_style = [].concat(quote_style);
			for (i = 0; i < quote_style.length; i++) {
				if (OPTS[quote_style[i]] === 0) {
					noquotes = true;
				} else if (OPTS[quote_style[i]]) {
					optTemp = optTemp | OPTS[quote_style[i]];
				}
			}
			quote_style = optTemp;
		}
		if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) {
			string = string.replace(/'/g, '&#039;');
		}
		if (!noquotes) {
			string = string.replace(/"/g, '&quot;');
		}
		return string;
	}	
	function pageX(elem){
		return elem.offsetParent?(elem.offsetLeft+pageX(elem.offsetParent)):elem.offsetLeft;
	}
	function pageY(elem){
		return elem.offsetParent?(elem.offsetTop+pageY(elem.offsetParent)):elem.offsetTop;
	}	
	function parentX(elem){
		return elem.parentNode==elem.offsetParent?elem.offsetLeft:pageX(elem)-pageX(elem.parentNode);
	}
	function parentY(elem){
		return elem.parentNode==elem.offsetParent?elem.offsetTop:pageY(elem)-pageY(elem.parentNode);
	}	
	function stripslashes(str){
		return str.replace(/\\(.?)/g, function (s,n1) {
			switch (n1) {
				case '\\':return '\\';
				case '0':return '\u0000';
				case '':return '';
				default:return n1;
			}
		});	
	}
	function ver(){
		var userAgent = navigator.userAgent.toLowerCase();
		var version= (userAgent.match( /.(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1];
		if(/msie/.test( userAgent ) && !/opera/.test( userAgent )){
			return "ie"+version;
		}else{
			return "ok";
		}
	}
/*end functions
***************/

	Uxll.arr={
		uniq:function(arr){
			var newArray=new Array();
			var len=arr.length;
			for (var i=len-1;i>=0;i--){
				for(var j=i-1;j>=0;j--){
					if(arr[i]===arr[j]){
						j=--i;
					}
				}
				newArray.unshift(arr[i]);
			}
			return newArray;
		},
		remove:function(arr,n){
			if (n<0) return arr;
			return arr.slice(0,n).concat(arr.slice(n+1,arr.length));
		},
		has:function(arr,item){
			for(var i=0;i<arr.length;i++){
				if(item === arr[i])return true;
			}
			return false;
		}
	};
	Uxll.data={
		uid:2,/*1 assign to window 2 to document*/
		cacheid:cacheid||'uxllcacheid',
		nodata:[window,document],
		check:function(elem){
			var i;
			for(i=Uxll.data.nodata.length-1;i>=0;i--){
				if(elem===Uxll.data.nodata[i])return i+1;	
			}
			if(elem.nodeType)return 0;
			return false;
		},
		clear:function(elem){
			var c=Uxll.data.check(elem);
			if(c===false)return;
			var id=Uxll.data.cacheid;
			if(c>0){id=c;}else{id=elem.getAttribute(id);}
			if(/^\d+$/.test(id)){
				if(id in Uxll.cache){
					delete Uxll.cache[id];
				}
			}
			return elem;			
		},
		get:function(elem,name){
			var c=Uxll.data.check(elem);
			if(c===false)return;
			var id=Uxll.data.cacheid;
			if(c>0){id=c;}else{id=elem.getAttribute(id);}
			if(/^\d+$/.test(id)){
				if((id in Uxll.cache)&&(name in Uxll.cache[id])){
					return Uxll.cache[id][name];
				}
			}
			return;
		},
		set:function(elem,name,value){
			var c=Uxll.data.check(elem);
			if(c===false)return;
			var id=Uxll.data.cacheid;
			if(c>0){id=c;}else{id=elem.getAttribute(id);}
			if(/^\d+$/.test(id)){
				if(id in Uxll.cache){
					Uxll.cache[id][name]=value;	
				}else{
					Uxll.cache[id]={};
					Uxll.cache[id][name]=value;	
				}
			}else{
				id=++Uxll.data.uid;
				elem.setAttribute(Uxll.data.cacheid,id);
				Uxll.cache[id]={};
				Uxll.cache[id][name]=value;	
			}
			return elem;
		}
	};
	Uxll.dom={
		clone:function(el,config){
			var config=config||{};
			var events=Uxll.events.split(" ");
			var elnew=el.cloneNode(config.withChild?true:false);
			var c=Uxll.data.get(el,'events');
			if(c){Uxll.data.set(elnew,'events',c);}/*clone bind event 2011/3/19 11:51:34*/
			for(var x in events){
				c=Uxll.data.get(el,"on"+events[x]);
				if(typeof c==='function'){
					if(config.withEvent?true:false){
						Uxll.data.set(elnew,"on"+events[x],c);
					}else{
						Uxll.data.set(elnew,"on"+events[x],null);
					}
				}	
			}
			return elnew;	
		},
		height:function(elem,val){
			return Uxll.dom.wh('height',elem,val);
		},
		left:function(elem,val){
			if(typeof val==='undefined')return pageX(elem);
			fixpx('left',val,elem);
			return elem;
		},
		replaceNode:function(oldElem,newElem){
			var node=oldElem.parentNode;
			return node.replaceChild(newElem,oldElem);	
		},
		top:function(elem,val){
			if(typeof val==='undefined')return pageY(elem);
			fixpx('top',val,elem);
			return elem;
		},
		trigger:function(elem,type,data){
			if(Uxll.data.get(elem,'events')&&Uxll.data.get(elem,'events')[type]&&Uxll.data.get(elem,'events')[type].length>0){
				var handlers=Uxll.data.get(elem,'events')[type];
				for (var i in handlers) {
					if(i==='length'){continue;}
					var $$handleEvent = handlers[i][1];
					var args=handlers[i][2]||[];
					if ($$handleEvent.apply(elem,[event].concat(args)) === false) {
						returnValue = false;
					}
				}
			};
			return elem;
		},
		wh:function(wh,elem,val){
			if(typeof val==='undefined'){
				if(Uxll.getStyle(elem,"display")!="none"){
					return elem["offset"+Uxll.str.capitalize(wh)]||parseInt(Uxll.getStyle(elem,wh));
				}else{
					var old=Uxll.resetCss(elem,{display:"block",visibility:"hidden",position:"absolute"});
					var w=elem["offset"+Uxll.str.capitalize(wh)]||parseInt(Uxll.getStyle(elem,wh));
					Uxll.restoreCss(elem,old);
					return w;
				}
			}else{
				fixpx(wh,val,elem);	
				return elem;						
			}		
		},
		width:function(elem,val){
			return Uxll.dom.wh('width',elem,val);
		}
	};
	Uxll.eff={
		Hertz:25,
		maxCount:0,
		speed:{
			slow:1000,
			normal:500,
			fast:300	
		},
		motion:{
			Linear:{
				'in':function(t, b, c, d){
					return c * t / d + b;
				},
				out:function(t, b, c, d){
					return (c * t / d + b);
				},
				io:function(t, b, c, d){
					return c * t / d + b;
				}
			},
			Back:{
				'in':function(t, b, c, d, s){
					s=s||1.70158;
					return c * (t /= d) * t * ((s + 1) * t - s) + b;
				},
				out:function(t, b, c, d, s){
					s=s||1.70158;
					return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
				},
				io:function(t, b, c, d, s){
					s=s||1.70158;
					if ((t /= d / 2) < 1){return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;}
					return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
				}
			},
			Bounce:{
				'in':function(t,b,c,d){
					return c - Uxll.eff.motion.Bounce.out (d-t, 0, c, d) + b;
				},
				out:function(t,b,c,d){
					if((t/=d)<(1/2.75)){
						return c*(7.5625*t*t) + b;
					}else if(t<(2/2.75)){
						return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;
					}else if(t<(2.5/2.75)){
						return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;
					}else{
						return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;
					}
				},
				io:function(t,b,c,d){
					if (t < d/2) return Uxll.eff.motion.Bounce.easeInBounce (t*2, 0, c, d) * 0.5 + b;
					return Uxll.eff.motion.Bounce.easeOutBounce (t*2-d, 0, c, d) * 0.5 + c*.5 + b;
				}
			},			
			Cubic:{
				'in':function(t, b, c, d){
					return c * (t /= d) * t * t + b;
				},
				out:function(t, b, c, d){
					return c * ((t = t / d - 1) * t * t + 1) + b;
				},
				io:function(t, b, c, d){
					if ((t /= d / 2) < 1){return c / 2 * t * t * t + b;}
					return c / 2 * ((t -= 2) * t * t + 2) + b;
				}
			},
			Elastic:{
				'in':function(t,b,c,d,a,p){
					if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*0.3;
					if (a < Math.abs(c)) { a=c; var s=p/4; }
					else{var s = p/(2*Math.PI) * Math.asin (c/a);}
					return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;					
				},
				out:function(t,b,c,d,a,p){
					if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
					if (a < Math.abs(c)) { a=c; var s=p/4; }
					else var s = p/(2*Math.PI) * Math.asin (c/a);
					return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;				
				},
				io:function(t,b,c,d,a,p){
					if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
					if (a < Math.abs(c)) { a=c; var s=p/4; }
					else var s = p/(2*Math.PI) * Math.asin (c/a);
					if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
					return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;					
				}
			},
			Exponential:{
				'in':function(t, b, c, d){
					return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
				},
				out:function(t, b, c, d){
					return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
				},
				io:function(t, b, c, d){
					if (t==0) return b;
					if (t==d) return b+c;
					if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
					return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
				}
			},			
			Quad:{
				'in':function(t, b, c, d){
					return c * (t /= d) * t + b;
				},
				out:function(t, b, c, d){
					return -c * (t /= d) * (t - 2) + b;
				},
				io:function(t, b, c, d){
					if ((t /= d / 2) < 1)return c / 2 * t * t + b;
					return -c / 2 * ((--t) * (t - 2) - 1) + b;
				}
			},
			Quart:{
				'in':function(t, b, c, d){
					return c * (t /= d) * t * t * t + b;
				},
				out:function(t, b, c, d){
					return -c * ((t = t / d - 1) * t * t * t - 1) + b;
				},
				io:function(t, b, c, d){
					if ((t /= d / 2) < 1){return c / 2 * t * t * t * t + b;}
					return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
				}
			},
			Sine:{
				'in':function(t, b, c, d){
					return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
				},
				out:function(t, b, c, d){
					return c * Math.sin(t/d * (Math.PI/2)) + b;
				},
				io:function(t, b, c, d){
					return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
				}
			},
			Sqrt:{
				'in':function(t,b,c,d){
					return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
				},
				out:function(t,b,c,d){
					return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
				},
				io:function(t,b,c,d){
					if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
					return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
				}
			}
		},
		type:{
			fadein:function(e,t,b,c,d,motion){
				var u=Uxll.eff.motion[motion]['in'](t,b,c,d);
				Uxll.eff.setOpacity(e,u);
			},
			fadeout:function(e,t,b,c,d,motion){
				var u=Uxll.eff.motion[motion]['out'](t,b,c,d);
				Uxll.eff.setOpacity(e,c-u);
			},
			move:function(e,t,b,c,d,motion){
				var x=Uxll.eff.motion[motion]['out'](t,b.x,c.x,d);
				var y=Uxll.eff.motion[motion]['out'](t,b.y,c.y,d);
				Uxll.resetCss(e,{left:x,top:y});
			},
			moveToLeft:function(e,t,b,c,d,motion){
				var u=Uxll.eff.motion[motion]['out'](t,b,c,d);
				Uxll.resetCss(e,{left:u});
			},
			moveToRight:function(e,t,b,c,d,motion){
				var u=Uxll.eff.motion[motion]['out'](t,b,c,d);
				Uxll.resetCss(e,{left:u});
			},
			moveToUp:function(e,t,b,c,d,motion){
				var u=Uxll.eff.motion[motion]['out'](t,b,c,d);
				Uxll.resetCss(e,{top:u});
			},
			moveToDown:function(e,t,b,c,d,motion){
				var u=Uxll.eff.motion[motion]['out'](t,b,c,d);
				Uxll.resetCss(e,{top:u});
			},
			slidedown:function(e,t,b,c,d,motion){
				Uxll.eff.slide(e,'down',t,b,c,d,motion);
			},	
			slideleft:function(e,t,b,c,d,motion){
				Uxll.eff.slide(e,'left',t,b,c,d,motion);
			},
			slideright:function(e,t,b,c,d,motion){
				Uxll.eff.slide(e,'right',t,b,c,d,motion);
			},			
			slideup:function(e,t,b,c,d,motion){
				Uxll.eff.slide(e,'up',t,b,c,d,motion);
			}
			
	
		},
		block:[],
		ready:[],
		Animate:function(args){
			var n={};
			if(args.constructor===Array){
				Uxll.each(args,function(){
					Uxll.eff.Animate(this.self[this.i]);	
				});
			}else if(args.constructor===Object){
				Uxll.eff.attachTask(args.elem,args.opType,args.iCount,n,args.motion,args.callback||{before:null,after:null});
			}else{
				return false;
			};
			n.b=0;
			switch(args.opType){
				case 'slidedown':
				case 'slideup':
					var old=Uxll.resetCss(args.elem,{'overflow':'hidden'});
					n.c=args.args||Uxll.dom.height(args.elem);
					break;
				case 'slideleft':
				case 'slideright':
					var old=Uxll.resetCss(args.elem,{'overflow':'hidden'});
					n.c=args.args||Uxll.dom.width(args.elem);
					break;
				case 'fadein':
				case 'fadeout':
					if('args' in args){
						n.c=args.args;
					}else{
						n.c=Uxll.eff.getOpacity(args.elem);
					}

					break;
				case 'moveToUp':
					n.b=Uxll.dom.top(args.elem);
					n.c=args.args||Uxll.dom.height(args.elem)*-1;
					break;
				case 'moveToDown':	
					n.b=Uxll.dom.top(args.elem);
					n.c=(args.args||Uxll.dom.height(args.elem));
					break;
				case 'moveToLeft':
					n.b=Uxll.dom.left(args.elem);
					n.c=args.args||Uxll.dom.width(args.elem)*-1;
					break;
				case 'moveToRight':
					n.b=Uxll.dom.left(args.elem);
					n.c=(args.args||Uxll.dom.width(args.elem));
					break;
				case 'move':
					n.b=args.args.from;
					n.c=args.args.to;
					break;
			};
			Uxll.eff.interrupt();
		},
		attachTask:function(elem,opType,opTime,args,motion,callback){
			var t=Uxll.eff.time2count(opTime);
			args.d=t;
			Uxll.eff.block.push(
				[elem,opType,t,args,motion,callback]
			);
		},
		checkReady:function(e){
			var i;
			for(i=0;i<Uxll.eff.ready.length;i++){
				if(e===Uxll.eff.ready[i].Elem)return i;	
			}
			return -1;
		},
		dispatch:function(){
			if(Uxll.eff.maxCount<=0){return false;}
			Uxll.eff.maxCount--;
			var i,x;
			for(i=0;i<Uxll.eff.ready.length;i++){
				/*alert(
				.stringify(Uxll.eff.ready[i]))*/
				for(x in Uxll.eff.ready[i].op){
					if(Uxll.eff.ready[i].op[x]['args'].d-Uxll.eff.ready[i].op[x]['count']===0){
						if(typeof Uxll.eff.ready[i].op[x]['callback']['before'] === 'function'){
							Uxll.eff.ready[i].op[x]['callback']['before'].apply(Uxll.eff.ready[i].Elem,Uxll.eff.ready[i].op[x]['callback']['beforeargs']||[]);	
						}	
					}
					Uxll.eff.type[x](
						Uxll.eff.ready[i].Elem,
						Uxll.eff.ready[i].op[x]['args'].d-Uxll.eff.ready[i].op[x]['count']+1,
						Uxll.eff.ready[i].op[x]['args'].b,
						Uxll.eff.ready[i].op[x]['args'].c,
						Uxll.eff.ready[i].op[x]['args'].d,
						Uxll.eff.ready[i].op[x]['motion']
					);
					if(Uxll.eff.ready[i].op[x]['status']==='normal'){
						if(--Uxll.eff.ready[i].op[x]['count']<=0){
							if(typeof Uxll.eff.ready[i].op[x]['callback']['after'] === 'function'){
								Uxll.eff.ready[i].op[x]['callback']['after'].apply(Uxll.eff.ready[i].Elem,Uxll.eff.ready[i].op[x]['callback']['afterargs']||[]);
							}
							delete Uxll.eff.ready[i].op[x];
							Uxll.eff.ready[i].length--;
						}
					}
					if(Uxll.eff.ready[i].length<=0){
						Uxll.eff.ready=Uxll.arr.remove(Uxll.eff.ready,i);
					}
				}
				
			}
			setTimeout(Uxll.eff.interrupt,1000/Uxll.eff.Hertz);
		},
		fade:function(io,elem,speed,callback,args){
			var speed=typeof speed ==='string'?((speed in Uxll.eff.speed)?Uxll.eff.speed[speed]:Uxll.eff.speed.normal):speed;
			var d=speed/Uxll.eff.Hertz;
			var c=100,u,t=0;
			var timer=setInterval(function(){
				if(t>=d){clearInterval(timer);if(typeof callback==='function'){callback.apply(elem,args||[]);}}
				u=Uxll.eff.motion.Linear(t++,0,c,d);
				Uxll.eff.setOpacity(elem,u);
			},1000/Uxll.eff.Hertz);
		},
		getOpacity:function(el){
			var value;
			if(window.getComputedStyle){
				value = el.style.opacity;
				if(!value){
					value = el.ownerDocument.defaultView.getComputedStyle(el,null)['opacity'];
				}
				return value*100;
			}else if(document.documentElement.currentStyle){
				value = 100;
				try {
					value = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;
				} catch(e) {
					try {
						value = el.filters('alpha').opacity;
					} catch(err) {}
				}
				return value ;
			}
		},
		interrupt:function(){
			if(Uxll.eff.block.length===0&&Uxll.eff.ready.length===0){return false;}
			var i=0,p,n;
			while(Uxll.eff.block.length){
				p=Uxll.eff.checkReady(Uxll.eff.block[i][0]);
				if(p===-1){
					n={
						Elem:Uxll.eff.block[i][0],
						length:1,
						op:{}
					};
					Uxll.eff.ready.push(n);
				}else{
					if(!(Uxll.eff.block[i][1] in Uxll.eff.ready[p].op)){
						Uxll.eff.ready[p].length++;
					};
					n=Uxll.eff.ready[p];
				};
				n.op[Uxll.eff.block[i][1]]={
					count:Uxll.eff.block[i][2],
					motion:Uxll.eff.block[i][4],
					args:Uxll.eff.block[i][3],
					status:'normal',
					callback:Uxll.eff.block[i][5]
				};
				Uxll.eff.block.shift();
			};
			Uxll.eff.resetMaxCount();
			Uxll.eff.dispatch();
		},
		pause:function(elem,opType){
			var p=Uxll.eff.checkReady(elem);
			if(p===-1)return false;
			if(!(opType in Uxll.eff.ready[p].op))return false;
			Uxll.eff.ready[p].op[opType]['status']='pause';
		},
		resetMaxCount:function(){
			var i,p,count=0;
			for(i=0;i<Uxll.eff.ready.length;i++){
				for(p in Uxll.eff.ready[i].op){
					if(Uxll.eff.ready[i].op[p]['count']>count&&Uxll.eff.ready[i].op[p]['status']==='normal'){count=Uxll.eff.ready[i].op[p]['count'];}	
				}
			};
			Uxll.eff.maxCount = count;
		},
		resume:function(elem,opType){
			var p=Uxll.eff.checkReady(elem);
			if(p===-1)return false;
			if(!(opType in Uxll.eff.ready[p].op))return false;
			if(Uxll.eff.ready[p].op[opType]['status']==='normal')return false;
			Uxll.eff.ready[p].op[opType]['status']='normal';
			if(Uxll.eff.maxCount===0){
				Uxll.eff.interrupt();	
			}
		},
		setOpacity:function(el,i){
			var i=i/100;
			if(window.getComputedStyle){
				el.style.opacity = i;
			}else if(document.documentElement.currentStyle){
				if(!(el.currentStyle&&el.currentStyle.hasLayout)){
					el.style.zoom = 1;
				}
				if(!el.currentStyle.hasLayout){
					el.style.display = 'inline-block';
				}
				try{
					if(el.filters){
						if(el.filters('alpha')){
							el.filters('alpha').opacity = i * 100;
						}else{
							el.style.filter += 'alpha(opacity='+ i * 100 +')';
						}
					}
				}catch(e){
					el.style.filter = 'alpha(opacity='+ i * 100 +')';
				}
			}
			return el;
		},
		slide:function(e,trbl,t,b,c,d,motion){
			var motion=(motion in Uxll.eff.motion)?Uxll.eff.motion[motion]:Uxll.eff.motion.Linear;
			var u;
			switch(trbl.toLowerCase()){
				case 'up':
					u=motion['out'](t,b,c,d);
					Uxll.resetCss(e,{height:c-u});
					break;
				case 'left':
					u=motion['out'](t,b,c,d);
					Uxll.resetCss(e,{width:c-u});
					break;
				case 'down':
					u=motion['in'](t,b,c,d);
					Uxll.resetCss(e,{height:u});
					break;
				case 'right':
					u=motion['in'](t,b,c,d);
					Uxll.resetCss(e,{width:u});
					break;
				break;
			}
		},
		time2count:function(Millisecond){
			return Millisecond/1000*Uxll.eff.Hertz;
		}
	
	
	};
	Uxll.event={
		bind:function(element,type,handler,args){
			var evtid=0,c=Uxll.data.get(element,'events');
			if (!c){c={},Uxll.data.set(element,'events',c);}
			if(c[type]&&c[type].constructor==Object){
				var i=0,virgin=true;
				for(;i<c[type].length;i++){
					if(i in c[type]){
						if(c[type][i][0]===handler.toString()){virgin=false;evtid=i;break};	
					}
				}
				if(virgin){
					evtid=c[type].length;
					c[type][c[type].length]=[handler.toString(),handler,args];
					c[type].length++;
				}
			}else{
				c[type]={length:1,0:[handler.toString(),handler,args]};
			};
			element["on" + type]=Uxll.event.handle;
			return evtid;
		},
		fixEvent:function(event){
			event.preventDefault = Uxll.event.preventDefault;
			event.stopPropagation = Uxll.event.stopPropagation;
			return event;
		},
		stop:function(e) { 
			var e = e ? e : window.event;  
			if (window.event) {
				e.cancelBubble = true;   
			} else { // FF  
				e.preventDefault();   
				e.stopPropagation();   
			}   
		},
		getElementXY:function(e,xy){
			var ret={
				x:getElementX(e),
				y:getElementY(e)	
			};
			if(xy && (xy in ret))return ret[xy];
			return ret;				
		},
		getXY:function(e,xy){
			var ret={
				x:getX(e),
				y:getY(e)	
			};
			if(xy && (xy in ret))return ret[xy];
			return ret;
		},
		handle:function(event){
			var returnValue = true;
			event = event || Uxll.event.fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
			var handlers = Uxll.data.get(this,'events')[event.type];
			for (var i in handlers) {
				if(i==='length'){continue;}
				var $$handleEvent = handlers[i][1];
				var args=handlers[i][2]||[];
				if ($$handleEvent.apply(this,[event].concat(args)) === false) {
					returnValue = false;
					Uxll.event.stop(event);
				}
			}
			return returnValue;
		},
		preventDefault:function(){
			this.returnValue = false;
		},
		remove:function(element,type,bindid){
			delete Uxll.data.get(element,'events')[type][bindid];
		},
		unbind:function(element,type,handler){
			var v = Uxll.data.get(element,'events')[type];
			for(var i in v){
				if(i==='length')continue;
				if(v[i][1]===handler)delete v[i];	
			}
		},
		removeAll:function(element, type){
			Uxll.data.get(element,'events')[type]={length:0};
		},
		stopPropagation:function() {
			this.cancelBubble = true;
		}
	};
	Uxll.html = {
		'getSelectText':function(o){
			return o.options[o.selectedIndex].innerHTML;	
		}
		
	};	
	Uxll.num={
		padZero:function (num,len){
			var s = num.toString(10);
			while (s.length<len) s = "0" + s;
			return s;
		}
	};
	Uxll.str={
		addslashes:function(str){
			return addslashes(str);
		},
		capitalize:function(str){
			return str.charAt(0).toUpperCase() + str.substring(1).toLowerCase();
		},
		html2text:function(html){
			return htmlentities(html);
		},
		keepcn:function(str){
			return str.replace(/[^\u4e00-\u9fa5\uf900-\ufa2d]/g,"");
		},
		keepen:function(str){
			return str.replace(/[^A-Za-z]/g,"");	
		},
		keepnum:function(str){
			return str.replace(/[^\d]/g,"");
		},
		left:function(str,len){
			return str.slice(0,len);
		},
		nl2br:function(str){
			var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '' : '<br>';
			return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
		},
		removecn:function(str){
			return str.replace(/[\u4e00-\u9fa5\uf900-\ufa2d]/g,"");
		},
		removeen:function(str){
			return str.replace(/[A-Za-z]/g,"");
		},
		removenum:function(str){
			return str.replace(/[\d]/g,"");
		},
		lTrim:function(str){
			return str.replace(/^\s+/g,"");
		},
		repeat:function(input,multiplier){
			return new Array(multiplier+1).join(input);
		},
		rTrim:function(str){
			return str.replace(/\s+$/g,"");
		},
		right:function(str,len){
			return str.slice(str.length-len);
		},
		stripslashes:function(str){
			return stripslashes(str);
		},
		text2html:function(text){
			return html_entity_decode(text); 
		},
		trim:function(str){
			return str.replace(/(^\s+)|(\s+$)/g,"");
		},
		trimHTML:function(html){
			return html.replace(/<[^>]+>/g,"");
		}
	};

/*uxll static functions
************************/
	Uxll.appendRows=function(node, html){ 
	    var temp = document.createElement("div");
	    var tbody = node.parentNode;
	    var nextSib = node.nextSibling;
	
	    temp.innerHTML = "<table><tbody>"+html;
	    var rows = temp.firstChild.firstChild.childNodes;
	
	    while(rows.length){
	    	tbody.insertBefore(rows[i], nextSib);
	    }
	};
	Uxll.checkNode=function(node){
		return node&&node.nodeType&&(node.nodeType==1||node.nodeType==9);	
	};
	Uxll.each=function(obj,callback,argus){
		if(typeof(callback)!=="function"){return false;}
		argus=(argus&&argus.constructor==Array?argus:[argus])||[];
		if(obj.constructor==Array){
			for(var i=0;i<obj.length;i++){
				if(callback.apply({'self':obj,'i':i},argus)===false){break};
			}
		}else if(obj.constructor==Object && ('length' in obj)){
			for(var i=0;i<obj.length;i++){
				if(callback.apply({'self':obj[i],'i':i},argus)===false){break};
			}
		}
		return obj;			
	};	
	Uxll.Error=function(error){
		alert(error);
	};
	Uxll.find=function(selector,operator,context){
		if(operator==":"){
			if(context.constructor&&context.constructor!=Array){
				Uxll.Error(("apo.fn.find,context type is not a array selector:"+(selector)+"\noperator:"+(operator==" "?"空格":operator)+"\ncontext"+context));
				return false;
			}
			switch(selector.replace(/\([\w\|\-]+\)|\(\-\d+\)/g,"").toUpperCase()){
				case "FIRST":
					return Array.prototype.slice.apply(context,[0,1])[0];
				case "LAST":
					return Array.prototype.slice.apply(context,[-1])[0];
				case "EQ":
					var index = selector.replace(/[^\d-]/g,"");
					return index >= 0 ? Array.prototype.slice.apply(context,[index,index+1])[0] : context[context.length + index*1];
				case "LT":
					var index=selector.replace(/[\D]/g,"");
					return Array.prototype.slice.apply(context,[0,index]);
				case "GT":
					var index=selector.replace(/[\D]/g,"");
					return Array.prototype.slice.apply(context,[index]);
				case "EVEN":
					var t=[];
					for(var i=0;i<context.length;i++){
						if(i%2==0)t.push(context[i]);
					}
					return t;
				case "ODD":
					var t=[];
					for(var i=0;i<context.length;i++){
						if(i%2)t.push(context[i]);
					}
					return t;
				case "SUB":
					if(/\(([^\)]+)\)/.test(selector)){
						var tag=RegExp.$1.split("|")[0];
						var idx=RegExp.$1.split("|")[1];
					}else{
						Uxll.Error(("apo.fn.find,sub filter is illegal"));
						return false;	
					}
					
					var t=[];
					for(var i=0;i<context.length;i++){
						try{
							var x=context[i].getElementsByTagName(tag);
							if(idx=="0"){
								x=x[0];
							}else{
								x=x[idx>0?idx:x.length-1-Math.abs(idx)];
							}
							t.push(x);
						}catch(E){}
					}
					return t;
			}
			if(Uxll.attPatterns.ATTRIBUTEEXP.test(selector)){
				
				var attr=RegExp.$1,logicOp=RegExp.$2,VALUE=RegExp.$3;

				var t=[];
				for(var i=0;i<context.length;i++){
					if(!context[i].getAttribute){
						Uxll.error(("apo.fn.find,context[i]'s type is not a DOM Elem selector:"+(selector)+"\noperator:"+(operator==" "?"空格":operator)+"\ncontext"+context));
						continue;
					}
					var a=context[i].getAttribute(attr);
					
					switch(logicOp){
						case "":
						if(a){t.push(context[i])}
						break;
						case "=":
						if(attr.toLowerCase()==='classname'){
							a=context[i].className;
							if(a&&Uxll.arr.has(a.split(' '),VALUE)){
								t.push(context[i])
							}
						}else{
							if(a&&(a+'').toLowerCase()==VALUE.toLowerCase()){t.push(context[i])}
						}
						break;
						case "!":
						if(attr.toLowerCase()==='classname'){
							a=context[i].className;
							if(!(a && Uxll.arr.has(a.split(' '),VALUE))){
								t.push(context[i])
							}
						}else{
							if(a&&(a+'')!=VALUE){t.push(context[i])}
						}
						break;
						case "^":
						if(a&&(eval("/^"+VALUE+"/")).test(a)){t.push(context[i])}
						break;
						case "$":
						if(a&&(eval("/"+VALUE+"$/")).test(a)){t.push(context[i])}
						break;
						case "*":
						if(a&&(eval("/"+VALUE+"/")).test(a)){t.push(context[i])}
						break;
					}
				}
				return t;
			}
		}else{
			if(context&&context.constructor===Array){
					var ret=[],q;
					for(var i=0;i<context.length;i++){
						q=arguments.callee(selector,operator,context[i]);
						if(q&&q.constructor===Array){
							while(q.length){
								ret.push(q.shift());		
							}	
						}else{
							ret.push(q);	
						}
						
					}
					return ret;
			};
			switch(operator){
				case " ":
					if(Uxll.attPatterns.IDEXP.test(selector)){return document.getElementById(selector.substr(1))}
					if(Uxll.attPatterns.TAGNAMEEXP.test(selector)){return getElementsByAtt(selector,1,context);}
					if(Uxll.attPatterns.ALLEXP.test(selector)){return getElementsByAtt(selector,3,context);}
					if(Uxll.attPatterns.CLASSNAMEEXP.test(selector)){return getElementsByAtt(selector,2,context);}
					return false;
				case ">":
					if(context===document){return false;}
					var nn=context.nextSibling;
					while(nn){
						if(Uxll.checkNode(nn)&&filterFn(nn,selector)){return nn;}
						nn=nn.nextSibling;
					}
					return nn;
				case "<":
					if(context===document){return false;}
					var nn=context.previousSibling;
					while(nn){
						if(Uxll.checkNode(nn)&&filterFn(nn,selector)){return nn;}
						nn=nn.previousSibling;
					}
					return nn;
				case "~":
					if(context===document){return false;}
					var nn=context.nextSibling,t=[];
					while(nn){
						if(Uxll.checkNode(nn)&&filterFn(nn,selector)){t.push(nn);}
						nn=nn.nextSibling;
					}
					return t;
				case "`":
					if(context===document){return false;}
					var nn=context.previousSibling,t=[];
					while(nn){
						if(Uxll.checkNode(nn)&&filterFn(nn,selector)){t.push(nn);}
						nn=nn.previousSibling;
					}
					return t;
				case "^":
					if(context===document){return false;}
					var pn=context.parentNode;
					while(pn){
						if(Uxll.checkNode(pn)&&filterFn(pn,selector)){return pn;}
						pn=pn.parentNode;
					}
					return false;

				case "+":
					var t=[],cds=context.childNodes;
					for(var i=0;i<cds.length;i++){
						if(Uxll.checkNode(cds[i])&&filterFn(cds[i],selector)){t.push(cds[i]);}	
					}
					return t;
			}				
		}  
	};
	Uxll.fixpx=function(a,v,e){
		return fixpx(a,v,e);
	};
	Uxll.getSelectedText=function(){
		if (window.getSelection) {return window.getSelection().toString();}
		else if (document.getSelection) {return document.getSelection();}
		else if (document.selection) {return document.selection.createRange().text;}
	};	
	Uxll.getStyle=function(elem,name){
		if(elem.currentStyle){
			return elem.currentStyle[name];
		}else if(document.defaultView&&document.defaultView.getComputedStyle){
			name=name.replace(/([A-Z])/g,"-$1");
			name=name.toLowerCase();
			var s=document.defaultView.getComputedStyle(elem,"");
			return s&&s.getPropertyValue(name);
		}else if(elem.style[name]){
			return elem.style[name];
		}else{
			return null;
		}
	};
	Uxll.insertHtml=function(where,el,html){
		where = where.toLowerCase();
		if(el.insertAdjacentHTML){
			switch(where){
				case "beforebegin":
				case "ob":
					el.insertAdjacentHTML('BeforeBegin', html);
					return el.previousSibling;
				case "afterbegin":
				case "ib":
					el.insertAdjacentHTML('AfterBegin', html);
					return el.firstChild;
				case "beforeend":
				case "ie":
					el.insertAdjacentHTML('BeforeEnd', html);
					return el.lastChild;
				case "afterend":
				case "oe":
					el.insertAdjacentHTML('AfterEnd', html);
					return el.nextSibling;
			}
			throw 'Illegal insertion point -> "' + where + '"';
		}
		var range = el.ownerDocument.createRange();
		var frag;
		switch(where){
			case "beforebegin":
			case "ob":
				range.setStartBefore(el);
				frag = range.createContextualFragment(html);
				el.parentNode.insertBefore(frag, el);
				return el.previousSibling;
			case "afterbegin":
			case "ib":
				if(el.firstChild){
					range.setStartBefore(el.firstChild);
					frag = range.createContextualFragment(html);
					el.insertBefore(frag, el.firstChild);
					return el.firstChild;
				}else{
					el.innerHTML = html;
					return el.firstChild;
				}
			case "beforeend":
			case "ie":
				if(el.lastChild){
					range.setStartAfter(el.lastChild);
					frag = range.createContextualFragment(html);
					el.appendChild(frag);
					return el.lastChild;
				}else{
					el.innerHTML = html;
					return el.lastChild;
				}
			case "afterend":
			case "oe":
				range.setStartAfter(el);
				frag = range.createContextualFragment(html);
				el.parentNode.insertBefore(frag, el.nextSibling);
				return el.nextSibling;
		}
		throw 'Illegal insertion point -> "' + where + '"';
	};	
	Uxll.makeArray=function(c){
		try {return Array.prototype.slice.call(c);}catch(e){
			var ret = [], i = 0, len = c.length;
			for (; i < len; ++i) {ret[i] = c[i];}
			return ret;
		}
	};	
	Uxll.pp=function(title,price,_ext,_type,_additionalFieldTxtName){
		/*order require type,price,title*/
		var HOME = '/';
		var newW = true;
		var _additionalFieldTxtName = _additionalFieldTxtName || 'pl';
		var _type = _type || 'powerlevel';
		if(typeof title === 'undefined' || typeof price === 'undefined'){alert('neither price or title is illegal');return false;}
		var price = typeof price === 'number' ? price : price.replace(/[^\.0-9]+/,'');
		var order =  _ext && _ext instanceof Object ? _ext : {};
		order['title'] = title;
		order['price'] = price;
		order['type'] = _type;
		var url = window.location.href.split('?');
		if(/guild\.php$/.test(url[0])){
			order['url'] = decodeURIComponent(url[1].split('=')[1].replace(/\+/g,' '));
		}
		if(newW){
			var newWin = window.open();
			newWin.document.write('<h1>Posting data...</h1>');
		}
		Uxll.ajax.post(
			HOME+'paypal/s.php',
			'c='+encodeURIComponent(Uxll.JSON.stringify(order)),
			function(){
				if(this.responseText === 'ok'){
					if(newW){
						newWin.window.location = HOME+'paypal/p.php?p='+_additionalFieldTxtName;	
					}else{
						window.location = HOME+'paypal/p.php?p='+_additionalFieldTxtName;
					}
				}
				else {alert('error\n'+this.responseText);	}
			}
		);
		return true;
	};
	Uxll.resetCss=function(elem,prop){
		var old={};
		for(var i in prop){
			old[i]=elem.style[i];
			fixpx(i,prop[i],elem);
		}
		return old;
	};
	Uxll.restoreCss=function(elem,prop){
		for(var i in prop){
			fixpx(i,prop[i],elem);
		}
		return elem;
	};
	Uxll.scroll=function(d){
		var de=document.documentElement;
		var ret = {
			top:self.pageYOffset||document.body.scrollTop||de.scrollTop,
			left:self.pageXOffset||document.body.scrollLeft||de.scrollLeft,
			width:document.body.scrollWidth||de.scrollWidth,
			height:document.body.scrollHeight||de.scrollHeight
		};
		return (d&&(d in ret))?ret[d]:ret;
	};	
	Uxll.window=function(wh){
		var de=document.documentElement;
		var ret = {
			width:window.innerWidth||( de && de.clientWidth)||document.body.clientWidth,
			height:window.innerHeight||(de && de.clientHeight)||document.body.clientHeight
		};
		return (wh&&(wh in ret))?ret[wh]:ret;
	};
	Uxll.fn = Uxll.prototype={
		length:0,
		e:null,/*e is nicer than f*/
		x:null,/*haha exg*/
		g:0,/*z3 ZG*/
		uxll:1.0,
		addclass:function(className){
			Uxll.each(this,function(c){
				var cs;
				if(this.self.className){
					cs=this.self.className.split(" ");
					c=Uxll.str.trim(c).split(" ");
					c=Uxll.arr.uniq(cs.concat(c)).join(" ");	
				}
				this.self.className=c;
			},[className]);
			return this;
		},
		after:function(c,a,f){
			if(typeof a==='boolean'&&typeof f==='undefined'){f=a;}
			return this._xpend.apply(this,['oe',c,a,f||false]);
		},
		animate:function(opType,motion,count,args,callback){
			Uxll.each(this,function(c){
				c.elem=this.self;
				Uxll.eff.Animate(c);
			},[{motion:motion,opType:opType,iCount:count,args:args,callback:callback}]);
			return this;
		},
		append:function(c,a,f){
			if(typeof a==='boolean'&&typeof f==='undefined'){f=a;}
			return this._xpend.apply(this,['ie',c,a,f||false]);	
		},
		appendTo:function(t,config,f){
			var ret=[],f;
			if(typeof config==='boolean'&&typeof f==='undefined'){f=config;}
			Uxll.each(this,function(t,c,ret,f){
				var r;
				r=t.uxll?t.append(this.self,c,f||false):Uxll(t).append(this.self,c,f||false);
				ret.push(r.e);
			},[t,config,ret,f]);
			return f===true?Uxll(ret):this;
		},
		attr:function(k,v){
			switch(k.constructor){
				case String:
					if(v){
						Uxll.each(this,function(k,v){
							this.self.setAttribute(k,v);
						},[k,v]);
						return this;	
					}else{
						return this[0].getAttribute(k);
					}
				case Function:
					Uxll.each(this,function(k,v){
						k.apply(this,v);	
					},[k,v]);
					return this;
				case Object:
					Uxll.each(this,function(k){
						for(var x in k){
							this.self.setAttribute(x,k[x]);	
						}	
					},[k]);
					return this;
					
			}
		},
		before:function(c,a,f){
			if(typeof a==='boolean'&&typeof f==='undefined'){f=a;}
			return this._xpend.apply(this,['ob',c,a,f||false]);
		},
		bind:function(type,handler,handlerArgs,callback,callbackArgs){
			Uxll.each(this,function(type,handler,handlerArgs,callback,callbackArgs){
				var bindid=Uxll.event.bind(this.self,type,handler,handlerArgs);
				if(typeof callback==='function'){
					callback.apply({elem:this.self,bindid:bindid},callbackArgs||[]);
				}
			},[type,handler,handlerArgs,callback,callbackArgs]);
			return this;
		},
		clone:function(c){
			var ret=[];
			Uxll.each(
				this,function(c,ret){
					ret.push(Uxll.dom.clone(this.self,c));
				},[c,ret]
			);
			return Uxll(ret);
		},
		css:function(a,b){
			try{
				for(var i=0;i<this.length;i++){
					if(a.constructor===String){
						fixpx(a,b,this[i]);
					}else if(a.constructor===Object){
						for(var x in a)	{
							fixpx(x,a[x],this[i]);	
						}
					}
				}
			}catch(E){}
			return this;
		},
		each:function(callback,argus){
			Uxll.each(this,callback,argus);
			return this;
		},	
		empty:function(){
			Uxll.each(this,function(){this.self.innerHTML="";});
			return this;
		},
		fadein:function(speed,callback,args){
			
		},
		find:function(selector,operator){
			var r,ret=[];
			for(var i=0;i<this.length;i++){
				r=Uxll.find(selector,operator,this[i]);
				if(r&&Uxll.checkNode(r))ret.push(r);
				else if(r&&r.constructor===Array)ret=ret.concat(r);
				else continue;
			}
			return Uxll(Uxll.arr.uniq(ret));
		},
		get:function(index){
			if(typeof index==='number'){return this[index];}
			var ret=[];
			for(var i=0;i<this.length;i++){
				ret.push(this[i])	;
			}	
			return ret;
		},
		height:function(v){
			var ret=[0];
			Uxll.each(this,function(v,ret){ret[0]=Uxll.dom.height(this.self,v);},[v,ret]);
			return ret[0];
		},			
		hide:function(speed,callback,args){
			Uxll.each(this,function(){
				if(Uxll.getStyle(this.self,"display")==="none")return;
				if(typeof speed==='undefined'){
					this.self.style.display='none';
				}else{
					Uxll.eff.Animate({
						elem:this.self,
						motion:'Cubic',
						opType:'fadeout',
						iCount:speed||500,
						args:100,
						callback:{
							before:null,
							beforeargs:[],
							after:typeof callback==='function'?function(){callback.apply(this,args||[]);this.style.display='none';}:function(){this.style.display='none';},
							afterargs:args||[]
						}
					});						
				}
			});
			return this;
		},
		hover:function(over,out){
			Uxll.each(this,function(over,out){
				Uxll.event.bind(this.self,'mouseover',over.fn,over.data||[]);
				Uxll.event.bind(this.self,'mouseout',out.fn,out.data||[]);
			},[over,out]);
			return this;
		},
		html:function(v,b){
			if(v){
				if(typeof v==='number'){
					return this[v].innerHTML;
				}
				for(var i=0;i<this.length;i++){
					this[i].innerHTML=typeof v==='function'?v.apply({'self':this[i],'i':i},b?b:[]):v;
				}
				return this;
			}else{
				return this[0].innerHTML;
			}	
		},
		index:function(dom){
			var ret=-1;
			for(var i=0;i<this.length;i++){
				ret++;
				if(dom==this[i])break;
			};
			return ret;
		},
		init:function(selector,context,callback,argus){
			var k = false;
			if ( !selector ) {
				return this;
			}
			if ( selector.nodeType ) {
				this.e = this.x = this[0] = selector;
				this.g=this.length = 1;
				return this;
			}
			if( selector.constructor === Array ){
				for(i=0;i<selector.length;i++){
					if(Uxll.checkNode(selector[i]))this[i]=selector[i];
				};	
				this.g=this.length=selector.length;
				this.e=this[0];
				this.x=this[this.length-1];		
				return this;					
			}
			selector=Uxll.str.trim(selector).replace(/ ( )+/g," ");

			if(!(eval(Uxll.attPatterns.operateExp.toString()).test(selector.substr(0,1)))){
				selector = '* '+selector;
			}else{
				selector = '*'+selector;
			}	

			var selectorSet=selector.split(Uxll.attPatterns.operateExp);
			var operateSet=selector.match(Uxll.attPatterns.operateExp);
					
			if(!selectorSet || selectorSet.constructor !== Array || !operateSet || operateSet.constructor !== Array){
				return false;	
			}

			selectorSet.shift()


			if(selectorSet.length !== operateSet.length){
				alert(
					selector+':'+selectorSet.join()
					+"\nselectorSet.length:"+selectorSet.length
					+"\noperateSet:"+operateSet.join()
					+"\noperateSet.length:"+operateSet.length
				);
				return false;
			}
			var curContext=context||document;
			for(var i=0;i<selectorSet.length;i++){
				curContext = Uxll.find(selectorSet[i],operateSet[i],curContext);
				if(!curContext)return false;
			}
			if(curContext && (curContext.nodeType || curContext.constructor === Array)){
				return arguments.callee.apply(this,[curContext]);
			}else{
				return false;	
			}
			
		},
		offset:function(lt){
			if(lt&&lt==='left')return pageX(this[0]);
			if(lt&&lt==='top')return pageY(this[0]);
			return {left:pageX(this[0]),top:pageY(this[0])};	
		},
		position:function(lt){
			if(lt&&lt==='left')return parentX(this[0]);
			if(lt&&lt==='top')return parentY(this[0]);
			return {left:parentX(this[0]),top:parentY(this[0])};	
		},
		prepend:function(c,a,f){
			if(typeof a==='boolean'&&typeof f==='undefined'){f=a;}
			return this._xpend.apply(this,['ib',c,a,f||false]);	
		},
		prependTo:function(t,config,f){
			var ret=[],f;
			if(typeof config==='boolean'&&typeof f==='undefined'){f=config;}
			Uxll.each(this,function(t,c,ret,f){
				ret.push((t.uxll?t.prepend(this.self,c,f):Uxll(t).prepend(this.self,c,f)).e);
			},[t,config,ret,f||false]);
			return f===true?Uxll(ret):this;
		},
		removeAttr:function(name){
			Uxll.each(this,function(n){
				this.self.removeAttribute(n);
			},[name]);
			return this;
		},
		removeCss:function(classname){
			Uxll.each(this,function(){
				if(!classname)this.self.className='';
				var c=Uxll.str.trim(classname).split(" ");
				var u="";
				if(this.self.className){
					u=this.self.className;	
				}
				var v=[u];
				Uxll.each(c,function(v){v[0]=Uxll.str.trim(v[0].replace(new RegExp("\\b"+this.self[this.i]+"\\b"),"").replace(/\s+/," "))},[v]);
				this.self.className=v[0];
			});
			return this;
		},
		removeElem:function(){
			Uxll.each(
				this,function(){
					this.self.parentNode.removeChild(this.self);
				}
			);
			return this;
		},
		removeEvent:function(type,callback,args){
			Uxll.each(this,function(type,callback,args){
				if(typeof callback==='function'){
					Uxll.event.remove(this.self,type,callback.apply(this.self,args||[]));
				}else{
					Uxll.event.removeAll(this.self,type);
				}
			},[type,callback,args]);
			return this;
		},
		replaceWith:function(elem){
			if(Uxll.checkNode(elem)){
				Uxll.each(this,function(elem){
					Uxll.dom.replaceNode(this.self,elem);
				},[elem]);
			}
			return this;
		},
		scrollLeft:function(val){
			if(typeof val==='undefined'){
				return Uxll.scroll('left')-pageX(this[0]);
			}else{
				val=parseInt(val);
				this.css({position:'absolute',left:(val+Uxll.scroll('left'))+"px"});	
			}	
			return this;
		},
		scrollTop:function(val){
			if(typeof val==='undefined'){
				return Uxll.scroll('top')-pageY(this[0]);
			}else{
				val=parseInt(val);
				this.css({position:'absolute',top:(val+Uxll.scroll('top'))+"px"});	
			}	
			return this;
		},
		show:function(speed,callback,args){
			Uxll.each(this,function(){
				if(Uxll.getStyle(this.self,"display")!="none")return;
				if(typeof speed==='undefined'){
					this.self.style.display='block';
				}else{

					this.self.style.display='block';
					Uxll.eff.Animate({
						elem:this.self,
						motion:'Cubic',
						opType:'fadein',
						iCount:speed||500,
						args:100,
						callback:{
							before:null,
							beforeargs:[],
							after:callback,
							afterargs:args||[]
						}
					});						
				}
			});
			return this;
		},
		toggle:function(){
			Uxll.each(this,function(){	
				this.self.style.display = Uxll.getStyle(this.self,"display")!="none"?"none":"block";
			});
		},
		trigger:function(type,data){
			Uxll.each(this,function(data){
				Uxll.dom.trigger(this.self,type,data);
			},[data]);
			return this;
		},
		triggerHandler:function(type,data){
			if(this.length>1){
				var fn=this[0]["on"+type];
				if(typeof fn==='function'){
					return fn.apply(this[0],data||[]);
				}
			}
			return undefined;
		},
		text:function(v,b){
			if(v){
				if(typeof v==='number'){
					return Uxll.str.html2text(this[v].innerHTML);
				}
				for(var i=0;i<this.length;i++){
					this[i].innerHTML=Uxll.str.html2text((typeof v==='function'?v.apply({'self':this[i],'i':i},b?b:[]):v));
				}
				return this;
			}else{
				if(this[0].nodeType && this[0].tagName.toLowerCase() === 'select')return Uxll.html.getSelectText(this[0]);
				return Uxll.str.html2text(this[0].innerHTML);
			}
		},
		unwrap:function(f){
			var ret=[];
			Uxll.each(this,function(ret){
				ret.push(Uxll.insertHtml('ob',this.self,this.self.innerHTML));
			},[ret]);	
			this.removeElem();
			var f=f||false;
			return f===true?Uxll(ret):this;
		},
		value:function(c,a){
			if(typeof c === 'undefined')return this.e.value;
			var a=a||[];
			Uxll.each(this,function(c,a){
				this.self.value=typeof c === 'function'?c.apply(this,a):c;
			},[c,a]);
		},
		width:function(v){
			var ret=[0];
			Uxll.each(this,function(v,ret){ret[0]=Uxll.dom.width(this.self,v);},[v,ret]);
			return ret[0];
		},
		wrap:function(html,args,f){
			var ret=[];
			Uxll.each(this,function(html,ret){
				var x = Uxll.insertHtml('ob',this.self,typeof html==='function'?html.apply(this,args||[]):html);
				Uxll(x).append(this.self,{keep:false});
				ret.push(x);
			},[html,ret]);
			if(typeof args==='boolean'&&typeof f==='undefined'){f=args;}
			return f===true?Uxll(ret):this;
		},
		_xpend:function(x,c,a,f){
			if(typeof a==='boolean'&&typeof f==='undefined'){f=a;}
			var ret=[];
			switch(c.constructor){
				case String:
					Uxll.each(this,function(c,ret){
						ret.push(Uxll.insertHtml(x,this.self,c));
					},[c,ret]);
					break;	
				case Function:
					Uxll.each(this,function(c,a,ret){
						ret.push(Uxll.insertHtml(x,this.self,c.apply(this,a?a:[])));	
					},[c,a,ret]);
					break;
				case Object:
					a=a||{};
					if(!("keep" in a)){a['keep']=true;}
					if(c.uxll){
						Uxll.each(this,function(source,a,ret){
							Uxll.each(source,function(d,a,ret){
								var r;
								r=a.keep?Uxll.dom.clone(this.self,a):this.self;
								ret.push(r);
								switch(x){
									case 'ie':d.self.appendChild(r);break;
									case 'ib':d.self.insertBefore(r,d.self.childNodes[0]);break;
									case 'oe':d.self.parentNode.insertAfter(r,d.self);break;
									case 'ob':d.self.parentNode.insertBefore(r,d.self);break;
								}
							},[this,a,ret]);
						},[c,a.constructor===Object?a:{},ret]);
					}
					break;
				default:
					a=a||{};
					if(!("keep" in a)){a['keep']=true;}
					if(Uxll.checkNode(c)){
						Uxll.each(this,function(c,a,ret){
							var r=a.keep?Uxll.dom.clone(c,a):c;
							ret.push(r);
							switch(x){
								case 'ie':this.self.appendChild(r);break;
								case 'ib':this.self.insertBefore(r,this.self.childNodes[0]);break;
								case 'oe':this.self.parentNode.insertAfter(r,this.self);break;
								case 'ob':this.self.parentNode.insertBefore(r,this.self);break;
							};
						},[c,a.constructor===Object?a:{},ret]);	
					}
			}
			return f===true?Uxll(ret):this;	
		}
	};
/*ajax
*************/
	var ajax={
		taskQueue:[],
		blockQueue:[],
		config:{
			timer:1000,
			status:0,/*0:stoped 1:running 2 pause*/
			randomMode:false,
			randomModeAttachment:'apoajaxrandomattachment',
			handlerError:function(){},
			done:function(){}
		},	
		ajaxRequest:function(){
			if(ajax.config.status){ajax.blockQueue.unshift(config);return false;}
			var config=ajax.taskQueue.pop();
			if(!config){
				if(ajax.blockQueue.length==0){
					ajax.config.done();
				}else{
					ajax.handlerBlockQueue();
				};
				return false;
			}

			var method,url,asynchronous,data,callback,argus;
			method=config["method"]?config["method"]:"get";
			
			url=config["url"];
			if(!url){alert(url);return false;}
			
			if(this.randomMode){url+=(url.indexOf("?")==-1?"?":"&")+ajax.config['randomModeAttachment']+"="+(new Date()).getTime()};
			asynchronous=config["asynchronous"]!==undefined?config["asynchronous"]:true;
			data=method.toLowerCase()=="get"?null:config["data"];
			if(method.toLowerCase=="post"&&undefined==data){return false;}
			callback=config["callback"];
			if(typeof(callback)!=="function"){alert('call failed');return false;}
			argus=config["argus"]||[];
			var xmlHttpObj = new ajax.xmlHttp();
	
			ajax.config.status=1;
			xmlHttpObj.open(method,url,asynchronous);
			xmlHttpObj.setRequestHeader("Cache-Control","no-cache");
			xmlHttpObj.setRequestHeader("If-Modified-Since",new Date(0));
			xmlHttpObj.setRequestHeader("Connection", "close");
			if(method.toLowerCase()=="post"){
				xmlHttpObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			}			
			if (asynchronous){
				xmlHttpObj.onreadystatechange = function(){
					if(xmlHttpObj.readyState==4){
						callback.apply(xmlHttpObj,argus);
						xmlHttpObj=null;
						ajax.handlerBlockQueue();
						if(ajax.config.status==1){ajax.config.status=0;}
						setTimeout(ajax.ajaxRequest,ajax.config.timer);
					}
				};
				xmlHttpObj.send(data);
				return true;
			}else{
				try{
					xmlHttpObj.send(data);
				}catch (e){
					throw new Error("LoadHttp Error.");
					return;
				}
				
				var r = callback.apply(xmlHttpObj,argus);
				xmlHttpObj=null;
				if(ajax.config.status==1){ajax.config.status=0;}
				return r;
			}
			
		},
		setConfig:function(p,v){
			ajax.config[p]=v;
		},
		xmlHttp:function(){if (window.XMLHttpRequest){httpRequest = new XMLHttpRequest();if (httpRequest.overrideMimeType) {httpRequest.overrideMimeType('text/html');}}else if (window.ActiveXObject){try{httpRequest = new ActiveXObject("MSXML2.XMLHTTP");	}catch(e){try {	httpRequest = new ActiveXObject("Microsoft.XMLHTTP");}catch (e){}}}if (!httpRequest) {return false;}return httpRequest;},
		handlerBlockQueue:function(){
			try{
				var nt;
				while(ajax.blockQueue.length){
					nt=ajax.blockQueue.pop();
					if(typeof(nt)=="function"){
						nt();
					}else if(typeof(nt)=="object"&&nt.constructor==Object){
						ajax.taskQueue.unshift(nt);
					}
				}
			}catch(E){alert(E.message)}
			
		},
		get:function(url,callback,argus,asynchronous){
			ajax[ajax.config.status?"blockQueue":"taskQueue"].unshift({
				url:url,
				callback:callback,
				argus:argus||[],
				method:"get",
				asynchronous:asynchronous!==undefined?asynchronous:true
			});
			return ajax.ajaxRequest();
		},
		post:function(url,data,callback,argus,asynchronous){
			ajax[ajax.config.status?"blockQueue":"taskQueue"].unshift({
				url:url,
				callback:callback,
				argus:argus||[],
				method:"post",
				data:data,
				asynchronous:asynchronous!==undefined?asynchronous:true
			});
			return ajax.ajaxRequest();
		},
		getTasksNum:function(){
			return ajax.taskQueue.length+ajax.blockQueue.length;
		},
		ajaxBreak:function(){
			ajax.config.status=2;
			return true;
		},
		viewTaskQueue:function(callback){
			var t=[];
			for(var i=0;i<ajax.taskQueue.length;i++){
				t.push(ajax.taskQueue[i].method=="post"?ajax.taskQueue[i].url+"<-->"+ajax.taskQueue[i].data:ajax.taskQueue[i].url);
			};
			return callback(t);
		},
		viewBlockQueue:function(callback){
			var t=[];
			for(var i=0;i<ajax.blockQueue.length;i++){
				t.push(typeof ajax.blockQueue[i]);
			};
			return callback(t);
		},
		emptyTaskQueue:function(){
			while(ajax.taskQueue.length){
				ajax.taskQueue.pop();
			};
			return true;
		},
		resume:function(){
			ajax.config.status=0;
			ajax.config.ajaxRequest();
		},
		pause:function(){
			ajax.blockQueue.unshift(ajax.ajaxBreak);
			return false;	
		},
		getTaskQueue:function(callback){
			ajax.blockQueue.unshift([ajax.viewTaskQueue,callback]);
			return false;	
		},
		getBlockQueue:function(callback){
			ajax.blockQueue.unshift([ajax.viewBlockQueue,callback]);
			return false;	
		},
		clearTaskQueue:function(){
			ajax.blockQueue.unshift([emptyTaskQueue,function(){}]);
			return false;
		},
		resume:function(){
			if(ajax.config.status==2){
				ajax.config.status=0;
				setTimeout(ajax.ajaxRequest,ajax.config.timer);
				return false;
			}
		},
		attachTask:function(blockEvent){
			ajax.blockQueue.unshift(blockEvent);
		}
	};

/*cookie
*************/
	var cookie={
		get : function (Name){
			var search = Name + "=";
			if(document.cookie.length > 0){
				var offset = document.cookie.indexOf(search);
				if(offset != -1){
					offset += search.length;
					var end = document.cookie.indexOf(";", offset);
					if(end == -1) end = document.cookie.length;
					return unescape(document.cookie.substring(offset, end));
				}
				else return "";
			}
			else return "";
		},
		set : function(name,value,day){
			var day=day||0;
			var today = new Date();
			var expires = new Date();
			expires.setTime(today.getTime() + 1000*60*60*24*day);
			document.cookie = name + "=" + escape(value) + "; path=/;"+(day?" expires=" + expires.toGMTString():"");
		},
		del : function (name){
			var today = new Date();
			var expires = new Date();
			expires.setTime(today.getTime() - 1);
			document.cookie = name + "=0; path=/; expires=" + expires.toGMTString();
		}
	};
/*JSON
********/
	var JSON={
		duplicate:function(o){
			var ret={};
			if(typeof o!=='object')return false;
			for(var x in o){
				switch(o.constructor){
					case Object:
					case Array:
						ret[x]=JSON.duplicate(o[x]);	
					default:
						ret[x]=o[x];
				}
					
			}		
			return ret;
		},
		debug:function(o,format,deep,mode){
			var temp=[],ret=[];
			deep=deep||1;
			format=format||false;
			mode=mode||false;
			try{
				switch(o.constructor){
					case String:
						return '"'+(format?o.replace(/\r\n|\t/g,''):o.replace(/[\\"]/g, '\\$&').replace(/\u0000/g, '\\0'))+'"';
					case Object:
						ret.push('{');
						for(var x in o){
							temp.push(
								(format?'\r\n'+Uxll.str.repeat('\t',deep):'')+
								'"'+Uxll.str.addslashes(x)+'":'+
								JSON.debug(o[x],format,deep+1,mode)
							);
						}
						ret.push(temp.join(","));
						format&&ret.push((format?'\r\n':'')+Uxll.str.repeat('\t',deep-1));
						ret.push('}');
						break;
					case Array:
						ret.push('[');
						for(var x=0;x<o.length;x++){
							temp.push((format?'\r\n'+Uxll.str.repeat('\t',deep):'')+JSON.debug(o[x],format,deep+1,mode));
						}
						ret.push(temp.join(","));
						format&&ret.push((format?'\r\n':'')+Uxll.str.repeat('\t',deep-1));
						ret.push(']');	
						break;
					case Function:
						if(format===true){
							if(mode===false)return 'function(){...}';
						}else{
							return 'null';	
						}
					default:
						return (o.toString());
				}
				
			}catch(e){return 'null';}
			ret = ret.join("");
			return ret;
		},

		stringify:function(o){
			return JSON.debug(o,false,1,false);
		},
		parse:function(str,showError){
			try{
				return eval('('+str+')');	
			}catch(e){showError && alert('JSON parse Error:\n'+(e.description||e.message));return false;}
		}	
	};

	Uxll.ajax=ajax;
	Uxll.cookie=cookie;
	Uxll.JSON=JSON;
	Uxll.fn.init.prototype = Uxll.fn;
	window[$]=Uxll;
})('$','uxllcacheid');
