1. You have to use == to check for equality, one = is for assigning a value.
2. Your code is impossible to debug without the 'bigger' picture (the code that's responsible for calling onWalkCheck()).
3. Please use PHP tags instead, and style your code properly when you post it. You can use my beautifier to do that for you:
http://fp4.ca/gs2beautifier