in reply to Conditions and Function call

Let me take a moment to strongly back up the statement of the preceeding poster regarding how crap those variable names are, and then further indicate that the actual code structure suggests a finite-state *nightmare* in your code.

You can tell when you have one of those, when your elseif clause operates solely on different variables. Hell I'd probably even go so far as to say most situations in which you use any other variable in the elseif is a sign of bad structure.

I suggest you get the whole of your code out, or at least an easily-readable section of it, and post up here for commentary, because even using the best of the solutions posted here, your structure is still going to cause you serious problems.