function each(a, f) { for(var i=0, l=a.length; i<l; i++) f(a[i]) };
each('a big blockquote br b center code div em form h1 h2 h3 h4 h5 h6 hr img iframe input i li ol option pre p script select small span strong style sub sup table tbody td textarea tr ul u'.split(' '),
	function(label){
		this[label]=function(){
			var tag=document.createElement(label);
			each(arguments, function(e){ 
				if(e.nodeType) tag.appendChild(e);
				else {
					if(typeof e=='string' || typeof e=='number') tag.innerHTML+=e;
					else for(var p in e) {
						if(p=='style') for(var q in e[p]) tag[p][q]=e[p][q];
						else tag[p]=e[p];
					};
				};
			});
			return tag;
		};
	});
function display() {
	var hhtml=$('hyperscript-html');
	hhtml.innerHTML='';
	try {
		eval("hhtml.appendChild("+$('hyperscript-hyperscript').value+")");
	}
	catch(err) {
		hhtml.innerHTML="<center><strong>Sorry, there was the following error in your HyperScript:</strong><br><br><div style=\"color:red; background:#eee; padding:10px\">"+err.message+"</div><br><br> Remember that though the words come from HTML you still follow Javascript syntax.<br> This means, among other things, that instead of 'text-align' you write 'textAlign' and that you place commas in all sorts of unexpected places. </center>"
	}
}

