//Ext.state.Manager.setProvider('new Ext.state.CookieProvider');
var feedbackform;
var feedbacktext;
var feedbackemail;
var feedbackname;
var feedbackph;
var feedbackmessage;
var feedbackchk1;
Ext.onReady(function() {
    Ext.QuickTips.init();
	function sendfeedback()
	{	if (feedbackform.getForm().isValid())
		{
			feedbackform.getForm().submit({
				url:'pages/index/sendfeedback.php',
				"success":function(form,action){ 
					 Ext.MessageBox.alert('Message', 'We have received your feedback information');
					 feedbackform.getForm().reset();
				},
				"failure":function(form, action) {
					Ext.MessageBox.alert('Message', 'Save failed');
				}
			
			});
		}
		else
		{	Ext.MessageBox.alert('Message', 'Please fill in the required field.');}
		
	
	}
	feedbackemail= new Ext.form.TextField({
		id:'contactusemail',
		name:'contactusemail',
		fieldLabel:'Your Email',
		vtype:'email',
		allowBlank:false,
		anchor:'90%'
	});
	feedbackname= new Ext.form.TextField({
		id:'contactusname',
		name:'contactusname',
		fieldLabel:'Your Name',
		allowBlank:false,
		anchor:'90%'
	});	
	feedbackph= new Ext.form.TextField({
		id:'contactusph',
		name:'contactusph',
		fieldLabel:'Your Moblie No',
		allowBlank:false,
		anchor:'90%',
		maskRe:/([0-9]+)$/	,
		blankText:'Pls Type Number'
	});
	feedbackmessage= new Ext.form.TextArea({
		id:'contactusmessage',
		name:'contactusmessage',
		fieldLabel:'Your Messages',
		allowBlank:false,
		width:500,
		height:58
	});
	feedbackform= new Ext.FormPanel({
		id:'feedbackform',
		name:'feedbackform',
		bodyStyle:'padding: 7px 5px 0',
		buttonAlign:'right',
		//layout:'column',
		//layout:'fit',
		frame:false,
		border:false,
		defaults:{msgTarget: 'side'	},
		height:155,
		items:[ 
				{	layout:'column',
					border:false,
					items:[
						{	columnWidth:.5,
							layout:'form',
							border:false,
							items:[	feedbackemail,feedbackname]
						},
						{	columnWidth:.5,
							layout:'form',
							border:false,
							items:[feedbackph]
						}
						]
				},feedbackmessage
			],
		buttons:[ '->',
					{	text:'<b>Submit</b>',
						handler:sendfeedback
					},'-',
					{	text:'<b>Cancel</b>',
						handler:function()
						{	feedbackform.getForm().reset();}
					}
				]
	});
	var apanel= new Ext.Panel({
		id:'apanel',
		name:'apanel',
		//layout:'border',
		frame:false,
		autoWidth:true,
		border:false,
		renderTo:'feedbackform',
		items:[feedbackform],
		autoScroll:true,
		tbar:[	
			new Ext.Toolbar.TextItem ("<p class=\"txt1\" style=\"font-size:11.5px;\">Your Feedback, Enquiry, We Value</p>")
			
		
		
		]	
		
	
	});

}); 

