﻿Ext.namespace('Root.Theme');

      var button =
     {
        id:'kalButton',
        xtype: 'panel',
        bodyStyle: 'padding: 4px 4px 0 4px',
        border: true,
        layout: 'table',
        autoWidth:true,
        layoutConfig:
         {
            columns: 1,
            tableAttrs: { style: 'width: 100%;' }
         },
        defaults:
         {
            style: 'margin-bottom: 4px;',
            xtype: 'button',
            scale: 'medium',
            width: 270,
            handler: function(button) {
               if(HOME_ACTIVATE_KALIKRATIS_SEARCH_BUTTON) {
                  var win = new Ext.Window({
                     title: 'Αναζήτηση Καλλικρατικού Δήμου'
                   , width: 650
                   , height: 350
                   , modal: true
                   , plain: true
                   , html: '<iframe src="' + URL_KALLIKRATIS_SEARCH + '" width="100%" height="100% style="border: 0px solid; background: White none no-repeat center center;" frameborder="0"></iframe>'
                  });
                  win.show();
               } else {
                  Ext.Msg.alert('Μήνυμα',MSG_DEACTIVATED);
               }
            }
         },
        items:
         [
             {
                id: 'btnSearch',
                text: 'Αναζήτηση Καλλικράτειου Δήμου'
             }
         ]
     };

Root.Theme.Right = Ext.extend(Ext.Container,
{
    id: 'right',
    siteRoot: undefined,
    autoScroll: true,
          
    // Constructor
    initComponent: function()
    {
        Ext.apply(this,
	    {
            /*items:
            [
                { 
                    width: 250,
                    id: 'map',
                    xtype: 'panel',
                    autoHeight: true,
                    autoWidth: true,
                    padding: 5,
                    defaults: { xtype: 'container', border: false },
                    items: [{ html: '<a href="http://www.ypes.gr/el/Regions/programma/" target="_new"><img src="home/images/map.png" style="margin:10px" border="0"/></a>'}]
                },
                {xtype:'spacer',height:5},  
                button
            ]*/
	    });
	    
	    // Call parent
	    Root.Theme.Right.superclass.initComponent.apply(this, arguments);
    }
});

// Register xtype
Ext.reg('Root-Theme-Right', Root.Theme.Right);
