d = document;
	
function cleanup(o, nocont) {
	for (var i=0, o2; o2 = o.childNodes[i]; i++) {
		if (o2.nodeType == 3 && o2.nodeValue.match(/^\s+$/)) {
			o.removeChild(o2);
			i--;
			continue;
		}
		
		if (!nocont) cleanup(o2);
	}
} 

function get_offset(o) {
	var offset = [o.offsetLeft, o.offsetTop], _p = o.offsetParent;
	
	offset[0] += _p.offsetLeft;
	offset[1] += _p.offsetTop;
	
	while (_p = _p.offsetParent) {
			offset[0] += _p.offsetLeft;
			offset[1] += _p.offsetTop;
	}
	
	return offset;
}

function make_menu (o) {
	var o = d.getElementById(o);
	o.itms = o.getElementsByTagName('a');
	
	cleanup(o);
	
	for (var i=0, o2;  o2 = o.itms[i]; i++) {
	
		if (o2.className == 'i' && o2.parentNode.className == 'sect') {			
			o2._p = o;
			o2.onmouseover = function() {
			
				clearTimeout(this._p.t1);
				
				if (this._p.s) this._p.s.className = 'sect';
				this.parentNode.className = 'sect s';
				this._p.s = this.parentNode;
			}
			
			o2.onmouseout = function() {
				var o = this, f = function() {
					o.parentNode.className = 'sect';
				}
				this._p.t1 = setTimeout(f, 500);
			}
			
			o2.sm = o2.nextSibling;
			
			if (o2.sm) {
			
				o2.sm._p = o;
				
				o2.sm.onmouseover = function(e) {
					clearInterval(this._p.t1);
				}
				
				o2.sm.onmouseout = function() {
					clearTimeout(this._p.t1);
					var o = this, f = function() {
						o.parentNode.className = 'sect';
						if (o.s) o.s.className = 'sect';
					}
					this._p.t1 = setTimeout(f, 500);
				}
			}
			
		} else if (o2.parentNode.className == 'sect') {
			o2._p = o;
			o2.onmouseover = function() {
				clearTimeout(this._p.t1);
				if (this.parentNode.parentNode.s) this.parentNode.parentNode.s.className = 'sect'
				this.sm.style.marginLeft = 0;
				this.parentNode.className = 'sect s';
				this.parentNode.parentNode.s = this.parentNode;
				
				this.sm.style.marginLeft = (d.documentElement.clientWidth < (get_offset(this.sm)[0] + this.offsetWidth + this.sm.offsetWidth + 5)) ? (-this.sm.offsetWidth - 10)+'px' : (this.offsetWidth+5)+'px'//365+'px';
			}
			
			o2.onmouseout = function() {
				clearTimeout(this._p.t1);
				var o = this, f = function() {
					o.parentNode.className = 'sect';
				}
				this._p.t1 = setTimeout(f, 500);
			}
			
			o2.sm = o2.nextSibling;
			o2.sm._p = o//o2.parentNode;
			
			o2.sm.onmouseover = function() {				
				clearTimeout(this._p.t1);
			}
		
		} else if (o2.parentNode.parentNode.className == 'sub') {
			o2._p = o;
			o2.onmouseover = function() {
				clearTimeout(this._p.t1);
				if (this.parentNode.parentNode.s) this.parentNode.parentNode.s.className = 'sect';
			}		
		}		
	}	
}

function make_sm(o) {

	var o = d.getElementById(o);
	o.itms = o.getElementsByTagName('a');
	
	for (var i=0, o2; o2 = o.itms[i]; i++) {
		if (o2.className != 'i') continue;
		
		o2._p = o;	
		
		if (o2.parentNode.className == 's') o.s = o2.parentNode;		
		
		o2.onclick = function() {
			if (this._p.s) this._p.s.className = '';
		
			if (this._p.s != this.parentNode) {
				this.parentNode.className = 's';
				this._p.s = this.parentNode;
			} else {
				this._p.s = false;
			}
			
			return (false);
		}
	}
}	
