﻿Ext.BLANK_IMAGE_URL = 'extjs/resources/images/default/s.gif';

var pageLayout;
var initPageLayout = function () { }

Ext.FormViewport = Ext.extend(Ext.Viewport, {
    initComponent: function () {
        Ext.FormViewport.superclass.initComponent.call(this);
        document.getElementsByTagName('html')[0].className += ' x-viewport';
        this.el = Ext.get(document.forms[0]);
        this.el.setHeight = Ext.emptyFn;
        this.el.setWidth = Ext.emptyFn;
        this.el.setSize = Ext.emptyFn;
        this.el.dom.scroll = 'no';
        this.allowDomMove = false;
        this.autoWidth = true;
        this.autoHeight = true;
        Ext.EventManager.onWindowResize(this.fireResize, this);
        this.renderTo = this.el;
    }
});
Ext.reg('FormViewport', Ext.FormViewport);

Ext.onReady(function () {
    initPageLayout();
    var viewport = new Ext.FormViewport({
        defaults: {
            border: false,
            autoScroll: true
        },
        layout: 'border',
        items: [{
            autoScroll: false,
            region: 'north',
            height: 150,
            contentEl: 'MainLayoutNorth'
        }, {
            id: 'PanelMainLayoutSouth',
            autoScroll: false,
            region: 'south',
            height: 100,
            contentEl: 'MainLayoutSouth'
        }, pageLayout]
    });
});