while loop not working in javascript

I'm having a bit of trouble getting this code to work. I think it has something to do with the while loop. Also I'm new to JavaScript so, if you any suggestions on ways to improve the syntax or make my code more efficient it would be greatly appreciated.

how the code should work.
The user enters a cost of an item and then the amount of
money given. The program will figure out the change and the number of quarters, dimes, nickels, pennies needed for the change.

what happens when run
the two prompt boxes pop up and than I get a alert warning..

"A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue."