function menu_toggle(obj) {

	// hide all the elements and then unhide specific one
	hideAll();
	
	// display only the specified "page"
	document.getElementById(obj).style.display = 'block';

	// make the active menu item frozen in hover state
	document.getElementById('menu_' + obj).className = 'active';
}


function hideAll(){
	for (var i=0;i<ids.length;i++){
		// hide all the elements defined in the array
		document.getElementById(ids[i]).style.display = 'none';

		// change the class back to not hover state
		document.getElementById('menu_' + ids[i]).className = 'inactive';
	}
}


// this function might not be needed
function showAll(){
	for (var i=0;i<ids.length;i++){
		// shows all the elements defined in the array
		document.getElementById(ids[i]).style.display = 'block';

		// change the class back to not hover state
		document.getElementById('menu_' + ids[i]).className = 'inactive';
	}
}


// Permalink function
function perma(link) {
	document.write('<div class="permalink top-content">');
	document.write('Permanent link to this page: ');
	document.write('<a href="' + link + '">' + link + '</a>');
	document.write('</div>');
	document.write('<div style="clear: left"></div>');
}


// generic toggle (similar to menu, but less specific)
function inline_toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = 'block';
	}
}

function inline_hideAll(page_ids){
	for (var i=0;i<page_ids.length;i++){
		document.getElementById(page_ids[i]).style.display = 'none';
	}
}

function inline_showAll(page_ids){
	for (var i=0;i<page_ids.length;i++){
		document.getElementById(page_ids[i]).style.display = 'block';
	}
}


/*
 * Konami-JS
 * http://snaptortoise.com/konami-js
 * Copyright (c) 2009 George Mandis (georgemandis.com)
 * Version: 1.0 (04/27/2009)
 * Licensed under the Artistic License/GPL
 * http://dev.perl.org/licenses/
 * Tested in: Safari 4, Firefox 3, IE7
 */

var konami = {
        input:"",
        clear:setTimeout('konami.clear_input()',2000),
        load: function(link) {
                window.document.onkeyup = function(e) {
                        konami.input+= e ? e.keyCode : event.keyCode         
                        if (konami.input == "38384040373937396665") {
                                konami.code(link)
                                clearTimeout(konami.clear)
                                }
                        clearTimeout(konami.clear)
                        konami.clear = setTimeout("konami.clear_input()",2000)
                        }
        },
        code: function(link) { window.location=link},
        clear_input: function() {
                konami.input="";
                clearTimeout(konami.clear);
        }
}