/*global Ext*/
/*global EOS*/

// Initialise quick-tips
Ext.QuickTips.init();

// Set default form error position to 'side'
Ext.form.Field.prototype.msgTarget = 'side';

// Set some defaults for grids
Ext.grid.GridPanel.prototype.enableHdMenu = false;
Ext.grid.GridPanel.prototype.enableColumnMove = false;
Ext.grid.GridPanel.prototype.columnLines = true;
Ext.grid.GridPanel.prototype.stripeRows = true;

// Set toolbars to overflow automaticall
Ext.Toolbar.prototype.enableOverflow = true;

Ext.namespace("EOS");

EOS.banner = Ext.extend( Ext.BoxComponent, {
    region: "north"
    ,border: false
    ,height: 100
    ,autoEl: 'div'
    ,layout: 'fit'
    ,style: 'background: black url(/static/logo-150.png) top left no-repeat;'
    ,tpl: [
        '<div class="x-panel-header" style="float: right; width: 200px; height: 89px">'
            ,'<p> Welcome {user}</p>'
            ,'<p> {email} </p>'
            ,'<p> <a href="/logout/" style="text-decoration: none;">Log Out</a></p>'
        ,'</div>'
    ]
});

// Fix for disappearing checkboxes in IE
// See: http://www.sencha.com/forum/showthread.php?98155-FIXED-919-3.2-IE7-Disappearing-checkboxes&highlight=checkbox+ie7+disappears
Ext.override(Ext.form.Checkbox, {
    onRender : function(ct, position){
        Ext.form.Checkbox.superclass.onRender.call(this, ct, position);
        if(this.inputValue !== undefined){
            this.el.dom.value = this.inputValue;
        }
        this.wrap = this.el.wrap({cls: 'x-form-check-wrap'});
        if(this.boxLabel){
            this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-form-cb-label', html: this.boxLabel});
        }
        if(this.checked){
            this.setValue(true);
        }else{
            this.checked = this.el.dom.checked;
        }
        if (Ext.isIE && !Ext.isStrict) {
            this.wrap.repaint();
        }
        this.resizeEl = this.positionEl = this.wrap;
    }
});

EOS.version['$HeadURL: svn+ssh://trac.umd.com.au/home/svn/R500/trunk/EOS/common/media/js/eos.js $'] = '$Rev: 2866 $';



