// JavaScript Document

function init() 
{
	fieldFocus();
}

function getObj(elementID)
{
	if (typeof elementID == "string") 
	{
		return document.getElementById(elementID);
	}
	else
	{
		return elementID;
	}
}

//Focus first field
function fieldFocus() 
{
   // var textElements = 0;
	var focusField = -1;
	
	if(document.forms[0])
	{
		for (i = 0; i < document.forms[0].elements.length; i++)
		{
			if (document.forms[0].elements[i].type == "text" || document.forms[0].elements[i].type == "password") 
			{
				if (focusField < 0) 
				{
						focusField = i;
				}
			}
		}
		//put focus in first text or password field
		if(focusField > -1)
		{
			document.forms[0].elements[focusField].focus();
		}
	}
}