function process_fasttrack()
{
	var company_index = document.getElementById("company").selectedIndex;
	var company_url = document.getElementById("company").options[company_index].value;
	var order_type_index = document.getElementById("ordertype").selectedIndex;
	var order_path = document.getElementById("ordertype").options[order_type_index].value;
	var action_to_do = getRadioButtonValue(document.frm_fasttrack.radioaction);
	var user_name = document.getElementById("user_name").value;
	var user_password = document.getElementById("user_password").value;

	if ( company_index == 0 )
	{
		alert("Please select an NTA company.");
		document.getElementById("company").focus();
		return false;
	}

	if ( isWhitespace(user_name) )
	{
		alert("Please enter your user name.");
		document.getElementById("user_name").focus();
		return false;
	}

	if ( isWhitespace(user_password) )
	{
		alert("Please enter your password");
		document.getElementById("user_password").focus();
		return false;
	}

	if ( action_to_do == "place" )
	{
		if ( order_type_index == 0 )
		{
			alert("Please select an order type.");
			document.getElementById("ordertype").focus();
			return false;
		}
	}
	else
	{
		order_path = "orders/vieworders.cfm";
	}

	// Trax-based sites have state-based domains, Tempest ones dont
	if ( company_url.indexOf("nta_state") == -1 )
	{
		// This is for Trax based sites
		document.getElementById("frm_fasttrack").action = company_url + order_path;
	}
	else
	{
		// This is for Tempest sites
		document.getElementById("frm_fasttrack").action = company_url;
	}

	return true;
}

function process_mini_fasttrack()
{
	var company_index = document.getElementById("company").selectedIndex;
	var company_url = document.getElementById("company").options[company_index].value;
	var user_name = document.getElementById("user_name").value;
	var user_password = document.getElementById("user_password").value;

	if ( company_index == 0 )
	{
		alert("Please select an NTA company.");
		document.getElementById("company").focus();
		return false;
	}

	if ( isWhitespace(user_name) )
	{
		alert("Please enter your user name.");
		document.getElementById("user_name").focus();
		return false;
	}

	if ( isWhitespace(user_password) )
	{
		alert("Please enter your password");
		document.getElementById("user_password").focus();
		return false;
	}

	document.getElementById("frm_fasttrack").action = company_url + "orders/placeorder.cfm";

	return true;
}

function newCustomer()
{
	var company_index = document.getElementById("company").selectedIndex;
	var company_url = document.getElementById("company").options[company_index].value;

	if ( company_index == 0 )
	{
		alert("Please select an NTA company.");
		document.getElementById("company").focus();
		return false;
	}

	if ( company_url.indexOf("loginout.process") >= 0 )
	{
		company_url = company_url.replace("loginout.process", "public.becomeclient");
	}
	else
	{
		company_url = company_url + "emailorders/placeemailorder.cfm";
	}

	window.location.href = company_url;
}

function company_onChange()
{
	var company_index = document.getElementById("company").selectedIndex;

	if ( company_index == 10 || company_index == 11 || company_index == 20 )
	{
		alert("Orders for the states of Maryland, Ohio and Pennsylvania are\nnow being processed through our Multi State division website.\n\nYour selection has been updated to reflect this.");
		document.getElementById("company").selectedIndex = 1;
	}
}