(function(){


var isie=navigator.userAgent.toLowerCase().indexOf('msie')!=-1 ? 1 : 0;
var KR = window.KR = function( selector ) {
	return new KR.fn.init(selector);
},
kr = window.kr = function( selector ) {
	var ret = KR.fn.find(selector);
	KR.planeObj(ret);
	return new ret;
},
toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
indexOf = Array.prototype.indexOf;
KR.fn = KR.prototype = {
	init:function(selector){
		var ret,chuck = /^[#|.|div|ul|ol|]+/i ;
		if ( !selector ) {
			return this;
		}
		if ( selector.nodeType ) {
			this[0] = selector;
			this.length = 1;
			return this;
		}
		if ( selector === "body" && !context ) {
			this[0] = document.body;
			this.length = 1;
			return this;
		}
		if ( typeof selector === "string" ) {
			apart = chuck.exec(selector);
			if(!apart) selector = "#"+selector;
			ret = KR.find(selector);
		}else if (KR.isFunction( selector )){
			return KR.func(selector);
		}else if (KR.isArray( selector )){
			ret = selector;
		}
		return KR.pushNew(ret,selector);
	},
	setArray: function( elems,selector ) {
		this.length = 0;
		push.apply( this, elems );
		this.selector = selector;
		//KR.merge(this, elems)
		return this;
	}
};

KR.fn.init.prototype = KR.fn;

KR.extend = KR.fn.extend = function() {
	// copy reference to target object
	var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
	// Handle a deep copy situation
	if ( typeof target === "boolean" ) {
		deep = target;
		target = arguments[1] || {};
		// skip the boolean and the target
		i = 2;
	}
	// Handle case when target is a string or something (possible in deep copy)
	if ( typeof target !== "object" && !KR.isFunction(target) )
		target = {};
	// extend jQuery itself if only one argument is passed
	if ( length == i ) {
		target = this;
		--i;
	}
	for ( ; i < length; i++ )
		// Only deal with non-null/undefined values
		if ( (options = arguments[ i ]) != null )
			// Extend the base object
			for ( var name in options ) {
				var src = target[ name ], copy = options[ name ];
				// Prevent never-ending loop
				if ( target === copy )
					continue;
				// Recurse if we're merging object values
				if ( deep && copy && typeof copy === "object" && !copy.nodeType )
					target[ name ] = KR.extend( deep, 
						// Never move original objects, clone them
						src || ( copy.length != null ? [ ] : { } )
					, copy );
				// Don't bring in undefined values
				else if ( copy !== undefined )
					target[ name ] = copy;
			}
	// Return the modified object
	return target;
};

KR.extend({
	length:1,i:1,
	offset :{left:"offsetLeft",top:"offsetTop",right:"offsetRight",width:"offsetWidth",height:"offsetHeight"},
	isFunction: function( obj ) {
		return toString.call(obj) === "[object Function]";
	},
	isArray: function( obj ) {
		return toString.call(obj) === "[object Array]";
	},
	planeObj: function( ret ) {
		if(ret.length){
			for (i=0;i<ret.length;i++ ){
				ret[i].first = KR.first
			}
		}else{
			ret.first = KR.first
		}
		return ret
	},
	func:function(func){
		eval(func)();
		return KR(document);
	},
	pushNew: function( elems , selector ) {
		var ret = KR();
		KR.planeObj(elems);
		ret.length = 0;
		if ( KR.isArray( elems ) ) {
			push.apply( ret, elems );
		} else {
			KR.merge( ret, elems );
		}
		ret.selector = selector;
		return ret;
	},
	merge: function( first, second ) {
		var i = first.length, j = 0;
		if ( typeof second.length === "number" ) {
			for ( var l = second.length; j < l; j++ ) {
				first[ i++ ] = second[ j ];
			}
		} else {
			while ( second[j] !== undefined ) {
				first[ i++ ] = second[ j++ ];
			}
		}
		first.length = i;
		return first;
	},
	first:function(el){
		obj = this;
		if(el){
			var elem = obj.getElementsByTagName(el)[0] ?obj.getElementsByTagName(el)[0] : null&& obj;
			elem = elem ? elem : null&& obj;
			return elem
		}else{
			var elem = obj;
			elem = elem.firstChild;
			var elel =  elem && elem.nodeType != 1 ? elem.nextSibling : elem ;
			return elel;
		}
	},
	getStyle : function(elem, name ) {
		var ret = null,name = name.toLowerCase();
		if (elem.style[name])
			ret = elem.style[name];
		else if (elem.currentStyle)
			ret = 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,"");
			ret = s && s.getPropertyValue(name);
		}
		if (name == "opacity"){
			if(!elem.style[name]){
				KR.css(elem,{opacity:1})
				ret = 1
			}
		}else if((name == "left" || name == "top" || name == "right"  || name == "width"  || name == "height") && ret == "auto" ){
			ret = elem[KR.offset[name]];
		}
		return ret;
	},
	css:function(obj,ret){
		var box = obj;
		if(!box.length) box = KR(obj);
		box.each(function(i){
			for (var prov in ret)
			{
				if(prov == "opacity"){
					if(isie) this.style.filter='alpha(opacity='+ret[prov]*100+')';
					this.style.opacity=ret[prov];
				}else
					this.style[prov] = ret[prov];
			}
		})
		return obj;
	}
});

KR.fn.extend({
	//KR(select).find(selector)
	find:function(selector){
		selector = this.selector +" "+ selector
		var result = KR.find(selector)
		return KR.pushNew(result,selector);
	},
	//KR(select).child(), KR(select).child(2), KR(select).child("div:3")
	child: function(stack){
		if(stack == undefined){
			selector = this.selector + " >*";
			var returnVal = KR.find(selector)
			return KR.pushNew(returnVal,this.selector + " >*");
		}else if(typeof stack == "number" ){
			selector = this.selector + ">*:nth("+stack+")";
			return KR.pushNew(KR.find(selector),selector);
		}else if(typeof stack == "string" ){
			var chuck = /([\w|>| |*]+):?(\w+)?/i,
				chuck2 = /(odd|even)/i,
				apart = chuck.exec(stack), // [1] = tag, [2] = num
				apart2 = chuck2.exec(stack), // [1] = tag, [2] = num
				chk = " >";
			if(apart2){
				var selector = this.selector + ">*:" + apart2[1],
				returnVal = KR.find(selector);
				return KR.pushNew(returnVal,selector);
			}
			var selector = this.selector + chk + apart[1],
				returnVal = KR.find(selector);
			while(!returnVal.length){
				selector = this.selector + chk + apart[1];
				returnVal = KR.find(selector);
				chk +="*>";
			}
			if(apart[2]){ returnVal = KR.find(selector+":nth("+apart[2]+")"); selector +=":nth("+apart[2]+")"}
			return KR.pushNew(returnVal,selector);
		}
	},
	nth: function(num){
		selector = this.selector+":nth("+num+")";
		returnVal = KR.find(selector);
		return KR.pushNew(returnVal,selector);
	},	
	first: function(tag){
		if(tag == undefined){
			selector = this.selector+":nth(0)";
			returnVal = KR.find(selector);
			return KR.pushNew(returnVal,selector);
		}else if(typeof tag == "string"){
			var selector = this.selector+" "+tag+":nth(0)",
			returnVal = KR.find(selector),
			chk = " >";
			while(!returnVal.length){
				selector = this.selector + chk + tag+":nth(0)";
				returnVal = KR.find(selector);
				chk +="*>";
			}
			return KR.pushNew(returnVal,selector);
		}
	},	
	//KR(select).chk(string)
	chk: function(selecter,status){
		var ret = [],stack = this;
		if(selecter === "length"){ret = this.length;}
		else for (i=0;i<stack.length;i++ ) ret.push(stack[i][selecter].toLowerCase());
		if(status) alert(ret)
		return ret;
	},
	//KR(select).attr({attr:"val"})
	attr: function(mass) {
		this.each(function(i){
			for (var prov in mass) this[prov] = mass[prov];
		});
		return this;
	},
	//KR(select).show()
	show: function( obj ) {
		this.each(function(){
			this.style.display = "";	
		});
		return this;
	},
	//KR(select).hide()
	hide: function( obj ) {
		this.each(function(){
			if(this["opacity"])
				clearInterval(this["opacity"].timer)
			this.style.display = "none";	
		});
		return this;
	},
	//KR(select).css({attr:"val"})
	css: function( ret , get) {
		if(get || typeof ret == "string" ){
			var mass=[];
			this.each(function(i){
				var css = "";
				if(get) css += ret+" = ";
				css +=  KR.getStyle(this,ret);
				mass.push(css)
			});
			if(get){alert(mass); return this}
			else	return mass;
		}else
			KR.css(this,ret)
		return this;
	},
	offset: function(name){
		var ret = 0;
		if( name == "left" || name == "top" || name == "right" ){
			for(var i=0; i<1; i++){
				ret += elem[KR.offset[name]];
				elem=elem.parentNode;
				if(elem.tagName.toLowerCase()!='body' 
					&& elem.tagName.toLowerCase()!='html' 
					&& elem.style.position != "relative"
					&& elem.style.position != "absolute") i--;
			}
		}
	},
	//KR(select).each(fn)
	each: function(func){	
		for(i=0;i<this.length;i++){KR.planeObj(this[i]);this[i].func = func;this[i].n = i;if(func) this[i].func(this[i].n,this[i]);else return this;}
	},
	//KR(select).class({add:"val"}).class({remove:"val"})
	className: function(lump){
		if(lump){
			this.each(function(){
				for (var prov in lump)
					if(prov == "add")
						this.className = KR.addClass(this,lump[prov]);
					else if(prov == "remove")
						this.className = KR.removeClass(this,lump[prov]);
			})
			return this;
		}else{
			var val = [];
			this.each(function(){
				if(this.className =="") val.push("null")
				else val.push(this.className)
			})
			alert(val);
			return this;
		}
	},
	src: function(){
		
	}
});

KR.extend({
	Class:function(elem){
		return elem.className.split(" ");
	},
	addClass: function(elem,val){
		var types = KR.Class(elem);
		if(types == "") return val;
		types.push(val);
		return types.join(" ")
	},
	removeClass: function(elem,val){
		var types = KR.Class(elem);
		var type, i = 0;
		while ( (type = types[ i ]) ) {
			if(val == type) types.splice(i,1);
			i++;
		}
		return types;
	},
	Event:function( e ){
		var evt = e?e:event;
		if(evt.preventDefault) event.preventDefault(); 
		else  evt.returnValue = false;
		KR.fix(evt,evt.type);
	},
	fix: function( event , type ) {

		// store a copy of the original event object
		// and "clone" to set read-only properties
		var originalEvent = event;
		// Fix target property, if necessary
		if ( !event.target ) {
			event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
		}

		// check if target is a textnode (safari)
		if ( event.target.nodeType === 3 ) {
			event.target = event.target.parentNode;
		}

		// Add relatedTarget, if necessary
		if ( !event.relatedTarget && event.fromElement ) {
			event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
		}

		// Calculate pageX/Y if missing and clientX/Y available
		if ( event.pageX == null && event.clientX != null ) {
			var doc = document.documentElement, body = document.body;
			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
		}

		// Add which for key events
		if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
			event.which = event.charCode || event.keyCode;
		}

		if ( !event.metaKey && event.ctrlKey ) {
			event.metaKey = event.ctrlKey;
		}

		target = event.target;
		if(target.node){
			return target[type](event,target)
		}else if(target.parentNode.node){
			return  target.parentNode[type](event,target.parentNode)
		}
	},
	aniSet:function(){
		easeInOutBack  = function(t,b,c,d,s){
			var s=(!s || typeof(s)!='number')? 1.70158 : s;
			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;
		}
		
		var rolling = setInterval(function(){
		},30)
	},
	opacityAni:function(obj,val){
		obj.each(function(){
			if(!KR.getStyle(this,"opacity"))
				KR.css(KR(this),{opacity:100});
			
		})
	}
});

