/*
 * Ext JS Library 1.1.1
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://www.extjs.com/license
 */
var html;
 //   

var contact=function(){
   // Ext.QuickTips.init();

    // turn on validation errors beside the field globally
   // Ext.form.Field.prototype.msgTarget = 'side';
//document.getElementById('les_messages').innerHTML='';
document.getElementById('form-ct2').innerHTML='';
//document.getElementById('centre').innerHTML=
    /*
     * ================  Form 2  =======================
     */
    var top = new Ext.form.Form({
        labelAlign: 'top'
    });

    top.column(
        {width:282}, // precise column sizes or percentages or straight CSS
        new Ext.form.TextField({
            fieldLabel: 'Votre Prénom',
            name: 'votreprenom',
            id: 'votreprenom',
            width:200
        }),

        new Ext.form.TextField({
            fieldLabel: 'Sujet du Message',
            name: 'sujet',
            id: 'sujet',
            width:200
        })
    );

    top.column(
        {width:272, style:'margin-left:10px', clear:true}, // apply custom css, clear:true means it is the last column
        new Ext.form.TextField({
            fieldLabel: 'Votre Nom * ',
            name: 'votrenom',
            id: 'votrenom',
            width:200
        }),

        new Ext.form.TextField({
            fieldLabel: 'Votre Email * ',
            id:'votreemail',
            name: 'votreemail',
            vtype:'email',
            width:200
            
        })
    );
 html=new Ext.form.HtmlEditor({
            id:'message',
            name:'message',
            fieldLabel:'Message',
            width:300,
            height:160,
            value:'Salut, '
        });
    top.container({},html
        
    );
 // APPEL DE LA FONCTION DANNULATION DENVOI DU MESSAGE
    top.addButton('Annuler', function(){
        Option_Cancel();
        html.setValue('Salut, ');
    });
 
    // APPEL DE LA FONCTION DENVOI DU MESSAGE
    var submit = top.addButton({
        text: 'Envoyer',
        disabled:false
      // handler:function(){top.load({url:' ', waitMsg:'Loading..'});}
    });

    top.render('form-ct2');
    top.on({
        actioncomplete: function(form, action){
            if(action.type == 'load'){
                submit.enable();
            }
        }
    });
     submit.on('click', function(e){
       // Ext.MessageBox.prompt('Name', 'Please enter your name:');
       //top.load({ waitMsg:'Envoi..'});
       Option_Send('php/send.php');
    });
   // function showResultText(btn, text){
   //     Ext.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);
   // };
  /*   Ext.get('boite_reception').on('click', function(e){
        //Ext.MessageBox.prompt('Name', 'Enter password:', showResult);
        // Option_Menu_Selogger('php/selogger.php');
                    Ext.MessageBox.prompt('Name', 'Please enter your name:',showResult);


    });
    
function showResult(btn,text){
      //Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
     if(btn=='ok') 
     Selogger('php/messages.php',text);
      //alert(text);
      else alert(btn);
    };*/

       
   };