Ext.ns('EMBrowser');

//------------------------------------------------------------------------------
EMBrowser.TextField1 = Ext.extend(Ext.form.TextField,{
  maxLength: 49,
  allowBlank: true,
  maskRe: EMBrowser.regexAlphanum
  ,initComponent:function() {
    var config = {
      blankText:'Le champ est obligatoire',
      maxLengthText:'La Taille maximum du champ est de '+this.maxLength,
      minLengthText:'La Taille minimum du champ est de '+this.minLength
    };
     // apply config
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    EMBrowser.TextField1.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    EMBrowser.TextField1.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('TextField1', EMBrowser.TextField1);


//------------------------------------------------------------------------------
EMBrowser.TextFieldmail1 = Ext.extend(Ext.form.TextField,{
  maxLength: 40,
  allowBlank: true,
  vtype:'email',
  vtypeText: 'Votre adresse email doit être de la forme de "user@domain.com"',
  blankText:"Veuillez saisir votre adresse email."
  ,initComponent:function() {
    EMBrowser.TextFieldmail1.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    EMBrowser.TextFieldmail1.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('TextFieldMail1', EMBrowser.TextFieldmail1);

//------------------------------------------------------------------------------
EMBrowser.NumberFieldZipCH = Ext.extend(Ext.form.NumberField,{
  allowBlank: true,
  minValue:999,
  maxValue:4000
  ,initComponent:function() {
    var config = {};
     // apply config
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    EMBrowser.NumberFieldZipCH.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    EMBrowser.NumberFieldZipCH.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('NumberFieldZipCH', EMBrowser.NumberFieldZipCH);

//------------------------------------------------------------------------------
EMBrowser.EMNumber = Ext.extend(Ext.form.NumberField,{
  initComponent:function() {
    var config = {};
     // apply config
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    EMBrowser.EMNumber.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    EMBrowser.EMNumber.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('EMNumber', EMBrowser.EMNumber);
//------------------------------------date--------------------------------------

EMBrowser.DateField = Ext.extend(Ext.form.DateField,{
  format:'d/m/Y'
  ,allowBlank:false
  ,vtype: 'daterange'
  ,minValue:new Date('01/01/1990 00:00:0 AM GMT-0600')
  ,maxValue:new Date('12/31/2030 00:00:0 AM GMT-0600')
  ,initComponent:function() {
    var config = {
//      minText:'Veuillez saisir une date supérieur a '+this.minValue,
//      maxText:'Veuillez saisir une date inférieur a '+this.maxValue
    };
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    EMBrowser.DateField.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  , onRender:function() {
    EMBrowser.DateField.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('EMBrowserdatefield', EMBrowser.DateField);

