what is the easiest way to figure out if a string ends with a certain value?
You can always prototype String class, this will work:
String.prototype.endsWith = function(str) {return (this.match(str+"$")==str)}
You can find other related extensions for String class in http://www.tek-tips.com/faqs.cfm?fid=6620