			
				
				MerkzettelLogin = Class.create({
				
					//
					//	initialize
					//
					initialize: function(_form) {
					
						// system variables
						this._form = $(_form);
						this._form_data = this._form.serialize();
						
						// initialize
						this.send_data();						
					
					},
					
					//
					//	send data
					//
					send_data: function() {
					
						new Ajax.Request('./ajax.php', {
						
							method: 'post',
							parameters: this._form_data+'&handler=0',
							onFailure: function() {
								alert('ajax request error');
							},
							onSuccess: function(t) {
								t = eval('('+t.responseText+')');
								// Error
								if(t.state == '0') {
									alert(t.error);
								}
								// Success
								if(t.state == '1') {
									this.set_session();
								}
							}.bind(this)
						
						});
					
					},
					
					//
					//	set session
					//
					set_session: function() {
					
						new Ajax.Request('./merkzettel.ajax.php', {

							method: 'post',
							parameters: this._form_data,
							onFailure: function() {
								alert('ajax request error');
							},
							onSuccess: function(t) {
								t = eval('('+t.responseText+')');
								// Success
								if(t.state == '1') {
									window.location.reload();
								}
							}.bind(this)
						
						});
					
					}
				
				});
				
				
				
				
				
				
				
				
				MerkzettelLogout = Class.create({
				
					//
					//	initialize
					//
					initialize: function(request) {
					
						// system variables
						this._form_data = request;
						
						// initialize
						this.send_data();						
					
					},
					
					//
					//	send data
					//
					send_data: function() {
					
						new Ajax.Request('./ajax.php', {
						
							method: 'post',
							parameters: this._form_data+'&handler=1',
							onFailure: function() {
								alert('ajax request error');
							},
							onSuccess: function(t) {
								t = eval('('+t.responseText+')');
								// Error
								if(t.state == '0') {
									alert(t.error);
								}
								// Success
								if(t.state == '1') {
									this.set_session();
								}
							}.bind(this)
						
						});
					
					},
					
					//
					//	set session
					//
					set_session: function() {
					
						new Ajax.Request('./merkzettel.logout.ajax.php', {

							method: 'post',
							parameters: this._form_data,
							onFailure: function() {
								alert('ajax request error');
							},
							onSuccess: function(t) {
								t = eval('('+t.responseText+')');
								// Success
								if(t.state == '1') {
									window.location.reload();
								}
							}.bind(this)
						
						});
					
					}
				
				});
				