function makeWindow(loc, w, h)
{
	w = window.open(loc,"painting","toolbar=no,width="+w+",height="+h+",resizable=1,scrollbars=1");
	return false;
}

function makeCommentBox(id)
{
	var action = 'comment.php';
	var box = document.getElementById('commentForm');
	box.innerHTML = "<form action=" + action + " method=POST>"+
		"<input type=hidden name=painting value='"+ id +"'/>"+
		"<div style='display:none'><input id=magicID type=text name=magic value=''/></div>"+
		"<textarea id=commentTextArea name=comment rows=10 cols=50></textarea>"+
		"<br>"+
		"<input type=submit name=submit value='Post Comment' onClick='return submitComment();'/>"+
		"</form>";
	return false;
}

function submitComment()
{
	var t = document.getElementById('commentTextArea').value;
	var str = 'SPAMBOTPOOP' + t;
	str = str.replace(/\s+/g, '');
	document.getElementById('magicID').value = hex_md5(str);
	return true;
}
