$(document).ready( function() {
	$('#signin input.email, #newsletter input.email').focus( function() {
		$(this).css( 'background-image', 'none' );
	});
	$('#signin input.password').focus( function() {
		$(this).css( 'background-image', 'none' );
	});

	$('#newsletter form').submit( function() {

		$.post( $('#newsletter form').attr( 'action' ),
			$('#newsletter form').serialize(),
		  	function( data )
			{
				// Close window if success
				if ( data.result == 1 )
				{
					alert( 'Thank you for subscribing.' );
				}
			
				alert( data.message );
		  	},
			'json'
		);
		
		return false;
	});

	if ( $('#fma').length ) {
		
		$('#fma').crossSlide( {
				sleep: 4,
				fade: 2
			},
			[
				{ src: '/fast/images/fma/01.jpg' },
				{ src: '/fast/images/fma/02.jpg'   },
				{ src: '/fast/images/fma/03.jpg'  },
				{ src: '/fast/images/fma/04.jpg' }
			] );		
	}
	
	if ( $('#recentNews li span' ).length ) {
		$('#recentNews li span' ).click( function() {
			$('#recentNews li').removeClass( 'a' );
			$(this).parent().addClass( 'a' );
		});
	}
	
	if ( $('a.event').length )
	{
		$('a.event').fancybox( {
			'hideOnContentClick': false
		} );
	}
} );