browser_name = navigator.appName;
browser_version = parseFloat(navigator.appVersion);

if (browser_name == "Netscape" && browser_version >= 3.0)
{
    roll = 'true';
}
else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 3.0)
{
    roll = 'true';
}
else
{
    roll = 'false';
}

function over(img,ref)
{
    if (roll == 'true')
    {
        document.images[img].src = eval(img+'.src');
    }
}

function out(img,ref)
{
    if (roll == 'true')
    {
        document.images[img].src = ref;
    }
}



function getElementsByClass(searchClass,node,tag) {

        var classElements = new Array();
        if ( node == null )
                node = document;

        if ( tag == null )
               tag = '*';
        var els = node.getElementsByTagName(tag);
        var elsLen = els.length;

        var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
        for (i = 0, j = 0; i < elsLen; i++) {
               if ( pattern.test(els[i].className) ) {
                    classElements[j] = els[i];
                   j++;
              }
        }
        return classElements;
}

// JavaScript Document

startList = function(id) {


    if (document.all&&document.getElementById)
    {
        //alert(222);
        
        var navRoots = new Array();
        navRoots[0] = document.getElementById("m1");
        navRoots[1] = document.getElementById("m21");
        navRoots[2] = document.getElementById("m22");
        navRoots[3] = document.getElementById("m3");
        //здесь добавлять новый id для ul меню
        
        navRoots = getElementsByClass("ul_over", null, "ul");
        //alert(navRoots);
        for (j=0; j<navRoots.length; j++)
        {
            navRoot = navRoots[j];

            //alert(navRoot);

            for (i=0; i<navRoot.childNodes.length; i++)
            {
                node = navRoot.childNodes[i];
                if (node.nodeName=="LI")
                {
                    node.onmouseover=function()
                    {
                        this.className+=" over";

                    }

                    node.onmouseout=function()
                    {
                        this.className=this.className.replace(" over", "");
                    }
                }
            }
        }
    }

}

window.onload=startList;


