// Dropdown Menu
var now_index;
var now_subindex;
var timeout;

function start() {
	initDHTMLAPI();
	now_index = 1;

	init();
	menu_position();
	rabba_central_h8();
}

function menu_position() {
    for(i = 1; i < 4; i++) {
		var r = getAbsCoord(document.getElementById("mi" + i));
		if(isIE) {
			document.getElementById("si" + i).style.left = r.x;
		}
		else {
			document.getElementById("si" + i).style.left = r.x + 20 + "px";
		}
		document.getElementById("si" + i).style.top = r.y + 20 + "px";
	}
}

function rabba_central_h8() {
	var y = getObjectHeight("main_content");
	if(isIE) {
		document.getElementById("cent_col").style.height = y;
	}
	else {
		document.getElementById("cent_col").style.height = y + "px";
	}
}

function showSubmenu(obj) {
	clearTimeout(timeout);
	var index = obj.id;
	index = obj.substr(2, 3);
	//alert (index);
	if (index != now_index) {
		hide ("si" + now_index);
		show ("si" + index);
		now_index = index;
	} else {
		show ("si" + index);
	}
}
function hideSubmenu(obj, ms) {
	var index = obj.id;
	index = obj.substr(2, 1);
	//alert (index);
	timeout = setTimeout("hideByTime()", ms);  
}
function hideByTime(obj) {
	hide("si" + now_index);
}
function showshow() {
	show ("si" + now_index);
}

function getAbsCoord(obj) {
	var x=0, y=0, tg=obj;	
	while(obj) {	
		x+=obj.offsetLeft;	
		y+=obj.offsetTop;	
		obj=obj.offsetParent;	
	}
	return {x: x, y:y};
}