
var mopened = null;

function more(num,outcall){
	var add = "";
	if(num>1){
		add += num;
	}
	if(mopened!=null){
		if(mopened!=num){
			more(mopened,outcall);
		}
	}
	
	m = document.getElementById("more"+add);
	b = document.getElementById("b4"+add);
	
	if(b.style.display == "none"){
		m.style.display = "none";
		b.style.display = "block";
		mopened = null;

	}
	else{
		m.style.display = "block";
		b.style.display = "none";
		mopened = num;

	}
	
	if(!outcall){
		opencat(num,true);
	}

}


var opened = null;

function opencat(num,outcall){
	//alert("cat"+num+"i");
	m = document.getElementById("cat"+num+"i");

	if(opened!=num){
		if(opened!=null){
			n = document.getElementById("cat"+opened+"i");
			n.style.display = "none";
			opened=null;

		}
		m.style.display = "";
		opened = num;
	}
	else{
 		m.style.display = "none";
 		opened = null;
	}
	
	if(!outcall){
		more(num,true);
	
		
		
	}
	else{
		
		
		loc = location.href.indexOf("#");
		
		if(loc!=-1){
			
			location = location.href;
		}
		else{
			
				loc = location.href;
				if(location.href.indexOf("#up")!=01){
					loc = loc + "#up";
					location=loc;
				}

		}		
	}
	
	 
		
	  
	//location = (location.href.replace("#up",""))+"#up";
	
}

