function addimg(l,i) {document.getElementById('fsubmenubg').innerHTML+=(l?"<a href='"+l+"'"+(l=="admin.php"?"target='_BLANK'":"")+"'>":"")+"<img src='http://sm.jcink.com/s/host/skullmonkey/images/forum/bgs/menu/"+i+"' />"+(l?"</a>":"")}

ul=document.getElementById('userlinks').innerHTML
sm=document.getElementById('submenu').innerHTML
li=ul.match("Logged in as:")

addimg("?act=Login&CODE=0"+(li?3:0),(li?"logout":"login")+".gif")
if (!li) addimg("?act=Reg&CODE=00","register.gif")
if (ul.match("admin.php")) addimg("admin.php","admincp.gif")
if (ul.match("act=modcp")) addimg("index.php?act=modcp","modcp.gif")
if (li) addimg("?act=Msg&CODE=01","pm"+(ul.match(/[1-9] New/)?"new":"no")+".gif")
if (li) addimg("index.php?act=UserCP&CODE=00","usercp.gif")

addimg(false,"mid.gif")

addimg("?act=Help","help.gif")
addimg("?act=Search","search.gif")
addimg("?act=Members","members.gif")
addimg("?act=calendar","calendar.gif")

addimg(false,"mid.gif")

if (sm.match("act=store")) addimg("?act=store","shop.gif")
if (sm.match("act=lottery")) addimg("?act=lottery","lottery.gif")
if (sm.match("act=javairc")) addimg("?act=javairc","chat.gif")
if (sm.match("act=Arcade")) addimg("?act=Arcade","arcade.gif")
if (sm.match("act=army")) addimg("?act=army","army.gif")
if (sm.match("act=usergroups")) addimg("?act=usergroups","groups.gif")
if (sm.match("act=rep")) addimg("?act=rep&CODE=totals","rep.gif")
if (sm.match("act=Shoutbox")) addimg("?act=Shoutbox","shoutbox.gif")
if (sm.match("act=Downloads")) addimg("?act=Downloads","downloads.gif")
if (sm.match("act=daffiliates")) addimg("?act=daffiliates","aff.gif")
if (sm.match("act=gallery")) addimg("?act=gallery","gallery.gif")
if (sm.match("act=Bookie")) addimg("?act=Bookie","bookie.gif")