// Focuses cursor to first textbox in form

window.onload = formFocus;

function formFocus()
{
	// Check that the form field is valid
	if (typeof sFocus != "undefined")
	{
		// Get the ID of the field
		oFocus = document.getElementById(sFocus)

		// Check length and if there is another field to focus instead
		if (oFocus.value.length > 0 && typeof sFocus != "undefined")
		{
			oFocus = document.getElementById(sFocus2);
		}

		// Focus cursor in field
		oFocus.focus();
		// Select the contents
		oFocus.select();
	}
}
