Moved vibrate function out of my application JavaScript and placed it into my index.html.