var tabCounts = Array();

function foldBox(_id, _container) {
	
	var box = getById("box_" + _id);
	var box_content = getById("box_" + _id + "_content");
	
	if(pathPrefix.indexOf("?") > -1)
		var seperator = "&";
	else
		var seperator = "?";
	
	if(box_content.style.display == "none") {
		
		box_content.style.display = "";
		if(_container == "t" || _container == "mmt" || _container == "mmb" || _container == "b")
			box_content.style.height = containerSizes[_container] + "px";
		getById("fold_box_" + _id).src = iconPath + "/arrow_up_16.png";
		
		if(!containerSizes[_container])
			box_content.style.height = "";
		
		var request = new AjaxRequest(pathPrefix + "/Ajax/styShowBox" + seperator + "id=" + _id + sid2);
		request.doRequest();
			
	}
	else {
		
		box_content.style.display = "none";
		if(box.style.height)
			box.style.height = "";
		getById("fold_box_" + _id).src = iconPath + "/arrow_down_16.png";
			
		var request = new AjaxRequest(pathPrefix + "/Ajax/styHideBox/" + seperator + "id=" + _id + sid2);
		request.doRequest();
		
	}
	
}

function showTab(_box, _tab, _container) {
	
	hideTabs(_box);
	
	getById("tab_" + _box + "_" + _tab).style.display = "";
	getById("tabli_" + _box + "_" + _tab).className = "tab active";
	
	if(getById("box_" + _box + "_content").style.display == "none")
		foldBox(_box, _container);
	
	return false;
	
}

function hideTabs(_box) {
	
	for(var i = 0; i < tabCounts[_box]; i++) {
		getById("tab_" + _box + "_" + i).style.display = "none";
		getById("tabli_" + _box + "_" + i).className = "tab";		
	}
	
}
