Hi arbab,
are you following the book? Which chapter are you add?
Just looking at your code (pleain javascript, no jquery), it looks like your missing the declaration of the global variable "count".
To have your code work (with plain javascript) you have to add the following to your head section:
Code:
<script language="javascript">
var count = 0;
</script>
Hope this helps