/*
 * Ext JS Library 2.0.2
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

Ext.onReady(function(){

    Ext.QuickTips.init();

    // turn on validation errors beside the field globally
    Ext.form.Field.prototype.msgTarget = 'side';

    var bd = Ext.getBody();


    /*
     * ================  Form 5  =======================
     */
    //bd.createChild({});
    var tab2 = new Ext.FormPanel
	({
		id: tab2,
		method:'post',
        onSubmit: Ext.emptyFn,
        submit: function() {
                this.getForm().getEl().dom.action = 'confirmerContact.php';
                this.getForm().getEl().dom.submit();
                },        
        labelAlign: 'top',
        title: 'Coordonnées',
        bodyStyle:'padding:5px',
        width: 627,
		height:265,
        items:
		[{
		 	layout:'column',
        	border:false,
			items:
			[{
				columnWidth:.5,
				layout: 'form',
				border:false,
				items: 
				[{
					xtype:'textfield',
					fieldLabel: 'Nom ',
					name: 'nom',
					allowBlank:true,
					anchor:'90%'
               	},
				{
					xtype:'textfield',
					fieldLabel: 'Téléphone ',
					name: 'telephone',
					allowBlank:true,
					anchor:'90%'
               	}]
           	},
			{
				columnWidth:.5,
				layout: 'form',
				border:false,
				items: 
				[{
					xtype:'textfield',
					fieldLabel: 'Entreprise ',
					name: 'entreprise',
					allowBlank:true,
					anchor:'90%'
               	},
				{					
					xtype:'textfield',
					fieldLabel: 'Courriel ',
					name: 'courriel',
					allowBlank:true,
					vtype:'email',
					anchor:'90%'
            	}]
			}]
       	},
		{
			columnWidth:1,
			layout:'form',
			border:false,
			items: 
			[{
				xtype:'textarea',
				fieldLabel: 'Commentaires ',
				name: 'commentaires',
				allowBlank:true,
				anchor:'95%'
			}]
		}],

       buttons: [{
            text: 'Soumettre',
			handler: submitForm
        }]
    });


    function submitForm(){
		tab2.submit();
    }
	

    tab2.render(document.getElementById('contact'));
});