Just supplying the JavaScript puts a lot of work on us to try to see the code in action. Why don't you upload us a full sample?