Ext.ns("Vreshenie.window");
Vreshenie.window.SendMailWindow = Ext.extend(Ext.Window, {
    initComponent : function() {
		var win=this;
        Ext.apply(this, {
			shadow:false,
			closeAction:'hide',
			resizable:true,
			width:150,
			height:90,
			layout:'fit',
			x:50,
			y:-100,
			html:'<div class="big-loading">Загрузка...</div>',
			listeners :{
				beforehide :function(){
					this.el.frame();
					this.removeAll();
					this.update('<div class="big-loading">Загрузка...</div>');
					this.setPosition(50,-100);
					this.setWidth(150);
					this.setHeight(90);
				},
				show:function(){					
					var effect='backIn';
					win.el.shift({
						y: 50, 
						duration:1,
						easing:effect,
						callback:function(){
							win.el.shift({
								x: 150, 
								duration:1,
								easing:effect,
								callback:function(){
									win.el.shift({
										width: 400,
										callback:function(){
											win.setWidth(400);
											win.setHeight(300);
											var panel = new Vreshenie.form.backConnectionForm();
											win.update('');																
											(function(){
												win.add(panel);
												win.doLayout();
												panel.setVisible(true);
												panel.el.slideIn('t',{duration:0.5});	
											}).defer(100);
										}
									});
								}
							});
						}
					});	
				}
			}
        });

        Vreshenie.window.SendMailWindow.superclass.initComponent.call(this);
    }
});
