Well I am a js newbie,
are the variables of the function local?
I mean is their structure like this "var variable = STRING" or variable = STRING?
Javascript is quite bugy if not made on the right structure. The variables with the var as a preffix are local and can be called only inside the functon i thing, maybe you should post the script here, so other users could give you further supervision and assistance.