i have written this code n using it i am able to control focus in my order.but now i want them to appear in loop.i mean from id 1 to 2,then 3,then again from 3 to 1.thus in a loop.what code should i add????

Code:
<html>
<head>
<title>Required Field</title>
<script type="text/javascript">
  function testing(event,number) 
    { 
        if( event.keyCode ==9 )
...