var Carpenter = (function(){
    var getProperHeight = function(){
        if (document.all && !window.opera) {//its IE! Hooray!!! My favorite browser!!
            /*
             * Test for quirksmode and returns the value I want.
             * in quirksmode DOM method (the one tested) returns 0
             */
            return document.documentElement.clientHeight === 0 ? document.body.clientHeight : document.documentElement.clientHeight;
        }
        else { //all other browsers > IE
            return window.innerHeight;
        }
    };
    var getProperWidth = function(){
        if (document.all && !window.opera) {//its IE! Hooray!!! My favorite browser!!
            /*
             * Test for quirksmode and returns the value I want.
             * in quirksmode DOM method (the one tested) returns 0
             */
            return document.documentElement.clientWidth === 0 ? document.body.clientWidth : document.documentElement.clientWidth;
        }
        else { //all other browsers > IE
            return window.innerWidth;
        }
    };
    var frame = function(f){
        f.style.visibility = "hidden";
        f.height = getProperHeight() - f.offsetTop;
        f.width = getProperWidth() - f.offsetLeft;
        f.style.visibility = "visible";
    };
    
    return function(frames){
        var f = document.getElementsByTagName("IFRAME")[0];
        frame(f);
        window.onresize = function(){
            frame(f);
        };
    };
}());

