// 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: 'To fill out this reserver form : ',
        bodyStyle:'padding:5px 5px 5px',
        width: 370,
        defaults: {width: 222},
		defaultType: 'textfield',
        items: [{
                xype: 'textfield',
				frame:true,
				fieldLabel: 'Company ',
                name: 'societe',
                allowBlank:true
            },{
                xype: 'textfield',
                fieldLabel: 'Name ',
                name: 'nom',
				allowBlank:false
            },{
                xype: 'textfield',
                fieldLabel: 'First name ',
                name: 'prenom',
                allowBlank:false
            }, {
                xype: 'textfield',
                fieldLabel: 'Email ',
                name: 'email',
                allowBlank:false,
                vtype:'email'
            },{
				fieldLabel: 'Address ',
				xtype: 'textarea',
				name: 'description'
			}, {
                xype: 'textfield',
                fieldLabel: 'Postcode ',
                name: 'cp',
                allowBlank:true
            }, {
                xype: 'textfield',
                fieldLabel: 'Town ',
                name: 'ville',
                allowBlank:true
            }, {
                xype: 'numberfield',
                fieldLabel: 'Phone ',
                name: 'tel',
                allowBlank:true,
				maxLength: 15
            }, new Ext.form.DateField({
                fieldLabel: 'Check in ',
                name: 'arrivee'
			}), new Ext.form.DateField({
                fieldLabel: 'Check out ',
                name: 'depart'
			}),{
				fieldLabel: 'Prefered hotel ',
				xtype: 'combo',
				store: ['Grand Hôtel', 'Patiotel'],
				name: 'hotel'
			},{
				fieldLabel: 'Room type ',
				xtype: 'combo',
				store: ['Single', 'Double', 'Twin two beds', 'Triple'],
				name: 'chambre'
			},{
				fieldLabel: 'No Smoking ',
				xtype: 'combo',
				store: ['Yes', 'No'],
				name: 'fumeur'
			}, {
				fieldLabel: 'Other ',
				xtype: 'textarea',
				name: 'precisions'
			}
			
        ],

        buttons: [{
            text: 'Submit',
			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");

    

});