improved javascript functionality for youtube video player