/**
 * votingStatus.js
 * @author R.A. Ray
 * @version 0.1.0
 * @date 05/29/08
 * 
 * @requires /scripts/jquery/core.js
 */

var votingStatus = function ()
{
	$( '#voting' ).find( 'input[type=radio]' ).click( function ( i )
		{
			var selection = $( this ).next().text();
			
			$( this ).parents( '.category, .categoryAlt' ).find( '.status' ).fadeOut( 200, function ()
				{
					
					$( this ).html( 'You have chosen ' + selection + '.' )
						.removeClass( 'noVote' )
							.addClass( 'voteCast' )
								.fadeIn( 200 );
				} 
			);
		}
	);
	
	$( '.resetButton' ).click( function ()
		{
			$( '.status' ).each( function ()
				{
					$( this ).html( 'You have not voted in this category yet.' )
						.removeClass( 'voteCast' )
							.addClass( 'noVote' );
				}
			);
		}
	);
};

$( document ).ready(
	function ()
	{
		votingStatus();	
	}
);


