var xmlDoc;
var bigClassID;
var smallClassID;

function loadXML(fileRoute){
    if (window.ActiveXObject) {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = false;
        xmlDoc.load(fileRoute);
    }
    else if (document.implementation && document.implementation.createDocument) {
        xmlDoc = document.implementation.createDocument('', '', null);
        xmlDoc.async = false;
        xmlDoc.load(fileRoute);
        browse = "ff";
    }
    else {
        alert('Î´×öÓë¸Ãä¯ÀÀÆ÷µÄ¼æÈÝ');
    }
}

function showClass(path){
	loadXML("/xml/" +path + ".xml");
	var BigClass = xmlDoc.getElementsByTagName("BigClass");
	var str = "";
	var smallstr = "";
	var BigClassCount = BigClass.length;
	var BigClassWitdh =  parseInt(705/BigClassCount);
	for(i=0;i<BigClassCount;i++){
		if (i == 0) {
			str += "<div class=\"ClassIndex\" onmousemove=\"changeList(this," + i + ")\"><div class=\"left\"><a target=\"_blank\" href=\"" + BigClass[i].getAttribute("url") + "\">" + BigClass[i].getAttribute("name") + "</a></div><div class=\"right\"></div></div>";
		}
		else {
			str += "<div class=\"ClassIndex_a\" onmousemove=\"changeList(this," + i + ")\"><div class=\"left\"><a target=\"_blank\" href=\"" + BigClass[i].getAttribute("url") + "\">" + BigClass[i].getAttribute("name") + "</a></div><div class=\"right\"></div></div>";
		}
		smallstr += "<div>";
		for(j=0;j<BigClass[i].childNodes.length;j++){
			smallstr += "<div><a target=\"_blank\" href=\"" + BigClass[i].childNodes[j].childNodes[1].text + "\\\">" + BigClass[i].childNodes[j].childNodes[0].text + "</a></div>";
		}	
		smallstr += "</div>";
	}
	bigClassID.innerHTML = str;
	smallClassID.innerHTML = smallstr;
	setWidth(bigClassID,1);
	setWidth(smallClassID,0);
}

function changeList(thisObject,num){
	for(i=0;i<bigClassID.childNodes.length;i++){
		bigClassID.childNodes[i].className = "ClassIndex_a";
	}
	thisObject.className = "ClassIndex";
	for(i=0;i<smallClassID.childNodes.length;i++){
		smallClassID.childNodes[i].style.display = "none";
	}
	smallClassID.childNodes[num].style.display = "block";
}

function setWidth(ElementObject,setType){
	for(i=0;i<ElementObject.childNodes.length;i++){
		if (setType == 1) {
			var ElementWidth = parseInt(705/ElementObject.childNodes.length);
			ElementObject.childNodes[i].style.width = ElementWidth;
			ElementObject.childNodes[i].childNodes[0].style.width = ElementWidth - 10;
		}
	}
	var a = "a";
	a.toLocaleLowerCase
}

