        //#e7ae4a - darker yellow

        function addTask(function1, function2)
        {
          // instead of using window.onload = init() on your own JS pages, please
          // use the following line:
          //
          // window.onload = addTask(myNewFunction, window.onload);

          // that way we can specify 'multiple' onload tasks without clobbering
          // each other's code.
          // Robert Hahn

          return function() {
            if (function1)
              function1();
            if (function2)
              function2();
          }
        }

        var viz_menu = [];

        function showMenu(m, level) {
                if (viz_menu == m) return;
                hideMenu(level);
                viz_menu[viz_menu.length] = m;
                menutitle = "top_" + m;
                dropshadow = m + "_shadow";
                dropshadow_side = dropshadow + "_s";

                //Element.show(m);
				getObject(m).style.display = '';
				
                //h=Element.getHeight(m);
				h=getObject(m).clientHeight;
				
                //$(dropshadow_side).style.height = h + "px";
				getObject(dropshadow_side).style.height = h + "px";
				
                //l = Element.getStyle(m,'left');
                //t = Element.getStyle(m,'top');
				l = getObject(m).style.left;
				t = getObject(m).style.top;
				
                if(l != null || t != null) {
					if(l > 0 && t > 0 ) {
                        //$(dropshadow).style.left = (parseInt(l)+3) + "px";
                        //$(dropshadow).style.top = t;
						
//alert(t + "/" + l);
//alert((t>0) + "/" + (l>0));
						
						getObject(dropshadow).style.left = (parseInt(l)+3) + "px";
						getObject(dropshadow).style.top  = t;
					}
				}
                //Element.show(dropshadow);
				getObject(dropshadow).style.display = '';

                //if($(menutitle)) {
                if(getObject(menutitle)) {
                        //$(menutitle).style.backgroundColor = '#e7ae4a';
						getObject(menutitle).style.backgroundColor = '#e7ae4a';
                }
                //Element.show('invisibleLyr');
				getObject('invisibleLyr').style.display = '';
        }

        function hideMenu() {
                level = (arguments.length == 1)? arguments[0]:1;
                if (viz_menu.length == 0) return;
                vm_length = viz_menu.length;
                while (level <= vm_length){
                        m = viz_menu[viz_menu.length-1];
                        viz_menu.length--;
                        menutitle = "top_" + m;
                        dropshadow = m + "_shadow";
                        dropshadow_side = dropshadow + "_s";

                        //Element.hide(m);
						getObject(m).style.display = 'none';

						//h=Element.getHeight(m);
						h=getObject(m).clientHeight;
						
                        //$(dropshadow_side).style.height = h + "px";
						getObject(dropshadow_side).style.height = h + "px";

						//l = Element.getStyle(m,'left');
                        //t = Element.getStyle(m,'top');
						l = getObject(m).style.left;
						t = getObject(m).style.top;

						if(l != null || t != null) {
							if(l > 0 && t > 0 ) {
                              //$(dropshadow).style.left       = (parseInt(l)+3) + "px";
                                //$(dropshadow).style.top        = t;
						
								getObject(dropshadow).style.left = (parseInt(l)+3) + "px";
								getObject(dropshadow).style.top  = t;
							}
                        }
                        //Element.hide(dropshadow);
						getObject(dropshadow).style.display = 'none';
                        
						//if($(menutitle)) {
						if(getObject(menutitle)) {
                                //$(menutitle).style.backgroundColor = '';
								getObject(menutitle).style.backgroundColor = '';
                        }
                        vm_length = viz_menu.length;
                }

                if (viz_menu.length == 0) {
                        //Element.hide('invisibleLyr');
						getObject('invisibleLyr').style.display = 'none';
                }
        }

        function toggleBar(menutitle) {
                if($(menutitle)) {
                        $(menutitle).style.backgroundColor = ($(menutitle).style.backgroundColor == '')? '#e7ae4a':'';
                }
        }

        function toggle_trigger(e) {
                node = e.parentNode;
                // toggle image
                imgnode = e.nextSibling;
                while (imgnode) {
                        if(imgnode.nodeName == "IMG") {
                                if(imgnode.src.indexOf("opened") > -1) {
                                        imgnode.src = imgnode.src.replace(/opened/, "closed");
                                } else {
                                        imgnode.src = imgnode.src.replace(/closed/, "opened");
                                }
                        }

                        imgnode = imgnode.nextSibling;
                }
                // toggle content
                while (node.nextSibling) {
                        node = node.nextSibling;
                        if(node.hasChildNodes() && Element.classNames(node) == "elementcollapsed") {
                                Element.toggle(node);
                                node = false;
                        }
                }
        }
        function setActiveStyleSheet(title) {
          var i, a, main;
                for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
                        if (a.getAttribute("rel") && a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
              a.disabled = true;
              if(a.getAttribute("title") == title) a.disabled = false;
            }
          }
        }

          // frameproofing the homepage.
                  if(window.top.frames.length > 0) window.top.location.href=location.href;


/* code needed for the events homepage */

function toggleform(img, frm, box) {
        $(img).src = (/arrow-bottom-right/.test($(img).src))? '/media/img/arrow-top-left.png':'/media/img/arrow-bottom-right.png';
        Element.toggle(frm);
        if ($(box).hasClassName('expandablebox_open')) {
                $(box).removeClassName('expandablebox_open');
                $(box).addClassName('expandablebox_close');
        } else {
                $(box).removeClassName('expandablebox_close');
                $(box).addClassName('expandablebox_open');
        }
}

