/*
 * 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 = 'confirmerSoumission.php';
                this.getForm().getEl().dom.submit();
                },        
		labelAlign: 'top',
        title: 'Formulaire abr&eacute;g&eacute;',
        bodyStyle:'padding:5px',
        width: 627,
        items: [{
            layout:'column',
            border:false,
            items:[{
                columnWidth:.5,
                layout:'form',
                border:false,
                items: [{
                    xtype:'textfield',
                    fieldLabel: 'Nom ',
                    name: 'nom',
					allowBlank:false,
                    anchor:'90%'
                },{
                    xtype:'textfield',
                    fieldLabel: 'Entreprise ',
                    name: 'entreprise',
					allowBlank:false,
                    anchor:'90%'
                } ,{
                    xtype:'textfield',
                    fieldLabel: 'T&eacute;l&eacute;phone ',
                    name: 'telephone',
					allowBlank:false,
                    anchor:'90%'
                }]
            },{
                columnWidth:.5,
                layout:'form',
                border:false,
                items: [{
                    xtype:'textfield',
                    fieldLabel: 'titre ',
                    name: 'titre',
					allowBlank:false,
                    anchor:'90%'
                },{
					xtype:'textfield',
                    fieldLabel: 'Secteur d\'activit&eacute; ',
                    name: 'secteur',
					allowBlank:false,
                    anchor:'90%'
                },{					
                    xtype:'textfield',
                    fieldLabel: 'Courriel ',
                    name: 'courriel',
					allowBlank:false,
                    vtype:'email',
                    anchor:'90%'
                }]
            }]
        
        }],

        buttons: [{
            text: 'Soumettre',
			handler: submitForm
        }]
    });


    function submitForm(){
		tab2.submit();
    }
	
	
	
    tab2.render(document.getElementById('formulaire'));
});
