added HTML5/JavaScript version
less cluttered version