/****************************************************************************
   ensures that the first form element receives focus on a form when it loads

   usage: <BODY onLoad="firstFocus()">  
   
*/

function firstFocus()
{
   if (document.forms.length > 0)
   {
      var TForm = document.forms[0];
      for (i=0;i<TForm.length;i++)
      {
         if ((TForm.elements[i].type=="text")||
           (TForm.elements[i].type=="textarea")||
           (TForm.elements[i].type.toString().charAt(0)=="s"))
         {
            if (document.forms[0].elements[i].disabled == false) {
	            document.forms[0].elements[i].focus();
	            break;
	          }
         }
      }
   }
}



/****************************************************************************
    autoselects a given form element
*/

function autoSelect (item)
{
	item.select();
}

