/** Miscellaneous JavaScript snippets common to all pages.
 */

/** Writes a mailto link to the page.
 * This is used to hide email addresses from spam bots.
 * @param box the local part of the address to link
 */
function Mail (box) {
    var address = box + '@snafucon.com';
    document.write('<a href="mailto:' + address + '">' + address + '</a>');
};

// Fix for CSS hover menus in Internet Exploder
if (window.attachEvent) window.attachEvent( "onload", function() {
	var menus = document.getElementById( "nav" ).getElementsByTagName( "li" );
    for (var idx=0; idx < menus.length; idx++) {
        menus[ idx ].onmouseover = function() {
            this.className += " sfhover";
        };
        
        menus[ idx ].onmouseout = function() {
            this.className = this.className.replace(
            		new RegExp(" sfhover\b"), "");
        };
    }
});
