#NEWLINE# def getScrollOffsets( ) : #NEWLINE# #INDENT# '\n    Get the window scroll offset values.\n    We only need these if pageX, pageY are not provided.\n\n    The uncommented formulation seems to work.\n    ' #NEWLINE# try : #NEWLINE# #INDENT# scrollOffsetY = doc ( ) . body . scrollTop #NEWLINE# scrollOffsetX = doc ( ) . body . scrollLeft #NEWLINE# return ( scrollOffsetX , scrollOffsetY ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# scrollOffsetY = doc ( ) . documentElement . scrollTop #NEWLINE# scrollOffsetX = doc ( ) . documentElement . scrollLeft #NEWLINE# return ( scrollOffsetX , scrollOffsetY )