/*
 *   PANOPTIC
 *
 *   Script for fold-out menu & project navigation numbering
 *   
 *   /scripts/panoptic-menu.js
 *
 *   vizi | vorm geven aan inhoud
 *
 *   V0.1 - 21/06/2007 - Jeroen Visser
 *   V0.2 - 01/04/2008 - Jeroen Visser
 *
 ************************************************************/

/* HANG EXTRA FEATURES IN DOM
 *
 */
window.addEvent('load', panoptic_menu_init);


/* MENU FOLD INIT
 *
 */
function panoptic_menu_init()
{
	$$('#menu li').each(function(elem) {
		elem.addEvent('mouseover', foldout);
	});
	$$('#menu li').each(function(elem) {
		elem.addEvent('mouseout', foldin);
	});
	
	// Add numbering to project navigation
	$$('#projectnav li').each(function(elem, index) {
		if (!elem.hasClass('prev') && !elem.hasClass('next'))
		{
			elem.id = "projectnav-" + index;
		}
	});
}


/* FOLD SUBMENU OUT
 *
 */
function foldout()
{
	// Get references to relevant objects.
	if (this.id && (this.id.length > 0)) this.addClass('over');
}


/* FOLD SUBMENU IN
 *
 */
function foldin()
{
	if (this.id && (this.id.length > 0)) this.removeClass('over');
}



