function SwatForm(id)
{
	this.id = id;
	this.form_element = document.getElementById(id);
}

SwatForm.prototype.setDefaultFocus = function(element_id)
{
	// TODO: check if another element in this form is already focused

	var element = document.getElementById(element_id);
	
	if (element)
		element.focus();
}

function SwatForm(id)
{
	this.id = id;
	this.form_element = document.getElementById(id);
}

SwatForm.prototype.setDefaultFocus = function(element_id)
{
	// TODO: check if another element in this form is already focused

	var element = document.getElementById(element_id);
	
	if (element && typeof element.focus == 'function')
		element.focus();
}

Make sure we only call focus() on focusable elements.
Make sure we only call focus() on focusable elements.


svn commit r1621
