Javascript.ie is a project mainly written in JavaScript, it's free.
detect ie
various ie detection methods in javascript