var bV = parseInt(navigator.appVersion);
NS4 = (document.layers) ? true : false;
IE4 = ((document.all)&&(bV>=4)) ? true:false;
ver4 = (NS4 || IE4) ? true : false;


function getIndex($1) {
	ind = null;
	for (i=0; i<document.layers.length; i++) {
		div = document.layers[i];
		if (div.id == $1) {
			ind = i;
			break;
		}
	}
	return ind;
}

function arrange() {
	pos = document.layers[index].pageY + document.layers[index].document.height;
	for (i=index+1; i<document.layers.length; i++){
		div = document.layers[i];
		if (div.visibility != "hide"){
			div.pageY = pos;
			pos += div.document.height;
		}
	}
}

function Carregar(){
	if (NS4) {
		for (i=0; i<document.layers.length; i++) {
			div = document.layers[i];
			if (div.id.indexOf("title") != -1){
				n = div.id;
				index = getIndex(n);
				showAll();
			}
			if (div.id.indexOf("ct") != -1) div.visibility = "hide";
		}
		arrange();
	}
	else {
		tot = document.all.tags("div");
		for (i=0; i<tot.length; i++) {
			if (tot(i).className == "ctd") tot(i).style.display = "none";
		}
	}
}

function abrir($1,$2) {
	
	if (!ver4) return;
	if (IE4) { showIE($1,$2); } 
	else { showNS($1,$2); }
}

function showIE($1,$2) {

	show_t = eval($1 + "t");
	show_t.blur();
	show_ct = eval($1 + "ct");
	show_img = eval($1 + "img");
	if (show_ct.style.display == "none") {
		show_ct.style.display = "block";
		show_img.src = "../../images/minus_" + $2 + ".jpg";
	}
	else {
		show_ct.style.display = "none";
		show_img.src = "../../images/plus_" + $2 + ".jpg";
	}
}

function showNS($1,$2) {
	show_ct = eval("document." + $1 + "ct");
	show_img = eval("document." + $1 + "img");
	if (show_ct.visibility == "hide") {
		show_ct.visibility = "show";
		show_img.src = "../../images/minus_" + $2 + ".jpg";
	}
	else {
		show_ct.visibility = "hide";
		show_img.src = "../../images/plus_" + $2 + ".jpg";
	}
	arrange();
}

function showAll() {
	for (i=index; i<document.layers.length; i++) {
		div = document.layers[i];
		div.visibility = "show";
	}
}


with (document) {
	write("<STYLE TYPE='text/css'>");
	if (NS4) {
		write(".tit { font-family: Verdana; font-size: 11px; text-decoration:none; color: #666666; line-height:0pt; margin-top: 0px; margin-bottom: 0px; position: absolute; visibility: hidden }");
		write(".ctd { font-family: Verdana; font-size: 11px; text-decoration: none; color: #666666; line-height:15pt; position:absolute }");
		write(".txt { font-family: Verdana; font-size: 11px; text-decoration: none; color: #666666}");
	}
	else {
		write(".tit { font-family: Verdana; font-size: 11px; text-decoration: none; color: #666666 }");
		write(".ctd { font-family: Verdana; font-size: 11px; text-decoration: none; color: #666666; display: none }");
		write(".txt { font-family: Verdana; font-size: 11px; text-decoration: none; color: #666666 }");
	}
	write("</STYLE>");
}

onload = Carregar;