            dojo.require("dojo.parser");	// scan page for widgets and instantiate them  
            dojo.require("dijit.form.TextBox");
            dojo.require("dijit.form.Button");
            dojo.require("dojo.io.iframe");
            dojo.require("dijit.form.CheckBox"); 
            
            
            // funcion que genera llamada a archivio
            function call_function() {                
                // Check the conditions 
                
                // 2.-
                    //a_x =  Estado de Situacion Financiera Clasificado
                    //b_x = Estado de Situacion Financiera por Liquidez
                    
                // 3     
                    //c_x = Estado de Cambios en el Patrimonio Neto
                    
                // 4.-      
                    //d_x = Estado de Resultados Integrales Por Funcion
                    //e_x = Estado de Resultados Integrales Por Naturaleza
                    
                // 5.-      
                    //f_x = Estado de Flujo de Efectivo Directo
                    //g_x = Estado de Flujo de Efectivo Indirecto
    
    			var a_x = dijit.byId("root_0_0").checked;
    			var b_x = dijit.byId("root_0_1").checked;
    			var c_x = dijit.byId("root_0_2").checked;
    			var d_x = dijit.byId("root_0_3").checked;
    			var e_x = dijit.byId("root_0_4").checked;
    			var f_x = dijit.byId("root_0_5").checked;
    			var g_x = dijit.byId("root_0_6").checked;
    			var h_x = dijit.byId("root_0_7").checked;
    
                var msg_var = "";
                var error_number = 0;
                
                if( (!a_x && !b_x && !c_x && !d_x && !e_x && !f_x &&  !g_x && !h_x) ){                
                    msg_var = msg_var + "No Se ha seleccionado informe" + ";"; 
                    error_number++;
                } else {
                    if ( !a_x && !b_x ) {
                        msg_var = msg_var + "Debe seleccionar a lo menos un Estado de situacion Financiera" + ";"; 
                        error_number++;
                    } else { if ( a_x && b_x ) {
                        msg_var = msg_var + "Seleccionado dos Estados de situacion Financiera. Debe seleccionar solo uno."+ ";";
                        error_number++;
                    }};       
                    if  ( !c_x ) {
                        msg_var = msg_var + "Debe seleccionar el Estado de Cambios en el Patrimonio Neto"+ ";"; 
                        error_number++;
                    };    
                    if  ( !d_x  && !e_x ) {
                        msg_var = msg_var + "Debe seleccionar a lo menos un Estado de Resultados Integrales "+ ";"; 
                        error_number++;
                    } else { if ( d_x  && e_x ) {
                        msg_var = msg_var + "Seleccionado dos Estado de Resultados Integrales. Debe seleccionar solo uno."+ ";";
                        error_number++;
                    }};     
                    if  (  !f_x && !g_x  ) {
                        msg_var = msg_var + "Debe seleccionar a lo menos un Estado de Flujo de Efectivo"+ ";"; 
                        error_number++;
                    } else { if (f_x && g_x ) {
                        msg_var = msg_var + "Seleccionado dos  Estado de Flujo de Efectivo. Debe seleccionar solo uno."+ ";";
                        error_number++;
                    }};     
                }
                

                if (  error_number == 0) {
                    // todo OK 
                    var WarningWinText = dojo.byId("WarningWin");
                    warn_full_msg = "SIN ERRORES  , Generando archivo " + "nombre " +"<br>";
                    WarningWinText.innerHTML = warn_full_msg; 
                    
                    var send_string = "";
                    
                    send_string = send_string.concat( (a_x ?"1":"0"),";", (b_x?"1":"0"),";",  
                                        ( c_x ?"1":"0"),";", ( d_x ?"1":"0"),";", 
                                        ( e_x ?"1":"0"),";", ( f_x ?"1":"0"),";",
                                        ( g_x ?"1":"0"),";", ( h_x ?"1":"0"),";" 
                                       );
                    
                    var file_name = dojo.byId("filename").value;
                    
                    var getArgs = {
                                method: "GET",
                                url: 'gen_shell.php',
                                content: { filename: file_name, opciones : send_string },
                                preventCache: true,
                                timeout: 1000
                     }
                     
                    dojo.io.iframe.send(getArgs); 
                } else {
                    // tratar errores.
                    // enviar errores a Ventana de errores
                    fill_Warning( msg_var , error_number );
                 };
                    
            }



            function fill_Warning( warn_msg , error_number ) {
                var WarningWinText = dojo.byId("WarningWin");
                var mySplitResult = warn_msg.split(";");

                warn_full_msg = " NUMERO DE ERRORES : " + error_number +" , El archivo no fue generado <br>";
                for(i = 0; i < mySplitResult.length; i++){
                    warn_full_msg = warn_full_msg + mySplitResult[i]+ "<br>";
                }
                WarningWinText.innerHTML = warn_full_msg;
            };   

