Was wondering if anyone could help please?

I am using a dragging JS class that I downloaded and have adapted it so that I can drag multiple objects on the webpage, using an array of objects rather than just one.

It works fine in Firefox, but in IE 7 it will not move any of the objects. The original code that I downloaded that only moved one object worked fine in both IE and FF, so I think it is the array code that I added that is buggy.

Here is the code that calls the dragging class:

<script type="text/javascript">

var inputs;
var squares;
var i = -1;
var square;



while ($row = mysql_fetch_array($result))
{ ?>

<div id="container">

<div id="info"></div>
<div id="square" name="myInput"></div><br />

<script type="text/javascript">


inputs = document.getElementsByName('myInput');

square =

square.dragBegin = begin;
square.drag = drag;
square.dragEnd = end;

var curleft = 0;
var curtop = 0;

curleft += square.offsetLeft;
curtop += square.offsetTop;



<?php } ?>

I won't bother including the js file code because I'm pretty sure that the problem is with the above code. However, if it will help I can add it in.

Thanks very much!