///////////////////////////////////////////////////////////////////////////////
//
// Signal Type Logic Scripts
// for Microsoft Train Simulator
//
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003-2009
// Timas S. Adamaitis
// Alexey G. Zaykov
// All rights reserved
//
// Mailto: boxplace@yandex.ru
//
///////////////////////////////////////////////////////////////////////////////
//
// 3-light signals
//
// Stop - Cab White
// Stop_And_Proceed - Red 0
// Restricting - White (Shunter or Welcome) 20 or 25
// Approach_1 - Yellow 60
// Approach_2 - Two Yellow, Two Yellow with Flashing 40
// Approach_3 - Two Yellow with Green Bar 60
// Clear_1 - Other signals with Green Bar 80
// Clear_2 - Green, Green Flashing, Yellow Flashing
//
///////////////////////////////////////////////////////////////////////////////
//
// 4-light signals
//
// Stop - Cab White
// Stop_And_Proceed - Red 0
// Restricting - White (Shunter or Welcome) 25
// Approach_1 - Yellow 40
// Approach_2 - Two Yellow, Two Yellow with Flashing 40
// Approach_3 - Two Yellow with Green Bar 60
// Clear_1 - Other signals with Green Bar 80
// Clear_2 - Green, Green Flashing, Yellow Flashing, YellowGreen
//
///////////////////////////////////////////////////////////////////////////////

SCRIPT T_Stop_W

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_RESTRICTING;
	draw_state = def_draw_state (state);

SCRIPT T_Stop_R

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	draw_state = def_draw_state (state);

SCRIPT T_Signal_V

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_CLEAR_2;
	draw_state = def_draw_state (state);

