Refactoring - add a function to get the parent box given an element (make it old browser compatible)