function show_topic(type){
	var selectno = document.getElementById('selectno').innerHTML;
	var select_old = selectno;
	var maxno = document.getElementById('maxno').innerHTML;
	switch(type){
		case 'ini':
			var i;
			maxno = 0;
			for(i=1;document.getElementById('f1-topic'+i);i++){
				maxno++;	var myID = 'f1-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			for(i=1;document.getElementById('f2-topic'+i);i++){
				maxno++;	var myID = 'f2-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			for(i=1;document.getElementById('f3-topic'+i);i++){
				maxno++;	var myID = 'f3-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			for(i=1;document.getElementById('f4-topic'+i);i++){
				maxno++;	var myID = 'f4-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			for(i=1;document.getElementById('f5-topic'+i);i++){
				maxno++;	var myID = 'f5-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			for(i=1;document.getElementById('f6-topic'+i);i++){
				maxno++;	var myID = 'f6-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			for(i=1;document.getElementById('f7-topic'+i);i++){
				maxno++;	var myID = 'f7-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			for(i=1;document.getElementById('f8-topic'+i);i++){
				maxno++;	var myID = 'f8-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			for(i=1;document.getElementById('f9-topic'+i);i++){
				maxno++;	var myID = 'f9-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			for(i=1;document.getElementById('b1-topic'+i);i++){
				maxno++;	var myID = 'b1-topic'+i;	var obj = document.getElementById(myID);
				obj.setAttribute('id','topic'+maxno);
			}
			selectno = 1;
		
			break;
		case 'next':
			selectno++;
			break;
		case 'back':
			selectno--;
			break;
		default:
			break;
	}
	if(selectno > maxno){
		selectno = 1;
	}else if(selectno < 1){
		selectno = maxno;
	}
	document.getElementById('selectno').innerHTML = selectno;
	document.getElementById('maxno').innerHTML = maxno;
	var myID;
	for(i=1;i <= maxno;i++){
		myID = 'topic' + i;	
		if(i == selectno){
			document.getElementById(myID).style.display = 'block';
			Spry.Effect.DoFade(myID, {duration:700,from:0,to:100,toggle:true});
			continue;
		}else if(i == select_old){
			hidd_topic(myID);
		}else{
			hidd_topic(myID);
		}
	}
}
function hidd_topic(myID){
	document.getElementById(myID).style.display = 'none';
}