/***********************************************
* Menu
* Menu system originally developed by
* Stuart Langridge, November 2002
* sil@kryogenix.org
* http://www.kryogenix.org/code/browser/aqlists/
* Inspired by Aaron's labels.js (http://youngpup.net/demos/labels/) and Dave Lindquist's menuDropDown.js (http://www.gazingus.org/dhtml/?id=109)
***********************************************/
addEvent(window, "load", makeTreesC); function makeTreesC() { if (!document.createElement) return; uls = document.getElementsByTagName("ul"); for (uli=0;uli<uls.length;uli++) { ul = uls[uli]; if (ul.nodeName == "UL" && ul.className == "nav_menu") { processULELC(ul);}
}
}
function processULELC(ul) { if (!ul.childNodes || ul.childNodes.length == 0) return; for (var itemi=0;itemi<ul.childNodes.length;itemi++) { var item = ul.childNodes[itemi]; if (item.nodeName == "LI") { var a; var subul; subul = ""; for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) { var sitem = item.childNodes[sitemi]; switch (sitem.nodeName) { case "A": a = sitem; break; case "UL": subul = sitem; processULELC(subul); break;}
}
if (subul) { associateELC(a,subul);} else { a.parentNode.className = "menu_bullet";}
}
}
}
function associateELC(a,ul) { if (a.parentNode.className.indexOf('menu_open') == -1)
a.parentNode.className = 'menu_closed'; a.onclick = function () { this.parentNode.className = (this.parentNode.className=='menu_open') ? "menu_closed" : "menu_open"; return false;}
}
function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, false); return true;} else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r;} else { return false;}
}

/***********************************************
* dynamicCSS.js v1.0 <http://www.bobbyvandersluis.com/articles/dynamicCSS.php>
* Copyright 2005 Bobby van der Sluis
* This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
***********************************************/
function createStyleRule(selector, declaration) { if (!document.getElementsByTagName || !(document.createElement || document.createElementNS)) return; var agt = navigator.userAgent.toLowerCase(); var is_ie = ((agt.indexOf("msie") != -1)&& (agt.indexOf("opera") == -1)); var is_iewin = (is_ie&& (agt.indexOf("win") != -1)); var is_iemac = (is_ie&& (agt.indexOf("mac") != -1)); if (is_iemac) return; var head = document.getElementsByTagName("head")[0]; var style = (typeof document.createElementNS != "undefined") ? document.createElementNS("http://www.w3.org/1999/xhtml", "style") : document.createElement("style"); if (!is_iewin) { var styleRule = document.createTextNode(selector + " {" + declaration + "}"); style.appendChild(styleRule);}
style.setAttribute("type", "text/css"); style.setAttribute("media", "screen"); head.appendChild(style); if (is_iewin&& document.styleSheets&& document.styleSheets.length > 0) { var lastStyle = document.styleSheets[document.styleSheets.length - 1]; if (typeof lastStyle.addRule == "object") { lastStyle.addRule(selector, declaration);}
}
}
function setElementStyleById(id, propertyName, propertyValue) { if (!document.getElementById) return; var el = document.getElementById(id); if (el) el.style[propertyName] = propertyValue;}
function setElementStyle(element, propertyName, propertyValue) { if (!document.getElementsByTagName) return; var el = document.getElementsByTagName(element); for (var i = 0; i < el.length; i++) { el[i].style[propertyName] = propertyValue;}
}
function setElementStyleByClassName(cl, propertyName, propertyValue) { if (!document.getElementsByTagName) return; var re = new RegExp("(^| )" + cl + "( |$)"); var el = document.all ? document.all : document.getElementsByTagName("body")[0].getElementsByTagName("*"); for (var i = 0; i < el.length; i++) { if (el[i].className&& el[i].className.match(re)) { el[i].style[propertyName] = propertyValue;}
}
}
if (document.getElementById) { createStyleRule(".nav_menu ul", "display:none;"); createStyleRule("#section", "display:block;"); window.onload = myUnobtrusiveBehavior;}
function myUnobtrusiveBehavior() { setElementStyleByClassName(".nav_menu ul", "display", "none"); setElementStyleByClassName("#section", "display", "block");}