ciao a tutti

sapreste spiegarmi perchè non riesco a reperire il valore del checkbox? la funzione mi ritorna sempre undefined!!

codice:
<script language="JavaScript">

function insimmagine(id){

alg = document.page.allin.value;
alert(alg);

tabella = " \n";
tabella = tabella + "<div align="+ alg +">\n";
tabella = tabella + "<img src=admin/getimagesmall.php?id_foto=" + id +" \n";
tabella = tabella + "</div>\n";
tabella = tabella + " \n";

if (id>0){
document.forms['page'].elements['contenuto'].value= document.forms['page'].elements['contenuto'].value + tabella;
}else{
alert("ATTENZIONE E' NECESSARIO SELEZIONARE PRIMA UN'IMMAGINE");
}

}

</script>

<form action="admin.php?gestione=pagine" method="post" name="page">
<div class="normale" align="left">
<table class="NORMALE">
<tr>
<td colspan="2">INSERSISCI FOTO</td>
</tr>
<tr>
<td>

<input type="radio" value="left" name="allin">A SINISTRA

<input type="radio" value="center" name="allin">AL CENTRO

<input type="radio" value="right" name="allin" checked>A DESTRA
</td>
        <td valign="middle"> SELEZIONA FOTO 
          [img]getimagesmall.php?id_foto=6[/img] 
        </td>
</tr>
</table>

</div>
<table>
il problema è che alg prende sempre il valore undefined!!
?? perchè??