window.addEvent('domready', function(){
	if($('newsletter') != null){
		var fx = {
			'loading': new Fx.Morph( 'nl-loading',{ duration: 500 } ),
			'success': new Fx.Morph( 'nl-success',{ duration: 1000 } ),
			'fail': new Fx.Morph( 'nl-fail',{ duration: 2000 } )
		};

		new FormCheck('newsletter',{
			submitByAjax:true,
			ajaxResponseDiv:'nl-response',
			onAjaxRequest: function(){
				fx.loading.start({
					'opacity': [1,0]
				});	
			},
			onAjaxSuccess : function(msg){
				fx.success.start({
					'opacity': [1,0]
				});	
			},
			onAjaxFailure : function(){
				fx.fail.start({
					'opacity': [1,0]
				});	
			}
		});
	}	
});
