ABC = function(id) {
	this.id = id;
	
	ABC.links[id] = this;
	this.div = document.getElementById(id);
	this.timer = null;
	this.timerC = null;
	this.open = 0;
	this.height = 0;
	this.shown = (this.div.style.display == '');
	
	this.nothide = false;

	this.listener = [];
	this.listener[0] = new Function('e', 'ABC.links[\'' + id + '\'].hide(e);');
	this.listener[1] = new Function('ABC.links[\'' + id + '\'].close();');
	
/*	if (this.div.addEventListener) {
		this.div.addEventListener('mouseout', this.listener[0], false);
		window.addEventListener('resize' , this.listener[1], false);
	} else if (this.div.attachEvent) {
		this.div.attachEvent('onmouseout' , this.listener[0]);
		window.attachEvent('onresize' , this.listener[1]);
	} else {
		this.div.onmouseout = new Function('e', 'ABC.links[\'' + id + '\'].hide(e); ABC.links[\'' + id + '\'].close();');
	}*/

	ABC.head = document.getElementById('headerLine');
	
}

ABC.minuse = 8;
ABC.deltaTop = 0;
ABC.links = [];
ABC.head = null;

ABC.prototype.show = function() {
	if (this.shown) { this.close(); return; }
	window.clearTimeout(this.timerC);
	var pos = ABC.absolute(ABC.head);
	this.div.style.position = 'absolute';
	this.div.style.top = (pos.y - ABC.deltaTop) + 'px';
	this.div.style.left = pos.x + 'px';
	this.div.style.width = (ABC.head.offsetWidth - ABC.minuse) + 'px';
	this.div.style.display = '';
	this.div.style.clip = 'rect(auto, auto, 0, auto)';
	this.height = this.div.offsetHeight;
	this.timer = window.setTimeout('ABC.links[\'' + this.id + '\'].anime()', 20);
/*	if (!this.nothide) this.timerC = window.setTimeout('ABC.links[\'' + this.id + '\'].close()', 7000);*/
	this.shown = true;
}

ABC.prototype.anime = function() {
	this.open += 7;
	this.div.style.clip = 'rect(auto, auto, ' + this.open + ', auto)';
	if (this.open < this.height) 
		this.timer = window.setTimeout('ABC.links[\'' + this.id + '\'].anime()', 10);
}

ABC.prototype.hide = function(event) {
	if (!event) event = window.event;
	var target = event.relatedTarget ? event.relatedTarget : event.toElement;
	var stop = false;
	while(target) {
		if (target.id == this.id) { stop = true; break; }
		target = target.parentElement ?  target.parentElement :  target.parentNode;
	}
	if (!stop) this.timerC = window.setTimeout('ABC.links[\'' + this.id + '\'].close()', 1000);
	else window.clearTimeout(this.timerC);
}

ABC.prototype.close = function() {
	this.open = 0;
	window.clearTimeout(this.timer);
	this.div.style.display = 'none';
	this.shown = false;
}

ABC.absolute = function(oObject) {
	var oPos = { x : oObject.offsetLeft, y : oObject.offsetTop };
	if (oObject.offsetParent) {
		var oTemp = ABC.absolute(oObject.offsetParent);
		oPos.x += oTemp.x;
		oPos.y += oTemp.y;
	}
	return oPos;
}