if (isArray(INIT_NAV_EFFECTS) && (document.createElementNS || document.createElement) && document.createTextNode && document.appendChild && document.insertBefore) {
    var stretchers = document.getElementsByClassName('stretcher'); // ul that stretches
    var toggles = new Array(); // links where I click on
    var p, a;
    for (var i = 0; i < stretchers.length; i++) {
        p = (document.createElementNS) ? document.createElementNS(XHTML_NS_URI, 'p') : document.createElement('p');
        p.className = 'links';
        a = (document.createElementNS) ? document.createElementNS(XHTML_NS_URI, 'a') : document.createElement('a');
        a.setAttribute('href', '#');
        a.className = 'closed';
        a.appendChild(document.createTextNode(INIT_NAV_EFFECTS[i].open.text));
        a.setAttribute('title', INIT_NAV_EFFECTS[i].open.tooltip)
        p.appendChild(a);
        toggles[i] = a;
        stretchers[i].parentNode.insertBefore(p, stretchers[i]);
    }

    // enhance default accordion effect object located in moo.fx.pack
    fx.Accordion.prototype.hideThis = function(toHide){
		if (toHide.offsetHeight == 0) setTimeout(function(){this.clearAndToggle(toHide);}.bind(this), this.options.delay);
		this.elements.each(function(el, i){
			if (el.offsetHeight > 0) this.clearAndToggle(el);
		}.bind(this));
	}

    // accordion effect
    var myAccordion = new fx.Accordion(toggles, stretchers, {opacity: true, duration: 500});
    toggles.each(function(a, i) {
        addEventHandler(a, 'click', function() {

            var srcEl;
            if (this == window && event) { // IE/Win does not understand "this", if event is attached other than "a.onclick = '...'"
                srcEl = event.srcElement
                while (srcEl.nodeName.toLowerCase() != 'a') { // Source element might be a nested node inside the desired a-node
                    srcEl = elem.parentNode;
                }
            } else {
                srcEl = this;
            }

            for (var k = 0; k < toggles.length; k++) {
                if (srcEl != toggles[k]) {
                    toggles[k].className = 'closed';
                    toggles[k].firstChild.nodeValue = INIT_NAV_EFFECTS[k].open.text;
                    toggles[k].title = INIT_NAV_EFFECTS[k].open.tooltip;
                }
            }
            srcEl.className = (srcEl.className == 'closed') ? 'opened' : 'closed';
            srcEl.firstChild.nodeValue = (srcEl.className == 'closed') ? INIT_NAV_EFFECTS[i].open.text : INIT_NAV_EFFECTS[i].close.text;
            srcEl.title = (srcEl.className == 'closed') ? INIT_NAV_EFFECTS[i].open.tooltip : INIT_NAV_EFFECTS[i].close.tooltip;

            var ul = Element.find(a.parentNode, 'nextSibling'); // element.find is located in prototype.lite
            myAccordion.hideThis(ul);
        });
    });

}
