      function windowUserEditor(loadMode, schoolID, treenode){

        if (!canEdit)
          return false;

        /*
        var theTemplates = new Ext.data.JsonStore({
                                            fields: ['valID','texty'],
                                            root: 'templates',
                                            url: '/ajax/navigation/templateList.cfm'});
        theTemplates.load();
        
        function saveSchoolForm(){
          //alert(Ext.getCmp('winSchoolSettingsEditor').getForm().getValues().toSource());
          //return false;
          var thisForm = Ext.getCmp('winSchoolSettingsEditor').getForm();
          thisForm.submit({
            clientValidation: true,            
            url:'/ajax/siteconfig/site/submitConfig.cfm?s='+schoolID, 
            waitMsg:'Saving settings...',
            params: {},
            errorReader : new Ext.data.JsonReader({
                root:'errors',
                successProperty:'success'
            }, ['id', 'msg']),
            success: function(form, action) {
              //if(action.result.data_id)
            
              if (treenode)
                treenode.setText(thisForm.getValues().school_title);
              winSchoolSettingsEdit.close();              
              return true;
            },
            failure: function(form, action) {
              switch (action.failureType) {
                case Ext.form.Action.CLIENT_INVALID:
                  Ext.Msg.alert('Failure', 'Please verify all form fields are correct.');
                  break;
                case Ext.form.Action.CONNECT_FAILURE:
                  Ext.Msg.alert('Failure', 'Ajax communication failed');
                  break;
                case Ext.form.Action.SERVER_INVALID:
                default:
                  Ext.Msg.alert('Failure', action.result.msg);
              }
              Ext.Msg.hide();
              return false;
            }
          });
        }
        */
        
        var xmlCols = [];
        xmlCols.push({name: 'school_title', mapping: 'title/title'});
        xmlCols.push({name: 'school_shortTitle', mapping: 'title/short'});
        xmlCols.push({name: 'school_address', mapping: 'mailing_addr/address'});
        xmlCols.push({name: 'school_city', mapping: 'mailing_addr/city'});
        xmlCols.push({name: 'school_state', mapping: 'mailing_addr/state'});
        xmlCols.push({name: 'school_zip', mapping: 'mailing_addr/zip'});
        xmlCols.push({name: 'school_business', mapping: 'phone/business'});
        xmlCols.push({name: 'school_fax', mapping: 'phone/fax'});
        xmlCols.push({name: 'school_email', mapping: 'email/general'});
        xmlCols.push({name: 'school_webmaster', mapping: 'email/webmaster'});
        xmlCols.push({name: 'school_webmail', mapping: 'config/webmail'});
        xmlCols.push({name: 'school_analytics', mapping: 'config/analytics'});
        xmlCols.push({name: 'school_swearfilter', mapping: 'config/swearfilter'});
        xmlCols.push({name: 'school_holidaymode', mapping: 'config/holidaymode'});
        xmlCols.push({name: 'school_externalwarn', mapping: 'config/externalwarn'});
        xmlCols.push({name: 'school_meta_keywords', mapping: 'meta/keywords'});
        xmlCols.push({name: 'school_meta_desc', mapping: 'meta/desc'});
        //xmlCols.push({name: 'school_template', mapping: 'config/template'});
    
        var navInfo = 'Changes will be applied when you click \'Save\' below.';
        
        var info_Tab = {
                                        title: 'Site Info',
                                        autoHeight:true,
                                        defaultType: 'textfield',
                                        id: loadMode ? 'tabSchoolSettingsEditor_site' : 'winSchoolSettingsEditor_site',
                                        labelWidth: 85, // label settings here cascade unless overridden
                                        waitMsgTarget: !Ext.isIE,
                                        reader : new Ext.data.XmlReader({
                                              record : 'result',
                                              success : '@success'
                                          }, xmlCols),
                                        items :[{
                                          fieldLabel: 'Title',
                                          anchor: '0',
                                          name: 'school_title',
                                          allowBlank:false
                                        },{
                                          fieldLabel: 'Short Title',
                                          name: 'school_shortTitle',
                                          width: 140,
                                          allowBlank:false
                                        },new Ext.form.DisplayField({html: ''}),{
                                          fieldLabel: 'Keywords',
                                          anchor: '0',
                                          name: 'school_meta_keywords'
                                        },{
                                          xtype:'textarea',
                                          height:100,
                                          anchor: '0',
                                          fieldLabel: 'Description',
                                          name: 'school_meta_desc'
                                        }]
                                    };
        var contact_Tab = {
                                        title: 'Contact Info',
                                        autoShow: true,
                                        id: loadMode ? 'tabSchoolSettingsEditor_contact' : 'winSchoolSettingsEditor_contact',
                                        labelWidth: 85, // label settings here cascade unless overridden
                                        waitMsgTarget: !Ext.isIE,
                                        reader : new Ext.data.XmlReader({
                                              record : 'result',
                                              success : '@success'
                                          }, xmlCols),
                                        autoHeight:true,
                                        defaultType: 'textfield',
                                        labelWidth: 120,
                                        items :[{
                                                  fieldLabel: 'Business Phone',
                                                  name: 'school_business',
                                                  vtype: !Ext.isIE ? 'phone' : '',
                                                  width: 200,
                                                  allowBlank:false
                                                },{
                                                  fieldLabel: 'Business Fax',
                                                  name: 'school_fax',
                                                  vtype: !Ext.isIE ? 'phone' : '',
                                                  width: 200,
                                                  allowBlank:false
                                                },new Ext.form.DisplayField({html: ''}),{
                                                  fieldLabel: 'Business Address',
                                                  name: 'school_address',
                                                  anchor: '0',
                                                  allowBlank:false
                                                },{
                                                  fieldLabel: 'City',
                                                  name: 'school_city',
                                                  width: 200,
                                                  allowBlank:false
                                                },new Ext.form.ComboBox({
                                                  fieldLabel: 'State',
                                                  hiddenName:'school_state',
                                                  store: new Ext.data.ArrayStore({
                                                    fields: ['abbr', 'state'],
                                                    data : Ext.exampledata.states // from states.js
                                                  }),
                                                  valueField:'abbr',
                                                  displayField:'state',
                                                  forceSelection: true,
                                                  mode: 'local',
                                                  triggerAction: 'all',
                                                  emptyText:'Select a state...',
                                                  width: 200,
                                                  selectOnFocus:true,
                                                  allowBlank:false
                                                }),{
                                                  fieldLabel: 'ZIP',
                                                  name: 'school_zip',
                                                  width: 80,
                                                  minLength:5,
                                                  maxLength:5,
                                                  maskRe: /[0-9]/,
                                                  allowBlank:false
                                                },new Ext.form.DisplayField({html: ''}),{
                                                  fieldLabel: 'General Email',
                                                  name: 'school_email',
                                                  width: 200,
                                                  vtype:'email',
                                                  allowBlank:false
                                                },{
                                                  fieldLabel: 'Webmaster Email',
                                                  name: 'school_webmaster',
                                                  width: 200,
                                                  vtype:'email',
                                                  allowBlank:false
                                                },{
                                                  fieldLabel: 'Web Mail URL',
                                                  anchor: '0',
                                                  name: 'school_webmail'
                                                }]
                                    };
        var google_Tab = {
                                        title: 'Google Analytics',
                                        autoHeight:true,
                                        autoShow: true,
                                        id: loadMode ? 'tabSchoolSettingsEditor_google' : 'winSchoolSettingsEditor_google',
                                        labelWidth: 85, // label settings here cascade unless overridden
                                        waitMsgTarget: !Ext.isIE,
                                        reader : new Ext.data.XmlReader({
                                              record : 'result',
                                              success : '@success'
                                          }, xmlCols),
                                        defaultType: 'textfield',
                                        items :[
                                                  new Ext.form.DisplayField({
                                                    hideLabel: true,
                                                    html: '<strong>Google Analytics requires an API Key to work.</strong><br />You can register your key at <a href="http://www.google.com/analytics/" target="_blank"><img src="/common/images/google_analytics.png" style="position: relative; top: 10px; left: 2px; border="0" /></a><br /><br />'
                                                  }),
                                                  {
                                                    fieldLabel: 'API Key',
                                                    width: 200,
                                                    name: 'school_analytics'
                                                  }
                                                ]
                                    };
        var extra_Tab = {
                                        title: 'Extra Options',
                                        autoHeight:true,
                                        autoShow: true,
                                        id: loadMode ? 'tabSchoolSettingsEditor_extra' : 'winSchoolSettingsEditor_extra',
                                        labelWidth: 85, // label settings here cascade unless overridden
                                        waitMsgTarget: !Ext.isIE,
                                        reader : new Ext.data.XmlReader({
                                              record : 'result',
                                              success : '@success'
                                          }, xmlCols),
                                        defaultType: 'textfield',
                                        defaults: {anchor: '0'},
                                        labelWidth: 1,
                                        items :[{
                                                  xtype: 'checkbox',
                                                  fieldLabel: '',
                                                  boxLabel: 'Swear Filter',
                                                  name: 'school_swearfilter'
                                                },{
                                                  xtype: 'checkbox',
                                                  fieldLabel: '',
                                                  boxLabel: 'Warn about External Links',
                                                  name: 'school_externalwarn'
                                                },{
                                                  xtype: 'checkbox',
                                                  fieldLabel: '',
                                                  boxLabel: 'Enable Holiday Mode (when extra graphics and/or effects are available)',
                                                  name: 'school_holidaymode'
                                                }]
                                    };

        
        var schoolSiteConfigTab = new Ext.FormPanel({
                    title: 'General Info',
                    padding: 5,
                    id: loadMode ? 'tabSchoolSettingsEditor' : 'winSchoolSettingsEditor',
                    layout: 'fit',
                    waitMsgTarget: !Ext.isIE,
                    reader : new Ext.data.XmlReader({
                          record : 'result',
                          success : '@success'
                      }, xmlCols),
                    bodyStyle: 'background: #DFE8F6',
                    autoScroll: true,
                    items: new Ext.Panel({
                          layout: 'border',
                          border: false,
                          items: [
                            new Ext.Panel({
                              region: 'north',
                              border: true,
                              html: '<div class="siteConfigInfo"><div class="siteConfigHeader">Here you can configure your site!</div><div class="siteConfigText">'+navInfo+'</div></div>'
                            }),
                            new Ext.Panel({
                              region: 'center',
                              activeTab: 0,
                              margins: '5 0 0 0',
                              bodyStyle:'padding: 5px 10px 0',
                              border: true,
                              plain: true,
                              autoScroll: true,
                              defaults: {autoScroll:true, xtype: 'fieldset', bodyStyle:'padding:15px 10px 0'},
                              items: [info_Tab,contact_Tab,google_Tab,extra_Tab/*,{
                                        xtype:'fieldset',
                                        title: 'Template',
                                        collapsible: true,
                                        autoHeight:true,
                                        defaults: {width: 410},
                                        defaultType: 'textfield',
                                        items :[new Ext.form.ComboBox({
                                                  fieldLabel: 'Site Layout',
                                                  hiddenName:'school_template',
                                                  store: theTemplates,
                                                  valueField:'valID',
                                                  displayField:'texty',
                                                  forceSelection: true,
                                                  triggerAction: 'all',
                                                  selectOnFocus:true,
                                                  allowBlank:false
                                                })]
                                    }*/]
                                  })
                                ]
                              })
                  });
        
        
        
        if (loadMode){
          schoolSiteConfigTab.title = 'General';
          return schoolSiteConfigTab;
        }
          
        var winSchoolSettingsEdit = new Ext.Window({
              width:400,
              height:550,
              title: 'School Settings Editor',
              layout:'fit',
              closeAction:'close',
              modal:true,
              closable:false,
              border:false,
              maximizable:true,
              items: schoolSiteConfigTab,
              buttons: [{
                text: 'Save',
                handler: saveSchoolForm
              },{ text: 'Cancel', handler: function(){ winSchoolSettingsEdit.close(); } }],
              listeners: {
                show: function(win){
                  var prefix = loadMode ? 'tabSchoolSettingsEditor' : 'winSchoolSettingsEditor';
                  Ext.getCmp(prefix+'_site').getForm().load({url:'/ajax/siteconfig/site/getSiteConfig.cfm?s='+schoolID, waitMsg:'Loading Setting...'});
                  Ext.getCmp(prefix+'_contact').getForm().load({url:'/ajax/siteconfig/site/getSiteConfig.cfm?s='+schoolID, waitMsg:'Loading Setting...'});
                  Ext.getCmp(prefix+'_google').getForm().load({url:'/ajax/siteconfig/site/getSiteConfig.cfm?s='+schoolID, waitMsg:'Loading Setting...'});
                  Ext.getCmp(prefix+'_extra').getForm().load({url:'/ajax/siteconfig/site/getSiteConfig.cfm?s='+schoolID, waitMsg:'Loading Setting...'});
                }
              }
          });
        if (treenode)
          winSchoolSettingsEdit.setTitle('School Settings - ' + treenode.text);
        winSchoolSettingsEdit.show(this);
      }
