I’m trying to run these two functions onload and don’t want the onload command in the body tag and am wondering if the way I set it up at the bottom is correct. It works fine but i’m not sure it’s the right way.
/* ================================================================
This copyright notice must be untouched at all times.
The original version of this script and the associated (x)html
is available at http://www.stunicholls.com/menu/paged_menu.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This script and the associated (x)html may be modified in any
way to fit your requirements.
=================================================================== */
rollMenu = function(menu) {
var getEls = document.getElementById(menu).getElementsByTagName('LI');
var getAgn = getEls;
for (var i=0; i<getEls.length; i++) {
getEls*.onmouseover=function() {
for (var x=0; x<getAgn.length; x++) {
getAgn[x].className=getAgn[x].className.replace('roll', '');
}
this.className+=' roll';
}
}
}
//-- ABBR Style, $Revision: 1.0 $,
//-- Courtesy of A List Apart: www.sovavsiti.cz/css/abbr.html
function styleAbbr() {
var oldBodyText, newBodyText, reg
if (isIE) {
oldBodyText = document.body.innerHTML;
reg = /<ABBR([^>]*)>([^<]*)<\/ABBR>/g;
newBodyText = oldBodyText.replace(reg, '<ABBR $1><SPAN class=\"abbr\" $1>$2</SPAN></ABBR>');
document.body.innerHTML = newBodyText;
}
}
window.onload = function() {
styleAbbr()
rollMenu('menu')
};
isIE = (document.all) ? true:false;