﻿//刷新或关闭
 function windowsClose()
 { 
    successLogin=false;
    //Stops all tasks that are currently running
    stopReload();
    //runner.stopAll();
    //清空用户持仓		                                             
    if(dsHolding!=null)dsHolding.removeAll();
    //清空可撤和当日委托共享内存
    if(dsVoidableAll!=null)dsVoidableAll.removeAll();
    //清空用户可撤单                                                
    if(dsVoidable!=null)dsVoidable.removeAll();        
    //清空日委托单   
    if(dsDayTrasaction!=null)dsDayTrasaction.removeAll();
     //清空成交单
    if(dsBargain!=null)dsBargain.removeAll();
    //清空用户资金(手动查询)
     SouthCapitalForm.getForm().reset();
    //清空下单区
    SouthOrderForm.getForm().reset();
    //重置下单区
    reSetOrderForm();
    
    //server logout
    Ext.Ajax.request({
                url: 'QueryData/TradeLogout.aspx',                                            
                    success : function(response) { 
                             if(response.responseText=="success")
                             {                                         
                             }else{
                             }
                        },
                    failure : function(response) {
                            }  
                       });
 
    clearUserCookie();
    //设置一键下单状态
    var comboContract= SouthOrderForm.getForm().findField('checkboxName');
    if(comboContract.getValue()==false) setUserCookie('OrderNoAlram','false');
             
    SouthPanel.hide();                                            
    SouthPanel.collapse(); 
 }
 //手动退出
 function logout()
 {
     Ext.MessageBox.confirm('确认','您确定退出交易吗？',function(btn)
                                {
                                    if(btn=='yes')
                                    {                                    
                                        windowsClose();
                                    }    			            
                                });
 }
 
 

 
 
