You can put this solution on YOUR website! I solved a very similar problem earlier today. I think that if you see the solution for that problem you will be able to solve this problem, Click here to see this other solution.
Sorry about the earlier problem. There was a typo that made the link fail. I tested this one and it works.