/*
 * 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 d&eacute;taill&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 ',
                    name: 'secteur',
					allowBlank:false,
                    anchor:'90%'
                },{					
                    xtype:'textfield',
                    fieldLabel: 'Courriel ',
                    name: 'email',
					allowBlank:false,
                    vtype:'email',
                    anchor:'90%'
                }]
            }]
        },{
            xtype:'tabpanel',
            plain:true,
            activeTab: 0,            
			height:600,
            defaults:{bodyStyle:'padding:15px'},
            items:[{
                title:'Site Internet',
                layout:'form',
				defaults: {width: 300},
                defaultType: 'textfield',				
                items: [{xtype : 'panel',
						border    : false,
						width: 500,
						html : 'Quelles type de site Internet d&eacute;sirez-vous?<br><br>'
					},{
                        xtype: 'checkbox',
                        boxLabel: 'informatif',  
						labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'informatif'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'portfolio',
                        labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'portfolio'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'corporatif',
                        labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'corporatif'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'transactinonel',
                        labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'transactionnel'                        
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'catalogue en ligne',
                        labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'catalogue'                        
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'portail',
                        labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'portail'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'intranet',
                        labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'intranet'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'extranet',
                        labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'extranet'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'commerce &eacute;lectronique',
                        labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'commerce'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'syst&egrave;me de commandes en ligne',
                        labelStyle: 'display: none',
                        name: 'fonctions[]',
                        inputValue: 'syst&egrave;me de commande'
                    },{					
						fieldLabel: 'Autres, pr&eacute;cisez',
						name: 'autreFonction'		
               		},{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br><br>En quelle(s) langue(s) votre site devra &ecirc;tre produit?<br><br>'
					},{
                        xtype: 'checkbox',
                        boxLabel: 'Fran&ccedil;ais',  
						labelStyle: 'display: none',
                        name: 'langue[]',
                        inputValue: 'fran&ccedil;ais'
                       
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'Anglais',  
						labelStyle: 'display: none',
                        name: 'langue[]',
                        inputValue: 'anglais'
                    },{					
						fieldLabel: 'Autres, pr&eacute;cisez',
						name: 'autreLangue'		
               		}]  
            	},{
                title:'D&eacute;tails techniques',
                layout:'form',
                defaults: {width: 300},
                defaultType: 'textfield',

                items: [{
                    fieldLabel: 'Avez-vous pr&eacute;sentement un site Internet? Si oui, veuillez indiquer l\'adresse ',
                    name: 'adresseSite',
                    allowBlank:false,
                    value: 'http://'
                },{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br><br>'
				},{
                    fieldLabel: 'Dans le cas o&ugrave; vous n\'avez pas de site Internet, avez-vous d&eacute;j&agrave; acquis un nom de domaine?<br>  Si oui, veuillez indiquer lequel ',
                    name: 'nomDomaine',
                    value: ''
                },{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br><br>D&eacute;sirez-vous faire appel &agrave; nos services d\'h&eacute;bergement?<br>'
					},{
                        xtype: 'radio',
                        boxLabel: 'Oui',  
						labelStyle: 'display: none',
                        name: 'hebergement',
                        inputValue: 'OUI'
                    },{
                        xtype: 'radio',
                        boxLabel: 'Non',
                        labelStyle: 'display: none',
                        name: 'hebergement',
                        inputValue: 'NON'
                    },{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br>Utiliserez-vous nos services de r&eacute;daction pour votre site?<br>'
					},{
                        xtype: 'radio',
                        boxLabel: 'Oui',  
						labelStyle: 'display: none',
                        name: 'redaction',
                        inputValue: 'OUI'
                    },{
                        xtype: 'radio',
                        boxLabel: 'Non',
                        labelStyle: 'display: none',
                        name: 'redaction',
                        inputValue: 'NON'
                    },{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br>Utiliserez-vous nos services de traduction pour votre site?<br>'
					},{
                        xtype: 'radio',
                        boxLabel: 'Oui',  
						labelStyle: 'display: none',
                        name: 'traduction',
                        inputValue: 'OUI'
                    },{
                        xtype: 'radio',
                        boxLabel: 'Non',
                        labelStyle: 'display: none',
                        name: 'traduction',
                        inputValue: 'NON'
                    },{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br>Utiliserez-vous nos services de conception pour votre site?<br>'
					},{
                        xtype: 'radio',
                        boxLabel: 'Oui',  
						labelStyle: 'display: none',
                        name: 'conception',
                        inputValue: 'OUI'
                    },{
                        xtype: 'radio',
                        boxLabel: 'Non',
                        labelStyle: 'display: none',
                        name: 'conception',
                        inputValue: 'NON'
                    }]
            },{
                cls:'x-plain',
                title:'Image corporative',
                layout:'form',
                defaults: {width: 300},
                defaultType: 'textfield',				
                items: [{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br>D&eacute;sirez-vous nous confier votre image corporative?  Si oui, quels sont vos besoins?<br><br>'
					},{
                        xtype: 'checkbox',
                        boxLabel: 'logo',  
						labelStyle: 'display: none',
                        name: 'imageCorporative[]',
                        inputValue: 'logo'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'cartes d\'affaires',
                        labelStyle: 'display: none',
                        name: 'imageCorporative[]',
                        inputValue: 'cartes d\'affaires'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'ent&ecirc;tes',  
						labelStyle: 'display: none',
                        name: 'imageCorporative[]',
                        inputValue: 'entêtes'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'enveloppes',  
						labelStyle: 'display: none',
                        name: 'imageCorporative[]',
                        inputValue: 'enveloppes'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'pochettes publicitaires',  
						labelStyle: 'display: none',
                        name: 'imageCorporative[]',
                        inputValue: 'pochettes publicitaires'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'brochures corporatives',  
						labelStyle: 'display: none',
                        name: 'imageCorporative[]',
                        inputValue: 'brochures corporatives'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'catalogue',  
						labelStyle: 'display: none',
                        name: 'imageCorporative[]',
                        inputValue: 'catalogue'
                    },{					
						fieldLabel: 'Autres, pr&eacute;cisez',
						name: 'autreMoyensImage'		
               		}]
            },{
                cls:'x-plain',
                title:'Pour votre satisfaction',
                layout:'form',
                items:[{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br>&Agrave; quelle date d&eacute;sirez-vous que votre site soit mis en ligne?  '
					},{
					xtype:'textfield',
					labelStyle: 'display: none',
                    name: 'date',
                    value: ''
					},{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br><br>Qu\'est ce qui motivera votre d&eacute;cision face &agrave; la r&eacute;alisation de votre site ? <br><br> '
					},{
                        xtype: 'checkbox',
                        boxLabel: 'efficacit&eacute; du concept',  
						labelStyle: 'display: none',
                        name: 'motivation[]',
                        inputValue: 'Efficacit&eacute; du concept'
                       
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'qualit&eacute; du service',  
						labelStyle: 'display: none',
                        name: 'motivation[]',
                        inputValue: 'Qualit&eacute; du service'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'rapidit&eacute; de la production',  
						labelStyle: 'display: none',
                        name: 'motivation[]',
                        inputValue: 'Rapidit&eacute; de la production'
                    },{
                        xtype: 'checkbox',
                        boxLabel: 'prix',  
						labelStyle: 'display: none',
                        name: 'motivation[]',
                        inputValue: 'Prix'
                    },{					
						xtype:'textfield',
						fieldLabel: 'Autres, pr&eacute;cisez',
						name: 'autreMotivation'		
               		},{xtype : 'panel',
						border    : false,
						width: 500,
						html : '<br><br>Avez-vous de l\'information additionnelle &agrave; nous mentionner ?  '
					},{
                    xtype:'textarea',
					labelStyle: 'display: none',
					name: 'commentaires',
					allowBlank:true,
					width:550,
					height:100
                }]
            }]
        }],

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


    function submitForm(){
		tab2.submit();
    }
	

    tab2.render(document.getElementById('formulaire'));
});
