Ext.namespace('Ext.photo123');

Ext.photo123.PhotoButton = Ext.extend(Ext.Button, {
    initComponent : function(){

        Ext.photo123.PhotoButton.superclass.initComponent.call(this);

    },
    
  // private
    onRender : function(ct, position){

        if(!this.template){			
            if(!Ext.photo123.PhotoButton.photobtnTemplate) {
                                Ext.photo123.PhotoButton.photobtnTemplate = new Ext.Template(
                    '<table style="margin-right: 3px; margin-bottom: -16px;" border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>',
                    '<td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><em unselectable="on"><button type="{1}"><span style="font-family: Arial; font-size: 14px; font-weight: bold; color:#8b8b8b;"></span></button></em></td><td class="btn1_b">{0}</td>',
                    "</tr></tbody></table>");
            }
            this.template = Ext.photo123.PhotoButton.photobtnTemplate;
        }
        var btn, targs = [this.text || '&#160;', this.type];

        if(position){
            btn = this.template.insertBefore(position, targs, true);
        }else{
            btn = this.template.append(ct, targs, true);
        }
   
    	var btnEl = btn.child(this.buttonSelector);
        btnEl.on('focus', this.onFocus, this);
        btnEl.on('blur', this.onBlur, this);

        this.initButtonEl(btn, btnEl);

        if(this.menu){
            this.el.child(this.menuClassTarget).addClass("x-btn-with-menu");
        }
        Ext.ButtonToggleMgr.register(this);

     }

  
        
});
Ext.reg('photobtn', Ext.photo123.PhotoButton);

