// JavaScript Document 

SPROFI.KontaktFormConfig = {
			id:'KontaktForm',
			title: 'Kontaktformular: ',
			renderTo: 'MainContent',
			url:'/kontaktform/send.php',
			loadMask:true,
			monitorValid: true,
			frame:true,
			autoHeight:true,
			autoWidth:true,
			width:320,
			center:true,
			stateful: true,
			hidden: true,
			layout:'form',
			items:[
					{
						items:[
								{
									xtype:'fieldset',
									title:'Ihre Kontaktdaten:',
									autoHeight:true,
									items:[
											
											{
												xtype:'textfield',
												id:'KontaktVorname',
												fieldLabel:'Vorname',
												name:'KontaktVorname',
												emptyText:'Ihr Vorname',
												width:'98%',
												allowBlank:false
											},								
											{
												xtype:'textfield',
												id:'KontaktName',
												fieldLabel:'Name',
												name:'KontaktName',
												emptyText:'Ihr Nachname',
												width:'98%',
												allowBlank:false
											},								
											{
												xtype:'textfield',
												id:'KontaktAdresse',
												fieldLabel:'Adresse',
												name:'KontaktAdresse',
												emptyText:'Ihre Anschrift',
												width:'98%',
												allowBlank:false
											},								
											{
												xtype:'textfield',
												id:'KontaktPLZ',
												fieldLabel:'PLZ',
												name:'KontaktPLZ',
												emptyText:'Ihre Postleitzahl',
												width:'98%',
												allowBlank:false
											},								
											{
												xtype:'textfield',
												id:'KontaktOrt',
												fieldLabel:'Ort',
												name:'KontaktOrt',
												emptyText:'Ihr Wohnort',
												width:'98%',
												allowBlank:false
											},								
											{
												xtype:'textfield',
												id:'KontaktTel',
												fieldLabel:'Telefon',
												name:'KontaktTel',
												emptyText:'Ihre Telefonummer für Rückrufe',
												width:'98%',
												allowBlank:false
											},
											
											{
												xtype:'textfield',
												id:'KontaktEmail',
												fieldLabel:'eMail',
												name:'KontaktEmail',
												emptyText:'Ihre Email-Adresse',
												width:'98%',
												allowBlank:false,
												vtype:'email'
											}
											
									]
								},
								
								{
									xtype:'fieldset',
									title:'Ihre Nachricht an uns',
									autoHeight:true,
									autoWidth:true,
									items:[
										{
											xtype:'textarea',
											id:'KontaktNachricht',
											name:'KontaktNachricht',
											emptyText:'Ihre Nachricht an uns',
											hideLabel:true,
											width:'98%',
											height:100,
											allowBlank: false
										}
									]								
								}
						]
					
					}			
			],
			
			listeners: {
				beforerender: function(){
					this.renderTo= Ext.getBody();
				}
			},
			
			buttons:[
			
				{
					text: 'Senden',
					//scope:this,
					handler:function(){
						Ext.getCmp('KontaktForm').getForm().submit({
							//scope:this,
							success: function(f,a){
								Ext.Msg.alert('Versand erfolgreich','Ihre Nachricht wurde<br/>erfolgreich versendet.');
								//var test =Ext.get('KontaktForm');
								Ext.getCmp('KontaktForm').getForm().reset();
								//this.getForm().reset();
							},
							failure: function(f,a){
								Ext.Msg.alert('Fehler beim Versand','Ich konnte Ihre Nachricht leider nicht versenden!');
							}						
						})
					}
				},
				
				{
					text: 'Zurücksetzen',
					//scope:this,
					handler:function(){
						Ext.getCmp('KontaktForm').getForm().reset();
					}
				}
			
			]

};
