Bottom line is, if you are using the OnClientClick property of the button, and you are trying to prevent a PostBack from happening, then you need to have your JavaScript function return false. If it doesn't, then the PostBack will occur.

Part of the issue here, I suspect, is the fact that you have JavaScript errors in your function. Namely, the lines are not terminating with a ;.

What browser are you using for debugging your application? These JavaScript errors should be getting shown to you.

Gary