<!--

	$(document).ready
	(
		function()
		{
			$('a[href=#]').attr('href', 'javascript:void(0);');
			
			var hintShowFunc = function()
			{
				$('#hint-' + $(this).attr('name') + ':hidden').slideDown();
				return false;
			}
			
			var hintHideFunc = function()
			{
				$('#hint-' + this.name + ':visible').slideUp();
				return false;
			}
			
			$('.hint-show').click(hintShowFunc).livequery('click', hintShowFunc);
			$('.hint-hide').click(hintHideFunc).livequery('click', hintHideFunc);
			
			$('.prompt').focus
			(
				function()
				{
					if (this.value == 'enter your email address to subscribe to the weekly truthQ' ||
						this.value == 'suggest a question to be considered for a weekly truthQ') this.value = '';
				}
			);
			
			$('div.ajax-voting a').click
			(
				function()
				{
					$(this).parent().html($('div.ajax-loader').html());
					
					$.ajax
					({
						type: 'POST',
						url: $(this).attr('href'),
						dataType: 'xml',
						data: 'mode=ajax-vote',
						success: votingSuccess
					});
					
					return false;
				}
			);
			
			function votingSuccess(data)
			{
				var response = $('response', data);
				var pollId = $('poll-id', response).text();
				
				$('div#poll-' + pollId).fadeOut
				(
					'slow',
					function()
					{
						$(this).html($('message', response).text()).fadeIn('slow');
					}
				);
				
				if ($('status', response).text() == 'OK')
				{
					$('div#poll-hint-' + pollId).fadeOut
					(
						'slow',
						function()
						{
							$(this).html($('poll-hint', response).text()).fadeIn('slow');
						}
					);
				}
				
				return false;
			}
		}
	);

//-->