I think that Javascipt is getting confused .....you have an object called Contact but you also define a variable called Contact after that so when you reference Contact it does not know which one you want. You can either rename the var to something else or use the full some expression to the Contact field.
Paul