// evt 
KR.fn.extend({
	ani:function(mass){
		//opacity,left,top
		if(mass.opacity) KR.opacityAni(this,mass.opacity)
	},
	evt:function(types,fn){
		var types = types.split(" ");
		var type, i = 0,eventHandle = KR.Event;
		while ( (type = types[ i++ ]) ) {
			this.each(function(j){
				this.n = j;
				this[type] =fn;
				if(!this.types) this.types = new Array;
				this.types.push(type)
				this.node = this.nodeName;
				eventHandle.type = type;
				var tidn = function(){
					alert('1')
				}
				this["on" + type] = eventHandle
			});
		}
		return this;
	},
	bind:function(types,fn){
		var types = types.split(" ");
		var type, i = 0,eventHandle = KR.Event;
		while ( (type = types[ i++ ]) ) {
			this.each(function(i){
				this.fn = fn;
				this.node = this.nodeName;
				if ( document.addEventListener ) {
					this.addEventListener( type, eventHandle, false );
				} else if ( document.attachEvent ) {
					this.attachEvent( "on" + type, eventHandle );
				}
			});
		}
		return this;
	},
	unbind:function(types,fn){
		var types = types.split(" ");
		var type, i = 0,eventHandle = KR.fix;
		while ( (type = types[ i++ ]) ) {
			this.each(function(i){
				this[fn] = fn;
				if ( document.addEventListener ) {
					this.removeEventListener( type, eventHandle, false );
				} else if ( document.attachEvent ) {
					this.detachEvent( "on" + type, eventHandle );
				}
			});
		}
		return this;
	},
	animate:function(mass,time){
		var type1 = "left top right margin marginRight marginTop marginLeft marginBottom padding paddingTop paddingLeft paddingRight paddingBottom width height opacity";
		//this.css({opacity:0.5})
		//alert(this.css('top'))
		if(!mass) return false;
		if(time)KR.time = time;
		 type1 = type1.split(" ") 
		 var i=0;
		for ( ; i<type1.length ; ) {
			if(mass[ type1[i] ]) {
				//alert(this.length+"  "+mass[ type1[i] ]+"  "+type1[i])
				this.each(function(){if(!this[type1[i]])this[type1[i]] = {}; KR.ani(this,mass[ type1[i] ],type1[i])})
			}
			i++;
		}
		//this.each(function(){KR.posAni(this,0,0)})
	}
});

