I'm learning about do-while statements in my javascript class right now. I have this jumbled mess at the moment:

PHP Code:
//declare and initialize the finalTotal variable and input tally
var finalTotal 0;
inputTotal 0;
do {
//take input from the user (will happen at least once)
var input parseInt(prompt("Let's add numbers! Enter a Number to Add. When you're done, type 'quit'.""Enter A Number"));

if (
isNaN(input)) {
//give a message to user if input is invalid
document.writeln("<p>Try again! We are looking for numbers to add. Type 'quit' if you're finished.</p>");
} else {
finalTotal = (input finalTotal);

} while (
input != "quit");

document.writeln("<p>You've finished! You're final tally is: " finalTotal ". You inputed " inputTotal " numbers. You can do more than that, can't you?</p>"); 
Now, I know I have a couple problems here. One, I have the parseInt on the prompt, so they can't enter anything but a number. But, I need them to be able to type "quit" and have the sequence end. So, somehow I need to be able to have them put in numbers and the "do" cycle keeps going, but if they type any word except quit, it returns as NaN and goes back to the start. Then, once they type "quit", the sequence ends and prints the results.

I'd appreciate any help on this. Thanks!