// USER DEFINABLE AREA

// jc_timer is the timing variable  - 1000 = 1 second
jc_timer = 300

//names of menus stored here.
jc_menu=new Array()

// END OF USER DEFINABLE AREA


jc_retain = -1;
var hideTimer;

function hideAll() {
	if(jc_menu.length > 0) {
	for(i=0;i<jc_menu.length;i++) {
		obj2 = jc_menu[i];
		if(jc_retain!=jc_menu[i]) {
			$(obj2).setStyle('visibility','hidden');
			}
	}
	}
}

function hide(object) {
	jc_retain=-1; 
	hideTimer = setTimeout('hideAll()',jc_timer);
}

var show = function() {
	object = this.getNext('div');
	hideAll();
	obj = object.id;
	jc_retain = object.id;
	$(obj).setStyle('visibility','visible');
	jc_menu[jc_menu.length] = obj;
}

var showsub = function() {
	object = this;
	hideAll();
	obj = object.id;
	jc_retain = object.id;
	$(obj).setStyle('visibility','visible');
	jc_menu[jc_menu.length] = obj;
}

window.addEvent('domready', function() {  
 $$('.navrun').addEvent('mouseenter', show);
 $$('.navrun').addEvent('mouseleave', hide);
 $$('.navrunsub').addEvent('mouseenter', showsub);
 $$('.navrunsub').addEvent('mouseleave', hide);
});  