in reply to Syntax error near ){
And at the end, there are two '}' too many, I think.
It would be easier if you used codetags, biofeng918. I mean, put <code> before your code and </code> after it.