// Zeitgeist Movement Menus
// Version 1.0 (c) ZeitgeistMovement.com c/o tanktopdude@gmail.com
// Copyright (c) 2009, The Zeitgeist Movement, Licenced under GPL
// Adapted from suckerfish dropdown menu for Joomla 1.5 written by tbianco. 
// Search div tags by name. set events for matching LI tags
sfHover = function() {
        var p,i;
        p=document.getElementsByTagName('div');
        for(i in p){
                div=p[i];
               // Find sub menu items by their class name, and set event handlers
                if(/moduletable_zeitgeist_top/.test(div.className)) {
                        for (j=0; j<div.childNodes.length; j++){
                                if(div.childNodes[j].nodeName=="UL") {
                                        li=div.childNodes[j];
                                        for (k=0; k<li.childNodes.length; k++){
                                               if(li.childNodes[k].nodeName=="LI") {
                                                        li.childNodes[k].onmouseover=function(){ this.className+=" sfhover"; }
                                                        li.childNodes[k].onmouseout=function(){ this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); }
                                                }
                                        }
                                 }
                        }
                } //if
        } // for i
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

