// JavaScript Document

/*
 * Ext JS Library 2.1
 * 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();

    /*
     * ================  Simple form  =======================
     */
    //bd.createChild({tag: 'h2', html: 'Form 1 - Very Simple'});


    var simple = new Ext.FormPanel({
		standardSubmit: true,
        labelWidth: 114, // label settings here cascade unless overridden
        shadow:true,
        frame:false,
		title: 'Pré-réserver votre chambre',
        bodyStyle:'padding:5px 5px 5px',
        width: 370,
        defaults: {width: 222},
		defaultType: 'textfield',
        items: [{
                xype: 'textfield',
				frame:true,
				fieldLabel: 'Société ',
                name: 'societe',
                allowBlank:true
            },{
                xype: 'textfield',
                fieldLabel: 'Prénom ',
                name: 'prenom',
				allowBlank:false
            },{
                xype: 'textfield',
                fieldLabel: 'Nom ',
                name: 'nom',
                allowBlank:false
            }, {
                xype: 'textfield',
                fieldLabel: 'Email ',
                name: 'email',
                allowBlank:false,
                vtype:'email'
            },{
				fieldLabel: 'Adresse ',
				xtype: 'textarea',
				name: 'description'
			}, {
                xype: 'textfield',
                fieldLabel: 'Code postal ',
                name: 'cp',
                allowBlank:true
            }, {
                xype: 'textfield',
                fieldLabel: 'Ville ',
                name: 'ville',
                allowBlank:true
            }, {
                xype: 'numberfield',
                fieldLabel: 'Téléphone ',
                name: 'tel',
                allowBlank:true,
				maxLength: 15
            }, new Ext.form.DateField({
                fieldLabel: 'Date d\'arrivée ',
                name: 'arrivee'
			}), new Ext.form.DateField({
                fieldLabel: 'Date de départ ',
                name: 'depart'
			}),{
				fieldLabel: 'Hôtel préféré ',
				xtype: 'combo',
				store: ['Grand Hôtel', 'Patiotel'],
				name: 'hotel'
			},{
				fieldLabel: 'Type de chambre ',
				xtype: 'combo',
				store: ['Simple', 'Double', 'Twin deux lits', 'Triple'],
				name: 'chambre'
			},{
				fieldLabel: 'Chambre fumeur ',
				xtype: 'combo',
				store: ['Oui', 'Non'],
				name: 'fumeur'
			}, {
				fieldLabel: 'Précisions ',
				xtype: 'textarea',
				name: 'precisions'
			}
			
        ],

        buttons: [{
            text: 'Envoyer',
			handler: function() {
				//gridForm.getForm().getEl().dom.action = 'confirmation.php';
				simple.getForm().getEl().dom.action = 'save_form.php';
				simple.getForm().getEl().dom.method = 'POST';
				simple.getForm().submit();
			}
        }]
    });

    simple.render("totorb");

    

});