Moved code to 100% jquery - no more document.