<!-- hide this script from non-javascript-enabled browsers
/* ---------------------------------------------------------------------------------------- 
*  All intellectual property rights relating to this code are owned by J Business Solutions 
*  ----------------------------------------------------------------------------------------
*  Title: Auto tab 
*  Purpose: Auto tab through form fields
*           The tab key is no longer required to tab between fields.
*           The user can go to the next form field just by pressing
*           the enter key instead of the tab key.
* 
*  Author: Joe Frausto Jr.
*  Created: 01/09/2001
*  History: Modified 05/22/2001
* 
*  ------------------------------------------------------------------------------------ */

var curField = ""; // name of currently selected field
var tabBy = 1;     // number of fields to tab by

if (navigator.appName == 'Netscape')
	netscape = true;
else if (navigator.appName == 'Microsoft Internet Explorer')
	netscape = false;

//function keyDown(DnEvents)
function keyUp(DnEvents)
{ // handles keypress
	// determines whether Netscape or Internet Explorer
	k = (netscape) ? DnEvents.which : window.event.keyCode;
	if (k != 0 && k != 9 && k != 16)
		doAutoTab(k);
}
document.onkeyup = keyUp; // check keystroke
if (netscape) document.captureEvents(Event.KEYUP);

function getIndex(inField)
{
	var index = -1;
	var i = 0;
	var found = false;
	while (i < inField.form.length && index == -1)
		if (inField.form[i] == inField)
			index = i;
		else
			i++;
	return index;
}

function doAutoTab(iKey)
{
	if (curField.name != 'Quote') { // send focus to next box
		if (tabBy > 0)
			if (iKey == 8 || iKey == 37 || iKey == 38)
				curField.form[(getIndex(curField) - tabBy) % curField.form.length].focus();
			else
				curField.form[(getIndex(curField) + tabBy) % curField.form.length].focus();
		return false;
	}
}
// stop hiding -->

