 
  var win;
  var isReady = false;
  Ext.onReady(function () {
    isReady = true;
  });
  
  function manageGalleries(el, scID){
    if (!isReady){
      setTimeout("profileEdit(" + scID + ")", 1000);
      return false;
    }
    
    dialogHeight = 500;
		
    var siteEdit = {
		title: "Site Info", 
		height: dialogHeight, 
		html: '<iframe src="/ajax.cfm?frame=true&a=sc&mode=edit&scID=' + scID + '&s=' + currentSchoolAlias +'&new=sc" style="width: 100%; border: 0; height: 100%"></iframe>'
		};
    var PhotoUpload = {
		title: "Manage School Photo", 
		height: dialogHeight, 
		html: '<iframe src="/ajax.cfm?frame=true&a=sc&mode=photo&scID=' + scID +  '&s=' + currentSchoolAlias +'&new=sc&id=0" style="width: 100%; border: 0; height: 100%"></iframe>'
		};
	var SlideShowUpload = {
		title: "Manage Front Page Slide Show", 
		height: dialogHeight, 
		html: '<iframe src="/ajax.cfm?frame=true&a=sc&mode=slideshow&scID=' + scID +  '&s=' + currentSchoolAlias +'&new=sc&id=0" style="width: 100%; border: 0; height: 100%"></iframe>'
		};
    
    var tabHolder = new Ext.TabPanel({
                                        activeTab: 0,                                   
                                        region: 'center',
                                        height: dialogHeight,
                                        items:[
                                         //siteEdit,
                                         PhotoUpload,
                                         SlideShowUpload
                                        ]
                                    });
                                    

		var modTitle = "Edit Site Configuration";			

		var infoBox = {region: 'north', baseCls: '', cls: 'dialogHelpTitle', height: 48, border: 0, html: '<strong>Manage your slideshow</strong> with these easy tools.'};

		var helpText = "<strong>School Name</strong> this name will be displayed on the header of the site and Contact Information<br/><br />...";
		var helpBox = {region: 'east', title: 'Help', split: true, width: 150, minSize: 150, layout:'fit', collapsible: true,  cls: 'dialogHelp', items: [{bodyStyle: 'padding: 10px; font-size: 1.4em', html: helpText}]};

		var depBox = {region: 'south', baseCls: '', cls: '', 
                  height: 35, border: 0, 
                  bodyStyle: 'padding: 10px; font-weight: bold; background: #fee; color: #a00; text-align: center',
                  html: 'The remaining features of this older dialog are planned to be moved into the Site Config in the near future'};

    win = new Ext.Window({
      title: "Gallery Manager",
      minWidth: 320,
      width: 700,
			layout:'fit',
      height: dialogHeight + 48,
      layout: 'border',
      modal: true,
      maximizable: true,
      closeAction: 'hide',
      buttons: [],
      items: [infoBox, tabHolder, depBox], //, helpBox
	  buttons: [{
				text: 'Finish',
				handler: function(){
					win.hide();
				}
			}],
      keys: {
        key: 27, // Esc key
        handler: function(){ win.hide(); },
        scope: this
      }
    });
    win.show();
  }

