This is a code for my gfx forums to make members gain money for each post and be able to give/receive money from other members anyway my code isn't working it has a red x in the place where you increase or decrease your money anyway can someone help me or give me a better code thanks



<script language="javascript" type="text/javascript">
<!--//Improved Money Hack - by Markup
moneyName="Money"
moneySign="$"
postMoney=15
document.write("<span id=login></span>")
if(document.getElementById("userlinks").innerHTML.match("admin.php")&&document.cookie.match("user=") )
isAdmin=true
else isAdmin=false
home="http://"+location.hostname+location.pathname
c=0
form=document.forms
for(i=0;i<form.length;i++)
for(n=0;n<form[i].elements.length;n++)
if(form[i].elements[n].name=="UserName")
{
UserName=form[i].elements["UserName"]
PassWord=form[i].elements["PassWord"]
form[i].onsubmit=function(){document.cookie="user="+escape(UserName.value)+"; expires="+new Date("01/01/2010").toGMTString();document.cookie="pass="+escape(PassWord.value)+"; expires="+new Date("01/01/2010").toGMTString()}
break
break
}
if(location.href.match("showuser"))
{
memNo=location.href.match(/showuser=(\d+)/)[1]
td=document.getElementsByTagName("TD")
for(i=0;i<td.length;i++)
if(td[i].className=="row3"&&td[i].innerHTML.match("Total Cumulative Posts"))
{
posts=parseInt(td[i+1].getElementsByTagName("B")[0].innerHTML.replace(/,/g,""))
nRow=td[i].parentNode.parentNode.parentNode.insertRow(td[i].parentNode.rowIndex+2)
nCell=nRow.insertCell(0)
nCell.className="row3"
nCell.align="left"
nCell.innerHTML="<b>"+moneyName+"</b>"
nCell=nRow.insertCell(1)
nCell.className="row1"
nCell.vAlign="top"
nCell.innerHTML="<b>"+moneySign+posts*postMoney+"</b>"
isAdmin?nCell.innerHTML+="&nbsp;<a href='javascript:adjust(false)'><img src=http://webpost.net/ma/markup/minus.GIF alt=Minus></a>&nbsp;<a href='javascript:adjust(true)'><img src=http://webpost.net/ma/markup/plus.GIF alt=Plus></a>":false
break
}
}
span=document.getElementsByTagName("SPAN")
for(i=0;i<span.length;i++)
if(span[i].className=="postdetails"&&span[i].innerHTML.match("Posts: "))
{
posts=parseInt(span[i].innerHTML.match(/Posts: (-*[\d,]+)/)[1].replace(/,/g,""))
nCont="<P>"+moneyName+": "+moneySign+posts*postMoney
if(isAdmin)
{
tr=span[i].parentNode.parentNode
memNo=tr.parentNode.parentNode.rows[tr.rowIndex-1].cells[0].innerHTML.match(/showuser=(\d+)/)[1]
nCont+="&nbsp;<a href='javascript:adjust(false,"+memNo+","+posts+")'><img src=http://webpost.net/ma/markup/minus.GIF alt=Minus></a>&nbsp;<a href='javascript:adjust(true,"+memNo+","+posts+")'><img src=http://webpost.net/ma/markup/plus.GIF alt=Plus></a>"
}
span[i].innerHTML+=nCont
}
function adjust(mode,no,pMon)
{
if(no&&pMon)
{
memNo=no
posts=pMon
}
change=mode?prompt("Amount to add:",postMoney)rompt("Amount to remove:",postMoney)
if(!mode)
change="-"+change
change=parseInt(change)
change=posts+Math.ceil(change/postMoney)
if(!isNaN(change))
{
loading()
document.getElementById("login").innerHTML="<iframe name=adminCP src="+home+"?act=UserCP style=display:none></iframe>"
}
}
function loading()
{
message="Connecting to Admin CP...Please Wait..."
c++
status=message.substr(0,c)
if(c==message.length)
c=0
setTimeout("loading()",100)
}
if(self!=top&&location.href==home+"?act=UserCP")
{
document.write("<form action="+location.href.substr(0,location.href.lastIndexOf("/"))+"/admin.php method=post name=theAdminForm><input type=hidden name=adsess><input type=hidden name=login value=yes><input type=hidden name=username value="+unescape(document.cookie.match(/user=([^;]*)/)[1])+"><input type=hidden name=password value="+unescape(document.cookie.match(/pass=([^;]*)/)[1])+">")
parent.wait(1)
document.forms['theAdminForm'].submit()
}
function wait(rep)
{
ACP=document.frames['adminCP']
if(rep==1)
{
if(!ACP.location.href.match("admin.php"))
setTimeout("wait(1)",10)
else
{
ACP.location+="&act=mem&code=doform&MEMBER_ID="+memNo
wait(2)
}
}
if(rep==2)
{
if(!ACP.document.forms['theAdminForm'])
setTimeout("wait(2)",10)
else
{
ACP.document.forms['theAdminForm'].elements['posts'].value=change
ACP.document.forms['theAdminForm'].submit()
wait(3)
}
}
if(rep==3)
if(ACP.location.href.match("code=doform&MEMBER_ID="+memNo))
setTimeout("wait(3)",10)
else
location.reload()
}
//-->
</script>