function getWindowForElement(element) {
        var doc = element.ownerDocument || element;
        return doc.defaultView || doc.parentWindow || window;
    }
function getWindowForElement(element) {
        var doc = element.ownerDocument || element;
        return doc.defaultView || doc.parentWindow || window;
    }
function getWindowForElement ( element ) { var doc = element . ownerDocument || element ; return doc . defaultView || doc . parentWindow || window ; }
get the window object of an element
@param {HTMLElement} element
@returns {DocumentView|Window}
get the window object of an element