KR.extend({
    fps : 27,time :0.7,
	easingOption:"easeOutQuart",
	ani:function(obj,xy,method){
		clearInterval(obj[method].timer);
		var i=0 , max=Math.round(KR.fps*KR.time), target = KR(obj);
		obj[method].from= parseInt(target.css(method));
		obj[method].to=(xy - obj[method].from);
		// alert(obj[method].from +  "  "  +  obj[method].to)
		var ceil = function (a){return parseInt(Math.ceil(a*100))/100};


		obj[method].timer = setInterval(function(){
			var ret = {};
			pos=KR.easing[KR.easingOption](i,Number(obj[method].from),Number(obj[method].to),max);
			//if(method =="opacity") alert(pos)
			ret[method]= ceil(pos);
			target.css(ret);
			if(i == max){
				clearInterval(obj[method].timer);
			}
			i++;
		},40)
	},
	easing:{
		easeInQuad : function(t,b,c,d){				// normal to fast
			return c*(t/=d)*t+b;
		},
		easeOutQuad : function(t,b,c,d){			// normal to slow
			return -c*(t/=d)*(t-2)+b;
		},
		easeInOutQuad : function(t,b,c,d){			//normal  fast-slow
			if((t/=d/2)<1) return c/2*t*t+b;
			return -c/2*((--t)*(t-2)-1)+b;
		},
		easeOutInQuad : function(t,b,c,d){
			if(t < d/2) return easing.easeOutQuad(t*2,b,c/2,d);
			return easing.easeInQuad((t*2)-d,b+c/2,c/2,d);
		},
		easeInCubic : function(t,b,c,d){			// to fast
			return c*(t/=d)*t*t+b;
		},
		easeOutCubic : function(t,b,c,d){			// to slow
			return c*((t=t/d-1)*t*t+1)+b;
		},
		easeInOutCubic : function(t,b,c,d){			// fast - slow
			if((t/=d/2)<1) return c/2*t*t*t+b;
			return c/2*((t-=2)*t*t+2)+b;
		},
		easeOutInCubic : function(t,b,c,d){
			if(t<d/2) return easing.easeOutCubic(t*2,b,c/2,d);
			return easing.easeInCubic((t*2)-d,b+c/2,c/2,d);
		},
		easeInQuart : function(t,b,c,d){			// to fast
			return c*(t/=d)*t*t*t+b;
		},
		easeOutQuart : function(t,b,c,d){			// to slow
			return -c*((t=t/d-1)*t*t*t-1)+b;
		},
		easeInOutQuart : 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;
		},
		easeOutInQuart : function(t,b,c,d){
			if(t<d/2) return easing.easeOutQuart(t*2,b,c/2,d);
			return easing.easeInQuart((t*2)-d,b+c/2,c/2,d);
		},
		easeInQuint : function(t,b,c,d){			// to fast
			return c*(t/=d)*t*t*t*t+b;
		},
		easeOutQuint : function(t,b,c,d){			// to slow
			return c*((t=t/d-1)*t*t*t*t+1)+b;
		},
		easeInOutQuint : function(t,b,c,d){
			if((t/=d/2)<1) return c/2*t*t*t*t*t+b;
			return c/2*((t-=2)*t*t*t*t+2)+b;
		},
		easeOutInQuint : function(t,b,c,d){
			if(t<d/2) return easing.easeOutQuint(t*2,b,c/2,d);
			return easing.easeInQuint((t*2)-d,b+c/2,c/2,d);
		},
		easeInSine : function(t,b,c,d){    // normal slow-fast
			return -c*Math.cos(t/d*(Math.PI/2))+c+b;
		},
		easeOutSine : function(t,b,c,d){   // normal fast-slow
			return c*Math.sin(t/d*(Math.PI/2))+b;
		},
		easeInOutSine : function(t,b,c,d){  // normal
			return -c/2*(Math.cos(Math.PI*t/d)-1)+b;
		},
		easeOutInSine : function(t,b,c,d){
			if(t<d/2) return easing.easeOutSine(t*2,b,c/2,d);
			return easing.easeInSine((t*2)-d,b+c/2,c/2,d);
		},
		easeInExpo : function(t,b,c,d){    // to fast
			return (t==0)? b : c*Math.pow(2,10*(t/d-1))+b-c*0.001;
		},
		easeOutExpo : function(t,b,c,d){    // to slow
			return (t==d)? b+c : c*1.001*(-Math.pow(2,-10*t/d)+1)+b;
		},
		easeInOutExpo : 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-c*0.0005;
			return c/2*1.0005*(-Math.pow(2,-10*--t)+2)+b;
		},
		easeOutInExpo : function(t,b,c,d){
			if(t<d/2) return easing.easeOutExpo(t*2,b,c/2,d);
			return easing.easeInExpo((t*2)-d,b+c/2,c/2,d);
		},
		easeInCirc : function(t,b,c,d){     // slow-fast
			return -c*(Math.sqrt(1-(t/=d)*t)-1)+b;
		},
		easeOutCirc : function(t,b,c,d){    // fast-slow
			return c*Math.sqrt(1-(t=t/d-1)*t)+b;
		},
		easeInOutCirc : function(t,b,c,d){  // slow-fast-slow
			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;
		},
		easeOutInCirc : function(t,b,c,d){
			if (t<d/2) return easing.easeOutCirc(t*2,b,c/2,d);
			return easing.easeInCirc((t*2)-d,b+c/2,c/2,d);
		},
		easeInElastic : function(t,b,c,d,a,p){
			if(!t) return b;
			if((t/=d)==1) return b+c;
			var s,p=(!p || typeof(p)!='number')? d*.3 : p,a=(!a || typeof(a)!='number')? 0 : a;
			if(!a || a<Math.abs(c)){
				a=c;
				s=p/4;
			}else 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;
		},
		easeOutElastic : function(t,b,c,d,a,p){
			if(!t) return b;
			if((t/=d)==1) return b+c;
			var s,p=(!p || typeof(p)!='number')? d*.3 : p,a=(!a || typeof(a)!='number')? 0 : a;
			if(!a || a<Math.abs(c)){
				a=c;
				s=p/4;
			}else 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);
		},
		easeInOutElastic : function(t,b,c,d,a,p){
			if(t==0) return b;
			if((t/=d/2)==2) return b+c;
			var s,p=d*(.3*1.5),a=0;
			var s,p=(!p || typeof(p)!='number')? d*(.3*1.5) : p,a=(!a || typeof(a)!='number')? 0 : a;
			if(!a || a<Math.abs(c)){
				a=c;
				s=p/4;
			}else 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;
		},
		easeOutInElastic : function(t,b,c,d,a,p){
			if (t<d/2) return easing.easeOutElastic(t*2,b,c/2,d,a,p);
			return easing.easeInElastic((t*2)-d,b+c/2,c/2,d,a,p);
		},
		easeInBack : function(t,b,c,d,s){
			var s=(!s || typeof(s)!='number')? 1.70158 : s;
			return c*(t/=d)*t*((s+1)*t-s)+b;
		},
		easeOutBack : function(t,b,c,d,s){
			var s=(!s || typeof(s)!='number')? 1.70158 : s;
			return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;
		},
		easeInOutBack : function(t,b,c,d,s){
			var s=(!s || typeof(s)!='number')? 1.70158 : s;
			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;
		},
		easeOutInBack : function(t,b,c,d,s){
			if(t<d/2) return easing.easeOutBack(t*2,b,c/2,d,s);
			return easing.easeInBack((t*2)-d,b+c/2,c/2,d,s);
		},
		easeInBounce : function(t,b,c,d){
			return c-easing.easeOutBounce(d-t,0,c,d)+b;
		},
		easeOutBounce : 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+.75)+b;
			else if(t<(2.5/2.75)) return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;
			else return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;
		},
		easeInOutBounce : function(t,b,c,d){
			if(t<d/2) return easing.easeInBounce(t*2,0,c,d)*.5+b;
			else return easing.easeOutBounce(t*2-d,0,c,d)*.5+c*.5+b;
		},
		easeOutInBounce : function(t,b,c,d){
			if(t<d/2) return easing.easeOutBounce(t*2,b,c/2,d);
			return easing.easeInBounce((t*2)-d,b+c/2,c/2,d);
		}
	}
});



