/**
*@ AshAPI	|
 Author : 			An.sehan (www.happyfri.com / plandas@naver.com)
 Creation Date : 	2007.12.04
 Last Modified : 	2009.04.23
 Version : 		1.6

*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var Ash=function(){};
Ash.prototype={_class:null,initialize:null,instancedCount:0,getClass:function(){return this._class?this._class:this.constructor;
	},toString:function(){var cls=this.constructor;
		return cls._className?'object '+cls._className:this;
	}
}
Ash._className='Ash';
Ash.createClass=function(className,extendClass){var f=function(){try{if(arguments[0]=='ashclassextended'){if(this.initialize)this.initialize();
			}else{this.instancedCount=++this.constructor.instancedCount;
				if(this.__commonAshreMembers!=null)this.__commonAshreMembers(); 
				if(this.initialize)this.initialize.apply(this,arguments); 
			}
		} catch(err){};
	}
	if(className)f._className=className;
	if(extendClass)f.prototype=new extendClass('ashclassextended');
	f.prototype.constructor=f;
	f.instancedCount=0;
	try{return f;
	} 
	finally{
	}
}
Ash.addPrototype=function(theClass,protoObj){for(var pro in protoObj)theClass.prototype[pro]=protoObj[pro];
}
Ash.multiInheritance=function(superClass,subClass){for(var pro in superClass.prototype)subClass.prototype[pro]=superClass.prototype[pro];
	subClass.prototype.constructor=subClass;
}  
Ash.NAMESPACE_URL='http://www.happyfri.com'; Ash.support=function(){window.open(Ash.NAMESPACE_URL); };
var AshUtil=Ash.createClass('AshUtil',Ash);
AshUtil.toProperty=function(obj){var value='';
	for(var p in obj)value+=","+p+"="+obj[p];
	value=value.replace(/,/,'');
	return"{"+value+"}";
}
AshUtil.availableBrowser=function(){return{ie:((navigator.appVersion.indexOf("MSIE")!=-1)?true:false),win:((navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false),ff:((navigator.userAgent.indexOf("Firefox")!=-1)?true:false),opera:( (navigator.userAgent.indexOf("Opera")!=-1)?true:false),safari:( (navigator.userAgent.indexOf("AppleWebKit")!=-1)?true:false),ie6:(( navigator.appVersion.indexOf("MSIE 6")>-1)?true:false)};
}
AshUtil.browser=AshUtil.availableBrowser();
AshUtil.random=function(max){return Math.floor(Math.random()*max);
}
AshUtil.randomRange=function(min,max){return Math.floor(Math.random()*(max-min+1))+min;
}
AshUtil.minToMax=function(value,min,max){return Math.min(Math.max(value,min),max);
}
AshUtil.arrayShuffle=function(arr,callback){for(var ran1,ran2,save,l=arr.length,i=0; i<l; i++){ran1=AshUtil.random(l); ran2=AshUtil.random(l); 
		save=arr[ran1];
		arr[ran1]=arr[ran2];
		arr[ran2]=save;
		if(callback!=null)callback(i,arr[i]);
	}
	return arr;
}
AshUtil.cloneObject=function(obj){var cloner=function(){}; 
	cloner.prototype=obj; 
	return new cloner(); 
}
AshUtil.obj=function(id,win){win=win||window;
	return win.document.getElementById(id);
}
AshUtil.getElementsByCName=function(target,cname){var elements=[];
	var g=function(t){for(var l=t.childNodes.length,c=null,i=0; i<l; i++){c=t.childNodes[i];
			if(c.nodeType==1&&c.getAttribute('cname')==cname)elements.push(c);
			if(c.hasChildNodes())g(c);
		}
	}
	g(target);
	return elements;
}
AshUtil.getChildByName=function(obj,name){if(!obj||!name)return null;
	for(var l=obj.childNodes.length,c=null,cn=null,i=0; i<l; i++){cn=obj.childNodes[i];
		if(cn.nodeType==1&&cn.getAttribute('name')==name)return cn;
		if(cn.hasChildNodes())c=AshUtil.getChildByName(cn,name);
		if(c)return c;
	}
	return c;
}
AshUtil.getChildByDotTree=function(dotTree){var getChild=function(obj,name){for(var l=obj.childNodes.length,c,o=null,i=0; i<l; i++){c=obj.childNodes[i];
			if(c.nodeType==1){if(c.getAttribute('id')==name||c.getAttribute('name')==name)return c;
				o=getChild(c,name);
				if(o)return o;
			}
		}
		return o;
	}
	var trees=dotTree.split('.');
	var obj=AshUtil.obj(trees[0]);
	for(var l=trees.length,i=1; i<l; i++){obj=getChild(obj,trees[i]);
		if(!obj)return null;
	}
	try{return obj;
	}finally{
	};
}
AshUtil.contains=function(parent,child){if(!parent||!child)return false;
	if(parent==child)return true;
	for(var l=parent.childNodes.length,r=false,c,i=0; i<l; i++){c=parent.childNodes[i];
		if(c==child)return true;
		if(c.hasChildNodes())r=AshUtil.contains(c,child);
		if(r)return r;
	}
	return r;
}
AshUtil.removeAllChild=function(target){if(!target)return;
	try{target.innerHTML='';
	}catch(error){for(var l=target.childNodes.length,i=l-1; i>=0; i--)target.removeChild(target.childNodes[i]);
	};
}
AshUtil.move=function(target,x,y){if(target&&target.style)target.style.left=x+'px',target.style.top=y+'px';
}
AshUtil.resize=function(target,w,h){
	if(target&&target.style){target.style.width=(typeof w=='string')?w:w+'px';
		target.style.height=(typeof h=='string')?h:h+'px';
	}
}
AshUtil.rebound=function(target,x,y,w,h){AshUtil.move(target,x,y); AshUtil.resize(target,w,h);
}
AshUtil.getStyle=function(obj,prop){if(obj.style[prop])return obj.style[prop];
	else if(obj.currentStyle&&obj.currentStyle[prop])return obj.currentStyle[prop];
	else if(window.getComputedStyle){
		var styleobj=obj.ownerDocument.defaultView.getComputedStyle(obj,null);
		if(styleobj)return styleobj[prop];
	}
	return'';
}
AshUtil.getBounds=function(obj){if(!obj)return{x:0,y:0,width:0,height:0};
	var pl=parseInt(AshUtil.getStyle(obj,'paddingLeft')),pr=parseInt(AshUtil.getStyle(obj,'paddingRight')),pt=parseInt(AshUtil.getStyle(obj,'paddingTop')),pb=parseInt(AshUtil.getStyle(obj,'paddingBottom'));
	if(isNaN(pl))pl=0; if(isNaN(pr))pr=0; if(isNaN(pt))pt=0; if(isNaN(pb))pb=0;
	var x=obj.offsetLeft?obj.offsetLeft:parseInt(AshUtil.getStyle(obj,'left')),y=obj.offsetTop?obj.offsetTop:parseInt(AshUtil.getStyle(obj,'top')),w=obj.offsetWidth?obj.offsetWidth-(pl+pr):parseInt(AshUtil.getStyle(obj,'width')),h=obj.offsetHeight?obj.offsetHeight-(pt+pb):parseInt(AshUtil.getStyle(obj,'height'));
	if(isNaN(x))x=0; if(isNaN(y))y=0; if(isNaN(w))w=0; if(isNaN(h))h=0;
	return{x:x,y:y,width:w,height:h};
}
AshUtil.globalCoordinates=function(obj){var x=0,y=0,cobj=obj;
	while(obj){x+=obj.offsetLeft||0; y+=obj.offsetTop||0;
		obj=obj.offsetParent;
	}
	
	if(AshUtil.browser.ie){for(;;){if(cobj.parentNode==document.body||!cobj)break;
			else cobj=cobj.parentNode;
		}
		if(cobj){x+=-parseInt(AshUtil.getStyle(cobj,'paddingLeft'))||0;
			y+=-parseInt(AshUtil.getStyle(cobj,'paddingTop'))||0}
	}
	return{x:x,y:y};
}
AshUtil.hitTest=function(target1,target2){if(!target1||!target2)return false;
	var p1=AshUtil.globalCoordinates(target1),p2=AshUtil.globalCoordinates(target2);
	var w1=target1.offsetWidth,h1=target1.offsetHeight,w2=target2.offsetWidth,h2=target2.offsetHeight;
	if((p1.x-w2<p2.x&&p2.x<p1.x+w1)&&(p1.y-h2<p2.y&&p2.y<p1.y+h1))return true;
	return false;
}
AshUtil.setInnerText=function(obj,value,win){win=win||window;
	if(obj)obj.replaceChild(win.document.createTextNode(value),obj.firstChild);
}
AshUtil.getInnerText=function(obj){if(obj){if(obj.innerText)return obj.innerText; 
		if(obj.textContent)return obj.textContent; 
		return obj.nodeType==3?obj.nodeValue:obj.innerHTML; 
	}
	return'';
}
AshUtil.toJSON=function(data){var result='';
	switch(typeof data){case'boolean':return data?'true':'false';
		 case'number':return data;
		 case'string':return'"'+data.replace(/\\/g,'\\\\').replace(/\r\n/g,'\\n').replace(/\r/g,'\\n').replace(/\"/g,'\\"')+'"';
		 case'object':var isArray=data.constructor==Array?true:false;
			for(var i in data)result+=isArray?AshUtil.toJSON(data[i])+', ':_SAVN(i)+':'+AshUtil.toJSON(data[i])+', ';
			result=isArray?'['+result.substr(0,result.length-2)+']':'{'+result.substr(0,result.length-2)+'}';
			break;
	}
	return result;
}
	function _SAVN(n){
		if(n.search(/^[0-9]+|[^a-zA-Z0-9_$]/)!=-1)return'"'+n+'"';
		return n;
	}
AshUtil.jsonToValue=function(json){eval('var value='+json); return value;
}
	
	AshUtil.document=Ash.createClass('AshUtil.document',Ash);
	
	AshUtil.document.importJS=function(src,callback){var scriptElem=document.createElement('script'),node=document.getElementsByTagName('head')[0]||document.body;
		scriptElem.setAttribute('src',src);
		scriptElem.setAttribute('type','text/javascript');
		if(callback)scriptElem.onload=callback;
		node.appendChild(scriptElem);
	}
	
	AshUtil.document.importCSS=function(href,callback){var linkElem=document.createElement('link'),node=document.getElementsByTagName('head')[0]||document.body;
		linkElem.setAttribute('rel','stylesheet');
		linkElem.setAttribute('type','text/css');
		linkElem.setAttribute('media','screen');
		linkElem.setAttribute('href',href);
		if(callback)linkElem.onload=callback;
		node.appendChild(linkElem);
	}
	
	AshUtil.document.runtimeAddCSS=function(cssFullSyntax,index){var styleSheet;
		if(!document.getElementsByTagName('style')[index||0]){document.getElementsByTagName('head')[0].appendChild(document.createElement('style'));
			styleSheet=document.styleSheets[0];
		} else styleSheet=document.styleSheets[index||0];
		if(AshUtil.browser.ie){var selectors=cssFullSyntax.replace(/\{.*/,'').split(','),style=cssFullSyntax.replace(/^.*\{/,'').replace(/\}.*$/,'');
			for(var l=selectors.length,i=0; i<l; i++)styleSheet.addRule(selectors[i],style);
		}
		else styleSheet.insertRule(cssFullSyntax,styleSheet.cssRules.length);
	}
	
	AshUtil.document.runtimeReplaceCSS=function(cssFullSyntax,index){var styleSheet;
		if(!document.getElementsByTagName('style')[index||0]){document.getElementsByTagName('head')[0].appendChild(document.createElement('style'));
			styleSheet=document.styleSheets[0];
		} else styleSheet=document.styleSheets[index||0];
		if(AshUtil.browser.ie)for(var i=styleSheet.rules.length-1; i>=0; i--)styleSheet.removeRule(i);
		else for(var i=styleSheet.cssRules.length-1; i>=0; i--)styleSheet.deleteRule(i);
		AshUtil.document.runtimeAddCSS(cssFullSyntax,index);
	}
	
	AshUtil.document.getCSSInStyleElement=function(index){return document.getElementsByTagName('style')[index||0].innerHTML;
	}
	
	AshUtil.document.scrollInfo=function(){var obj=document.documentElement,info={left:0,top:0};
		if(AshUtil.browser.safari)obj=document.body;
		info.left=obj.scrollLeft,info.top=obj.scrollTop;
		return info;
	}
	
	AshUtil.document.addOption=function(selectObj,values){if(selectObj&&values){var o=document.createElement("option");
			selectObj.options.add(o);
			o.value=values.value;
			o.innerHTML=values.text;
		}
	}
	
	AshUtil.filter=Ash.createClass('AshUtil.filter',Ash);
	
	AshUtil.filter.opacity=function(obj,value){try{if(obj){value=AshUtil.minToMax(value,0,1);
				if(AshUtil.browser.ie)obj.style.filter="alpha(opacity="+(value*100)+")"; 
				else obj.style.opacity=value;
			}
		} catch(error){} 
	}
	
	AshUtil.filter.blur=function(obj,enabled,radius){try{var availbro=AshUtil.browser;
			enabled=enabled?true:false;
			radius=radius||3;
			if(obj&&availbro.ie){
				if( isNaN(parseInt(obj.style.width)))obj.style.width=obj.offsetWidth+'px';
				if( isNaN(parseInt(obj.style.height)))obj.style.height=obj.offsetHeight+'px';
				obj.style.filter="progid:DXImageTransform.Microsoft.Blur(pixelradius="+radius+", enabled='"+enabled+"')";
			}
		} catch(error){} 
	}
	
	AshUtil.color=Ash.createClass('AshUtil.color',Ash);
	AshUtil.color.toRGB=function(value){if(value.search(/rgb/i)!=-1){
			value=value.replace(/rgb.*\(/,'');
			value=value.split(',');
			return Math.floor(parseInt(value[0]))*65536+Math.floor(parseInt(value[1]))*256+Math.floor(parseInt(value[2]));
		}
		return parseInt(value.replace(/#/,'0x'))}
	AshUtil.color.toHEX=function(value){if(typeof value=='string'){if(value.search(/rgb/i)!=-1){
				value=AshUtil.color.toRGB(value);
			}
		}
		var c=function(v){var r=v.toString(16); if(r.length==1)r='0'+r; return r.toUpperCase();};
		var r=(value>>16),g=(value>>8^ r<<8),b=(value^ (r<<16|g<<8));
		return'#'+c(r)+c(g)+c(b);
	}
	
	AshUtil.color.brightness=function(color,ratio){var colors=AshUtil.color.getGradient(color,0xffffff,100);
		return colors[ratio*100];
	}
	
	AshUtil.color.darkness=function(color,ratio){var colors=AshUtil.color.getGradient(color,0x000000,100);
		return colors[ratio*100];
	}
	
	AshUtil.color.getGradientMap=function(seqeunceColors,seqeunceLength){var colors=[],scs=seqeunceColors,n=seqeunceLength;
		for(var l=scs.length,i=0; i<l; i++)colors=colors.concat(AshUtil.color.getGradient(scs[i][0],scs[i][1],n));
		return colors;
	}
	
	AshUtil.color.drawGradient=function(target,seqeunceColors,seqeunceLength,w,h,vertical){var colors=AshUtil.color.getGradientMap(seqeunceColors,seqeunceLength),dw,dh,l,c;
		var dummy=document.createElement('DIV');
		dummy.style.border='0px';
		dummy.style.position='absolute';
		l=colors.length;
		dw=Math.round(w/l);
		dh=Math.round(h/l);
		AshUtil.removeAllChild(target);
		for(var i=0; i<l; i++){c=target.appendChild(dummy.cloneNode(true));
			c.style.backgroundColor=AshUtil.color.toHEX(colors[i]);
			if(vertical)AshUtil.rebound(c,0,dh*i,w,dh);
			else AshUtil.rebound(c,dw*i,0,dw,h);
		}
	}
	
	AshUtil.color.getGradient=function(beginColor,endColor,gLength){var colors=[],b=beginColor,e=endColor,n=gLength||100;
		var b1=b%256,b2=e%256;		
		var g1=((b-b1)/256)%256,g2=((e-b2)/256)%256;		
		var r1=(b-b1-g1*256)/65536,r2=(e-b2-g2*256)/65536;
		for(var i=0; i<n; i++)colors[i]=b1+(b2-b1)*i/(n-1)+Math.floor((g1+(g2-g1)*i/(n-1)))*256+Math.floor((r1+(r2-r1)*i/(n-1)))*65536;
		return colors;
	}
	
	AshUtil.color.drawSwatch=function(target,size){var c,i,j,x,y,ri=0,gi=0,bi=0;
		var cols=['00','33','66','99','cc','ff'];
		var extraCols=[0x000000,0x333333,0x666666,0x999999,0xcccccc,0xffffff,0xff0000,0x00ff00,0x0000ff,0xffff00,0x00ffff,0xff00ff];
		var r=cols[0],g=cols[0],b=cols[0],col;
		var dummy=document.createElement('DIV'),createPallet;
		dummy.style.border='0px';
		dummy.style.position='absolute';
		size=size||9;
		createPallet=function(color){var d=dummy.cloneNode(true);
			AshUtil.resize(d,size,size);
			d.style.backgroundColor=AshUtil.color.toHEX(color);
			try{return d;} finally{
			};
		}
		for(i=0; i<36; i++){if(i%6==0)r=cols[ri++];
			g=cols[gi++];
			if(gi>5)gi=0;
			for(j=0; j<6; j++){b=cols[j];
				col='0x'+r+g+b;
				c=createPallet(parseInt(col));
				x=size+(i*size-(i<18?0:18*size));
				y=j*size+(i<18?0:6*size);
				target.appendChild(c);
				AshUtil.move(c,x,y);
			}
		}
		for(i=0; i<12; i++){c=createPallet(extraCols[i]);
			target.appendChild(c);
			AshUtil.move(c,0,i*size);
		}
	}
var AshEvent=Ash.createClass('AshEvent',Ash);
Ash.addPrototype(AshEvent,{type:null,bubbles:false,cancelable:false,target:null,eventPhase:null,currentTarget:null,parameters:null});
AshEvent.prototype.initialize=function(){var args=arguments;
	this.type=args[0]||null,this.bubbles=args[1]?true:false,this.cancelable=args[2]?true:false;
}
var AshEventDispatcher=Ash.createClass('AshEventDispatcher',Ash);
Ash.addPrototype(AshEventDispatcher,{owner:null,_listenerObj:null,tempData:null,openData:null,_processDispatchEvent:function(event){var listeners=this._listenerObj[event.type];
		if(listeners){for(var listener,l=listeners.length,i=0; i<l; i++){listener=listeners[i];
				listener.call(this,event);
			}
		}
	}
});
	
	AshEventDispatcher.prototype.__commonAshreMembers=function(){this._listenerObj={};
		this.tempData={},this.openData={};
	}
	
	AshEventDispatcher.prototype.initialize=function(){this.owner=arguments[0]||null;
	}
	
	
	AshEventDispatcher.prototype.addEventListener=function(type,listener,useCapture){try{if(!this._listenerObj[type])this._listenerObj[type]=[];
			this.removeEventListener(type,listener,useCapture);
			this._listenerObj[type].push(listener);
		
			if(this.owner){if(this.owner.addEventListener)this.owner.addEventListener(type,listener,useCapture);
				else if(this.owner.attachEvent)this.owner.attachEvent('on' +type,listener);
			}
		} catch(err){};
	}
	
	AshEventDispatcher.prototype.removeEventListener=function(type,listener,useCapture){try{var listeners=this._listenerObj[type];
			if(this.owner){if(this.owner.removeEventListener)this.owner.removeEventListener(type,listener,useCapture);
				else if(this.owner.attachEvent)this.owner.detachEvent('on' +type,listener);
			}
			if(listeners){for(var l=listeners.length,i=0; i<l; i++){if(listeners[i]==listener){listeners.splice(i,1);
						return;
					}
				}
			}
		} catch(err){};
	}
	
	AshEventDispatcher.prototype.dispatchEvent=function(event,parameters){if(!event||!event.type||typeof event!='object')return;
		if(!event.target)event.target=this.owner?this.owner:this;
		if(parameters)event.parameters=parameters;
		this._processDispatchEvent(event);
	}
	
	AshEventDispatcher.prototype.hasEventListener=function(type){return this._listenerObj[type]?true:false;
	}
	
	AshEventDispatcher.prototype.getEventListeners=function(type){return this._listenerObj[type];
	}
var AshTimer=Ash.createClass('AshTimer',AshEventDispatcher);
AshTimer.TIMER="timer";
AshTimer.FINISH="finish ";
Ash.addPrototype(AshTimer,{delay:0,repeatCount:0,currentCount:0,running:false,_intervalID:null,onTimer:null,onFinish:null,
	_onTimer:function(e){this.running=true;
		if(this.onTimer)this.onTimer(e);
		if((this.currentCount>=this.repeatCount)&&this.repeatCount!=0)this.stop();
		else this.currentCount++;
	},_onFinish:function(e){this.running=false;
		if(this.onFinish)this.onFinish(e);
	},initialize:function(){this.delay=arguments[0]?arguments[0]:10;
		this.repeatCount=arguments[1]||0;
		this.addEventListener(AshTimer.TIMER,this._onTimer);
		this.addEventListener(AshTimer.FINISH,this._onFinish);
	}
});
AshTimer.prototype.start=function(){try{var own=this;
		window.clearInterval(this._intervalID);
		this._intervalID=window.setInterval(function(){own.dispatchEvent(new AshEvent(AshTimer.TIMER),{delay:own.delay,repeatCount:own.repeatCount,currentCount:own.currentCount,running:own.running});
		},this.delay);
	}
	catch(error){};
}
AshTimer.prototype.stop=function(){try{window.clearInterval(this._intervalID);
		if(this.running)this.dispatchEvent(new AshEvent(AshTimer.FINISH),{delay:this.delay,repeatCount:this.repeatCount,currentCount:this.currentCount,running:this.running});
	} catch(error){};
}
AshTimer.prototype.reset=function(){this.stop();
	this.currentCount=0;
}
var AshSWF=Ash.createClass('AshSWF',Ash);
Ash.addPrototype(AshSWF,{attrObject:null,params:null,attrEmbed:null,specialTag:'',initialize:function(){var addProperty=function(obj1,obj2,none){var chknone=function(_p){try{for(var i in none)if(none[i]==_p)return false;}catch(e){return true;}return true;};
			for(var p in obj1){if(chknone(p))obj2[p]=obj1[p];};
			return obj2;
		}
		var src=arguments[0],width=arguments[1],height=arguments[2],bgcolor=arguments[3],_src=arguments[0].split("/");
		var attrObject={},params={},attrEmbed={width:width,height:height};
		_src=_src[_src.length-1];
		attrObject.classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
		attrObject.version="9,0,0,0";
		attrObject.codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+attrObject.version;
		attrEmbed.id=attrEmbed.name=_src.indexOf('.swf')!=-1?(_src.split('.swf'))[0]:"";
		attrEmbed.align="middle";
		this.attrObject=addProperty(attrEmbed,attrObject);
		attrEmbed.src=src;
		attrEmbed.bgcolor=bgcolor?bgcolor:"#ffffff";
		attrEmbed.quality="high";
		attrEmbed.allowScriptAccess="sameDomain";
		attrEmbed.allowFullScreen="false";
		attrEmbed.base=""; 
		params.movie=attrEmbed.src;
		this.params=addProperty(attrEmbed,params,['id','name','align','src','width','height']);
		attrEmbed.type="application/x-shockwave-flash";
		attrEmbed.pluginspage="http://www.macromedia.com/go/getflashplayer";
		this.attrEmbed=attrEmbed;
	}
});
AshSWF.getInstanceFlashObjectById=function(idname){return navigator.appName.indexOf("Microsoft")!=-1?window[idname]:document[idname];
}
	
	AshSWF.prototype.addParam=function(attribute,value){switch(attribute){case'id':case'name':this.attrObject['name']=this.attrObject['id']=this.attrEmbed['name']=this.attrEmbed['id']=value;
				break;
			case'width':case'height':case'align':this.attrObject[attribute]=this.attrEmbed[attribute]=value;
				break;
			case'bgcolor':case'quality':case'allowScriptAccess':case'allowFullScreen':case'flashVars':case'wmode':case'base':this.params[attribute]=this.attrEmbed[attribute]=value;
				break;
			case'src':this.params['movie']=this.attrEmbed['src']=value;
				break;
			case'version':this.attrObject[attribute]=value;
				break;
			
			default:this.attrEmbed[attribute]=value;
				break;
		}
	}
	
	AshSWF.prototype.setFlashVars=function(value){this.addParam('flashVars',value);
	}
	
	AshSWF.prototype.createTag=function(){var availobj=AshUtil.browser;
		var swliveconTag="",tag;
		if(this.attrEmbed.swLiveConnect){swliveconTag+='<script language="JavaScript">\n';
			swliveconTag+='function '+this.attrEmbed.id+'_DoFSCommand(command, args)\n';
			swliveconTag+='{\n';
			swliveconTag+='	if (command=="javascript") eval(args);\n';
			swliveconTag+='};\n';
			swliveconTag+='</script>\n';
			swliveconTag+='<script language="VBScript">\n';
			swliveconTag+='On Error Resume Next\n';
			swliveconTag+='Sub '+this.attrEmbed.id+'_FSCommand(ByVal command, ByVal args)\n';
			swliveconTag+='	Call '+this.attrEmbed.id+'_DoFSCommand(command, args)\n';
			swliveconTag+='End Sub\n';
			swliveconTag+='</script>\n';
			document.write(swliveconTag);
		}
		if(availobj.ie&&availobj.win&&!availobj.opera){tag="<object "; for(var p in this.attrObject){if(p!='version')tag+=(p+"='"+this.attrObject[p]+"' ");}; tag+=">\n";
			for(var p in this.params){tag+=("<param name='"+p+"' value='"+this.params[p]+"' />\n");};
			tag+="<embed "; for(var p in this.attrEmbed){tag+=(p+"='"+this.attrEmbed[p]+"' ");}; tag+="</embed>\n\n"+this.specialTag+"\n</object>";
		}
		else{tag="<embed "; for(var p in this.attrEmbed){tag+=(p+"='"+this.attrEmbed[p]+"' ");}; tag+="</embed>";
		}
		document.write(tag);
		this.tag=swliveconTag+tag;
	}
	
	AshSWF.prototype.debugTag=function(){try{window.alert(this.tag);}catch(e){};
	}
	
	AshSWF.prototype.getInstanceFlashObject=function(){return this.attrObject?AshSWF.getInstanceFlashObjectById(this.attrObject['id']):null;
	}
	
	AshSWF.prototype.externalInterfaceAddCallback=function(functionName,value){var flashobj=this.getInstanceFlashObject();
		flashobj[functionName](value);
	}
	
	AshSWF.prototype.toString=function(){var availobj=AshUtil.browser;
		var addstr="";
		for(var i in availobj)addstr+=i+":"+availobj[i]+"\n";
		return this.tag+"\n\n"+addstr;
	}
	
	AshSWF.prototype.addSpecialTag=function(tag){this.specialTag+=tag;
	}
var AshTween=Ash.createClass('AshTween',AshEventDispatcher);
AshTween.START='start';
AshTween.PLAYING='playing';
AshTween.REPEAT='repeat';
AshTween.FINISH='finish';
AshTween.tweenLength=0;
AshTween.listeners=[];
AshTween.ct=0; 
AshTween.easing={none:{_in:function(t,b,c,d){return c*t/d+b;},_out:function(t,b,c,d){return c*t/d+b;},_inout:function(t,b,c,d){return c*t/d+b;}
	},regular:{_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;},_inout:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;}
	},strong:{_in:function(t,b,c,d){return c*(t/=d)*t*t*t*t+b;},_out:function(t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},_inout: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;}
	},back:{_in:function(t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},_out:function(t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},_inout:function(t,b,c,d){var 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-AshTween.easing.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+.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;
		},_inout:function(t,b,c,d){if(t<d/2)return AshTween.easing.bounce._in(t*2,0,c,d)*.5+b; else return AshTween.easing.bounce._out(t*2-d,0,c,d)*.5+c*.5+b;}
	}
}
	AshTween.getEasing=function(easingName){easingName=easingName||'out';
		var f=AshTween.easing;
		var dotStr=(easingName.toLowerCase()).split('.');
		if(dotStr.length==1)dotStr=['strong'].concat(dotStr);
		dotStr[1]='_'+dotStr[1];
		for(var i=0; i<dotStr.length; i++){f=f[dotStr[i]];
			if(!f)return AshTween.easing.bounce._out;
		}
		return f;
	}
	
	AshTween.addListener=function(tween){var index=AshTween.listeners.length;
		if(AshTween.existTween(tween))return;
		 AshTween.listeners[index]=tween;
		 tween.tweenIndex=index;
	}
	
	AshTween.removeListenerToIndex=function(index){return delete AshTween.listeners[index];
	}
	
	AshTween.removeListener=function(tween){for(var i in AshTween.listeners){if(AshTween.listeners[i]==tween){return delete AshTween.listeners[i];
			}
		}
		return false;
	}
	AshTween.existTween=function(tween){for(var i in AshTween.listeners){if(AshTween.listeners[i]==tween){return true;
			}
		}
		return false;
	}
	AshTween.start=function(){var internalFunc=function(){var t=(new Date).getTime(),tween,leng=0;
			
			if( t-AshTween.ct>15){AshTween.ct=t;
				for(var i in AshTween.listeners){tween=AshTween.listeners[i];
					if(tween.isPlaying)tween.tweenValidate(t);
					leng++;
				}
				AshTween.tweenLength=leng;
			}
		}
		window.setInterval(internalFunc,10);
		internalFunc();
	}
Ash.addPrototype(AshTween,{
	useCountDuration:false,startValue:null,endValue:null,tweenedValue:null,easing:null,duration:0,position:0,repeatCount:0,isPlaying:false,
	tweenIndex:0,repeatCountLength:0,callback:null,st:0,
	coworkMotioner:null,coworkName:null,initialize:function(){var own=this;
		var args=arguments;
		
		this.startValue=args[0];
		this.endValue=args[1];
		this.duration=args[2]||1000;
		this.setEasing(args[3]);
		this.repeatCount=args[4]!=null?args[4]:1;
		this.useCountDuration=args[5]?true:false;
	},setEasing:function(easingName){this.easing=AshTween.getEasing(easingName||'out');
	},play:function(callback){this.callback=null; 
		if( callback!=null)this.callback=callback;
		this.position=this.repeatCountLength=0;
		this.isPlaying=true;
		
		if( !this.useCountDuration)this.st=AshTween.ct;
		this.tweenedValue=this.ipv( this.startValue,this.endValue,this.easing(this.position,0,1,this.duration));
		this.castEvent(AshTween.START);
		AshTween.addListener(this);
	},stop:function(){this.callback=null;
		this.isPlaying=false;
		AshTween.removeListenerToIndex(this.tweenIndex);
	},pause:function(){this.isPlaying=false;
	},resume:function(){this.isPlaying=true;
		if( !this.useCountDuration)this.st=AshTween.ct-this.position;
	},tweenValidate:function(t){if( this.useCountDuration)this.position++;
			else this.position=(t-this.st);
	
			if( this.position<=this.duration){this.tweenedValue=this.ipv( this.startValue,this.endValue,this.easing(this.position,0,1,this.duration));
				this.castEvent( AshTween.PLAYING);
			}
			else{this.repeatCountLength++;
				if( this.repeatCount==0?true:this.repeatCountLength<this.repeatCount)
				{this.castEvent( AshTween.REPEAT);
					 this.position=0;
					if( !this.useCountDuration)this.st=t;
				}
				else{this.tweenedValue=this.endValue;
					this.position=0;
					this.isPlaying=false;
					this.castEvent( AshTween.FINISH); 
					
					
					if(this.isPlaying)return;
					this.stop();
				}
			}
		},ipv:function(s,e,p){var r;
			if(typeof e=='number')r=Number(s)*(1-p)+Number(e)*p;
			else if( typeof e=='object' ){r=new e['constructor']; 
				for(var i in e)r[i]=ipv( s[i],e[i],p);
			}
			return r;
		},castEvent:function(type){var e=new AshEvent(type);
			e.parameters={tweenedValue:this.tweenedValue,position:this.position,duration:this.duration};
			if(this.callback)this.callback.call(this,e);
			if(this.coworkMotioner)this.coworkMotioner.remoteCallAshTween(e,this.coworkName);
			this.dispatchEvent( e);
		}
});
AshTween.start();
var AshMotioner=Ash.createClass('AshMotioner',AshEventDispatcher);
AshMotioner.X='x';
AshMotioner.Y='y';
AshMotioner.WIDTH='width';
AshMotioner.HEIGHT='height';
AshMotioner.ALPHA='alpha';
AshMotioner.ALL='all';
Ash.addPrototype(AshMotioner,{
	duration:1000,easingName:'out',repeatCount:1,useCountDuration:false,
	tweens:null,fromV:null,toV:null,allp:null,
	initialize:function(){var own=this;
		var args=arguments;
		this.tweens={};
		this.fromV={};
		this.toV={};
		this.allp={};
		this.owner=args[0]||null;
		if(args[1])this.duration=args[1];
		if(args[2])this.easingName=args[2];
		if(args[3])this.repeatCount=Number(args[3]);
		if(args[4])this.useCountDuration=true;
	},x:function(value,duration,easingName,callback,repeatCount,useCountDuration){this._playAsOne('x',value,duration,easingName,callback,repeatCount,useCountDuration);
	},y:function(value,duration,easingName,callback,repeatCount,useCountDuration){this._playAsOne('y',value,duration,easingName,callback,repeatCount,useCountDuration);
	},width:function(value,duration,easingName,callback,repeatCount,useCountDuration){this._playAsOne('width',value,duration,easingName,callback,repeatCount,useCountDuration);
	},height:function(value,duration,easingName,callback,repeatCount,useCountDuration){this._playAsOne('height',value,duration,easingName,callback,repeatCount,useCountDuration);
	},alpha:function(value,duration,easingName,callback,repeatCount,useCountDuration){this._playAsOne('alpha',value,duration,easingName,callback,repeatCount,useCountDuration);
	},_playAsOne:function( p,value,duration,easingName,callback,repeatCount,useCountDuration){if(!this.owner)return;
			var at=this.getTween(p);
			at.startValue=0;
			at.endValue=1;
			this.fromV[p]=this.getFromValue(p);
			this.toV[p]=value;
			if(duration)at.duration=duration;
			if(repeatCount!=null)at.repeatCount=repeatCount;
			if(useCountDuration)at.useCountDuration=useCountDuration;
			if(easingName)at.setEasing(easingName);
			at.play(callback);
		},
	play:function( values,duration,easingName,callback,repeatCount,useCountDuration){if(!this.owner)return;
		var at=this.getTween('all'); 
		at.startValue=0;
		at.endValue=1;
		this.allp={};
		for(var p in values){this.clearTween(p); 	
			this.fromV[p]=this.getFromValue(p);
			this.toV[p]=values[p];
			this.allp[p]=true;
		}
		if(duration)at.duration=duration;
		if(repeatCount!=null)at.repeatCount=repeatCount;
		if(useCountDuration)at.useCountDuration=useCountDuration;
		if(easingName)at.setEasing(easingName);
		at.play(callback);
	},
	stop:function(){for(var n in this.tweens)this.clearTween(n);
		this.tweens={};
	},getTween:function(name){var at=this.tweens[name];
		if(!at){at=this.tweens[name]=new AshTween();
			at.duration=this.duration;
			at.repeatCount=this.repeatCount;
			at.useCountDuration=this.useCountDuration;
			at.setEasing(this.easingName);
			at.coworkMotioner=this;
			at.coworkName=name;
		}
		return at;
	},
	clearTween:function( name){if( this.tweens[name]){this.tweens[name].coworkMotioner=null;
			this.tweens[name].coworkName=null;
			this.tweens[name].stop();
			delete this.tweens[name];
		}
	},existTween:function(name){if( this.tweens[name])return true;
		return false;
	},
		getFromValue:function(p){var value,p1,p2;
			if(p=='alpha'){if(AshUtil.browser.ie)value=this.owner.style.filter.indexOf('opacity')!=-1?parseInt((this.owner.style.filter.split('='))[1])/100:1;
				else{value=parseInt(this.owner.style.opacity);
					if(isNaN(value))value=1;
				}
			}
			else{switch(p){case'x':p1='left',p2='offsetLeft'; break;
					case'y':p1='top',p2='offsetTop'; break;
					case'width':p1='width',p2='offsetWidth'; break;
					case'height':p1='height',p2='offsetHeight'; break;
				}
				value=parseInt(this.owner.style[p1]);
				if(isNaN(value)){value=parseInt(this.owner[p2]);
					if(isNaN(value))value=0;
				}
			}
			return value;
		},remoteCallAshTween:function(e,name){var tv=e.parameters.tweenedValue;
			if(name=='all')for(var n in this.allp)this.processMotion(n,tv);
			else this.processMotion( name,tv);
			if(e.type==AshTween.FINISH)this.clearTween(name);
			this.dispatchEvent(new AshEvent(name),{tweenEvent:e} );
		},processMotion:function(n,p){var value=this.fromV[n]*(1-p)+this.toV[n]*p;
			switch(n){case'x':this.owner.style.left=Math.round(value)+'px'; break;
				case'y':this.owner.style.top=Math.round(value)+'px'; break;
				case'width':this.owner.style.width=Math.round(value)+'px'; break;
				case'height':this.owner.style.height=Math.round(value)+'px'; break;
				case'alpha':if( /[^.0-9]/g.test(value.toString()))value=Math.round(value);  
					if(AshUtil.browser.ie)this.owner.style.filter="alpha(opacity="+(value*100)+")";
					else this.owner.style.opacity=value;
					break;
			}
		}
});
AshMotioner.prototype.left=AshMotioner.prototype.x;
AshMotioner.prototype.top=AshMotioner.prototype.y;
AshMotioner.prototype.tween=AshMotioner.prototype.play;
var AshMotionAgent=Ash.createClass('AshMotionAgent',AshMotioner);
AshMotionAgent.tween=function(target,props,duration,easingName,callback,repeatCount,useCountDuration){var sma=new AshMotionAgent(target);
	sma.tween(props,duration,easingName,callback,repeatCount,useCountDuration);
	return sma;
}
var AshAgent=Ash.createClass('AshAgent',AshMotionAgent);
Ash.addPrototype(AshAgent,{initialize:function(){this.owner=arguments[0];
		if(arguments[1]&&typeof arguments[1]=='function')arguments[1].call(this); 
	},getHTML:function(){return this.owner.innerHTML;
	},getOuterHTML:function(){try{if(this.owner.outerHTML)return this.owner.outerHTML;
			else return(new XMLSerializer).serializeToString(this.owner);
		}catch(err){};
		return'';
	},setHTML:function(htmlText){if(htmlText=='reset')htmlText='';
		this.owner.innerHTML=htmlText;
	},insertHTML:function(htmlText){var dummy=document.createElement('div');
		dummy.innerHTML=htmlText;
		try{return this.addChild(dummy.firstChild);
		} finally{
		};
	},insertBeforeHTML:function(htmlText,targetElement){var dummy=document.createElement('div');
		dummy.innerHTML=htmlText;
		try{return this.insertBefore(dummy.firstChild,targetElement);
		} finally{
		};
	},setInnerText:function(text){AshUtil.setInnerText(this.owner,text);
	},getInnerText:function(){return AshUtil.getInnerText(this.owner);
	},addChild:function(element){return this.owner.appendChild(element);
	},removeChild:function(element){return this.owner.removeChild(element);
	},insertBefore:function(element,targetElement){return this.owner.insertBefore(element,targetElement);
	},getChildAt:function(index){return this.owner.childNodes[index];
	},getFirstChild:function(){return this.owner.firstChild;
	},getLastChild:function(){return this.owner.lastChild;
	},getChildByName:function(name){return AshUtil.getChildByName(this.owner,name);
	},contains:function(child){return AshUtil.contains(this.owner,child);
	},getStyle:function(prop){return AshUtil.getStyle(this.owner,prop);
	},setStyle:function(prop,value){this.owner.style[prop]=value;
	},resetWidth:function(){this.setStyle('width','auto');
	},resetHeight:function(){this.setStyle('height','auto');
	},getWidth:function(){return this.owner.offsetWidth;
	},settWidth:function(value){this.setStyle('width',value+'px');
	},getHeight:function(){return this.owner.offsetHeight;
	},setHeight:function(value){this.setStyle('height',value+'px');
	},move:function(x,y){AshUtil.move(this.owner,x,y);
	},resize:function(w,h){AshUtil.resize(this.owner,w,h);
	},rebound:function(x,y,w,h){AshUtil.rebound(this.owner,x,y,w,h);
	},getBounds:function(){return AshUtil.getBounds(this.owner);
	},globalCoordinates:function(){return AshUtil.globalCoordinates(this.owner);
	},hitTest:function(targetElement){return AshUtil.hitTest(this.owner,targetElement);
	},setOpacity:function(value){AshUtil.filter.opacity(this.owner,value);
	}
});
var AshAJAX=Ash.createClass('AshAJAX',AshEventDispatcher);
AshAJAX.ABORTED='aborted';
AshAJAX.COMPLETED='completed';
AshAJAX.LOAD_ERROR='loadError'; 
AshAJAX.limitTime=10000;
AshAJAX.createXMLHttp=function(){var xhr;
	
	try{if(window.ActiveXObject){
			try{
				xhr=new ActiveXObject("Msxml2.XMLHTTP"); 
			} catch(e){try{xhr=new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e2){}
			} 
		}
		
		else if(window.XMLHttpRequest)xhr=new XMLHttpRequest();
		return xhr;
	} finally{
	}
}
AshAJAX.send=function(callback,content,method,url,async,user,password){var ajax=new AshAJAX(content,method,url,async,user,password);
	ajax.onCompleted=callback;
	ajax.send();
	return ajax;
}
Ash.addPrototype(AshAJAX,{xhr:null,content:null,method:'POST',url:'',async:true,user:null,password:null,running:false,responseText:null,responseXML:null,_interval:null,onAborted:null,onCompleted:null,onLoadError:null,_onAborted:function(event){if(this.onAborted!=null)this.onAborted(event);
	},_onCompleted:function(event){if(this.onCompleted!=null)this.onCompleted(event);
	},_onLoadError:function(event){if(this.onLoadError!=null)this.onLoadError(event);
	},_reset:function(){this.running=false;
		clearTimeout(this._interval);
	},_loadComplete:function(){try{this._reset();
			this.responseText=this.xhr.responseText;
			this.responseXML=this.xhr.responseXML;
			this.dispatchEvent(new AshEvent(AshAJAX.COMPLETED),{readyState:this.xhr.readyState,responseText:this.xhr.responseText,status:this.xhr.status});
			
			this.xhr.abort();
			this.xhr=null;
		} catch(error){}
	},_encode:function(data){var result=''; 
		for(var p in data)result+=p+'=' +encodeURIComponent(data[p])+'&';
		return result;
	}
});
AshAJAX.prototype.initialize=function(){args=arguments;
	this.content=args[0]||null;
	if(args[1]&&args[1].toUpperCase()=='GET')this.method=args[1];
	if(args[2])this.url=encodeURI(args[2]);
	if(args[3]!=null)this.async=args[3];
	if(args[4])this.user=args[4];
	if(args[5])this.password=args[5];
	this.addEventListener(AshAJAX.ABORTED,this._onAborted);
	this.addEventListener(AshAJAX.COMPLETED,this._onCompleted);
	this.addEventListener(AshAJAX.LOAD_ERROR,this._onLoadError);
}
AshAJAX.prototype.send=function(content,method,url,async,user,password){if(this.running)return; this.running=true;
	try{var own=this,xhr=this.xhr=AshAJAX.createXMLHttp();
		this.content=content||this.content;
		this.method=method||this.method;
		this.url=url?encodeURI(url):this.url;
		this.async=async!=null?async:this.async;
		this.user=user||this.user;
		this.password=password||this.password;
		if(!this.url){this._reset();
			return;
		}
		if(AshUtil.browser.ie){xhr.onreadystatechange=function(){if(xhr.readyState==4)own._loadComplete(); };
		} else{xhr.onreadystatechange=function(){if(xhr.readyState==4)own._loadComplete(); };
		}
		xhr.open(this.method,this.url,this.async,this.user,this.password);
		if(this.method.toUpperCase()=='POST')xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
		xhr.send(this.method.toUpperCase()=='POST'?this._encode(this.content):'unique='+(new Date()).getTime());
		clearTimeout(this._interval); 
		this._interval=setTimeout(function(){own.abort();
			own.dispatchEvent(new AshEvent(AshAJAX.LOAD_ERROR));
		},AshAJAX.limitTime);
	}
	catch(error){this._reset();
	}
}
AshAJAX.prototype.abort=function(){this._reset();
	if(this.xhr){this.dispatchEvent(new AshEvent(AshAJAX.ABORTED));
		this.xhr.abort();
	}
}
var AshDepthManager=Ash.createClass('AshDepthManager',AshEventDispatcher);
AshDepthManager.MANAGED='managed';
Ash.addPrototype(AshDepthManager,{extraDepth:100,lastManagedDepth:100,targets:null,onManaged:null,_onManaged:function(e){if(this.onManaged!=null)this.onManaged(e);
	},isAvailable:function(target){
		if(target&&target.style&&AshUtil.getStyle(target,'position')=='absolute' )return true;
		return false;
	},duplieCheckAndReconstruction:function(target){for(var t,ts=this.targets,l=ts.length,i=0; i<l; i++){if(ts[i]==target){ts[i]=null;
				ts.splice(i,1);
				return;
			}
		}
	},applyDepth:function(target,mode){this.duplieCheckAndReconstruction(target);
		switch(mode){case'front':this.targets.push(target); break;
			case'back':this.targets.unshift(target); break;
			case'next':if(target.__saveDepthIndex!=null)this.targets.splice(target.__saveDepthIndex+1,0,1);
				else this.targets.push(target);
				break;
			case'prev':if(target.__saveDepthIndex!=null)this.targets.splice(target.__saveDepthIndex-1,0,1);
				else this.targets.unshift(target);
				break;
		}
		for(var t,ts=this.targets,l=ts.length,i=0; i<l; i++){t=ts[i];
			if(t){t.__saveDepthIndex=i;
				t.style.zIndex=i+this.extraDepth;
			} else ts.splice(i,1);
		}
		if( target.__saveDepthIndex!=null){this.lastManagedDepth=target.style.zIndex;
			this.dispatchEvent(new AshEvent(AshDepthManager.MANAGED),{target:t,depth:t.__saveDepthIndex} );
		}
	}
});
AshDepthManager.prototype.initialize=function(){if(this.instancedCount>=2)throw new Error('no more can¡¯t create an instance[AshDepthManager]');
	this.targets=[];
	this.addEventListener(AshDepthManager.MANAGED,this._onManaged);
}
AshDepthManager.prototype.register=function(target,doDepth){if(this.isAvailable(target)){this.duplieCheckAndReconstruction(target);
		this.targets.push(target);
		if(doDepth)target.style.zIndex=this.lastManagedDepth;
	}
}
AshDepthManager.prototype.unRegister=function(target){if(this.isAvailable(target))this.duplieCheckAndReconstruction(target);
}
AshDepthManager.prototype.front=function(target){if(this.isAvailable(target))this.applyDepth(target,'front');
}
AshDepthManager.prototype.back=function(target){if(this.isAvailable(target))this.applyDepth(target,'back');
}
AshDepthManager.prototype.next=function(target){if(this.isAvailable(target))this.applyDepth(target,'next');
}
AshDepthManager.prototype.prev=function(target){if(this.isAvailable(target))this.applyDepth(target,'prev');
}
AshDepthManager.manager=new AshDepthManager();
var AshDrag=Ash.createClass('AshDrag',AshEventDispatcher);
AshDrag.DRAG_START='dragStart';
AshDrag.DRAGGING='dragging';
AshDrag.DRAG_STOP='dragStop';
AshDrag.createInitPositionValueForRelative=function(t){if(t){if( !t.__init_for_relative){try{var left=parseInt(AshUtil.getStyle(t,'left')),top=parseInt(AshUtil.getStyle(t,'top'));
				t.__init_for_relative={x:t.offsetLeft-left||t.offsetLeft,y:t.offsetTop-top||t.offsetTop};
			} catch(error){t.__init_for_relative={x:0,y:0}; };
		}
	}
}
Ash.addPrototype(AshDrag,{target:null,x:0,y:0,left:0,top:0,result:{x:0,y:0,left:0,top:0,target:null},draggable:true,onDragStart:null,onDragging:null,onDragStop:null,_agent:new AshEventDispatcher(document),sx:0,sy:0,useok:false,_onDragStart:function(e){if(this.onDragStart!=null)this.onDragStart(e);
	},_onDragging:function(e){if(this.onDragging!=null)this.onDragging(e);
	},_onDragStop:function(e){if(this.onDragStop!=null)this.onDragStop(e);
	},_pv:function(value){return parseInt(value);
	},_castEvent:function(eventType){var r=this.result,t=r.target=this.target;
		r.x=r.left=this.x=this.left=this._pv(t.style.left);
		r.y=r.top=this.y=this.top=this._pv(t.style.top);
		this.dispatchEvent(new AshEvent(eventType),r);
	},
	_onMouseDownRemoteTarget:function(e,callOwner){if(!e||callOwner!=AshDragAndDrop.manager)return;
		this._onMouseDown(e);
	},_onMouseDown:function(e){
		var own=arguments.callee.owner,t=e.target||e.srcElement,targetName=null,sinfo=AshUtil.document.scrollInfo();
		if(!own.useok)return;
		if(t&&t.getAttribute('ashdrag')=='true'){targetName=t.getAttribute('ashdragtarget');
			if(targetName){ns=targetName.split('.');
				if(ns.length==1&&ns[0]!='parent')t=AshUtil.obj(ns[0]);
				else{for(var i=0; i<ns.length; i++)if(ns[i]=='parent')t=t.parentNode;
				}
			}
			if(!t)return;
			if(t.__remoteAccessResizeable)return; 
			own.draggable=true;
			own.target=own.result.target=t;
			own.sx=sinfo.left+(e.clientX-t.offsetLeft);
			own.sy=sinfo.top+(e.clientY-t.offsetTop);
			AshDrag.createInitPositionValueForRelative(t); 
			if(AshUtil.getStyle(t,'position')=='relative')own.sx+=t.__init_for_relative.x,own.sy+=t.__init_for_relative.y;
			own._castEvent(AshDrag.DRAG_START);
		}
	},_onMouseMove:function(e){var own=arguments.callee.owner,r=own.result,t=own.target,x,y,dragArea,b,sinfo=AshUtil.document.scrollInfo();
		if(!own.useok)return;
		if(t&&own.draggable){x=sinfo.left+(e.clientX-own.sx);
			y=sinfo.top+(e.clientY-own.sy);
			
			dragArea=t.getAttribute('ashdragarea');
			if(dragArea){b=dragArea.split(',');
				x=AshUtil.minToMax(x,parseInt(b[0]),parseInt(b[0])+parseInt(b[2]));
				y=AshUtil.minToMax(y,parseInt(b[1]),parseInt(b[1])+parseInt(b[3]));
			}
			AshUtil.move(t,x,y);
			own._castEvent(AshDrag.DRAGGING);
		}
	},_onMouseUp:function(e){var own=arguments.callee.owner;
		if(!own.useok)return;
		own.draggable=false;
		if( own.target)own._castEvent(AshDrag.DRAG_STOP);
		own.target=null;
	},initialize:function(){if(this.instancedCount>=2)throw new Error('no more can¡¯t create an instance[AshDrag]');
		
		this._onMouseDown.owner=this._onMouseMove.owner=this._onMouseUp.owner=this;
		this._agent.addEventListener('mousedown',this._onMouseDown);
		this._agent.addEventListener('mousemove',this._onMouseMove);
		this._agent.addEventListener('mouseup',this._onMouseUp);
		this.addEventListener(AshDrag.DRAG_START,this._onDragStart);
		this.addEventListener(AshDrag.DRAGGING,this._onDragging);
		this.addEventListener(AshDrag.DRAG_STOP,this._onDragStop);
	}
});
AshDrag.prototype.start=function(){this.useok=true;
	this.draggable=false;
}
AshDrag.prototype.stop=function(){this.useok=false;
	this.draggable=false;
}
AshDrag.prototype.abort=function(){if(this.draggable)this._onMouseUp();
}
AshDrag.manager=new AshDrag();
AshDrag.manager.start();
var AshDragAndDrop=Ash.createClass('AshDragAndDrop',AshEventDispatcher);
Ash.addPrototype(AshDragAndDrop,{target:null,targetOwner:null,result:{x:0,y:0,left:0,top:0,target:null,targetOwner:null},
	alpha:0.5,onDragStart:null,onDragging:null,onDragStop:null,useok:false,_agent:new AshEventDispatcher(document),_onDragStart:function(e){if(this.onDragStart!=null)this.onDragStart(e);
	},_onDragging:function(e){if(this.onDragging!=null)this.onDragging(e);
	},_onDragStop:function(e){if(this.onDragStop!=null)this.onDragStop(e);
	},_clearTarget:function(){if(this.target){if(this.target.parentNode)this.target.parentNode.removeChild(this.target);
			AshDepthManager.manager.unRegister(this.target);
		}
	},_onAshDragCastEvent:function(e){var own=arguments.callee.owner;
		own.result=e.parameters;
		own.result.targetOwner=own.targetOwner;
		own.dispatchEvent(new AshEvent(e.type),own.result);
		switch(e.type){case AshDrag.DRAG_STOP:own._clearTarget();
				break;
		}
	},_onMouseDown:function(e){var own=arguments.callee.owner,t=e.target||e.srcElement,targetName,b=document.body,c,p,se;
		own._clearTarget();
		if(!own.useok)return;
		try{if(t&&(t=own._findParent(t))){targetName=t.getAttribute('ashdragtarget');
				if(targetName){ns=targetName.split('.');
					if(ns.length==1&&ns[0]!='parent')t=AshUtil.obj(ns[0]);
					else{for(var i=0; i<ns.length; i++)if(ns[i]=='parent')t=t.parentNode;
					}
				}
				if(!t)return;
				p=AshUtil.globalCoordinates(t);
				c=own.target=b.appendChild(t.cloneNode(true));
				c.owner=own.targetOwner=t;
				c.setAttribute('ashdrag','true');
				c.style.position='absolute';
				c.onselectstart=c.ondragtstart=function(){return false;};
				if( t.parentNode&&!AshUtil.browser.opera){
					if(t.parentNode.scrollLeft)p.x-=parseInt(t.parentNode.scrollLeft);
					if(t.parentNode.scrollTop)p.y-=parseInt(t.parentNode.scrollTop);
				}
				AshUtil.rebound(c,p.x,p.y,t.offsetWidth,t.offsetHeight);
				AshUtil.filter.opacity(c,own.alpha);
				AshDepthManager.manager.front(c);
				se=new AshEvent();
				se.target=c;
				se.clientX=e.clientX; se.clientY=e.clientY;
				AshDrag.manager._onMouseDownRemoteTarget(se,own);
				c.style.display='none'; 
			}
		}catch(error){};
	},_onMouseMove:function(){var own=arguments.callee.owner;
		if(own.target){if(own.target.moving)return; own.target.moving=true;
			own.target.style.display='block';
		}
	},_findParent:function(t){var gp=function(t){var obj=null;
			if(t.nodeName.toUpperCase()=='HTML')return null;
			if( t.getAttribute('ashdraganddrop')=='true' )return t;
			else{if(t.parentNode&&t.parentNode!=document.body)obj=gp(t.parentNode);
			}
			return obj;
		}
		try{return gp(t)} finally{
			};
	},initialize:function(){if(this.instancedCount>=2)throw new Error('no more can¡¯t create an instance[AshDragAndDrop]');
		this._onMouseDown.owner=this._onMouseMove.owner=this._onAshDragCastEvent.owner=this;
		this._agent.addEventListener('mousedown',this._onMouseDown);
		this._agent.addEventListener('mousemove',this._onMouseMove);
		AshDrag.manager.addEventListener(AshDrag.DRAG_START,this._onAshDragCastEvent);
		AshDrag.manager.addEventListener(AshDrag.DRAGGING,this._onAshDragCastEvent);
		AshDrag.manager.addEventListener(AshDrag.DRAG_STOP,this._onAshDragCastEvent);
		this.addEventListener(AshDrag.DRAG_START,this._onDragStart);
		this.addEventListener(AshDrag.DRAGGING,this._onDragging);
		this.addEventListener(AshDrag.DRAG_STOP,this._onDragStop);
	}
});
AshDragAndDrop.prototype.start=function(){this.useok=true;
}
AshDragAndDrop.prototype.stop=function(){this.useok=false;
}
AshDragAndDrop.manager=new AshDragAndDrop();
AshDragAndDrop.manager.start();
var AshResize=Ash.createClass('AshResize',AshEventDispatcher);
AshResize.RESIZE_START='resizeStart';
AshResize.RESIZING='resizing';
AshResize.RESIZE_STOP='resizeStop';
Ash.addPrototype(AshResize,{target:null,x:0,y:0,width:0,height:0,direction:'',result:{x:0,y:0,width:0,height:0,direction:'',target:null},resizeable:false,onResizeStart:null,onResizing:null,onResizeStop:null,_agent:new AshEventDispatcher(document),useok:false,captured:false,sx:0,sy:0,sl:0,st:0,sw:0,sh:0,_onResizeStart:function(e){if(this.onResizeStart!=null)this.onResizeStart(e);
	},_onResizing:function(e){if(this.onResizing!=null)this.onResizing(e);
	},_onResizeStop:function(e){if(this.onResizeStop!=null)this.onResizeStop(e);
	},_castEvent:function(eventType){var r=this.result,t=this.target;
		r.x=this.x=t.offsetLeft;
		r.y=this.y=t.offsetTop;
		r.width=this.width=t.offsetWidth;
		r.height=this.height=t.offsetHeight;
		r.direction=this.direction;
		this.dispatchEvent(new AshEvent(eventType),r);
	},_available:function(v){switch(v){case'n':case'e':case's':case'w':case'ne':case'nw':case'se':case'sw':return true; break;};
		return false;
	},initialize:function(){this.setTarget(arguments[0]);
		
		var td=this.tempData; 
		td.onMouseDown=function(e){var own=arguments.callee.owner,t=own.target;
			if(!own.useok||!t)return;
			var sinfo=AshUtil.document.scrollInfo(); 
			var pl=parseInt(AshUtil.getStyle(t,'paddingLeft')),pr=parseInt(AshUtil.getStyle(t,'paddingRight')),pt=parseInt(AshUtil.getStyle(t,'paddingTop')),pb=parseInt(AshUtil.getStyle(t,'paddingBottom'));
			if(isNaN(pl))pl=0; if(isNaN(pr))pr=0; if(isNaN(pt))pt=0; if(isNaN(pb))pb=0;
			
			if(own.resizeable){own.captured=true;
				own.sx=sinfo.left+e.clientX,own.sy=sinfo.top+e.clientY;
				own.sl=t.offsetLeft,own.st=t.offsetTop,own.sw=t.offsetWidth-(pl+pr),own.sh=t.offsetHeight-(pt+pb);
				AshDrag.createInitPositionValueForRelative(t); 
				if(AshUtil.getStyle(t,'position')=='relative')own.sl-=t.__init_for_relative.x,own.st-=t.__init_for_relative.y;
				own._castEvent(AshResize.RESIZE_START);
			}
		}
		td.onMouseMove=function(e){var own=arguments.callee.owner,t=own.target,d='';
			if(!own.useok||!t)return;
			if(own.captured){try{var x=e.clientX,y=e.clientY,d=own.direction,minW=own.minWidth,maxW=own.maxWidth,minH=own.minHeight,maxH=own.maxHeight;
					var isMaxW=(maxW>-1&&maxW>minW)?true:false,isMaxH=(maxH>-1&&maxH>minH)?true:false,conditionX,conditionY;
					var sinfo=AshUtil.document.scrollInfo();
					x+=sinfo.left; y+=sinfo.top;
					if(d.search(/n/)!=-1){conditionY=isMaxH?((own.sy+own.sh)-maxH<y&&y<(own.sy+own.sh)-minH):(y<(own.sy+own.sh)-minH);
						if(conditionY)t.style.top=own.st+(y-own.sy)+'px';
						t.style.height=isMaxH?AshUtil.minToMax(own.sh+(own.sy-y),minH,maxH)+'px':Math.max(own.sh+(own.sy-y),minH)+'px';
					}
					if(d.search(/e/)!=-1){t.style.width=isMaxW?AshUtil.minToMax(own.sw+(x-own.sx),minW,maxW)+'px':Math.max(own.sw+(x-own.sx),minW)+'px';
					}
					if(d.search(/s/)!=-1){t.style.height=isMaxH?AshUtil.minToMax(own.sh+(y-own.sy),minH,maxH)+'px':Math.max(own.sh+(y-own.sy),minH)+'px';
					}
					if(d.search(/w/)!=-1){conditionX=isMaxW?((own.sx+own.sw)-maxW<x&&x<(own.sx+own.sw)-minW):(x<(own.sx+own.sw)-minW);
						if(conditionX)t.style.left=own.sl+(x-own.sx)+'px';
						t.style.width=isMaxW?AshUtil.minToMax(own.sw+(own.sx-x),minW,maxW)+'px':Math.max(own.sw+(own.sx-x),minW)+'px';
					}
					own._castEvent(AshResize.RESIZING);
				} catch(error){};
			}
			else{own.resizeable=false;
				own.direction='';
				t.__remoteAccessResizeable=false;  
				if(AshUtil.getStyle(t,'position')!='static'){var x=e.clientX,y=e.clientY,tl=t.offsetLeft,tt=t.offsetTop,tw=t.offsetWidth,th=t.offsetHeight,s=own.sensitivity;
					var sinfo=AshUtil.document.scrollInfo();
					x+=sinfo.left; y+=sinfo.top;
					if(tt<=y&&y<=tt+s)d='n';
					if(tt+th-s<=y&&y<=tt+th)d='s';
					if(tl<=x&&x<=tl+s)d+='w';
					if(tl+tw-s<=x&&x<=tl+tw)d+='e';
					if(own.allowedDirection){var cds=own.allowedDirection.split(',');
						chk=function(v){for(var l=cds.length,i=0; i<l; i++){if(cds[i]==v)return true;} return false; };
						if(!chk(d))d=''; 
					}
					t.style.cursor=d?(d+"-resize"):(own.defaultCursor?own.defaultCursor:"default");
					if(own._available(d)){
						own.resizeable=true;
						own.direction=d;
						t.__remoteAccessResizeable=true;
					}
				}
			}
		}
		td.onMouseUp=function(e){var own=arguments.callee.owner,t=own.target;
			if(!own.useok||!t||!own.resizeable)return;
			own.resizeable=own.captured=false;
			own._castEvent(AshResize.RESIZE_STOP);
			t.style.cursor=own.defaultCursor?own.defaultCursor:"default";
			t.__remoteAccessResizeable=false;
		}
		td.onMouseDown.owner=td.onMouseMove.owner=td.onMouseUp.owner=this; 
		this._agent.addEventListener('mousedown',td.onMouseDown);
		this._agent.addEventListener('mousemove',td.onMouseMove);
		this._agent.addEventListener('mouseup',td.onMouseUp);
		this.addEventListener(AshResize.RESIZE_START,this._onResizeStart);
		this.addEventListener(AshResize.RESIZING,this._onResizing);
		this.addEventListener(AshResize.RESIZE_STOP,this._onResizeStop);
	}
});
AshResize.prototype.sensitivity=10;
AshResize.prototype.minWidth=20;
AshResize.prototype.minHeight=20;
AshResize.prototype.maxWidth=-1; 
AshResize.prototype.maxHeight=-1; 
AshResize.prototype.allowedDirection='';
AshResize.prototype.defaultCursor='';
AshResize.prototype.setTarget=function(obj){if(obj)this.target=this.owner=obj;
}
AshResize.prototype.start=function(){this.useok=true;
	this.resizeable=this.captured=false;
}
AshResize.prototype.stop=function(){this.useok=false;
	this.resizeable=this.captured=false;
}
AshResize.prototype.abort=function(){if(this.resizeable)this.tempData.onMouseUp();
}
var AshPopup=Ash.createClass('AshPopup',AshEventDispatcher);
AshPopup.CREATE='create';
AshPopup.CLEAR='clear';
Ash.addPrototype(AshPopup,{target:null,cloner:null,coordinates:null,useMotion:true,onCreate:null,onClear:null,callback:null,useAutoClearAsRollout:true,_agent:null,event:null,rollover:false,_onCreate:function(e){if(this.onCreate!=null)this.onCreate(e);
	},_onClear:function(e){if(this.onClear!=null)this.onClear(e);
	},_createDummyElement:function(){var d=this.tempData.lineDummy=document.createElement('DIV');
		d.style.backgroundColor='transparent';
		d.style.border='1px solid #000000';
		d.style.position='absolute';
	},_createLineMotioner:function(){var d=this.tempData.lineDummy.cloneNode(true);
		var m=this.tempData.currentLineMotioner=new AshMotionAgent( document.body.appendChild(d));
		var b=this.tempData.lineMotionBoundsOut;
		AshUtil.rebound(d,b.x,b.y,0,0);
		AshDepthManager.manager.register(d,true);
	},_motionOrder:function(mode){if(!this.tempData.currentLineMotioner)return;
		var own=this,m=this.tempData.currentLineMotioner,b;
		if(mode=='in'){own.cloner.style.display='none';
			b=this.tempData.lineMotionBoundsIn;
			m.tween({x:b.x,y:b.y,width:b.width,height:b.height,alpha:0},200,'in',function(e){if(e.type==AshTween.FINISH){own.cloner.style.display='block';
					AshUtil.move(own.cloner,b.x,b.y);
				}
			});
		}
		else{b=this.tempData.lineMotionBoundsOut;
			AshUtil.move(m.owner,this.cloner.offsetLeft,this.cloner.offsetTop);
			m.tween({x:b.x,y:b.y,width:0,height:0,alpha:0.5},200,'out',function(e){if(e.type==AshTween.FINISH){AshDepthManager.manager.unRegister(m.owner);
					document.body.removeChild(m.owner);
				}
			});
		}
	},_process:function(t){var doc=document,docElement=doc.documentElement,c=null,e=this.event,coor=this.coordinates;
		var sinfo=AshUtil.document.scrollInfo(),x,y,p,b;
		if(!t)return c;
		try{this.target=t;
			c=this.cloner=t.cloneNode(true);
			c.className=t.className;
			c.style.position='absolute';
			doc.body.appendChild(c);
			if(coor){if(coor.nodeName){p=AshUtil.globalCoordinates(coor);
					x=p.x; y=p.y; y+=coor.offsetHeight;
					x-=sinfo.left; y-=sinfo.top;
				}
				else if(coor.target){p=AshUtil.globalCoordinates(coor.target);
					x=p.x; y=p.y; x+=coor.x||0; y+=coor.y||0;
					x-=sinfo.left; y-=sinfo.top;
				}
				else{x=coor.x; y=coor.y;
				}
			} else{x=e?e.clientX:0; y=e?e.clientY:0;
			}
			x+=sinfo.left; y+=sinfo.top; bx=x; by=y;
			 
			c.style.left=x+'px'; c.style.top=y+'px';
			
			
			if(x+c.offsetWidth>docElement.clientWidth+sinfo.left)x=x-( x+c.offsetWidth-docElement.clientWidth); 
			if(y+c.offsetHeight>docElement.clientHeight+sinfo.top)y=y-c.offsetHeight;
			if(this.useMotion){
				b=this.tempData.lineMotionBoundsOut=AshUtil.getBounds(this.cloner);
				this.tempData.lineMotionBoundsIn={x:x,y:y,width:b.width,height:b.height};
				this._createLineMotioner();
				this._motionOrder('in');
			}
			else{c.style.left=x+'px'; c.style.top=y+'px';
			}
			AshDepthManager.manager.front(c);
			if(this.useAutoClearAsRollout)this._agent.addEventListener('mouseover',this._onMouseOver);
			this.dispatchEvent(new AshEvent(AshPopup.CREATE),{target:t,cloner:c,left:c.offsetLeft,top:c.offsetTop});
		} 
		catch(error){};
		return c;
	},_onMouseOver:function(e){var own=arguments.callee.owner,t=e.target||e.srcElement;
		if(own.cloner){if(own.callback!=null)own.callback.call(own,'mouseover');
			if(own.coordinates&&own.coordinates.nodeName){
				if(t!=own.coordinates&&!AshUtil.contains(own.cloner,t))own.clear();
			}
			else
			{if(AshUtil.contains(own.cloner,t)){if(own.rollover==false)own.rollover=true;
				} else{if(own.rollover)own.clear();
				}
			}
		}
	},_onMouseDown:function(e){var own=arguments.callee.owner,t=e.target||e.srcElement;
		if(own.cloner){if(own.callback!=null)own.callback.call(own,'mousedown');
			if(!AshUtil.contains(own.cloner,t))own.clear();
		}
		own.event=e;
	},_onMouseUp:function(e){var own=arguments.callee.owner,t=e.target||e.srcElement;
		if(own.cloner&&own.callback!=null){setTimeout(function(){if(own.cloner&&own.callback!=null)own.callback.call(own,'mouseup');},1);  
		}
	},initialize:function(){if(this.instancedCount>=2)throw new Error('no more can¡¯t create an instance[AshPopup]');
		this._agent=new AshEventDispatcher(document);
		this.tempData.clonerMotioner=new AshMotionAgent();
		this._onMouseDown.owner=this._onMouseOver.owner=this._onMouseUp.owner=this;
		this._agent.addEventListener('mousedown',this._onMouseDown);
		this._agent.addEventListener('mouseup',this._onMouseUp);
		this.addEventListener(AshPopup.CREATE,this._onCreate);
		this.addEventListener(AshPopup.CLEAR,this._onClear);
		this._createDummyElement();
	}
});
AshPopup.prototype.create=function(target,coordinates,useMotion,callback,useAutoClearAsRollout){if(!target)return this.cloner;
	if(typeof target=='string'){target=AshUtil.getChildByDotTree(target);
		if(!target)return this.cloner;
	}
	if(this.target==target)return this.cloner;
	this.clear();
	this.coordinates=coordinates;
	this.useMotion=useMotion==false?false:true;
	this.callback=callback;
	this.useAutoClearAsRollout=useAutoClearAsRollout==false?false:true;
	return this._process(target);
}
AshPopup.prototype.clear=function(){if(!this.cloner)return;
	if(this.useMotion)this._motionOrder('out');
	if(this.cloner&&this.cloner.parentNode){AshDepthManager.manager.unRegister(this.cloner);
		this.cloner.parentNode.removeChild(this.cloner);
		this.dispatchEvent(new AshEvent(AshPopup.CLEAR),{target:this.target,cloner:this.cloner});
	}
	this.target=null;
	this.cloner=null;
	this.coordinates=null;
	this.useMotion=true;
	this.callback=null;
	this.rollover=false;
	this.useAutoClearAsRollout=true;
	this._agent.removeEventListener('mouseover',this._onMouseOver);
}
AshPopup.manager=new AshPopup();
var AshLocationHistory=new AshEventDispatcher();
AshLocationHistory.RECALL='recall' 
AshLocationHistory.autoExecute=true; 
AshLocationHistory.contentURL='history.html';
AshLocationHistory.initialize=function(){var own=this;
	var createIframe=function(){var ele=document.createElement('iframe');
		ele.setAttribute('frameBorder','0');
		ele.style.display='none';
		AshUtil.resize(ele,0,0);
		return ele;
	}
	this._convert=function(data,mode){if(mode=='encoding')return'?'+encodeURIComponent(AshUtil.toJSON(data));
		var cdata={};
		if(data.length>0)return AshUtil.jsonToValue(decodeURIComponent(data.substr(1)));
	}
	this.iframe=document.body.appendChild(createIframe());
	this._agent=new AshEventDispatcher(this.iframe);
	this._agent.addEventListener('load',function(e){if(own.ulcerativecolitisfucku){own.ulcerativecolitisfucku=false;
			return;
		}
		var data=own._convert(own.iframe.contentWindow.location.search);
		if(own.autoExecute&&typeof data=='object' &&data.exec)eval(data.exec);
		own.dispatchEvent(new AshEvent(AshLocationHistory.RECALL),data);
	});
}
AshLocationHistory.setHistory=function(data){if(!this._initialized){this._initialized=true;
		this.initialize();
	}
	this.ulcerativecolitisfucku=true;
	this.iframe.contentWindow.location.href=this.contentURL+this._convert(data,'encoding');
}
var AshCalendar=Ash.createClass('AshPopup',AshEventDispatcher);
AshCalendar.EXTRACT='extract';
AshCalendar.ELEMENTS_LENGTH=42;
AshCalendar.MONTH_LAST_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31];
AshCalendar.DAY_TO_STRING=['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
Ash.addPrototype(AshCalendar,{elements:null,
	theDate:null,todayDate:null,onExtract:null,_onExtract:function(e){if(this.onExtract!=null)this.onExtract(e);
	},initialize:function(){this.theDate=new Date();
		this.todayDate=new Date();
		this.addEventListener(AshCalendar.EXTRACT,this._onExtract);
	},today:function(){this.extract();
	},getYear:function(){return this.theDate.getFullYear();
	},setYear:function(value){if(value==this.getYear())return;
		this.theDate.setFullYear(value);
		this.extract();
	},getMonth:function(){return this.theDate.getMonth();
	},setMonth:function(value){if(value==this.getMonth())return;
		this.theDate.setMonth(value);
		this.extract();
	},getRealMonth:function(){return this.theDate.getMonth()+1;
	},setRealMonth:function(value){if(value-1!=this.getMonth())this.setMonth(value-1);
	},getDate:function(){return this.theDate.getDate();
	},setDate:function(value){if(value==this.getDate())return;
		this.theDate.setDate(value);
		this.extract();
	},getDay:function(){return this.theDate.getDay();
	},getDayToString:function(){return AshCalendar.DAY_TO_STRING[this.getDay()]; 
	},
	getFirstWeekDay:function(){var date=new Date( this.getYear(),this.getMonth(),1);
		return date.getDay();
	},thisYear:function(){this.setYear(this.todayDate.getFullYear());
	},prevYear:function(){this.setYear(this.getYear()-1);
	},nextYear:function(){this.setYear(this.getYear()+1);
	},thisMonth:function(){this.theDate.setFullYear( this.todayDate.getFullYear());
		this.theDate.setMonth( this.todayDate.getMonth());
		this.extract();
	},prevMonth:function(){this.setMonth(this.getMonth()-1);
	},nextMonth:function(){this.setMonth(this.getMonth()+1);
	},
	anyMonth:function(year,realMonth){this.theDate.setFullYear(year||this.todayDate.getFullYear());
		this.theDate.setMonth(realMonth>0?realMonth-1:this.todayDate.getMonth());
		this.extract();
	},
	extract:function(){var lastDay=AshCalendar.MONTH_LAST_DAYS[this.getMonth()],leng=AshCalendar.ELEMENTS_LENGTH;
		 
		if(this.getMonth()==1)lastDay+=(this.getYear()%4==0)?1:0;
		
		var elements=[];
		for(var i=0,wd=0,j=0,firstWeekDay=this.getFirstWeekDay(); i<leng; i++){if(i<firstWeekDay)elements[i]={value:'',today:false};
			else{j++;
				if(j<=lastDay){elements[i]={value:j,today:false};
					
					if(this.getYear()==this.todayDate.getFullYear()&&this.getMonth()==this.todayDate.getMonth()&&j==this.getDate())elements[i].today=true;
				}
				else elements[i]={value:'',today:false};
			}
			wd++;
			if(i%7==0)wd=0;
			elements[i].day=wd;
		}
		this.dispatchEvent(new AshEvent(AshCalendar.EXTRACT),{elements:elements} );
		return(this.elements=elements);
	}
});
var AshImageViewer=Ash.createClass('AshImageViewer',AshAgent);
AshImageViewer.LOADED='loaded';
AshImageViewer.APPLY='apply';
Ash.addPrototype(AshImageViewer,{cover:null,body:null,fileInfo:null,img:null,bnds:null,resizer:null,onLoaded:null,onApply:null,initialize:function(){var own=this;
		this.owner=(function(){var ele=document.createElement('div');
			ele.innerHTML="<div style='position:absolute; display:none; padding:5px 5px 30px 5px; background-color:#000000; width:1px; height:1px;' ashdrag='true' onselectstart='return false;' ondragstart='return false;'>"+"<div name='cover' style='position:absolute; z-index:1; left:0px; top:0px; width:100%; height:100%; background-color:#000000; _height:expression(parentNode.offsetHeight-10);'></div>"+"<div name='body' style='width:100%; height:100%;'></div>"+"<div name='fileInfo' style='position:absolute; left:5px; bottom:10px; color:#999999; font-family:arial; font-size:9px; cursor:default; '></div>"+"<div onclick='Ash.support();' style='position:absolute; right:5px; bottom:10px; color:#666666; font-family:arial; font-size:10px; cursor:pointer; font-weight:bold;'>"+"AshImageViewer<span style='color:#444444; font-size:9px; font-weight:normal;'> (ver 0.2)</span><span style='color:#CA6500; font-size:9px;'> By AshAPI</span></div>"+"</div>";
			return document.body.appendChild(ele.firstChild);
		})();
		this.cover=new AshAgent(this.getChildByName('cover'));
		this.body=this.getChildByName('body');
		this.fileInfo=this.getChildByName('fileInfo');
		this.resizer=new AshResize(this.owner);
		this.resizer.start();
		this.resizer.onResizeStart=function(){own.setBounds();
		}
		
		if(arguments[0]){this.cover.setHTML("<table width='100%' height='100%' onclick='siv.hide();'><tr><td align='center' valign='middle'><img src='"+arguments[0]+"'></td></tr></table>");
			this.cover.getFirstChild().siv=own;
		}
		 
		if(arguments[1]&&typeof arguments[1]=='function')arguments[1].call(this);
		this.addEventListener(AshImageViewer.LOADED,function(e){if(this.onLoaded!=null)this.onLoaded(e);
		});
		this.addEventListener(AshImageViewer.APPLY,function(e){if(this.onApply!=null)this.onApply(e);
		});
	},show:function(src){this.owner.style.display='block';
		AshDepthManager.manager.front(this.owner);
		if(src){this.resizer.defaultCursor='default';
			this.cover.owner.style.display='block';
			this.cover.setOpacity(1);
			this.body.innerHTML="<img src='"+src+"' style='visibility:hidden;' onload='siv.onImageLoaded(event);' ashdrag='true' ashdragtarget='parent.parent' "+"onmousedown='siv.setBounds(); return false;' onmousemove='return false;' onclick='siv.checkAndHide();'>";
			this.body.firstChild.siv=this;
		}
	},hide:function(){this.owner.style.display='none';
	},
	setBounds:function(){this.bnds=this.getBounds();
		AshDepthManager.manager.front(this.owner);
	},checkAndHide:function(){var bnds=this.getBounds();
		if(bnds.x==this.bnds.x&&bnds.y==this.bnds.y&&bnds.width==this.bnds.width&&bnds.height==this.bnds.height)this.hide();
	},onImageLoaded:function(e){var own=this,img=this.img=e.target||e.srcElement;
		var d=document.documentElement,dw=d.clientWidth,dh=d.clientHeight,sinfo=AshUtil.document.scrollInfo();
		var w=img.width,h=img.height;
		var x=sinfo.left+(dw/2-w/2),y=sinfo.top+(dh/2-h/2);
		AshUtil.resize(img,'100%','100%');
		this.tween( {x:x,y:y,width:w,height:h},800,'back.out',function(e2){if(e2.type==AshTween.FINISH){img.style.visibility='visible';
				own.resizer.defaultCursor='move';
				own.cover.alpha(0,800,'out',function(e3){if(e3.type==AshTween.FINISH)own.cover.owner.style.display='none';
				});
				own.dispatchEvent(new AshEvent(AshImageViewer.APPLY));
			}
		});
		this.dispatchEvent(new AshEvent(AshImageViewer.LOADED),{src:img.src,img:img} );
		if(AshUtil.browser.ie)this.fileInfo.innerHTML=this.getFileSize(img.fileSize);
	},getFileSize:function(size){size=+size;
		size=size/1024;
		if(size<1024)return Math.ceil(size)+" K byte";
		else{size=size/1024;
			if(size<1024)return Math.ceil(size)+" M byte";
			else{size=size/1024;
				if(size<1024)return Math.ceil(size)+" G byte";
			}
		}
		return'0 byte';
	}
});
var AshAccordion=Ash.createClass('AshAccordion',AshEventDispatcher);
AshAccordion.APPLY='apply'; 
AshAccordion.FINISH='finish'; 
AshAccordion.apply=function(target,mode,duration,easingName,callback){if(!target)return;
	if(!target.__r_accoditon__)target.__r_accoditon__=new AshAccordion(target);
	if(target.__r_accoditon__.targetChild)target.__r_accoditon__.apply(mode,duration,easingName,callback);
	return target.__r_accoditon__;
}
Ash.addPrototype(AshAccordion,{target:null,targetChild:null,motioner:null,mode:'auto',onApply:null,onFinish:null,initialize:function(target){var targetChild=this.getTargetChild(target);
		if(!target||!targetChild)throw new Error('can¡¯t create an instance[missing arguments]');
		
		target.style.cssText+=';overflow:hidden; position:relative;';
		this.motioner=new AshMotionAgent(target);
		this.target=target;
		this.targetChild=targetChild;
		this.addEventListener(AshAccordion.APPLY,function(e){if(this.onApply!=null)this.onApply(e);
		});
		this.addEventListener(AshAccordion.FINISH,function(e){if(this.onFinish!=null)this.onFinish(e);
		});
	},apply:function(mode,duration,easingName,callback){var own=this,h=this.target.offsetHeight,value;
		this.target.accorIsMotioning=true;
		if(!mode||mode=='auto')mode=AshUtil.getStyle(this.targetChild,'display')=='none'?'open':'close';
		this.mode=mode;
		this.target.style.height='auto';
		this.targetChild.style.display=mode=='open'?'block':'none';
		value=this.target.offsetHeight;
		this.target.style.height=h+'px';
		this.targetChild.style.display='block';
		this.motioner.height(value,duration||700,easingName,function(e){if(e.type==AshTween.FINISH){if(mode=='close')own.targetChild.style.display='none';
				else own.target.style.height='auto';
				own.target.accorIsMotioning=false;
				own.dispatchEvent(new AshEvent(AshAccordion.FINISH),{mode:mode,event:e});
				if(callback!=null)callback(e);
			}
		});
		this.dispatchEvent(new AshEvent(AshAccordion.APPLY),{mode:mode});
	},getTargetChild:function(o){
		for(var children=o.getElementsByTagName('*'),l=children.length,i=0; i<l; i++)if(children[i].className.indexOf('Accordion')!=-1)return children[i];
		return null;
	}
});