Fast JavaScript Max/Min, John Resig. From http://ejohn.org/blog/fast-javascript-maxmin/