function hiddenSPAN(){
//	var num = document.getElementsByTagName('span').length;
//	for(i=0;i<num;i++){
//		document.getElementsByTagName('span')[i].style.display='none';
//	}
	var id = 'subMenu_' + id;
	for(i=0;i<8;i++){
		var temp = 'subMenu_' + i;
		var objtemp=document.getElementById(temp);
		objtemp.style.display='none';
	}
}
document.onclick=function()
{
	hiddenSPAN();
	document.getElementById("subMenu_0").style.display='block';
	//document.getElementById("search_select").style.display='none';
}
function showSubMenu(id){
	var ids = 'subMenu_' + id;
	for(i=0;i<9;i++){
		var temp = 'subMenu_' + i;
		document.getElementById(temp).style.display='none';
	}
	document.getElementById(ids).style.display='block';
}
function chgTable(sequenceNum,sheetNum){
	var id = sequenceNum + '_' + sheetNum;
	for(i=1;i<=3;i++){
		var temp = sequenceNum + '_' + i;
		var tempMenu = sequenceNum + '_menu' + i;
		document.getElementById(temp).style.display='none';
		if(sheetNum == i){
			document.getElementById(tempMenu).className = 'title_sequence_on';
		}
		else{
			document.getElementById(tempMenu).className = 'title_sequence_top';
		}
	}
	document.getElementById(id).style.display='block';
}

function chgLabel(pos){
	if(pos=='left'){
		document.getElementById('labelClass').className = 'back_txt_gray';
		document.getElementById('labelClass_L').className = 'title_red_big';
		document.getElementById('labelClass_R').className = 'back_title_gray';
		document.getElementById('table_right').style.display='none';
		document.getElementById('table_left').style.display='';
	}
	else{
		document.getElementById('labelClass').className = 'back_txt_gray_m';
		document.getElementById('labelClass_R').className = 'title_red_big';
		document.getElementById('labelClass_L').className = 'back_title_gray';
		document.getElementById('table_right').style.display='';
		document.getElementById('table_left').style.display='none';
	}
}

function loadSubMenu(id){
	var objid=document.getElementById(id);
	objid.style.display='block';
}

function randomNum(startNum, endNum){
	return startNum+(Math.floor(Math.random()*endNum));
}

function randomStartNum(endNum){
	return Math.floor(Math.random()*endNum); 

}

function bringRandomStartImg(contextPath){
	var startNum = randomStartNum(5);
	var startImg;
	if(startNum==0) 
		startImg='<img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13">';
    else if(startNum==1) 
		startImg='<img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13">';
    else if(startNum==2) 
		startImg='<img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13">';
    else if(startNum==3) 
		startImg='<img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13">';
    else if(startNum==4) 
		startImg='<img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star_g.jpg" width="14" height="13">';
    else if(startNum==5) 
		startImg='<img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13"><img src="'+contextPath+'/images/star.jpg" width="14" height="13">';
	
	
	return startImg;
}

function getRootPath(){
	var strfullpath=window.document.location.href;
	var strpath=window.document.location.pathname;
	var pos=strfullpath.indexOf(strpath);
	var prepath=strfullpath.substring(0,pos);
	var postpath=strpath.substring(0,strpath.substr(1).indexOf('/')+1);
	return (prepath+postpath);
}

var rootPath="";
function setRootPath(contentPath){
	rootPath = contentPath;
}
