38fcc662be 2010-11-10 kinaba: /* This file is a part of CanDyDOC fileset. 38fcc662be 2010-11-10 kinaba: File is written by Victor Nakoryakov and placed into the public domain. 38fcc662be 2010-11-10 kinaba: 38fcc662be 2010-11-10 kinaba: This file is javascript with cross-browser utility functions. */ 38fcc662be 2010-11-10 kinaba: 38fcc662be 2010-11-10 kinaba: function getLeft(elem) 38fcc662be 2010-11-10 kinaba: { 38fcc662be 2010-11-10 kinaba: var ret = 0; 38fcc662be 2010-11-10 kinaba: while (elem.offsetParent) 38fcc662be 2010-11-10 kinaba: { 38fcc662be 2010-11-10 kinaba: ret += elem.offsetLeft; 38fcc662be 2010-11-10 kinaba: elem = elem.offsetParent; 38fcc662be 2010-11-10 kinaba: } 38fcc662be 2010-11-10 kinaba: 38fcc662be 2010-11-10 kinaba: return ret; 38fcc662be 2010-11-10 kinaba: } 38fcc662be 2010-11-10 kinaba: 38fcc662be 2010-11-10 kinaba: function getTop(elem) 38fcc662be 2010-11-10 kinaba: { 38fcc662be 2010-11-10 kinaba: var ret = 0; 38fcc662be 2010-11-10 kinaba: while (elem.offsetParent) 38fcc662be 2010-11-10 kinaba: { 38fcc662be 2010-11-10 kinaba: ret += elem.offsetTop; 38fcc662be 2010-11-10 kinaba: elem = elem.offsetParent; 38fcc662be 2010-11-10 kinaba: } 38fcc662be 2010-11-10 kinaba: 38fcc662be 2010-11-10 kinaba: return ret; 38fcc662be 2010-11-10 kinaba: } 38fcc662be 2010-11-10 kinaba: 38fcc662be 2010-11-10 kinaba: function getWindowHeight() 38fcc662be 2010-11-10 kinaba: { 38fcc662be 2010-11-10 kinaba: var ret = 0; 38fcc662be 2010-11-10 kinaba: if (typeof(window.innerHeight) == "number") 38fcc662be 2010-11-10 kinaba: ret = window.innerHeight; 38fcc662be 2010-11-10 kinaba: else if (document.documentElement && document.documentElement.clientHeight) 38fcc662be 2010-11-10 kinaba: ret = document.documentElement.clientHeight; 38fcc662be 2010-11-10 kinaba: else if (document.body && document.body.clientHeight) 38fcc662be 2010-11-10 kinaba: ret = document.body.clientHeight; 38fcc662be 2010-11-10 kinaba: 38fcc662be 2010-11-10 kinaba: return ret; 38fcc662be 2010-11-10 kinaba: }