Someone please help (this is from a site from www.avidgamers.com)

i tried to update my avatar url but messed up quiet badly, now
every post have a users.length not a object error happeneed every time

this is copied from flat reply page from private board, can someone help me debug this??

<script language="JavaScript">
var name = 0
var avatar = 1
var signaturepic = 2
var signature = 3
users = parent.menu.users

function writeSig(user) {
for (var count = 1; count <= (users.length-1); count++) {
if (user == users[count\][name\]) {
var image = (users[count\][signaturepic\])
var image1 = ('<img src="http://')
var image2 = ('">')
document.write(image1)
document.write(image)
document.write(image2)
document.write('
')
document.write(users[count\][signature\])
} } }
</script>


<table border=0 cellpadding=0 cellspacing=0 width=600><tr><td align=left>
[Private board] -> [[area_name]] -> [[thread_name]]


<table border=0 cellpadding=4 cellspacing=0><tr><td align=left style="color: [th_text_color];">
<h3>[subject]</h3>
<table border=1 cellpadding=4 cellspacing=0><tr><td>
[text]




--------------------------------------------------------------------------------


<script>writeSig('[username]')</script>

</td></tr></table>Posted by [if:user_url][endif:user_url][sig][username][if:user_url]
<script language=javascript>

if("[userlevel]"=="Consul"){
document.write('
<img alt="Consul"src="http://www.primadog.50megs.com/Consul.gif" border="0">')}
else if("[userlevel]"=="Imperator"){
document.write('
<img alt="Imperator"src="http://www.primadog.50megs.com/Imperator" border="0">')}
else if("[userlevel]"=="Augur"){
document.write('
<img alt="Augur"src="http://www.primadog.50megs.com/Augur.gif" border="0">')}
else if("[userlevel]"=="Signifer"){
document.write('
<img alt="Signifer"src="http://www.primadog.50megs.com/Signifer.gif" border="0">')}
else if("[userlevel]"=="Optio"){
document.write('
<img alt="Optio"src="http://www.primadog.50megs.com/Optio.gif" border="0">')}
else if("[userlevel]"=="Centurion"){
document.write('
<img alt="Centurion"src="http://www.primadog.50megs.com/Centurion.gif" border="0">')}
else if("[userlevel]"=="Ariovistus"){
document.write('
<img alt="Ariovistus"src="http://www.primadog.50megs.com/Ariovistus.gif" border="0">')}
else if("[userlevel]"=="Praetor"){
document.write('
<img alt="Praetor"src="http://www.primadog.50megs.com/Praetor.gif" border="0">')}
else if("[userlevel]"=="Extraordinarius"){
document.write('
<img alt="Extraordinarius"src="http://www.primadog.50megs.com/Extraordinarius.gif" border="0">')}
else if("[userlevel]"=="Trariiequitus"){
document.write('
<img alt="Trariiequitus"src="http://www.primadog.50megs.com/Traiiequitus.gif" border="0">')}
else if("[userlevel]"=="Principis"){
document.write('
<img alt="Principis"src="http://www.primadog.50megs.com/Principis.gif" border="0">')}
else if("[userlevel]"=="Hastaius"){
document.write('
<img alt="Hastaius"src="http://www.primadog.50megs.com/Hastaius.gif" border="0">')}
else if("[userlevel]"=="Equitus"){
document.write('
<img alt="Equitus"src="http://www.primadog.50megs.com/Equitus.gif" border="0">')}
else if("[userlevel]"=="Morte"){
document.write('
<img alt="Morte"src="http://www.primadog.50megs.com/Exiled.gif" border="0">')}
else if("[userlevel]"=="Tribunus"){
document.write('
<img alt="Tribunus"src="http://www.primadog.50megs.com/Tribunus.gif" border="0">')}
else if("[userlevel]"=="Mercator"){
document.write('
<img alt="Mercator"src="http://www.primadog.50megs.com/Mercator.gif" border="0">')}
else if("[userlevel]"=="Quaestor"){
document.write('
<img alt="Quaestor"src="http://www.primadog.50megs.com/Quaestor.gif" border="0">')}
else if("[userlevel]"=="Redeous"){
document.write('
<img alt="Redeous"src="http://www.primadog.50megs.com/Redeous.gif" border="0">')}
</script>
[endif:user_url] <small>([userlevel])</small> on [date]
[if:edited]
<small>Edited by the author on [edited_date]</small>[endif:edited][if:author_iscurrent]<small>&nbsp;&nbsp;[Edit message]</small>[endif:author_iscurrent]
</td></tr></table>
[if:replies]
Replies:
[if:is_moderator]<form method="post" action="[form_action]">[endif:is_moderator]
<table border=1 cellspacing=0 cellpadding=0>
<tr><td>
<table border=0 cellpadding=2>
[loop:replies]
<tr><td valign=top class="[alternating]">[target][if:user_url][endif:user_url][username][if:user_url][endif:user_url]
<small>[userlevel]</small>
<script language=javascript>if("[userlevel]"=="Consul"){
document.write('
<img alt="Consul"src="http://www.primadog.50megs.com/Consul.gif" border="0">')}
else if("[userlevel]"=="Imperator"){
document.write('
<img alt="Imperator"src="http://www.primadog.50megs.com/Imperator" border="0">')}
else if("[userlevel]"=="Augur"){
document.write('
<img alt="Augur"src="http://www.primadog.50megs.com/Augur.gif" border="0">')}
else if("[userlevel]"=="Signifer"){
document.write('
<img alt="Signifer"src="http://www.primadog.50megs.com/Signifer.gif" border="0">')}
else if("[userlevel]"=="Optio"){
document.write('
<img alt="Optio"src="http://www.primadog.50megs.com/Optio.gif" border="0">')}
else if("[userlevel]"=="Centurion"){
document.write('
<img alt="Centurion"src="http://www.primadog.50megs.com/Centurion.gif" border="0">')}
else if("[userlevel]"=="Ariovistus"){
document.write('
<img alt="Ariovistus"src="http://www.primadog.50megs.com/Ariovistus.gif" border="0">')}
else if("[userlevel]"=="Praetor"){
document.write('
<img alt="Praetor"src="http://www.primadog.50megs.com/Praetor.gif" border="0">')}
else if("[userlevel]"=="Extraordinarius"){
document.write('
<img alt="Extraordinarius"src="http://www.primadog.50megs.com/Extraordinarius.gif" border="0">')}
else if("[userlevel]"=="Trariiequitus"){
document.write('
<img alt="Trariiequitus"src="http://www.primadog.50megs.com/Traiiequitus.gif" border="0">')}
else if("[userlevel]"=="Principis"){
document.write('
<img alt="Principis"src="http://www.primadog.50megs.com/Principis.gif" border="0">')}
else if("[userlevel]"=="Hastaius"){
document.write('
<img alt="Hastaius"src="http://www.primadog.50megs.com/Hastaius.gif" border="0">')}
else if("[userlevel]"=="Equitus"){
document.write('
<img alt="Equitus"src="http://www.primadog.50megs.com/Equitus.gif" border="0">')}
else if("[userlevel]"=="Morte"){
document.write('
<img alt="Morte"src="http://www.primadog.50megs.com/Exiled.gif" border="0">')}
else if("[userlevel]"=="Tribunus"){
document.write('
<img alt="Tribunus"src="http://www.primadog.50megs.com/Tribunus.gif" border="0">')}
else if("[userlevel]"=="Mercator"){
document.write('
<img alt="Mercator"src="http://www.primadog.50megs.com/Mercator.gif" border="0">')}
else if("[userlevel]"=="Quaestor"){
document.write('
<img alt="Quaestor"src="http://www.primadog.50megs.com/Quaestor.gif" border="0">')}
else if("[userlevel]"=="Redeous"){
document.write('
<img alt="Redeous"src="http://www.primadog.50megs.com/Redeous.gif" border="0">')}
</script>
</td><td valign=top class="[alternating]">[if:use_subject][subject]
[endif:use_subject][text]



--------------------------------------------------------------------------------


<script>writeSig('[username]')</script>


<small>[date][if:edited]&nbsp;&nbsp;(Edited on [edited_date])[endif:edited][if:author_iscurrent]&nbsp;&nbsp;[Edit message][endif:author_iscurrent]</small>

</td>[if:is_moderator]<td valign=top class="[alternating]">[delete_box]</td>[endif:is_moderator]</tr>
[endloop:replies]
</table></tr></td></table>
[if:is_moderator]<input type="submit" value="Delete checked messages"></form>[endif:is_moderator]
[endif:replies]
[total_replies] replies. [ifagenumbers]Showing page [current_page] of [total_pages]:[loopagenumbers] [[else:current][endelse:current][num][else:current][endelse:current]][endloopagenumbers][endifagenumbers]
[if:closed]
This thread has been closed for additional posting.

[endif:closed]
[elseosting_allowed]
You are not allowed to post in this message area.

[endelseosting_allowed]
[ifosting_allowed]
[else:closed]

Reply:

<table border=1 cellpadding=3 cellspacing=0><tr><td>
<form method=post name="post" action="[form_action]">
<INPUT type="hidden" name="text">
<table border=0 cellpadding=3 cellspacing=0>
[if:use_subject]<tr><td align=left valign=top>Subject:</td>
<td align=left><input type=text size=20 maxlength=[subject_length] name=subject value="[new_subject]"></td></tr>[endif:use_subject]
<tr><td align=left valign=top>Text:</td>
<td align=left><textarea rows=6 cols=35 name=pretext onChange="doSmilies()" wrap=virtual></textarea></td></tr>
<tr>
<td></td><td align=left valign=top><input type=submit name=submit value="Submit"></td>
</tr>
<tr><td></td><td align=left valign=top>
<INPUT type="checkbox" name="disable" onChange="doSmilies()" value="ON">Disable
smilies on your post.</td></tr></table>
</form>
</td></tr></table>


[endelse:closed]
[endifosting_allowed]
</td></tr>
</table>