function showSub(n){
	hideAll();
	var obj = document.getElementById("sub"+n);
	var root = document.getElementById("subMenu");
	var subs = root.getElementsByTagName("div");

	obj.style.display = "block";
	
	if(n>0&&n<5){
		obj.style.textAlign = "left";
		obj.style.paddingLeft = (n-1) * 60 + "px";
	}
	if(n>4&&n<8){
		obj.style.textAlign = "center";
	}
	if(n>7&&n<11){
		obj.style.textAlign = "right";
		obj.style.paddingRight = (subs.length-n+1) * 60 + "px";
	}
	
}

function hideAll(){
	var root = document.getElementById("subMenu");
	var subs = root.getElementsByTagName("div");
	for(var i=0;i<subs.length;i++){
		subs[i].style.display = "none";
	}
}

function hideSub(){
	var root = document.getElementById("subMenu");
	var subs = root.getElementsByTagName("div");
	var folderName = getFolderName();
	for(var i=0;i<subs.length;i++){
//		if(folderName!=subs[i].getAttribute("sub").toString())
//			subs[i].style.display = "none"
//		else
//			subs[i].style.display = "block";
			
		subs[i].style.display = "none"
	}
	
}


function getFolderName(){
	var stringA = location.href.toLowerCase();
	var strlocation="/";
	var len = strlocation.length;
	var pos = stringA.indexOf(strlocation);
	if(pos>=0){
		var pos1,pos2;
		pos1 = stringA.lastIndexOf("/");
		stringA = stringA.substring(pos+len,pos1);
		pos2 = stringA.lastIndexOf("/");
		stringA = stringA.substring(pos2+1,pos1);
	}
	return stringA;
}


function disp(obj){
	obj.style.display="block";
	return false;
}

