function Balloon(){
	this.balloon;
	this.isShow=false;
	
	var field=null;
	//var charactor=null;
	
//	return this;

/****/
this.Init=function(fld, cha, tplurl){
	var self=this;
	field=fld;
	//charactor=cha;
	
	this.balloon=U.CE('div');
	this.balloon.className='balloon';
	this.balloon.style.position='absolute';
	
	var frame=U.CE('div');
	frame.className='frame';
	
	this.output=U.CE('div');
	with(this.output){
		className='output';
	}

	var imcls=U.CE('img');
	imcls.src=SPACER_URI;//'system/spacer.gif';
	imcls.className='close';
	imcls.onclick=function(e){
			if(field.action.timeCritical)
				return self;
			field.action.Stop();
			self.Clear();
			self.Close();
			return self;
		};

	var imup=U.CE('img');
	imup.src=SPACER_URI;//'system/spacer.gif';
	imup.className='sup';
	imup.onmousedown=function(e){
			//self.ScrollUp();
		};
	imup.onmouseup=function(e){
			//self.ScrollStop();
		};

	var imdn=U.CE('img');
	imdn.src=SPACER_URI;//'system/spacer.gif';
	imdn.className='sdn';
	imdn.onmousedown=function(e){
			//self.ScrollUp();
		};
	imdn.onmouseup=function(e){
			//self.ScrollStop();
		};
	
	frame.appendChild(this.output);
	frame.appendChild(imcls);
	frame.appendChild(imup);
	frame.appendChild(imdn);
	
	this.balloon.appendChild(frame);
	
	this.Clear();
	return this;
};//

/****/
this.Destroy=function(){
	this.output=null;
	return this;
};//

/****/
this.SetClass=function(cname, oName){
	var cn=this.balloon.className;
	cn+=' ';
	if(oName)
		cn=cn.replace(oName+' ', cname).replace(/ $/, '');
	else
		cn+=cname;
	this.balloon.className=cn;
	
	return this;
};//

/****/
this.SetStyle=function(ss){
	for(var s in ss)
		this.balloon.style[s]=ss[s];
	
	return this;
};//


/****/
this.Clear=function(){
	this.output.innerHTML='<p></p>';
	
	return this;
};//

/****/
this.Close=function(){
	this.balloon.style.display='none';
	this.isShow=false;
	return this;
};//

/****/
this.Show=function(){
	if(this.isShow)
		return this;
	this.isShow=true;
	this.balloon.style.display='block';
	
	return this;
};//

/****/
this.AddTo=function(pa, nextNode){
	pa.insertBefore(this.balloon, nextNode);
	
	return this;
};//

/****/
this.MoveTo=function(x, y){
	this.balloon.style.top=y+'px';
	this.balloon.style.left=x+'px';
	
	return this;
};//


/****
#タイマー40msを使用し１文字ずつ表示。
#前回の出力から60ms経過している場合は2文字出力。
#以降、40ms遅延ごとに出力文字を１文字増やす。
１文字ずつ出力
/****/
this.Talk=function(html, add){
	if(!add)
		this.Clear();
	if(!this.isShow)
		return this;
	//this.output.innerHTML+=html;

	if(html=='<br>')
		this.output.appendChild(U.CE('p'));
	else if(html.charAt(0)!='<')
		//if(Config.mode)
		if(Config.tcon)
		this.output.lastChild.textContent+=html;
		else
		this.output.lastChild.innerText+=html;
	else{
		this.output.appendChild(U.CE('p'));
		this.output.lastChild.innerHTML=html;
		this.output.appendChild(U.CE('p'));
	}
	
	return this;
};//

/****/
this.Play=function(){
//	this.output.innerHTML=html;
	
	return this;
};//


}//Balloon

