Ext.onReady(function(){
			var start=new Date().getTime();
			Ext.QuickTips.init();
			var storeCountry = new Ext.data.JsonStore({
				url: 'register.php5?mode=fetchCountryList', 			
				autoLoad: true,
				root: 'data',
				fields: [{name: 'Name'},{name: 'ISO-3'}]
			});
	

			var contactForm = new Ext.FormPanel({
				url: 'contact.php5?mode=contact_request',
				id: 'contactForm',
				renderTo: 'contactFrm',
				scrollable: true,
				width: 500,
				border: false,
				bodyStyle: 'background-color:#000;color:#fff;',
				style: 'background-color:#000;color:#fff;position:absolute;left:23%;right:23%;padding-top: 10px;',
				defaults: {
					width: 260,
					allowBlank: false,
					msgTarget: 'under',
							blankText: (webLang=='de')?'Bitte geben Sie hier was ein (Pflichtfeld)':'This field is required'
				},

				items:[{
					xtype: 'hidden',
					id: 'modification_date',
					value: start
				},{
					xtype: 'textfield',
					id: 'co_name',
					fieldLabel: 'Name*'
				},{
					xtype: 'textfield',
					id: 'co_vorname',
					fieldLabel: (webLang=='de')?'Vorname*':'Firstname*'
				},{
					xtype: 'textfield',
					id: 'co_strasse',
					fieldLabel: (webLang=='de')?'Straße, Hausnr.*':'Street, No.*'
				},{
					layout: 'column',
					border: false,
					frame: false,
					width: 500,
					style: 'margin-bottom:10px;',
					bodyStyle: 'background-color:#000;color:#fff;',
					items:[{
						layout: 'form',
						bodyStyle: 'background-color:#000;color:#fff;',
						frame: false,
						width: 180,
						border: false,
						items:[{
							xtype: 'numberfield',
							id: 'co_plz',
							width: 60,
							allowBlank: false,
							msgTarget: 'side',
							blankText: (webLang=='de')?'Bitte geben Sie hier was ein (Pflichtfeld)':'This field is required',
							fieldLabel: (webLang=='de')?'Plz* / Ort*':'ZIP* / City*'
						}]
					},{
						layout: 'form',
						bodyStyle: 'background-color:#000;color:#fff',
						border: false,
						frame: false,
						items:[{
							xtype: 'textfield',
							id: 'co_ort',
							width: 185,
							allowBlank: false,
							blankText: (webLang=='de')?'Bitte geben Sie hier was ein (Pflichtfeld)':'This field is required',
							msgTarget: 'under',
							hideLabel: true
						}]

					}]
				},{
					xtype: 'combo',
					name: 'c_land',
					id: 'id_land',
					hiddenName: 'co_land',
					mode: 'local',
					width: 230,
					fieldLabel: (webLang=='de')?'Land*':'Country*',
					displayField: 'Name',
					valueField: 'ISO-3',
					store: storeCountry,
					typeAhead: true,
			   		triggerAction: 'all',
					selectOnFocus: true,
					forceSelection: true,
					listWidth:'240'//,
					//allowBlank: false
				},{
					xtype: 'textfield',
					id: 'co_telefon',
					fieldLabel: (webLang=='de')?'Telefon':'Phone',
					allowBlank: true
				},{
					xtype: 'textfield',
					fieldLabel: 'Email*',
					id: 'co_email',
					style: 'margin-bottom:10px;',
					vtype: 'email',
					vtypeText: (webLang=='de')?'Bitte geben Sie ein gültiges Emailkonto an':'Please enter a valid email address.'
				},{
					xtype: 'textfield',
					id: 'co_betreff',
					fieldLabel: (webLang=='de')?'Betreff*':'Subject*',
					allowBlank: false
				},{
					xtype: 'textarea',
					id: 'co_message',
					height: 150,
					fieldLabel: (webLang=='de')?'Nachricht*':'Message',
					allowBlank: false
				},{
					xtype: 'checkbox',
					id: 'co_newsletter',
					fieldLabel: 'Newsletter',
					inputValue: 'ps',
					checked: true,
					style: 'margin-top: 4px;',
					boxLabel: (webLang=='de')?'Ja, ich möchte den HKAudio-Newsletter':'Yes, i want to be informed about news'
				}],

				buttons:[{
text: (webLang=='de')?'Abschicken':'Send',
					scope: this,
					handler: function(btn,e){
						Ext.getCmp("modification_date").setValue((new Date().getTime()-start)/1000);
//						alert("Sie brauchten "+(new Date().getTime()-start)+" ms");
						Ext.getCmp("contactForm").getForm().submit({
							success: function(form,action){
								alert(action.result.message);
								location.href="index.php5";
							//	window.setTimeout('if(win=Ext.get("popupWindow")) win.remove(); Ext.get("page").setOpacity(1);',5000);
							},
							failure: function(form,action){
							}
						});
					}
				}]
			});
});

