/*

 * Ext JS Library 2.0.2

 * Copyright(c) 2006-2008, Ext JS, LLC.

 * licensing@extjs.com

 *

 * http://extjs.com/license

 */

Ext.onReady(function(){

///////// panel inside 'require/show_results.php'   ///////

  var tb1 = document.getElementById('panel_map');

  var tb2 = document.getElementById('listing_map');

  if(tb1)

  {

    var collap = (collapsed_map == 0 ? true : false);

    var tabActions = new Ext.Panel({

//            renderTo:'panel_map',

            renderTo:'tabs1',

            frame:true,

            title: 'Hide Map',

            collapsible:true,

            collapseMode: 'mini',

            collapsed: collap,

            width:530,

            margins:'0 0 0 0',

            border: true,

//            contentEl:'map_layer',

            contentEl:'script',

            defaults:{autoHeight: true, autoScroll: true},

            titleCollapse: true,

            listeners : {

             beforeCollapse: function(cmp){

                cmp.setTitle('View Map', 'add');

             },

             beforeexpand: function(cmp,an){

               cmp.setTitle('Hide Map', 'delete');

             }

            }

    });



//    setTitle( String title, [String iconCls] )

//collapse : ( Ext.Panel p )

/*

    // map tabs 1, built from existing content

    var tabs = new Ext.TabPanel({

        renderTo: 'tabs1',

        width:520,

        margins:'0 0 0 0',

        activeTab: 0,

        frame:true,

        defaults:{autoHeight: true},

        items:[

            {contentEl:'script', title: 'Map'}

        ]

    });

*/

  }

///////// panel inside 'main/show_results.php'   ///////

  if(tb2)

  {

/*

    var tabActions2 = new Ext.Panel({

            renderTo:'listing_map',

            frame:true,

            title: 'Details',

            collapsible: false,

            collapseMode: 'mini',

            collapsed: false,

            width:330,

            margins:'0 0 0 0',

            border: true,

            contentEl:'photo_map_layer',

            defaults:{autoHeight: true, autoScroll: true},

            titleCollapse: false

    });

*/

    // map tabs 2, built from existing content

    var tabs2 = new Ext.TabPanel({

        renderTo: 'pm_tabs',

        width:320,

        margins:'0 0 0 0',

        activeTab: 0,

        frame:true,

        defaults:{autoHeight: true},

        items:[

            {contentEl:'gallery', title: 'Photos'},

            {contentEl:'l_map_tab', title: 'Map'}

        ]

    });

  }

});