// selecter css
// *  More information: http://sizzlejs.com/
(function(){
	var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
		done = 0,
		toString = Object.prototype.toString;

	var Sizzle = function(selector, context, results, seed) {
		results = results || [];
		context = context || document;

		if ( context.nodeType !== 1 && context.nodeType !== 9 )
			return [];
		
		if ( !selector || typeof selector !== "string" ) {
			return results;
		}

		var parts = [], m, set, checkSet, check, mode, extra, prune = true;
		
		// Reset the position of the chunker regexp (start from head)
		chunker.lastIndex = 0;
		
		while ( (m = chunker.exec(selector)) !== null ) {
			parts.push( m[1] );
			
			if ( m[2] ) {
				extra = RegExp.rightContext;
				break;
			}
		}

		if ( parts.length > 1 && origPOS.exec( selector ) ) {
			if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
				set = posProcess( parts[0] + parts[1], context );
			} else {
				set = Expr.relative[ parts[0] ] ?
					[ context ] :
					Sizzle( parts.shift(), context );

				while ( parts.length ) {
					selector = parts.shift();

					if ( Expr.relative[ selector ] )
						selector += parts.shift();

					set = posProcess( selector, set );
				}
			}
		} else {
			var ret = seed ?
				{ expr: parts.pop(), set: makeArray(seed) } :
				Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );
			set = Sizzle.filter( ret.expr, ret.set );

			if ( parts.length > 0 ) {
				checkSet = makeArray(set);
			} else {
				prune = false;
			}

			while ( parts.length ) {
				var cur = parts.pop(), pop = cur;

				if ( !Expr.relative[ cur ] ) {
					cur = "";
				} else {
					pop = parts.pop();
				}

				if ( pop == null ) {
					pop = context;
				}

				Expr.relative[ cur ]( checkSet, pop, isXML(context) );
			}
		}

		if ( !checkSet ) {
			checkSet = set;
		}

		if ( !checkSet ) {
			throw "Syntax error, unrecognized expression: " + (cur || selector);
		}

		if ( toString.call(checkSet) === "[object Array]" ) {
			if ( !prune ) {
				results.push.apply( results, checkSet );
			} else if ( context.nodeType === 1 ) {
				for ( var i = 0; checkSet[i] != null; i++ ) {
					if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
						results.push( set[i] );
					}
				}
			} else {
				for ( var i = 0; checkSet[i] != null; i++ ) {
					if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
						results.push( set[i] );
					}
				}
			}
		} else {
			makeArray( checkSet, results );
		}

		if ( extra ) {
			Sizzle( extra, context, results, seed );

			if ( sortOrder ) {
				hasDuplicate = false;
				results.sort(sortOrder);

				if ( hasDuplicate ) {
					for ( var i = 1; i < results.length; i++ ) {
						if ( results[i] === results[i-1] ) {
							results.splice(i--, 1);
						}
					}
				}
			}
		}

		return results;
	};

	Sizzle.matches = function(expr, set){
		return Sizzle(expr, null, null, set);
	};

	Sizzle.find = function(expr, context, isXML){
		var set, match;

		if ( !expr ) {
			return [];
		}

		for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
			var type = Expr.order[i], match;
			
			if ( (match = Expr.match[ type ].exec( expr )) ) {
				var left = RegExp.leftContext;

				if ( left.substr( left.length - 1 ) !== "\\" ) {
					match[1] = (match[1] || "").replace(/\\/g, "");
					set = Expr.find[ type ]( match, context, isXML );
					if ( set != null ) {
						expr = expr.replace( Expr.match[ type ], "" );
						break;
					}
				}
			}
		}

		if ( !set ) {
			set = context.getElementsByTagName("*");
		}

		return {set: set, expr: expr};
	};

	Sizzle.filter = function(expr, set, inplace, not){
		var old = expr, result = [], curLoop = set, match, anyFound,
			isXMLFilter = set && set[0] && isXML(set[0]);

		while ( expr && set.length ) {
			for ( var type in Expr.filter ) {
				if ( (match = Expr.match[ type ].exec( expr )) != null ) {
					var filter = Expr.filter[ type ], found, item;
					anyFound = false;

					if ( curLoop == result ) {
						result = [];
					}

					if ( Expr.preFilter[ type ] ) {
						match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );

						if ( !match ) {
							anyFound = found = true;
						} else if ( match === true ) {
							continue;
						}
					}

					if ( match ) {
						for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
							if ( item ) {
								found = filter( item, match, i, curLoop );
								var pass = not ^ !!found;

								if ( inplace && found != null ) {
									if ( pass ) {
										anyFound = true;
									} else {
										curLoop[i] = false;
									}
								} else if ( pass ) {
									result.push( item );
									anyFound = true;
								}
							}
						}
					}

					if ( found !== undefined ) {
						if ( !inplace ) {
							curLoop = result;
						}

						expr = expr.replace( Expr.match[ type ], "" );

						if ( !anyFound ) {
							return [];
						}

						break;
					}
				}
			}

			// Improper expression
			if ( expr == old ) {
				if ( anyFound == null ) {
					throw "Syntax error, unrecognized expression: " + expr;
				} else {
					break;
				}
			}

			old = expr;
		}

		return curLoop;
	};

	var Expr = Sizzle.selectors = {
		order: [ "ID", "NAME", "TAG" ],
		match: {
			ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
			CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
			NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
			ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
			TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
			CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
			POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
			PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
		},
		attrMap: {
			"class": "className",
			"for": "htmlFor"
		},
		attrHandle: {
			href: function(elem){
				return elem.getAttribute("href");
			}
		},
		relative: {
			"+": function(checkSet, part, isXML){
				var isPartStr = typeof part === "string",
					isTag = isPartStr && !/\W/.test(part),
					isPartStrNotTag = isPartStr && !isTag;

				if ( isTag && !isXML ) {
					part = part.toUpperCase();
				}

				for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
					if ( (elem = checkSet[i]) ) {
						while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}

						checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
							elem || false :
							elem === part;
					}
				}

				if ( isPartStrNotTag ) {
					Sizzle.filter( part, checkSet, true );
				}
			},
			">": function(checkSet, part, isXML){
				var isPartStr = typeof part === "string";

				if ( isPartStr && !/\W/.test(part) ) {
					part = isXML ? part : part.toUpperCase();

					for ( var i = 0, l = checkSet.length; i < l; i++ ) {
						var elem = checkSet[i];
						if ( elem ) {
							var parent = elem.parentNode;
							checkSet[i] = parent.nodeName === part ? parent : false;
						}
					}
				} else {
					for ( var i = 0, l = checkSet.length; i < l; i++ ) {
						var elem = checkSet[i];
						if ( elem ) {
							checkSet[i] = isPartStr ?
								elem.parentNode :
								elem.parentNode === part;
						}
					}

					if ( isPartStr ) {
						Sizzle.filter( part, checkSet, true );
					}
				}
			},
			"": function(checkSet, part, isXML){
				var doneName = done++, checkFn = dirCheck;

				if ( !part.match(/\W/) ) {
					var nodeCheck = part = isXML ? part : part.toUpperCase();
					checkFn = dirNodeCheck;
				}

				checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
			},
			"~": function(checkSet, part, isXML){
				var doneName = done++, checkFn = dirCheck;

				if ( typeof part === "string" && !part.match(/\W/) ) {
					var nodeCheck = part = isXML ? part : part.toUpperCase();
					checkFn = dirNodeCheck;
				}

				checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
			}
		},
		find: {
			ID: function(match, context, isXML){
				if ( typeof context.getElementById !== "undefined" && !isXML ) {
					var m = context.getElementById(match[1]);
					return m ? [m] : [];
				}
			},
			NAME: function(match, context, isXML){
				if ( typeof context.getElementsByName !== "undefined" ) {
					var ret = [], results = context.getElementsByName(match[1]);

					for ( var i = 0, l = results.length; i < l; i++ ) {
						if ( results[i].getAttribute("name") === match[1] ) {
							ret.push( results[i] );
						}
					}

					return ret.length === 0 ? null : ret;
				}
			},
			TAG: function(match, context){
				return context.getElementsByTagName(match[1]);
			}
		},
		preFilter: {
			CLASS: function(match, curLoop, inplace, result, not, isXML){
				match = " " + match[1].replace(/\\/g, "") + " ";

				if ( isXML ) {
					return match;
				}

				for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
					if ( elem ) {
						if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
							if ( !inplace )
								result.push( elem );
						} else if ( inplace ) {
							curLoop[i] = false;
						}
					}
				}

				return false;
			},
			ID: function(match){
				return match[1].replace(/\\/g, "");
			},
			TAG: function(match, curLoop){
				for ( var i = 0; curLoop[i] === false; i++ ){}
				return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
			},
			CHILD: function(match){
				if ( match[1] == "nth" ) {
					// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
					var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
						match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
						!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);

					// calculate the numbers (first)n+(last) including if they are negative
					match[2] = (test[1] + (test[2] || 1)) - 0;
					match[3] = test[3] - 0;
				}

				// TODO: Move to normal caching system
				match[0] = done++;

				return match;
			},
			ATTR: function(match, curLoop, inplace, result, not, isXML){
				var name = match[1].replace(/\\/g, "");
				
				if ( !isXML && Expr.attrMap[name] ) {
					match[1] = Expr.attrMap[name];
				}

				if ( match[2] === "~=" ) {
					match[4] = " " + match[4] + " ";
				}

				return match;
			},
			PSEUDO: function(match, curLoop, inplace, result, not){
				if ( match[1] === "not" ) {
					// If we're dealing with a complex expression, or a simple one
					if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
						match[3] = Sizzle(match[3], null, null, curLoop);
					} else {
						var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
						if ( !inplace ) {
							result.push.apply( result, ret );
						}
						return false;
					}
				} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
					return true;
				}
				
				return match;
			},
			POS: function(match){
				match.unshift( true );
				return match;
			}
		},
		filters: {
			enabled: function(elem){
				return elem.disabled === false && elem.type !== "hidden";
			},
			disabled: function(elem){
				return elem.disabled === true;
			},
			checked: function(elem){
				return elem.checked === true;
			},
			selected: function(elem){
				// Accessing this property makes selected-by-default
				// options in Safari work properly
				elem.parentNode.selectedIndex;
				return elem.selected === true;
			},
			parent: function(elem){
				return !!elem.firstChild;
			},
			empty: function(elem){
				return !elem.firstChild;
			},
			has: function(elem, i, match){
				return !!Sizzle( match[3], elem ).length;
			},
			header: function(elem){
				return /h\d/i.test( elem.nodeName );
			},
			text: function(elem){
				return "text" === elem.type;
			},
			radio: function(elem){
				return "radio" === elem.type;
			},
			checkbox: function(elem){
				return "checkbox" === elem.type;
			},
			file: function(elem){
				return "file" === elem.type;
			},
			password: function(elem){
				return "password" === elem.type;
			},
			submit: function(elem){
				return "submit" === elem.type;
			},
			image: function(elem){
				return "image" === elem.type;
			},
			reset: function(elem){
				return "reset" === elem.type;
			},
			button: function(elem){
				return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
			},
			input: function(elem){
				return /input|select|textarea|button/i.test(elem.nodeName);
			}
		},
		setFilters: {
			first: function(elem, i){
				return i === 0;
			},
			last: function(elem, i, match, array){
				return i === array.length - 1;
			},
			even: function(elem, i){
				return i % 2 === 0;
			},
			odd: function(elem, i){
				return i % 2 === 1;
			},
			lt: function(elem, i, match){
				return i < match[3] - 0;
			},
			gt: function(elem, i, match){
				return i > match[3] - 0;
			},
			nth: function(elem, i, match){
				return match[3] - 0 == i;
			},
			eq: function(elem, i, match){
				return match[3] - 0 == i;
			}
		},
		filter: {
			PSEUDO: function(elem, match, i, array){
				var name = match[1], filter = Expr.filters[ name ];

				if ( filter ) {
					return filter( elem, i, match, array );
				} else if ( name === "contains" ) {
					return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
				} else if ( name === "not" ) {
					var not = match[3];

					for ( var i = 0, l = not.length; i < l; i++ ) {
						if ( not[i] === elem ) {
							return false;
						}
					}

					return true;
				}
			},
			CHILD: function(elem, match){
				var type = match[1], node = elem;
				switch (type) {
					case 'only':
					case 'first':
						while (node = node.previousSibling)  {
							if ( node.nodeType === 1 ) return false;
						}
						if ( type == 'first') return true;
						node = elem;
					case 'last':
						while (node = node.nextSibling)  {
							if ( node.nodeType === 1 ) return false;
						}
						return true;
					case 'nth':
						var first = match[2], last = match[3];

						if ( first == 1 && last == 0 ) {
							return true;
						}
						
						var doneName = match[0],
							parent = elem.parentNode;
		
						if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
							var count = 0;
							for ( node = parent.firstChild; node; node = node.nextSibling ) {
								if ( node.nodeType === 1 ) {
									node.nodeIndex = ++count;
								}
							} 
							parent.sizcache = doneName;
						}
						
						var diff = elem.nodeIndex - last;
						if ( first == 0 ) {
							return diff == 0;
						} else {
							return ( diff % first == 0 && diff / first >= 0 );
						}
				}
			},
			ID: function(elem, match){
				return elem.nodeType === 1 && elem.getAttribute("id") === match;
			},
			TAG: function(elem, match){
				return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
			},
			CLASS: function(elem, match){
				return (" " + (elem.className || elem.getAttribute("class")) + " ")
					.indexOf( match ) > -1;
			},
			ATTR: function(elem, match){
				var name = match[1],
					result = Expr.attrHandle[ name ] ?
						Expr.attrHandle[ name ]( elem ) :
						elem[ name ] != null ?
							elem[ name ] :
							elem.getAttribute( name ),
					value = result + "",
					type = match[2],
					check = match[4];

				return result == null ?
					type === "!=" :
					type === "=" ?
					value === check :
					type === "*=" ?
					value.indexOf(check) >= 0 :
					type === "~=" ?
					(" " + value + " ").indexOf(check) >= 0 :
					!check ?
					value && result !== false :
					type === "!=" ?
					value != check :
					type === "^=" ?
					value.indexOf(check) === 0 :
					type === "$=" ?
					value.substr(value.length - check.length) === check :
					type === "|=" ?
					value === check || value.substr(0, check.length + 1) === check + "-" :
					false;
			},
			POS: function(elem, match, i, array){
				var name = match[2], filter = Expr.setFilters[ name ];

				if ( filter ) {
					return filter( elem, i, match, array );
				}
			}
		}
	};

	var origPOS = Expr.match.POS;

	for ( var type in Expr.match ) {
		Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
	}

	var makeArray = function(array, results) {
		array = Array.prototype.slice.call( array );

		if ( results ) {
			results.push.apply( results, array );
			return results;
		}
		
		return array;
	};

	// Perform a simple check to determine if the browser is capable of
	// converting a NodeList to an array using builtin methods.
	try {
		Array.prototype.slice.call( document.documentElement.childNodes );

	// Provide a fallback method if it does not work
	} catch(e){
		makeArray = function(array, results) {
			var ret = results || [];

			if ( toString.call(array) === "[object Array]" ) {
				Array.prototype.push.apply( ret, array );
			} else {
				if ( typeof array.length === "number" ) {
					for ( var i = 0, l = array.length; i < l; i++ ) {
						ret.push( array[i] );
					}
				} else {
					for ( var i = 0; array[i]; i++ ) {
						ret.push( array[i] );
					}
				}
			}

			return ret;
		};
	}

	var sortOrder;

	if ( document.documentElement.compareDocumentPosition ) {
		sortOrder = function( a, b ) {
			var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
			if ( ret === 0 ) {
				hasDuplicate = true;
			}
			return ret;
		};
	} else if ( "sourceIndex" in document.documentElement ) {
		sortOrder = function( a, b ) {
			var ret = a.sourceIndex - b.sourceIndex;
			if ( ret === 0 ) {
				hasDuplicate = true;
			}
			return ret;
		};
	} else if ( document.createRange ) {
		sortOrder = function( a, b ) {
			var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
			aRange.selectNode(a);
			aRange.collapse(true);
			bRange.selectNode(b);
			bRange.collapse(true);
			var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
			if ( ret === 0 ) {
				hasDuplicate = true;
			}
			return ret;
		};
	}

	// Check to see if the browser returns elements by name when
	// querying by getElementById (and provide a workaround)
	(function(){
		// We're going to inject a fake input element with a specified name
		var form = document.createElement("form"),
			id = "script" + (new Date).getTime();
		form.innerHTML = "<input name='" + id + "'/>";

		// Inject it into the root element, check its status, and remove it quickly
		var root = document.documentElement;
		root.insertBefore( form, root.firstChild );

		// The workaround has to do additional checks after a getElementById
		// Which slows things down for other browsers (hence the branching)
		if ( !!document.getElementById( id ) ) {
			Expr.find.ID = function(match, context, isXML){
				if ( typeof context.getElementById !== "undefined" && !isXML ) {
					var m = context.getElementById(match[1]);
					return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
				}
			};

			Expr.filter.ID = function(elem, match){
				var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
				return elem.nodeType === 1 && node && node.nodeValue === match;
			};
		}

		root.removeChild( form );
	})();

	(function(){
		// Check to see if the browser returns only elements
		// when doing getElementsByTagName("*")

		// Create a fake element
		var div = document.createElement("div");
		div.appendChild( document.createComment("") );

		// Make sure no comments are found
		if ( div.getElementsByTagName("*").length > 0 ) {
			Expr.find.TAG = function(match, context){
				var results = context.getElementsByTagName(match[1]);

				// Filter out possible comments
				if ( match[1] === "*" ) {
					var tmp = [];

					for ( var i = 0; results[i]; i++ ) {
						if ( results[i].nodeType === 1 ) {
							tmp.push( results[i] );
						}
					}

					results = tmp;
				}

				return results;
			};
		}

		// Check to see if an attribute returns normalized href attributes
		div.innerHTML = "<a href='#'></a>";
		if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
				div.firstChild.getAttribute("href") !== "#" ) {
			Expr.attrHandle.href = function(elem){
				return elem.getAttribute("href", 2);
			};
		}
	})();

	if ( document.querySelectorAll ) (function(){
		var oldSizzle = Sizzle, div = document.createElement("div");
		div.innerHTML = "<p class='TEST'></p>";

		// Safari can't handle uppercase or unicode characters when
		// in quirks mode.
		if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
			return;
		}
		
		Sizzle = function(query, context, extra, seed){
			context = context || document;

			// Only use querySelectorAll on non-XML documents
			// (ID selectors don't work in non-HTML documents)
			if ( !seed && context.nodeType === 9 && !isXML(context) ) {
				try {
					return makeArray( context.querySelectorAll(query), extra );
				} catch(e){}
			}
			
			return oldSizzle(query, context, extra, seed);
		};

		Sizzle.find = oldSizzle.find;
		Sizzle.filter = oldSizzle.filter;
		Sizzle.selectors = oldSizzle.selectors;
		Sizzle.matches = oldSizzle.matches;
	})();

	if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
		var div = document.createElement("div");
		div.innerHTML = "<div class='test e'></div><div class='test'></div>";

		// Opera can't find a second classname (in 9.6)
		if ( div.getElementsByClassName("e").length === 0 )
			return;

		// Safari caches class attributes, doesn't catch changes (in 3.2)
		div.lastChild.className = "e";

		if ( div.getElementsByClassName("e").length === 1 )
			return;

		Expr.order.splice(1, 0, "CLASS");
		Expr.find.CLASS = function(match, context, isXML) {
			if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
				return context.getElementsByClassName(match[1]);
			}
		};
	})();

	function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
		var sibDir = dir == "previousSibling" && !isXML;
		for ( var i = 0, l = checkSet.length; i < l; i++ ) {
			var elem = checkSet[i];
			if ( elem ) {
				if ( sibDir && elem.nodeType === 1 ){
					elem.sizcache = doneName;
					elem.sizset = i;
				}
				elem = elem[dir];
				var match = false;

				while ( elem ) {
					if ( elem.sizcache === doneName ) {
						match = checkSet[elem.sizset];
						break;
					}

					if ( elem.nodeType === 1 && !isXML ){
						elem.sizcache = doneName;
						elem.sizset = i;
					}

					if ( elem.nodeName === cur ) {
						match = elem;
						break;
					}

					elem = elem[dir];
				}

				checkSet[i] = match;
			}
		}
	}

	function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
		var sibDir = dir == "previousSibling" && !isXML;
		for ( var i = 0, l = checkSet.length; i < l; i++ ) {
			var elem = checkSet[i];
			if ( elem ) {
				if ( sibDir && elem.nodeType === 1 ) {
					elem.sizcache = doneName;
					elem.sizset = i;
				}
				elem = elem[dir];
				var match = false;

				while ( elem ) {
					if ( elem.sizcache === doneName ) {
						match = checkSet[elem.sizset];
						break;
					}

					if ( elem.nodeType === 1 ) {
						if ( !isXML ) {
							elem.sizcache = doneName;
							elem.sizset = i;
						}
						if ( typeof cur !== "string" ) {
							if ( elem === cur ) {
								match = true;
								break;
							}

						} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
							match = elem;
							break;
						}
					}

					elem = elem[dir];
				}

				checkSet[i] = match;
			}
		}
	}

	var contains = document.compareDocumentPosition ?  function(a, b){
		return a.compareDocumentPosition(b) & 16;
	} : function(a, b){
		return a !== b && (a.contains ? a.contains(b) : true);
	};

	var isXML = function(elem){
		return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
			!!elem.ownerDocument && isXML( elem.ownerDocument );
	};

	var posProcess = function(selector, context){
		var tmpSet = [], later = "", match,
			root = context.nodeType ? [context] : context;

		// Position selectors must be done after the filter
		// And so must :not(positional) so we move all PSEUDOs to the end
		while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
			later += match[0];
			selector = selector.replace( Expr.match.PSEUDO, "" );
		}

		selector = Expr.relative[selector] ? selector + "*" : selector;

		for ( var i = 0, l = root.length; i < l; i++ ) {
			Sizzle( selector, root[i], tmpSet );
		}

		return Sizzle.filter( later, tmpSet );
	};

	KR.find = Sizzle;
	return;

	window.Sizzle = Sizzle;

})();

})();
