The javascript would be less than a dozen lines of code, so it's not a huge task if you had to start from scratch.
Have a go at it and if you get stuck post your code and we can try to help you get it working. That would save me from starting from scratch