
	activeli = null;	
	function menu(a) {
		if (! activeli) activeli = document.getElementById('firstmenu');
		var li = a.parentNode;
		if (li == activeli) return false;
		 
		activeli.className='';
		li.className = 'current';	
		activeli = li;
		return false;
	}

	function ena(obj,name) {
		var o = document.getElementById(name)
		if (! o) return true;
		
		o.className = (obj.checked) ? '' : 'disabled';
	
	}



	var cal = new DateTimePicker();

	function hidecal() {
		if (cal) setTimeout("cal.detach()",10);
	}

	function showcal(img) {
		picker = img.parentNode;
		if (! picker) return false;
		if (cal) cal.detach();
		input = picker.getElementsByTagName('input')[0];
		input.focus();
		div = picker.getElementsByTagName('div')[0];
		cal.attach(input,div);
		div.style.display = 'block';
	}


	function view(a) {
		div = getNextSibling(a);
		if (div == null) return;
		div.style.display = (div.style.display != 'block') ? 'block' : 'none';
		return false;
	}
		
		
	function getNextSibling(n)
	{
		x = n;
		while (x != null)
  		{
			x = x.nextSibling;
  			if (x.nodeType==1) return x;
  		}
  		return null;
	}
	

