var box2_selectedIndex;
var box1, box2;

function initBox(box,boxArray) {
	f = document.getElementById(box);
	f.length = boxArray.length;
	for (x=0;x<boxArray.length;x++) {
		f.options[x].value=boxArray[x].substring(0,boxArray[x].indexOf("::"));
		f.options[x].text=boxArray[x].substring(boxArray[x].indexOf("::")+2);
	}
	f.selectedIndex=0;
}

function writeBox2() {
	boxArray = box2Array[box1.selectedIndex];
	strHTML = "";
	for (x=0;x<boxArray.length;x++) {
		if (x==box2_selectedIndex) {
			strHTML += "- <span class='ext_links_sel'>"
			+ boxArray[x].substring(boxArray[x].indexOf("::")+2)
			+ "</span><br>";
		}
		else {
			strHTML += "- <a href='JavaScript:void(null)' onClick='showContent(" + x + ");return(false)'>"
				+ boxArray[x].substring(boxArray[x].indexOf("::")+2)
				+ "</a><br>";
		}
	}
	box2.innerHTML = strHTML;
}

function initBoxes() {
	box1 = document.getElementById("selBox1");
	box2 = document.getElementById("divBox2");
	initBox("selBox1",box1Array);
	initBox2();
}

function initBox2() {
	box2_selectedIndex = 0;
	writeBox2();
	showContent(0);
}

function showContent(index) {
	box2_selectedIndex = index;
	writeBox2();
	if (window.ActiveXObject) obj_loader = new ActiveXObject("Microsoft.XMLHTTP")
	else obj_loader = new XMLHttpRequest()
		
	obj_loader.onreadystatechange = function() {
		if (obj_loader.readyState == 4) {
			document.getElementById("dinContent").innerHTML = obj_loader.responseText
			}
		}
	obj_loader.open('GET',contentPath + box2Array[box1.selectedIndex][index].substring(0,box2Array[box1.selectedIndex][index].indexOf("::")),true)
	obj_loader.send(null)
}

