It had to happen some day….
In the project we’re currently working on, we have a masterpage with a JavaScript powered menu. In this masterpage, a JavaScript function with the name HideUnhide was defined to toggle the visibility of parts of the menu.
Everything worked fine until we opened a page containing a webpart rendering a SharePoint DateTimeControl. After some investigation, it appeared that the DateTimeControl is referencing a script file with the name datepicker.js from the \12\TEMPLATE\LAYOUTS folder.
As you’ve probably already guessed it turned out that this script file also defines a function with the name HideUnhide. Renaming our MasterPage function obviously solved the issue.
There are lots of .js files in the 12 hive so there’s always a chance that a javascript function with the same name as the one you’re about to implement already exists.

