Fix this:
With:
Also:
Code:
<script type="text/javascript">
With this:
Code:
<script language="JavaScript" type="text/javascript">
(Maybe you even need a version-attribute for IE?)
Also, regarding general JavaScript code, this is how you initialize a variable:
Code:
var N = 0; // integer, not a string :-)
I am not sure if there is anything else missing, maybe it's even more picky.

The code doesn't look like it's too much ahead of IE.