Hi.

I have a small script which adds a class to the current menu item selected.

function activate(single){
var links=document.getElementsByTagName('a');
for(i=0;i<links.length;i++){
if(links[i].className=='mywork_active'){
links[i].className='xtrig';
}
}
single.className='mywork_active';
}

Currently on the page load (this menu is within one page) the first menu item which is loaded does not have this .mywork_active class. Its not until you click it or another item that the class is added.

What would I need to do make the script add this class to the first item on load.

The menu looks like so:

<div class="mywork_nav">
<ul>
<li><a class="xtrig" href="#1" onclick="activate(this);" rel="slider-1">1</a></li>
<li><a class="xtrig" href="#2" onclick="activate(this);" rel="slider-1">2</a></li>
<li><a class="xtrig" href="#3" onclick="activate(this);" rel="slider-1">3</a></li>
<li><a class="xtrig" href="#4" onclick="activate(this);" rel="slider-1">4</a></li>
<li><a class="xtrig" href="#5" onclick="activate(this);" rel="slider-1">5</a></li>
</ul>
</div>

Thank you!!