/*****************************************/
/*****Callback de confirmation************/
/*****************************************/
function showResult(btn){
    if (btn == "yes"){
        eval(this.parentNode.href);     
    }    
    else
        return false;
}

/*****************************************/
/*****Fenetre de confirmation*************/
/*****************************************/
function confirmExtJS(title,msg,scope){
    Ext.MessageBox.confirm(title, msg, showResult,scope);
    return false;
}

/*****************************************/
/*****Callback de confirmation************/
/*****************************************/
function showResultAndWait(btn){ 
    if (btn == "yes"){
        eval(this.firstChild.href);   
        waitingProgress();   
    }    
    else
        return false;
}

/*****************************************/
/*****Fenetre de confirmation*************/
/*****************************************/
function confirmAndWait(title,msg,scope){   
    Ext.MessageBox.confirm(title, msg, showResultAndWait,scope);    
    return false;
}


/*****************************************/
/*****Fenetre de progression**************/
/*****************************************/
function uploadProgress(msg){
    Ext.MessageBox.show({
       msg: msg,
       progressText: 'Transfert...',
       width:300,
       wait:true,
       waitConfig: {interval:200},
       icon:'ext-mb-download' 
   });
    setTimeout(function(){
        //This simulates a long-running operation like a database save or XHR call.
        //In real code, this would be in a callback function.
        Ext.MessageBox.hide();
    }, 60000);
}  

//==== Progress bar 3 ====
function waitingProgress(){
    Ext.MessageBox.show({
       msg: 'Patientez...',
       progressText: 'Patientez...',
       width:300,
       wait:true,
       waitConfig: {interval:200},
       icon:'ext-mb-wait'
   });
    setTimeout(function(){
        //This simulates a long-running operation like a database save or XHR call.
        //In real code, this would be in a callback function.
        Ext.MessageBox.hide();
    }, 60000);
}
