CREDITSThe original code was written by Ryan Hansen (http://techandbehavior.com) and reposted here with his permission