SCRIPT T_Always_R

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP;
	if (enabled)
	{
		state = SIGASP_STOP_AND_PROCEED;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Always_G

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_CLEAR_2;
	draw_state = def_draw_state (state);

SCRIPT T_Head_G

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	next_state = next_sig_lr (SIGFN_NORMAL);
	if (next_state ># SIGASP_RESTRICTING)
	{
		state = SIGASP_CLEAR_2;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_G

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	next_state = next_sig_lr (SIGFN_NORMAL);
	if (next_state ># SIGASP_RESTRICTING)
	{
		state = SIGASP_CLEAR_2;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_GR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_STOP)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_GR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_WGR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_WGR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_GR_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_GR_GW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_Gxx_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_GxG_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_YG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	next_state = next_sig_lr (SIGFN_NORMAL);
	if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
	{
		state = SIGASP_APPROACH_1;
	}
	else
	{
		state = SIGASP_CLEAR_2;
	}
	draw_state = def_draw_state (state);
	if (state >=# SIGASP_APPROACH_1)
	{
		if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 3;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 4;
		}
	}

SCRIPT T_Head_YRY

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_APPROACH_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_YRY

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_APPROACH_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_xR_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
		{
			state = SIGASP_RESTRICTING;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_YR_Gx_N

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		draw_state = def_draw_state (state);
		if (enabled)
		{
			state = SIGASP_RESTRICTING;
			draw_state = def_draw_state (state);
			if (sig_feature (SIGFEAT_USER1))
			{
				draw_state = 3;
			}
			else if (sig_feature (SIGFEAT_USER2))
			{
				draw_state = 4;
			}
			else if (sig_feature (SIGFEAT_USER3))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
		state = SIGASP_RESTRICTING;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
		state = SIGASP_RESTRICTING;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_WB

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
			state = SIGASP_STOP_AND_PROCEED;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_WB

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
			state = SIGASP_STOP_AND_PROCEED;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_WRW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
		state = SIGASP_RESTRICTING;
	}
	draw_state = def_draw_state (state);
	if ((state ==# SIGASP_RESTRICTING) && (block_state() ==# BLOCK_CLEAR))
	{
		draw_state = 2;
	}

SCRIPT T_Small_WRW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
		state = SIGASP_RESTRICTING;
	}
	draw_state = def_draw_state (state);
	if ((state ==# SIGASP_RESTRICTING) && (block_state() ==# BLOCK_CLEAR))
	{
		draw_state = 2;
	}

SCRIPT T_Head_WBW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
			state = SIGASP_RESTRICTING;
	}
	draw_state = def_draw_state (state);
	if ((state ==# SIGASP_RESTRICTING) && (block_state() ==# BLOCK_CLEAR))
	{
		draw_state = 2;
	}

SCRIPT T_Small_WBW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
			state = SIGASP_RESTRICTING;
	}
	draw_state = def_draw_state (state);
	if ((state ==# SIGASP_RESTRICTING) && (block_state() ==# BLOCK_CLEAR))
	{
		draw_state = 2;
	}

SCRIPT T_Head_YGR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if ((enabled || !sig_feature (SIGFEAT_USER1)) && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGR_Back

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else if (next_state ==# SIGASP_STOP )
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_YG_R

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YG_RW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGR_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGR_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGR_xxW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGx_RxW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Yx_RW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YxR_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YxR_xxW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Yxx_RxW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YxR_YW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YxR_YW_no40

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Yx_RY_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_xGR_GW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_xGR_xG_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_YxR_Yx_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGR_Yx_G

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_3;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGR_Yx_GG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_3;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YG_RY_G

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_3;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YG_RY_GG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_3;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Yx_RY_x_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Yx_RY_xx_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_xGR_xG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_YxR_Yx_x_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YxR_Yx_xx_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YxR_YxW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGR_Yxx_G

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_3;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGR_Yxx_GG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_3;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YxY_RY

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_RESTRICTING;
				draw_state = def_draw_state (state);
			}
			else
			{
				state = SIGASP_APPROACH_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 5;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 3;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 2;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}
	
SCRIPT T_Head_YB_RW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_RESTRICTING;
			}
			else if (next_state ==# SIGASP_STOP_AND_PROCEED)
			{
				state = SIGASP_APPROACH_2;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}
	
SCRIPT T_Small_BR_YW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_RESTRICTING;
			}
			else if (next_state ==# SIGASP_STOP_AND_PROCEED)
			{
				state = SIGASP_APPROACH_2;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}
	
SCRIPT T_Head_YxY_RxW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YxY_Rx_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGx_R

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_YGR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);
	if (state ==# SIGASP_CLEAR_2)
	{
		if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 4;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 5;
		}
	}

SCRIPT T_Small_GR_YW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_YGW_Rx

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_YxW_Rx

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_YGx_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_YxY_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_GYx_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_GxG_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_YRG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if ((enabled || !sig_feature (SIGFEAT_USER1)) && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YR_G

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YR_GW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRG_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRG_W

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRG_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRG_xxW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YR_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRx_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRx_xxW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRx_YW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YR_xY_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_xRG_WG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_xRG_xG_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_YRx_xYW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRx_xY_x_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRx_xY_xx_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRG_xYx_G

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_2;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRG_xYx_GG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_2;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRG_xY_G

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_2;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRG_xY_GG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_2;
			}
			else
			{
				state = SIGASP_CLEAR_1;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_CLEAR_1) && (next_state ==# SIGASP_APPROACH_2))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRx_YxY

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_RESTRICTING;
				draw_state = def_draw_state (state);
			}
			else
			{
				state = SIGASP_APPROACH_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 5;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 3;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 2;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YRx_Yxx_I

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_YRG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);
	if (state ==# SIGASP_CLEAR_2)
	{
		if (next_state ==# SIGASP_APPROACH_1)
		{
			draw_state = 2;
		}
		else if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 5;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 6;
		}
	}

SCRIPT T_Small_YxG_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);
	if (state ==# SIGASP_CLEAR_2)
	{
		if (next_state ==# SIGASP_APPROACH_1)
		{
			draw_state = 2;
		}
		else if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 5;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 6;
		}
	}

SCRIPT T_Small_xRx_YWG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_YRY_xWx

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_GRG_xWx

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_Route_Left

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_Right

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_-

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_1

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_2

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_3

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_4

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_5

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_6

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_7

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_8

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_9

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_0

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Route_10

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_Left

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_Right

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_-

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_1

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_2

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_3

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_4

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_5

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_6

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_7

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_8

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_9

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_0

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_Route_10

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if (next_state ==# SIGASP_RESTRICTING)
			{
				state = SIGASP_CLEAR_2;
				draw_state = 1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
				if (next_state ==# SIGASP_STOP_AND_PROCEED)
				{
					draw_state = 0;
				} else if (next_state ==# SIGASP_CLEAR_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_2)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_APPROACH_1)
				{
					draw_state = 1;
				} else if (next_state ==# SIGASP_STOP)
				{
					draw_state = 0;
				}
			}
		}
		else
		{
			draw_state = def_draw_state (state);
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Route

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float		next_state;

	state = SIGASP_CLEAR_2;
	draw_state = def_draw_state (state);

SCRIPT T_Head_PS45_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
		state = SIGASP_RESTRICTING;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_PS45_WB

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (block_state() !=# BLOCK_JN_OBSTRUCTED)
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((block_state() ==# BLOCK_OCCUPIED) || (next_state ==# SIGASP_STOP) || (next_state ==# SIGASP_RESTRICTING) || (next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED))
		{
			state = SIGASP_RESTRICTING;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_PS45_WGR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_PS45_GR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Head_PS45_YG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	next_state = next_sig_lr (SIGFN_NORMAL);
	if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
	{
		state = SIGASP_APPROACH_1;
	}
	else
	{
		state = SIGASP_CLEAR_2;
	}
	draw_state = def_draw_state (state);
	if (state >=# SIGASP_APPROACH_1)
	{
		if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 3;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 4;
		}
	}

SCRIPT T_Head_PS45_YGR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if ((enabled || !sig_feature (SIGFEAT_USER1)) && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);
	if (state ==# SIGASP_CLEAR_2)
	{
		if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 4;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 5;
		}
	}

SCRIPT T_Head_PS45_YGR_W

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
		else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 6;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_PS45_YxR_YW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
		else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 4;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_PS45_xGR_GW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_PS45_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
		state = SIGASP_RESTRICTING;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_PS45_WB

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (block_state() !=# BLOCK_JN_OBSTRUCTED)
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((block_state() ==# BLOCK_OCCUPIED) || (next_state ==# SIGASP_STOP) || (next_state ==# SIGASP_RESTRICTING) || (next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED))
		{
			state = SIGASP_RESTRICTING;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_PS45_WGR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_PS45_GR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Small_PS45_YGR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);
	if (state ==# SIGASP_CLEAR_2)
	{
		if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 4;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 5;
		}
	}

SCRIPT T_Tunnel_WR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() !=# BLOCK_JN_OBSTRUCTED))
	{
		state = SIGASP_RESTRICTING;
	}
	draw_state = def_draw_state (state);

SCRIPT T_Tunnel_WB

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (block_state() !=# BLOCK_JN_OBSTRUCTED)
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((block_state() ==# BLOCK_OCCUPIED) || (next_state ==# SIGASP_STOP) || (next_state ==# SIGASP_RESTRICTING) || (next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED))
		{
			state = SIGASP_RESTRICTING;
		}
	}
	draw_state = def_draw_state (state);

SCRIPT T_Tunnel_YGR

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);
	if (state ==# SIGASP_CLEAR_2)
	{
		if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 4;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 5;
		}
	}
	else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
	{
		draw_state = 3;
	}

SCRIPT T_Tunnel_YRG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);
	if (state ==# SIGASP_CLEAR_2)
	{
		if (next_state ==# SIGASP_APPROACH_1)
		{
			draw_state = 2;
		}
		else if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 5;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 6;
		}
	}
	else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
	{
		draw_state = 7;
	}

SCRIPT T_Tunnel_YG_RW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
		else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 6;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_Yx_RW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YR_GW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
		else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 7;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YR_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YGR_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
		else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 6;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YxR_YW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
		else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 4;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YxR_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YRG_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
		else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 7;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YRx_YW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
		else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 4;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YRx_xW

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YGR_Repeater

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);
	if (state ==# SIGASP_CLEAR_2)
	{
		if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 4;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 5;
		}
	}
	else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
	{
		draw_state = 3;
	}

SCRIPT T_Small_xxW_YRG

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_YxW_xRx

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ( ( sig_feature (SIGFEAT_USER1) || (next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) ) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 4;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 5;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_xxW_YRY

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
		if ((state >=# SIGASP_APPROACH_1) && (next_state ># SIGASP_RESTRICTING))
		{
			draw_state = 3;
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YR_xW_1

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Small_YxW_Rx_1

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_Yx_RW_1

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else
			{
				state = SIGASP_APPROACH_2;
			}
		}
		draw_state = def_draw_state (state);
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Head_YGR_xW_ALSO

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 2;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Always_W

	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;

	//if(enabled) {
        	state = SIGASP_RESTRICTING;
	//} else {
	//	state = SIGASP_STOP;
	//}
	draw_state = def_draw_state (state);

 SCRIPT T_Head_YRG_1

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	if (route_set())
	{
		state = SIGASP_STOP_AND_PROCEED;
		if (enabled && (block_state() ==# BLOCK_CLEAR))
		{
			next_state = next_sig_lr (SIGFN_NORMAL);
			if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
			{
				state = SIGASP_RESTRICTING;
			}
			else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
			{
				state = SIGASP_APPROACH_1;
			}
			else
			{
				state = SIGASP_CLEAR_2;
			}
		}
		draw_state = def_draw_state (state);
		if (state ==# SIGASP_CLEAR_2)
		{
			if (next_state ==# SIGASP_APPROACH_1)
			{
				draw_state = 2;
			}
			else if (next_state ==# SIGASP_APPROACH_2)
			{
				draw_state = 5;
			}
			else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
			{
				draw_state = 6;
			}
		}
	}
	else
	{
		state = SIGASP_STOP;
		if (block_state() ==# BLOCK_JN_OBSTRUCTED)
		{
			state = SIGASP_STOP_AND_PROCEED;
		}
		draw_state = def_draw_state (state);
	}

SCRIPT T_Tunnel_YRG_Repeater

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	next_sig_mr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	extern float	sig_feature ();
	float		next_state;

	state = SIGASP_STOP_AND_PROCEED;
	if (enabled && (block_state() ==# BLOCK_CLEAR))
	{
		next_state = next_sig_lr (SIGFN_NORMAL);
		if ((next_state ==# SIGASP_STOP) || ((next_sig_mr (SIGFN_NORMAL) ==# SIGASP_STOP_AND_PROCEED) && (next_state ==# SIGASP_RESTRICTING)))
		{
			state = SIGASP_RESTRICTING;
		}
		else if ((next_state ==# SIGASP_STOP_AND_PROCEED) || (next_state ==# SIGASP_RESTRICTING))
		{
			state = SIGASP_APPROACH_1;
		}
		else
		{
			state = SIGASP_CLEAR_2;
		}
	}
	draw_state = def_draw_state (state);
	if (state ==# SIGASP_CLEAR_2)
	{
		if (next_state ==# SIGASP_APPROACH_1)
		{
			draw_state = 2;
		}
		else if (next_state ==# SIGASP_APPROACH_2)
		{
			draw_state = 5;
		}
		else if ((next_state ==# SIGASP_APPROACH_3) || (next_state ==# SIGASP_CLEAR_1))
		{
			draw_state = 6;
		}
	}
	else if ((state ==# SIGASP_RESTRICTING) && sig_feature (SIGFEAT_USER1))
	{
		draw_state = 7;
	}

