Ext.onReady( function(){  Ext.QuickTips.init();  layout.beginUpdate();  window.top.ctb = Ext.get('center-iframe-panel').toolbar = new Ext.Toolbar('centeriframetoolbar');  window.top.ctb.add(  {            cls: 'x-btn-text-icon biggerToolbar', // icon and text class            icon: 'images/cross.png',            		  text: 'Close',            id: 'docClose',            hidden: true,            tooltip:"<b>Close</b><br/>Close this document",            handler:   function closeDoc () { updatePanel('LastViewURL', 'center', 'center-content-panel' ); }  },  {            cls: 'x-btn-text-icon biggerToolbar', // icon and text class            icon: 'images/page_save.png',            text: 'Submit',            hidden: true,            id: 'docSubmit',            tooltip:"<b>Submit</b><br/>Submit changes made to this document",            scope: window.centerIframePanel,            handler: function submitDoc() {                               var iframeDoc = getIframeDocument('center-iframe');                              var targetWindow = Ext.get('center-iframe').dom.contentWindow;                                                            if ( targetWindow.doValidateFields == true ) {                                 if ( targetWindow.ValidateFields() == false ) {                                   Ext.Msg.alert( 'Submit', 'Enter required values in highlighted fields before submitting' );							return false;						   }                               }                               if ( targetWindow.doMCEOnSubmit == true ) {                                 tinyMCE.triggerSave();                                 targetWindow.doMCEOnSubmit = null;                               }                                                              //Ext.get('center-iframe-panel').mask();                               //layout.mask();                               Ext.get('top_body').mask();                                                              iframeDoc.forms[0].submit();                               if ( targetWindow.PostCloseAction ) {                                 switch( targetWindow.PostCloseAction ) {                                   case 'close' : updatePanel( 'Focus', 'center', 'center-content-panel' ); break;                                   case 'close+refresh' : updatePanel( 'Refresh', 'center', 'center-content-panel' ); break;                                 }                               }                                                              // cleanup                               iframeDoc, targetWindow = null;                             }      },       {            cls: 'x-btn-text-icon biggerToolbar', // icon and text class            icon: 'images/cross.png',            text: 'Cancel',            id: 'docCancel',            hidden: true,            tooltip: '<b>Cancel</b><br/>Cancel changes made to this document',            handler: function cancelDoc() { updatePanel('LastViewURL', 'center', 'center-content-panel' ); }     },	{            cls: 'x-btn-text-icon biggerToolbar', // icon and text class            icon: 'images/page_edit.png',            text: 'Edit',            id: 'docEdit',            hidden: true,            tooltip: '<b>Edit</b><br/>Edit this document',            handler: function editDoc(){ if ( Ext.get( 'center-iframe' ).dom.contentWindow.DocEditURL ){ updatePanel( Ext.get('center-iframe').dom.contentWindow.DocEditURL, 'center', 'center-iframe-panel' ); } }        },        	{            cls: 'x-btn-text-icon biggerToolbar', // icon and text class            icon: 'images/page_delete.png',            text: 'Delete',            id: 'docDelete',            hidden: true,            tooltip: '<b>Delete</b><br/>Delete this document',		  handler: function deleteDoc(){ Ext.Msg.confirm( "Delete", "Are you sure you want to delete this document?", function(response){ if( "yes" == response ) { updatePanel( Ext.get('center-iframe').dom.contentWindow.DocDeleteURL, 'center', 'center-iframe-panel' ) }}, this)}        },        	{            cls: 'x-btn-text-icon biggerToolbar', // icon and text class            icon: 'images/resultset_previous.png',            text: 'Previous Document',            id: 'docPrevious',            hidden: true,            tooltip:'<b>Previous</b><br/>Navigate to the previous document',            handler: function previousDoc (){ if (Ext.get('center-iframe').dom.contentWindow.NavigatePrevURL){ layout.getRegion('east').collapse(); updatePanel( Ext.get('center-iframe').dom.contentWindow.NavigatePrevURL, 'center', 'center-iframe-panel' )}}        },        	{            cls: 'x-btn-text-icon biggerToolbar', // icon and text class            icon: 'images/resultset_next.png',            text: 'Next Document',            id: 'docNext',            hidden: true,            tooltip: '<b>Next</b><br/>Navigate to the next document',            handler: function nextDoc (){ if (Ext.get('center-iframe').dom.contentWindow.NavigateNextURL){ layout.getRegion('east').collapse(); updatePanel( Ext.get('center-iframe').dom.contentWindow.NavigateNextURL, 'center', 'center-iframe-panel' )}}        },        {            cls: 'x-btn-text-icon biggerToolbar', // icon and text class            icon: 'images/printer.png',            text:'Print',            id: 'docPrint',            hidden: true,            tooltip: '<b>Print</b><br/>Print this document',		  handler: function printDoc(){ if ( Ext.get( 'center-iframe' ).dom.contentWindow.DocPrintURL ){ window.open( Ext.get('center-iframe').dom.contentWindow.DocPrintURL, '_blank' ); } }        },        '-',         {               cls: 'x-btn-text-icon biggerToolbar', // icon and text class               icon: 'images/layout2.png',        		text: 'Table of Contents',        		id: 'toggleEast',        		hidden: true,        		tooltip: '<b>Show/Hide Table of Contents Pane</b><br/>The table of contents pane lists all related elements in a hierarchy',        		//handler: function toggleCEP() { AppUI.toggleEast(); }	   	     enableToggle: true,        		toggleHandler: function toggleCEP() { AppUI.toggleEast(); this.pressed = true; }        		, pressed: false    		}    );    layout.endUpdate();    });function resetButtons() {	for ( var x= 1; x <= window.top.ctb.items.length; x++ ){		window.top.ctb.items.get( window.top.ctb.items.keys[x-1]).hide();	}}function showAllButtons() {	for ( var x= 1; x <= window.window.top.ctb.items.length; x++ ){		window.top.ctb.items.get( window.top.ctb.items.keys[x-1]).show();	}}function addUtilityActions() {	window.top.ctb.items.get( 'toggleEast').show();}
