Ok, to achieve this as you've started it I'd recommend some sort of javascript library (first guess
http://www.jquery.com).
I would recommend that you don't do it this way though - 6000 entries is a lot. Is this running on a web server or just a file you open off your computer?