<byondprompt name="message">
<style type="text/css">
.byond_prompt {
	padding: 10px;
	text-align: center;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-o-user-select: none;
	user-select: none;
}
.byond_prompt_title {
	text-align: center;
	font-size: 1.25em;
	font-weight: bold;
	margin: 0 0 10px 0;
}
.byond_prompt_help {
	display: table;
	text-align: left;
	max-width: 100%;
	margin: 0 auto 10px auto;
}
.byond_prompt textarea {
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	-o-user-select: text;
	user-select: text;
}
textarea.byond_prompt_input {
	display: inline-block;
	margin: 0 auto;
	width: 100%;
	height: 250px;
	overflow: auto;
	border-width: 1px;
	border-style: solid;
	position: relative;
}
.byond_prompt_button {
	display: inline-block;
	min-width: 5em;
	margin: 0 20px;
	padding: 5px 0;
	text-align: center;
	border-width: 1px;
	border-style: solid;
	font-weight: bold;
	cursor: pointer;
}
.byond_prompt_buttons {
	text-align: center;
	margin-top: 20px;
}
</style>
<script type="text/javascript">
{
	fn: {
		fill: function() {
			var e=this.elem,ui=this.ui,p=this.params,i,bt,b,d,l,sel=this._sel=-1;
			(ui.title||{}).innerHTML=byond.htmlEncode(p.title);
			(ui.help||{}).innerHTML=byond.htmlEncode(p.help);
			if(bt=ui.input) {
				if(bt.tagName!='TEXTAREA') {
					b=bt.getElementsByTagName('textarea')[0];
					if(!b) {b=document.createElement('textarea'); bt.appendChild(b);}
					bt=ui.input=b;
				}
				bt.innerHTML = byond.htmlEncode(p.defaultChoice);
			}
			if(bt=ui.button) {
				ui.ok=b=bt.cloneNode(true);
				bt.parentNode.insertBefore(b,bt);
				b.innerHTML='OK';
				b.addEventListener('click',this.ok.bind(this));
				if(p.canCancel) {
					ui.cancel=b=bt.cloneNode(true);
					bt.parentNode.insertBefore(b,bt);
					b.innerHTML='Cancel';
					b.addEventListener('click',this.cancel.bind(this));
				}
				bt.parentNode.removeChild(bt);
			}
		},
		onshow: function() {
			var i=this.ui.input;
			if(i) i.focus();
		},
		ok: function() {
			var p=this.params,i=this.ui.input;
			if(!i) return this.cancel();
			this.reply(i.value);
		},
		keyEvent: function(e) {
			if(e.type!='keydown') return false;
			if(e.keyCode==27) {if(this.params.canCancel) this.cancel(); byond.event.end(e); return true;}
			var i=this.ui.input;
			if(i) i.focus();
		}
	}
}
</script>
<div class=byond_prompt_title id=title></div>
<div class=byond_prompt_help id=help></div>
<textarea class="byond_prompt_input byond_boxbk1" id=input></textarea>
<div class=byond_prompt_buttons>
	<div class="byond_prompt_button byond_buttonbk" id=button></div>
	<div style="clear:both"></div>
</div>
</byondprompt>