/*
 * Ext JS Library 2.2.1
 * Copyright(c) 2006-2009, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */


//var button = Ext.get('show-btn');
//var button = document.getElementById('show-btn');
var mapwin;

function gmap()
{
    //var button = Ext.get('show-btn');
    //button.on('click', function(){
        // create the window on the first click and reuse on subsequent clicks
        //if(!mapwin){

            mapwin = new Ext.Window({
                layout: 'fit',
                title: 'GMap Window',
                closeAction: 'hide',
                width:500,
                height:500,
                x: 40,
                y: 60,
                items: {
                    xtype: 'gmappanel',
                    region: 'center',
                    zoomLevel: 14,
                    gmapType: 'map',
                    mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging','enableGoogleBar', 'openInfoWindow'],
                    mapControls: ['GSmallMapControl','GScaleControl','GMapTypeControl','NonExistantControl'],
                    setCenter: {
                        geoCodeAddr: '32 Rue des moulins Gémeaux, 93200 Saint-Denis, France',
                        marker: {title: 'Centre Imagerie du Nord'}
                    },
                    markers: [{
                        lat: 48.880430,
                        lng: 2.355022,
                        marker: {title: 'Gare du Nord'},
                        listeners: {
                            click: function(e){
                                Ext.Msg.alert('Its fine', 'and its art.');
                            }
                        }
                    }]
                }
            });
            
        //}
        
        mapwin.show();
        
    //});
 };