TaxTool.LearnOurMethodology = function()
{
	var win = null;
	var form;

	return {
		createParts: function()
		{
			
			form = new Ext.FormPanel({
				//width: 300,
				anchor: '100%',
				height: 320,
				frame: true,
				labelWidth: 75,
				labelAlign: 'top',
				bodyStyle: 'padding:5px; text-align: left;',
				monitorValid: true,

				items: [
					new Ext.form.TextArea({
							fieldLabel: 'Thank you for providing us with feedback - we appreciate any comments and suggestions on improving this tool.<br /><br /><span style="font-size:10px;">Please note: Your email address is not required, but you may provide it if you would like us to have the option of responding to you personally. We will not have access to any of your tax information.</span><br /><br />',
							labelSeparator: '',
							id: 'message',
							allowBlank: false,
							anchor: '100%',
							height: '120'
						}),
					new Ext.form.TextField({
							fieldLabel: 'Enter your email address (optional)',
							id: 'email',
							vtype: 'email',
							allowBlank: true,
							anchor: '100%'
						})
				],
				buttons:[{ 
	                text:'Submit',
	                handler:function(){
	                	if (!form.getForm().isValid()) { return; }

						Ext.Ajax.request({
							url: 'give-us-feedback.php',
							method: 'POST',
							form: form.getForm().getEl().dom,
							timeout: 250000,
			
							success: function (result, request)
							{
								if (result.responseText.indexOf('succ:') == 0)
								{
									var wnd = Ext.MessageBox.alert('Success', result.responseText.substring(5));
									var delayedHide = new Ext.util.DelayedTask(wnd.hide, wnd).delay(5000); 
								}
								else Ext.MessageBox.alert('Failed', result.responseText);
			
								win.hide();
							},
			
							failure: function (result, request) {
								Ext.MessageBox.alert('Failed', result.responseText);
								win.hide();
							}
						});
	                } 
            }] 
 
			});
		},

		init: function()
		{
			this.createParts();
			var rend = Ext.get('learn_feedback_holder');
			if (rend != 'undefined') {
				form.render(rend);
			}
			else
			{	
				alert('Container not found!Cant render form')
			}
		}
	};
}();
