Set focus on first element of specified form

<body onload="Form.focusFirstElement('form1')">
<form id="form1" name="form1">
    ...
</form>
</body>

If you are creating a form that is embedded in a table you may run into these errors:

Error: element has no properties
Error: form has no properties

If you have code that looks like this it will fail:
(while this displays correctly in all browsers it is technically invalid and thus confusing to javascript)

<body onload="Form.focusFirstElement('form1')">
<table><form id="form1">
<td><input type="text" /></td></table>
</body>

This however will fix the issue:

<body onload="Form.focusFirstElement('form1')">
<form id="form1"><table>
<td><input type="text" /></td></table>
</body>