//
//// reference local blank image
//Ext.BLANK_IMAGE_URL = './s.gif';
//Ext.QuickTips.init();							//necessary to init error tooltip
//Ext.form.Field.prototype.msgTarget = 'side';	//necessary to init error tooltip
//// create namespace
//Ext.namespace('EMBrowser');
//
//
//// create application
//EMBrowser.app_main = function() {
//  // do NOT access DOM from here; elements don't exist yet
//
//  // private variables
//   var layout = 'homepage';//container 'navigation' -> left :treepanel, main :org stuff)
//   //var layout = 'organisation';
//   var container = null;
//   var container_choice = null;
//  // private functions
//
//  // public space
//  return {
//    // public properties, e.g. strings to translate
//
//    // public methods
//    init: function() {
//      this.display();
//    },
//    fillLayout: function(layout,infos) {
//      switch(layout){
//        case"homepage":
//          //var tn_id = infos;
//          this.selectContainer('navigation');
//          EMBrowser.app_homepage_layout.fillContainerNavigation(this);
//          //EMBrowser.app_site_layout.init();
//          break;
//        case"organisation":
//          var tn_id = infos;
//          this.selectContainer('navigation');
//          EMBrowser.app_org_layout.fillContainerNavigation(this,tn_id);
//          //EMBrowser.app_org_layout.init();
//          break;
//        case"site":
//          var tn_id = infos;
//          this.selectContainer('navigation');
//          EMBrowser.app_site_layout.fillContainerNavigation(this,tn_id);
//          //EMBrowser.app_site_layout.init();
//          break;
//      }
//      //var layoutOrganisation = new EMBrowser.layoutOrganisation({});
//    },
//    selectContainer:function(containerchoice) {
//      switch(containerchoice){
//        case"navigation":
//          if(this.container_choice != 'navigation') {
//            this.container = new EMBrowser.navigationContainer({});
//            this.container_choice = 'navigation';
//          }
//        break;
//      }
//    }
//    ,display:function() {
//      Ext.Ajax.request({
//        ownerCt: this,
//        waitMsg: 'Please wait...',
//        url: '/process/EMBrowser/mainapp/mainapp.php',
//        params: {
//          cmd: "getlayoutinfos"
//        },
//        success: function(response,scope){
//          var result = Ext.util.JSON.decode(response.responseText);
//          switch(result.success){
//            case 1:
//              scope.ownerCt.fillLayout(result.layout,result.infos);
//              break;
//            default:
//              scope.ownerCt.fillLayout('homepage',0);
//              break;
//          }
//        },
//        failure: function(response) {
//          Ext.MessageBox.alert('error','L application n a pas pu se connecter a la base de données. Veuillez réessayer plus tard');
//        }
//      });
//    }
//    ,setLayout:function(layout,infos) {
//      Ext.Ajax.request({
//        ownerCt: this,
//        waitMsg: 'Please wait...',
//        url: '/process/EMBrowser/mainapp/mainapp.php',
//        params: {
//          cmd: "savelayoutinfos",
//          layout: layout,
//          infos: infos
//        },
//        success: function(response,scope){
//          var result = Ext.util.JSON.decode(response.responseText);
//          switch(result.success){
//            case 1:
//              //console.log("save datas ok");
//              break;
//            default:
//              console.log("savelayoutinfos error");
//              break;
//          }
//        },
//        failure: function(response) {
//          Ext.MessageBox.alert('error','L application n a pas pu se connecter a la base de données. Veuillez réessayer plus tard');
//        }
//      });
//    }
//  };
//}(); // end of app
//
//// end of file

