imported from http://remysharp.com/2009/01/26/element-in-view-event-plugin/
formatting
added links, code formatting
trying to get github to render code blocks...
almost there...
almost there... ...
almost there... ... ...
README.textile should look as it does on Remy's blog post now
added note clarifying who 'I' is
added onResize event in addition to onScroll.
Now I off here to test this new fork...
added onClick to detect hidden/shown blocks in DOM tree.

But maybe that not so good solution, I will appreciate any better.
Added third parameter to binded function to detect which part of element fits into viewport: top, bottom or both.
Added third parameter to binded function to detect which part of element fits into viewport: top, bottom or both. (sic! forgot to update code :-) )
bug corrected: extended internal .data('inview') to hold three state, not two.
Added more complex example to detect full element view but more of that - only after some timeout
do_main_check renamed into adequate name (check_inview) because there is can not be smilies in function name.
iPad workaround: manually calculate offset rather than using jQuery's offset
iPad fix - window.innerHeight is the correct value
Use window.pageYOffset where available (correct on iOS)