
	/********* ALF ***********/
	
		function alf_json_form( url, form, button, onSuccess )
		{
		
			alf_json( url, $( form ).serialize( true ), button, onSuccess );
				
		}
		
		///////////// Clear json
		
		function alf_json( url, parameters, button, onSuccess )
		{
		
			var trans = '';
			
			if( button != null )  {
				button.disabled = true;
				parameters[ 'button' ] = button.id;
			}
				
			new Ajax.Request( url, {
					method: 'post',
					parameters: parameters,
					requestHeaders: { Accept: 'application/json' },
					onSuccess: function( transport ) {
						var json = transport.responseText.evalJSON( true );
						
						if( json[ 'signal' ] == 'ERROR' ) {
							
							alf_msg( json[ 'msg' ] );
							
						} else if( json[ 'signal' ] == 'OK' ) {
							
							if( onSuccess != null ) {
								onSuccess( json );	
							}
								
						} else if( json[ 'signal' ] == 'LOGIN FAIL' ) {
						
							alf_msg( 'Bitte loggen Sie sich neu ein. Die SESSION ist abgelaufen.' );
							if( login_url != undefined ) {
								location = login_url;
							}
						
						} else {
							
							alf_msg( 'Interner Fehler: JSON liefert keine verwertbare Antwort' );
							
						}
						
						if( json[ 'button' ] != null && $( json[ 'button' ] ) != undefined ) 
							$( json[ 'button' ] ).disabled = false;
								
					}
				} );
				
		}
		
		//////// Roundabout
		
		/////// MSG BOX
		
		function alf_msg( msg ) {
			$( 'alf_msg' ).innerHTML = msg;
			$( 'alf_blackbox' ).style.display = '';
			$( 'alf_msg_box' ).style.display = '';
		}
		
		function alf_msg_hide() {
			$( 'alf_blackbox' ).style.display = 'none';
			$( 'alf_msg_box' ).style.display = 'none';
		}
