I am creating a small javascript script which helps in creating form elements, everything is working fine except that now that I am in the section for the check-boxes they donīt behave as they should, once the code runs to create the check-boxes javasceript generates this html and places it inside the form:

Code HTML4Strict:
<label id="somevaluel">
Some checkbox
<span>Select several</span>
<p id="somevalue">
<input type="checkbox" checked="checked" value="option_1" name="cbgroup">
<span>This is label 1</span>
<input type="checkbox" checked="checked" value="option_2" name="cbgroup">
<span>This is label 2</span>
<input type="checkbox" checked="checked" value="option_3" name="cbgroup">
<span>This is label 3</span>
<input type="checkbox" checked="checked" value="etc" name="cbgroup">
<span>This is etc label</span>
</p>
<a class="button_remove buttons" onclick="remove_field(this);return false;" href="#">
<span>Remove field</span>
</a>
<a class="button_up buttons" onclick="move_field(this, 'previous');return false;" href="#">
<span>Move up</span>
</a>
<a class="button_down buttons" onclick="move_field(this, 'next');return false;" href="#">
<span>Move down</span>
</a>
<span class="checkbox checkbox_u" onmousedown="checked_(this);"></span>
</label>

My problem is that when I click any of the generated check-boxes the first box is always checked, I noticed is because of the label tag, however because of the way the script works I would prefer not to remove the label tag, here is a link to the file showing that behavior does anyone know what I can do to overcome this problem?