/*Ext.override(Ext.layout.FormLayout, {
    renderItem : function(c, position, target){
        if(c && !c.rendered && c.isFormField && c.inputType != 'hidden'){
            var args = [
                   c.id, c.fieldLabel,
                   c.labelStyle||this.labelStyle||'',
                   this.elementStyle||'',
                   typeof c.labelSeparator == 'undefined' ? this.labelSeparator : c.labelSeparator,
                   (c.itemCls||this.container.itemCls||'') + (c.hideLabel ? ' x-hide-label' : ''),
                   c.clearCls || 'x-form-clear-left' 
            ];
            if(typeof position == 'number'){
                position = target.dom.childNodes[position] || null;
            }
            if(position){
                c.formItem = this.fieldTpl.insertBefore(position, args, true);
            }else{
                c.formItem = this.fieldTpl.append(target, args, true);
            }
            c.render('x-form-el-'+c.id);
            c.container = c.formItem; // must set after render, because render sets it.
            c.actionMode = 'container';
        }else {
            Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments);
        }
    }
});

Ext.override(Ext.form.HtmlEditor, {
	onResize : function(w, h){
	    Ext.form.HtmlEditor.superclass.onResize.apply(this, arguments);
	    if(this.el && this.iframe){
	        if(typeof w == 'number'){
	            var aw = w - this.wrap.getFrameWidth('lr');
	            if (aw < 0) aw = 0;
	            this.el.setWidth(this.adjustWidth('textarea', aw));
	            this.iframe.style.width = aw + 'px';
	        }
	        if(typeof h == 'number'){
	            var ah = h - this.wrap.getFrameWidth('tb') - this.tb.el.getHeight();
	            if (ah < 0) ah = 0;
	            this.el.setHeight(this.adjustWidth('textarea', ah));
	            this.iframe.style.height = ah + 'px';
	            if(this.doc){
	                this.getEditorBody().style.height = Math.max(ah - (this.iframePad*2), 0) + 'px';
	            }
	        }
	    }
	}
});
*/
Ext.apply(Ext.form.VTypes, {
    email:  function(v) {
		var email = /^([\w\-]+)(\.[\w\-]+)*@([\w\-]+\.){1,5}([A-Za-z]){2,4}$/;
        return email.test(v);
    }
});
