warning and perhaps quite noticeable to other people. in the call back function you cannot pass parameters otherwise you will call the callback function immediately i feel like a big idiot. look below if you do stopfunction(); as supposed to stopfunction you will end up calling the callback function immediately and chase your own tale. Hopefully this helps someone else who might run into this problem. The key hear is that "()"makes an anonymous function in Java script and immediately runs the function.
navigator.notification.confirm(
'you are aproaching your desired location', // message
stopFunction, // callback to invoke with index of button pressed
'Alarm', // title
['Dismissed'] // buttonLabels
);