
function showMenu(nownum,maxnum,css){
  hide();
  for(var i=1; i<=maxnum;i++){
      try{
	        document.getElementById("bg"+i).className='';
	        document.getElementById("menu"+i).style.display="none";
	  }catch(e){}
  }
  document.getElementById("menu"+nownum).style.display="";
  document.getElementById("bg"+nownum).className=css;
}
function hideMenu(maxnum){
  for(var i=1; i<=maxnum;i++){
      try{
	        document.getElementById("bg"+i).className='';
	        document.getElementById("menu"+i).style.display="none";
	  }catch(e){}
  }
}
function SonMenu(nownum,maxnum,str){
  hide();
  for(var i=1; i<=maxnum;i++){
      try{
	        document.getElementById(str+i).style.display="none";
	  }catch(e){}
  }
  document.getElementById(str+nownum).style.display="";
}
function hideSon(maxnum,str){
  for(var i=1; i<=maxnum;i++){
      try{
	        document.getElementById(str+i).style.display="none";
	  }catch(e){}
  }
}
function showType(){
   $("#mtype").slideDown(100);
}
function getType(m){
    document.getElementById("sotype").value=m;
    document.getElementById("mtype").style.display="none";
}
function hide(){
    document.getElementById("mtype").style.display="none";
}
//window.onresize=hide;
window.document.body.onclick=hide;
