

Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
var form10329738866877 = new Ext.FormPanel({
	title:"",
	bodyStyle:'padding:5px 5px 0',
	labelAlign: 'left',
	buttons: [{
		text: 'Submit Form',
		handler: function(){
			form10329738866877.getForm().submit({
			method:'post',
			waitTitle:'Saving Query',
			waitMsg:'Please wait while your query is sent',
			url:'/echo/modules/formbuilder/submit.jsp',
			params: {"formcode" : "-10329738866877"},
			success : function (fForm, action) {
				Ext.MessageBox.alert('Query saved', "The query has been sent succesfully");
				form10329738866877.getForm().reset();
			},
			failure : function (fForm, action) {
				if(action.failureType == 'server'){
					Ext.MessageBox.alert('Query could not be sent', action.result.message);
				} 
				else if (action.failureType == Ext.form.Action.LOAD_FAILURE) {
					Ext.MessageBox.alert('Query could not be sent', action.response.responseText);
				}
				else if (action.failureType == Ext.form.Action.CONNECT_FAILURE) {
					Ext.MessageBox.alert("Connection error", "Please contact support with the following: " + "Status: " + action.response.status +", Status Text: " + action.response.statusText);
				}
				else if (action.failureType == Ext.form.Action.CLIENT_INVALID) {
					Ext.MessageBox.alert('Validation failure', "Please fill in the required fields");
				}
				else{
					Ext.MessageBox.alert('Query could not be sent', "Your message could not be sent, please try again later.");
				}
			}
		});
	},
	scope: this
	}],
	items:[{"allowBlank":false,"xtype":"textfield","labelStyle":"font-size : 11px;","name":"name","fieldLabel":"Full Name&nbsp;<span class='nag'>*<\/span>"},{"allowBlank":false,"xtype":"textfield","labelStyle":"font-size : 11px;","name":"email","vtype":"email","fieldLabel":"E-mail Address&nbsp;<span class='nag'>*<\/span>"},{"allowBlank":false,"xtype":"textfield","labelStyle":"font-size : 11px;","name":"telephone","vtype":"alphanum","fieldLabel":"Telephone&nbsp;<span class='nag'>*<\/span>"},{"height":200,"allowBlank":false,"width":300,"xtype":"textarea","labelStyle":"font-size : 11px;","name":"message","fieldLabel":"Message&nbsp;<span class='nag'>*<\/span>"},{"hidden":true,"xtype":"datefield","name":"formdate","fieldLabel":"Date","hideLabel":true}]
});

$('form10329738866877').innerHTML = "";
Ext.onReady(function(){form10329738866877.render('form10329738866877');});
