function SWFForceSize(id) {
    this.div = id;
    this.lasth = 0;
    this.lastw = 0;
    var o = this;
    this.addWindowEvent('onload', this, this.onLoadDiv);
}
SWFForceSize.prototype = {
    addWindowEvent: function(eventName, scope, func) {
        var oldEvent = window[eventName];
        if (typeof window[eventName] != 'function') window[eventName] = function() { func.call(scope); };
        else {
            window[eventName] = function() {
                if (oldEvent) oldEvent();
                func.call(scope);
            }
        }
    },
    getWinSize: function() {
        var winH, winW;
        if (parseInt(navigator.appVersion) > 3) {
            if (typeof (window.innerWidth) == 'number') { // Gecko / WebKit
                winW = window.innerWidth;
                winH = window.innerHeight;
            } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
                winW = document.documentElement.clientWidth;
                winH = document.documentElement.clientHeight;
            }
            else {
                winW = document.getElementsByTagName('body')[0].clientWidth,
                 winH = document.getElementsByTagName('body')[0].clientHeight
            }
        }
        return { height: winH, width: winW };
    },
    onLoadDiv: function() {
        this.addWindowEvent('onresize', this, this.onResizeDiv);
        this.onResizeDiv();
    },
    onResizeDiv: function() {
        window['onresize'] = null;
        var winSize = this.getWinSize();
        var w = winSize.width < 600 ? "600px" : "100%";
        var h = winSize.height - 136;
        var hs = h + "px";
        if (h < 600) {
            h = 600;
            hs = "600px";
        }
        if (w != this.lastw) {
            document.getElementById(this.div).style.width = w;
            this.lastw = w;
        }
        if (h != this.lasth) {
            if (h - 8 != this.lasth) {
                if (h - 10 != this.lasth) {
                    document.getElementById(this.div).style.height = hs;
                    document.getElementById('FlashId').style.height = hs;
                    this.lasth = h;
                }
            }
        }
        this.addWindowEvent('onresize', this, this.onResizeDiv);
    }
}
