//alert("alive 5.91");
sfHover = function() {
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].title = sfEls[i].className; // use title for fear of other stuff not existing
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover " + this.className+"_sfhover";
        // drosenstark: now it has three classnames: the original, sfhover, and a new hybrid for direct addressing
        }
        sfEls[i].onmouseout=function() {
            //restore the classname
            this.className = this.title;
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
		
var __eventListeners = [];
function addListener(instance, eventName, listener) {
    var listenerFn = listener;
    if (instance.addEventListener) {
        instance.addEventListener(eventName, listenerFn, false);
    } else if (instance.attachEvent) {
        listenerFn = function() {
            listener(window.event);
        };
        instance.attachEvent("on" + eventName, listenerFn);
    } else {
    //throw new Error("Event registration not supported");
    }
    var event = {
        instance: instance,
        name: eventName,
        listener: listenerFn
    };
    __eventListeners.push(event);
    return event;
}
		
var SITE=window.SITE||{};
var qVal;
function windowOnload(){
    //search input box listener: empty default value on click, reload if unchanged on blur, else leave as what user input
    qVal = window.document.getElementById('q').value;
    SITE.listener = addListener(window.document.getElementById('q'), "click", function() {
        if(window.document.getElementById('q').value == qVal){
            window.document.getElementById('q').value = '';
        }
    });
    SITE.listener = addListener(window.document.getElementById('q'), "blur", function() {
        if(window.document.getElementById('q').value === ''){
            window.document.getElementById('q').value = qVal;
        }
    });
}
window.onload = windowOnload;
