added well-formed javascript
added id for prev,next,index and inserted ulgified js