var race1	=	{
	
	race1s:	[],
	varEl:	false,
	
	init:function()
	{
		if( !document.getElementById( 'race1_Value' ) )
			return false;
			
		this.varEl	=	document.getElementById( 'race1_Value' );
		
		if( this.varEl.value != '' )
		{
			this.activate( this.varEl.value );
		}
	},
	
	add:function( rid )
	{
		this.race1s.push( rid );
	},
	
	select:function( rid )
	{
		this.deactivateAll();
		this.activate( rid );
		
		this.varEl.value	=	rid;
	},
	
	activate:function( rid )
	{
		var imgEl	=	document.getElementById( 'race1_Image_'+rid );
		imgEl.src	=	'img/radio_1.gif';
	},
	
	deactivateAll:function()
	{
		var imgEl;
		
		for( var i = 0; i < this.race1s.length; i++ )
		{
			imgEl	=	document.getElementById( 'race1_Image_'+this.race1s[i] );
			imgEl.src	=	'img/radio_0.gif';
		}
	}
}


var race2	=	{
	
	race2s:	[],
	varEl:	false,
	
	init:function()
	{
		if( !document.getElementById( 'race2_Value' ) )
			return false;
			
		this.varEl	=	document.getElementById( 'race2_Value' );
		
		if( this.varEl.value != '' )
		{
			this.activate( this.varEl.value );
		}
	},
	
	add:function( rid )
	{
		this.race2s.push( rid );
	},
	
	select:function( rid )
	{
		this.deactivateAll();
		this.activate( rid );
		
		this.varEl.value	=	rid;
	},
	
	activate:function( rid )
	{
		var imgEl	=	document.getElementById( 'race2_Image_'+rid );
		imgEl.src	=	'img/radio_1.gif';
	},
	
	deactivateAll:function()
	{
		var imgEl;
		
		for( var i = 0; i < this.race2s.length; i++ )
		{
			imgEl	=	document.getElementById( 'race2_Image_'+this.race2s[i] );
			imgEl.src	=	'img/radio_0.gif';
		}
	}
}

