﻿var LoginWindow=Ext.extend(Ext.Window,{
                        title : '交易登录',        
                        width : 265,            
                        height : 170,  //170 140无验证码高度
                        collapsible : true,
                        defaults : {            
                        border : false
                        },
                        buttonAlign : 'center',   
                        close:function(){
                        //alert('close');
                        WindowLogin=null;
                        this.destroy();
                        },
                        createFormPanel :function() {
                                return new Ext.form.FormPanel( {
                                                bodyStyle : 'padding-top:6px',
                                                defaultType : 'textfield',
                                                labelAlign : 'right',
                                                labelWidth : 55,
                                                labelPad : 0,
                                                frame : true,                                                
                                                //keys:keyMap,
                                                defaults : {
                                                allowBlank : true,
                                                width : 158                     
                                                },
                                                items : [{
                                                    cls : 'user',
                                                    name : 'username',
                                                    id:'usernameId',
                                                    fieldLabel : '帐号',
                                                    blankText : '帐号不能为空',
                                                    emptyText:""//00111
                                                    }, 
                                                    {
                                                    cls : 'key',
                                                    name : 'password',
                                                    id:'passwordId',
                                                    fieldLabel : '密码',
                                                    blankText : '密码不能为空',
                                                    inputType : 'password',
                                                    emptyText:""//888888
                                                    }
                                                    ,{
                                                    cls : 'key',    
                                                    name:'randCode',
                                                    id:'randCode',
                                                    fieldLabel:'验证码',
                                                    width:100,
                                                    blankText : '验证码不能为空'
                                                    }
                                                    ]
                                                });
                                },                    
                        login:function() {
                                Userlogin();
                                // SouthPanel.show();
                                //SouthPanel.expand();
                        },
                initComponent : function(){
                        LoginWindow.superclass.initComponent.call(this);       
                        this.fp=this.createFormPanel();
                        this.add(this.fp);
                        this.addButton('登录',this.login,this);
                        this.addButton('重置', function(){this.fp.form.reset();},this);
                        }     
                });

var LoadingWindow=Ext.extend(Ext.Window,{
                        title : 'Loading......',        
                        width : 265,            
                        height : 80,        
                        collapsible : true,
                        closable:false,
                        defaults : {            
                        border : false
                        },
                        buttonAlign : 'center',   
                        createFormPanel :function() {
                                return new Ext.form.FormPanel( {
                                                bodyStyle : 'padding-top:6px',
                                                defaultType : 'textfield',
                                                labelAlign : 'right',
                                                labelWidth : 55,
                                                labelPad : 0,
                                                frame : true,
                                                defaults : {
                                                allowBlank : false,
                                                width : 158
                                                //,renderTo:'DivLogin'
                                                },
                                                items : {
                                                    xtype:"textfield",
                                                    name : 'LoadingTxt',
                                                    fieldLabel : '提示',
                                                    readOnly:true,
                                                    blankText : 'Loading......',
                                                    emptyText:"Loading......"
                                                    }
                                                });
                                }, 
                    initComponent : function(){
                        LoadingWindow.superclass.initComponent.call(this);       
                        this.fp=this.createFormPanel();
                        this.add(this.fp);
//                        this.addButton('登陆',this.login,this);
//                        this.addButton('重置', function(){this.fp.form.reset();},this);
                        }                            
                });