        /**
         * initialize FormRefiller on all Forms
         */
		window.addEvent('domready',  function()
        {
		    //registerUploadForm();
		    registerMyTest()
			//test();  
			$$('form').each(function(form_element)
	        {
	            new FormRefiller(form_element);
	        });			
		});

		function test()
		{
			if(!$('myForm2'))
			{
				return false;
			}
		
			$('myForm2').addEvent('submit', function(e) {
			    /**
			     * Prevent the submit event
			     */
			    new Event(e).stop();
			 
			    /**
			     * send takes care of encoding and returns the Ajax instance.
			     * onComplete removes the spinner from the log.
			     */
			    this.send({
			        update: $('myForm2'),
			        onComplete: function() {
			        }
			    });
			});		    		
		}

		function registerMyTest()
		{
			if(!$('user_uploadFrame'))
			{
				return false;
			}	
			
			var test = new Asset.image('images/misc/ajax-loader.gif');			
					
			$('user_uploadFrame').addEvent('submit', function(e) 
			{
				$('ajaxWrapper').addClass('ajax-loading');
			});

			
		}
		


		function registerUploadForm()
		{
			if(!$('user_upload'))
			{
				return false;
			}
			var normalAction = $('user_upload').getProperty('action');
			normalAction = normalAction.replace('Ajax', '');
			
			
			normalAction = $('base_href').getProperty('href')+normalAction;
			$('user_upload').setProperty('action', normalAction.replace('SubmitArticle', 'SubmitArticleAjax'));
   		    console.log();
   		    
			$('user_upload').addEvent('submit', function(e) 
			{
				/**
				 * Prevent the submit event
				 */
				new Event(e).stop();
			 
				/**
				 * This empties the log and shows the spinning indicator
				 */
//				var log = $('user_upload').addClass('ajax-loading');
				$('ajaxWrapper').addClass('ajax-loading');
				/**
				 * send takes care of encoding and returns the Ajax instance.
				 * onComplete removes the spinner from the log.
				 */
				 
				 
				new Ajax($('user_upload').getProperty('action'), {update: $('user_upload'),
					method: 'post',
					onComplete: function() {
						//log.removeClass('ajax-loading');
						$('ajaxWrapper').removeClass('ajax-loading');
					}
				}).request(this);
			});
		}