I'm making a site that rebuilds itself every night to allow static pages to keep fresh. Much of the addresses and navigation relies on clear naming of variables etc, which are later used as directory names and headers. I've got a rollover menu which until now has been fine, but I've got a new link to the site search engine. I want this engine to reside in a directory 'search', but if I try to pass an object called 'search' to a javascript function then it does not, and object.name etc are declared undefined. I might have expained badly so here is a bit of code...
This is the Javascript rollover on function:
--------------------------------
function on(obj)
{
if (document.images)
{
obj.src = path + obj.name + '_on.gif';
}
}
--------------------------------
This is a stripped down example of a link that works:
--------------------------------
<a href="link" onMouseOver="Javascript:on(history)">
<img src="history_off.gif" name="history"><a>
--------------------------------
This is the link that doesn't:
--------------------------------
<a href="link" onMouseOver="Javascript:on(search)">
<img src="search_off.gif" name="search"><a>
--------------------------------
Any ideas? I really would like to name this image 'search' for various reasons. Is the word search a special case in Javascript, I can't seem to find it anywhere...