Javascript script loaded function. Thanks to Nicholas C. Zakas. See http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/