	function LetterBox(x,y,w,h,ch, fontsizepercent, fontcol, fonttp) {
		this.Dynlayer=DynLayer;
		this.Dynlayer(null,x,y,w,h);

		
		this.ch = ch;
//		fontcol = '#CCCCCC';
		if (fontsizepercent==null) fontsizepercent = 1;
		if (fontcol!=null)
			this.fontcol = ' color:' + fontcol + '; ';
		else
			this.fontcol = ' ';
		
		this.fsizew = Math.round(w * fontsizepercent);
		this.fsizeh = Math.round(h * fontsizepercent);
		if (this.fsizew < this.fsizeh)
			this.fsize = this.fsizew;
		else
			this.fsize = this.fsizeh;
			
		this._html = '<table cellspacing=0 cellpadding=0 border=0 width="100%" height="100%" style="' + this.fontcol+ ' font-size: ' + this.fsize+ 'px;"><tr><td align=center valign=center>' + ch + '<\/td><\/tr><\/table>';
		this.onPreCreate(LetterBox.PreCreate);
		this.onCreate(function() { this.addEventListener(LetterBox.listener); });
//		DragEvent.enableDragEvents(this);

	}
	var p = dynapi.setPrototype('LetterBox','DynLayer');
	LetterBox.PreCreate = function() {
	//	this.setBgColor('#EEEEEE')	
		this.setCursor('hand');
		this.setTextSelectable(false);
		// create child layer for caption
		this.addChild(new DynLayer(null,0,-3,this.w,this.h),'lettercaption');
		if (this._html!=null) {
			this.lettercaption.setHTML(this._html);
		}		
		this.lettercaption.setCursor('default');

//		this.addChild(new DynLayer(null,0,-3,this.w,this.h),'lettercaptionoverlay');
//		this.lettercaptionoverlay.setCursor('hand');

		this.setVisible(true); // make sure the widget is visible

		// add layer for event handling
		this.dynevents = new DynLayer(null,0,0,this.w,this.h); 
		this.addChild(this.dynevents);

	};
	LetterBox.listener = {
			onclick : function(e) { 
			var o=e.getSource();
			shiftPieceToEmptyPosition(o);
			o.slideTo(o._currentx*o.w,o._currenty*o.h);
			//	alert('elementdblclick');
		}

	}


