Online document editor - Where and what do I start with?
===

I plan to build a product that would let users do what Google Docs is doing today (although, not as good as Microsoft would do it) - edit word docs. The reason I can't use Google Docs is coz I need to build something new on top of it - like annotation support/ metadata support and all that. 

So, if I were to start from scratch, How big a task is this going to be? Can I start with some  fancy JS libraries and extend them or something? For instance, something like yahoo pipes, non-flash, pure JS/HTML5 + ajax based web application. Are there open source alternatives that I can make use of?