/**
 * SoftViewport - alternatywa dla Viewport. Różnica polega na tym, że Viewport nie zmniejsza się poniżej rozdzielczości
 * 1020x525. 
 * @author Piotr Krokowski
 * @version 1.0, Ext 2.0-alhpa!!!
 * @copyright LGPL
 **/

Ext.SoftViewport = Ext.extend(Ext.Container, {
    initComponent : function() {
        Ext.Viewport.superclass.initComponent.call(this);
        document.getElementsByTagName('html')[0].className += ' x-softviewport';
        this.el = Ext.getBody();
        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;
    },

    fireResize : function(w, h){
    	if (w>1020 && h>525)
        	this.fireEvent('resize', this, w, h, w, h);
    }
});
Ext.reg('softviewport', Ext.SoftViewport);
