I'm trying to get the alternant modal from http://javascript.about.com/library/blmodald2.htm
running. I have those two files (viewable on the link) copied in full, and the example link on the page prior works for me. However, when I run my small piece of driver code to test it out and get it working, I get "'null' is null or not an object." How do I fix this and get it running? My code is this:

<HTML>
<HEAD>
<script type="text/javascript" src="modaldbox.js">
<div id="box" class="dialog">
<div style="text-align:center"><span id="txt">Press OK to continue.</span><br>
<button onclick="hm('box');okSelected()">OK</button>
</div>
</SCRIPT>
<link rel="stylesheet" href="modaldbox.css" type="text/css" />
</HEAD>
<BODY>
<script>
var x = 'something to check';
$('txt').innerHTML = x;
sm('box',200,50);
function okSelected() {
var y = x;
}
</script>

</BODY>
</HTML>