var max_menu_up_num=6;
var max_menu_down_num=12;

var up_index=-1;
var is_out_menu_up=true;
var is_out_menu_down=true;
var is_out_menu_div=true;
//鼠标旋停时切换图片
function show_menu_up(){
	var i=0;
	for(i=0;i<max_menu_up_num;i++){
		if(typeof(menu_up[languageHobby][i])!="undefined" && 
			typeof(menu_up[languageHobby][i][0])!="undefined" && 
			document.getElementById("menu_up_"+i)!=null ){
			document.getElementById("img_menu_up_"+i+"_"+languageHobby).style.display="none";
			document.getElementById("img_menu_up_"+i+"_"+languageHobby+"_1").style.display="";
			document.getElementById("menu_up_"+i).style.width=menu_up[languageHobby][i][2];
		}
	}
}

function show_menu_down(show_down_index){
	var i=0;
	if(typeof(menu_down[languageHobby][up_index])!="undefined"){
			if(show_down_index==1){
					document.getElementById("dht1").style.display="none";
					document.getElementById("oters").style.display="none";
					document.getElementById("dht2").style.display="";
			}else if(show_down_index==5){
					document.getElementById("dht2").style.display="none";
					document.getElementById("oters").style.display="none";
					document.getElementById("dht1").style.display="";
			}else{
					document.getElementById("dht1").style.display="none";
					document.getElementById("dht2").style.display="none";
					document.getElementById("oters").style.display="";
			}
	}
}

function set_menu_up_select(index){
	if(typeof(menu_up[languageHobby][index])!="undefined" && 
		typeof(menu_up[languageHobby][index][1])!="undefined" && 
		document.getElementById("menu_up_"+index)!=null ){
		document.getElementById("img_menu_up_"+index+"_"+languageHobby).style.display="";
		document.getElementById("img_menu_up_"+index+"_"+languageHobby+"_1").style.display="none";
		document.getElementById("menu_up_"+index).style.width=menu_up[languageHobby][index][2];
			
			if(index==1){
				document.getElementById("oters").style.display="none";
				document.getElementById("dht1").style.display="none";
				document.getElementById("dht2").style.display="";
			}else if(index==5){
				document.getElementById("oters").style.display="none";
				document.getElementById("dht2").style.display="none";
				document.getElementById("dht1").style.display="";
			}else{
				document.getElementById("dht1").style.display="none";
				document.getElementById("dht2").style.display="none";
				document.getElementById("oters").style.display="";
			}
	}
}

function set_menu_down_select(down_index){
	if(typeof(menu_down[languageHobby][up_index])!="undefined" && 
		typeof(menu_down[languageHobby][up_index][down_index])!="undefined" && 
		typeof(menu_down[languageHobby][up_index][down_index][1])!="undefined" && 
		document.getElementById("menu_down_"+down_index)!=null ){
		document.getElementById("img_menu_down_"+down_index+"_"+up_index+"_"+languageHobby).style.display="none";
		document.getElementById("img_menu_down_"+down_index+"_"+up_index+"_"+languageHobby+"_1").style.display="";
		document.getElementById("menu_down_"+down_index).style.width=menu_down[languageHobby][up_index][down_index][2];
	}
}

function over_menu_up(index){
	up_index=index;
	is_out_menu_up=false;
	is_out_menu_div=false;
	show_menu_up();
	set_menu_up_select(index);
	clear_menu_down();
	show_menu_down(index);
}

function over_menu_down(down_index){
	is_out_menu_down=false;
	is_out_menu_div=false;

}

function over_menu_div(){
	is_out_menu_div=false;
}

function clear_menu_down(){
	if(up_index==1){
		document.getElementById("dht1").style.display="none";
		document.getElementById("oters").style.display="none";
		document.getElementById("dht2").style.display="";
	}else if(up_index==5){
		document.getElementById("oters").style.display="none";
		document.getElementById("dht2").style.display="none";
		document.getElementById("dht1").style.display="";
	}else{
		document.getElementById("dht1").style.display="none";
		document.getElementById("dht2").style.display="none";
		document.getElementById("oters").style.display="";
	}
			
}

function out_menu_up(){
	is_out_menu_up=true;
	delay();
}

function out_menu_down(){
	is_out_menu_down=true;
	delay();
}

function out_menu_div(){
	is_out_menu_div=true;
	delay();
}

function delay(){
	setTimeout('out_all_menu()',1000);
}

function out_all_menu(){
	if(is_out_menu_div && is_out_menu_up && is_out_menu_down){
		up_index=-1;
		show_menu_up();
		clear_menu_down();
		show_default_menu();
	}
}

function menu_up_onclick(index,languageHobby){
	switch(index){
	case 1:
		switch(languageHobby){
		case 0:
			 window.location.href="/jp/Product/productList";break;
		case 1:
			 window.location.href="/en/Product/productList";break;
		case 2:
			 window.location.href="/kr/Product/productList";break;
		case 3:
			 window.location.href="/cn/Product/productList";break;
		case 4:
			 window.location.href="/es/Product/productList";break;
		default:
			window.location.href="/jp/Product/productList";
		 }break;
	case 2:
		switch(languageHobby){
			case 0:
				  window.location.href="/jp/Provider/providerList";break;
			case 1:
				  window.location.href="/en/Provider/providerList";break;
			case 2:
				  window.location.href="/kr/Provider/providerList";break;
			case 3:
				 window.location.href="/cn/Provider/providerList";break;
			case 4:
				 window.location.href="/es/Provider/providerList";break;
			default:
				window.location.href="/jp/Provider/providerList";
			 }break;
		
	case 3:
		 //window.location.href="/User/login.jsp";
	case 4:
		switch(languageHobby){
			case 0:
				 window.location.href="/jp/Info/infoList";break;
			case 1:
				  window.location.href="/en/Info/infoList";break;
			case 2:
				   window.location.href="/kr/Info/infoList";break;
			case 3:
				  window.location.href="/cn/Info/infoList";break;
			case 4:
				  window.location.href="/es/Info/infoList";break;
			default:
				  window.location.href="/jp/Info/infoList";
			 }break;
		
	case 5:
		switch(languageHobby){
			case 0:
				window.location.href="/jp/Static/membershipFees.html";break;
			case 1:
				 window.location.href="/en/Static/membershipFees.html";break;
			case 2:
				   window.location.href="/kr/Static/membershipFees.html";break;
			case 3:
				 window.location.href="/cn/Static/membershipFees.html";break;
			case 4:
				  window.location.href="/es/Static/membershipFees.html";break;
			default:
				 window.location.href="/jp/Static/membershipFees.html";
			 }break;
		
	default:
			switch(languageHobby){
			case 0:
				window.location.href="/jp/index.html";break;
			case 1:
				window.location.href="/en/index.html";break;
			case 2:
				   window.location.href="/kr/index.html";break;
			case 3:
				 window.location.href="/cn/index.html";break;
			case 4:
				 window.location.href="/es/index.html";break;
			default:
				window.location.href="/jp/index.html";
			 }
		 
	}
}

function menu_down_onclick(index){
	switch(index){
	case 0:
		 window.location.href="/Product/productList/classify_1.html";break;
	case 1:
		 window.location.href="/Product/productList/classify_2.html";break;
	case 2:
		 window.location.href="/Product/productList/classify_3.html";break;
	case 3:
		 window.location.href="/Product/productList/classify_4.html";break;
	case 4:
		 window.location.href="/Product/productList/classify_5.html";break;
	case 5:
		 window.location.href="/Product/productList/classify_6.html";break;
	case 6:
		 window.location.href="/Product/productList/classify_7.html";break;
	case 7:
		 window.location.href="/Product/productList/classify_8.html";break;
	default:
		 window.location.href="/Product/productList";
	}
}

function show_default_menu(){
	if(menu_default_id>=0 && menu_default_id<6){
		over_menu_up(menu_default_id);
	}
}
function setUrl(){
var currentUrl = window.location.toString();
var sublength=0;
	if(currentUrl=="http://www.machine2live.com"){
		sublength=currentUrl.length;
	}else{
		sublength="http://www.machine2live.com/jp".length;
	}
var url = currentUrl.substr(sublength,currentUrl.length);
if(url==""){
	document.getElementById("jp").href="/jp/index.html";
	document.getElementById("en").href="/en/index.html";
	document.getElementById("kr").href="/kr/index.html";
	document.getElementById("cn").href="/cn/index.html";
	document.getElementById("es").href="/es/index.html";
}else{
	document.getElementById("jp").href="/jp"+url;
	document.getElementById("en").href="/en"+url;
	document.getElementById("kr").href="/kr"+url;
	document.getElementById("cn").href="/cn"+url;
	document.getElementById("es").href="/es"+url;
}
}
/***************************************************************/

var menu_up=new Array();

/*japan*/
menu_up[0]=new Array();
menu_up[0][0]=new Array();
menu_up[0][0][0]="/images/G_162_1.gif";
menu_up[0][0][1]="/images/G_162.gif";
menu_up[0][0][2]="84px";

menu_up[0][1]=new Array();
menu_up[0][1][0]="/images/G_163_1.gif";
menu_up[0][1][1]="/images/G_163.gif";
menu_up[0][1][2]="117px";

menu_up[0][2]=new Array();
menu_up[0][2][0]="/images/G_164_1.gif";
menu_up[0][2][1]="/images/G_164.gif";
menu_up[0][2][2]="117px";

menu_up[0][3]=new Array();
menu_up[0][3][0]="/images/G_165_1.gif";
menu_up[0][3][1]="/images/G_165.gif";
menu_up[0][3][2]="84px";

menu_up[0][4]=new Array();
menu_up[0][4][0]="/images/G_166_1.gif";
menu_up[0][4][1]="/images/G_166.gif";
menu_up[0][4][2]="117px";


menu_up[0][5]=new Array();
menu_up[0][5][0]="/images/G_220_1.gif";
menu_up[0][5][1]="/images/G_220.gif";
menu_up[0][5][2]="117px";

/*usa*/
menu_up[1]=new Array();
menu_up[1][0]=new Array();
menu_up[1][0][0]="/images/G_167_1.gif";
menu_up[1][0][1]="/images/G_167.gif";
menu_up[1][0][2]="84px";

menu_up[1][1]=new Array();
menu_up[1][1][0]="/images/G_168_1.gif";
menu_up[1][1][1]="/images/G_168.gif";
menu_up[1][1][2]="117px";

menu_up[1][2]=new Array();
menu_up[1][2][0]="/images/G_169_1.gif";
menu_up[1][2][1]="/images/G_169.gif";
menu_up[1][2][2]="117px";

menu_up[1][3]=new Array();
menu_up[1][3][1]="/images/G_170.gif";
menu_up[1][3][0]="/images/G_170_1.gif";
menu_up[1][3][2]="84px";

menu_up[1][4]=new Array();
menu_up[1][4][0]="/images/G_171_1.gif";
menu_up[1][4][1]="/images/G_171.gif";
menu_up[1][4][2]="117px";

menu_up[1][5]=new Array();
menu_up[1][5][0]="/images/G_221_1.gif";
menu_up[1][5][1]="/images/G_221.gif";
menu_up[1][5][2]="136px";

/*korea*/
menu_up[2]=new Array();
menu_up[2][0]=new Array();
menu_up[2][0][0]="/images/G_172_1.gif";
menu_up[2][0][1]="/images/G_172.gif";
menu_up[2][0][2]="84px";

menu_up[2][1]=new Array();
menu_up[2][1][0]="/images/G_173_1.gif";
menu_up[2][1][1]="/images/G_173.gif";
menu_up[2][1][2]="117px";

menu_up[2][2]=new Array();
menu_up[2][2][0]="/images/G_174_1.gif";
menu_up[2][2][1]="/images/G_174.gif";
menu_up[2][2][2]="117px";

menu_up[2][3]=new Array();
menu_up[2][3][0]="/images/G_175_1.gif";
menu_up[2][3][1]="/images/G_175.gif";
menu_up[2][3][2]="84px";

menu_up[2][4]=new Array();
menu_up[2][4][0]="/images/G_176_1.gif";
menu_up[2][4][1]="/images/G_176.gif";
menu_up[2][4][2]="117px";

menu_up[2][5]=new Array();
menu_up[2][5][0]="/images/G_222_1.gif";
menu_up[2][5][1]="/images/G_222.gif";
menu_up[2][5][2]="117px";

/*china*/
menu_up[3]=new Array();
menu_up[3][0]=new Array();
menu_up[3][0][0]="/images/G_106_1.gif";
menu_up[3][0][1]="/images/G_106.gif";
menu_up[3][0][2]="84px";

menu_up[3][1]=new Array();
menu_up[3][1][0]="/images/G_107_1.gif";
menu_up[3][1][1]="/images/G_107.gif";
menu_up[3][1][2]="117px";

menu_up[3][2]=new Array();
menu_up[3][2][0]="/images/G_108_1.gif";
menu_up[3][2][1]="/images/G_108.gif";
menu_up[3][2][2]="117px";

menu_up[3][3]=new Array();
menu_up[3][3][0]="/images/G_109_1.gif";
menu_up[3][3][1]="/images/G_109.gif";
menu_up[3][3][2]="84px";

menu_up[3][4]=new Array();
menu_up[3][4][0]="/images/G_110_1.gif";
menu_up[3][4][1]="/images/G_110.gif";
menu_up[3][4][2]="117px";

menu_up[3][5]=new Array();
menu_up[3][5][0]="/images/G_223_1.gif";
menu_up[3][5][1]="/images/G_223.gif";
menu_up[3][5][2]="117px";

/*spain*/
menu_up[4]=new Array();
menu_up[4][0]=new Array();
menu_up[4][0][0]="/images/G_177_1.gif";
menu_up[4][0][1]="/images/G_177.gif";
menu_up[4][0][2]="84px";

menu_up[4][1]=new Array();
menu_up[4][1][0]="/images/G_178_1.gif";
menu_up[4][1][1]="/images/G_178.gif";
menu_up[4][1][2]="117px";

menu_up[4][2]=new Array();
menu_up[4][2][0]="/images/G_179_1.gif";
menu_up[4][2][1]="/images/G_179.gif";
menu_up[4][2][2]="117px";

menu_up[4][3]=new Array();
menu_up[4][3][0]="/images/G_180_1.gif";
menu_up[4][3][1]="/images/G_180.gif";
menu_up[4][3][2]="84px";

menu_up[4][4]=new Array();
menu_up[4][4][0]="/images/G_181_1.gif";
menu_up[4][4][1]="/images/G_181.gif";
menu_up[4][4][2]="117px";

menu_up[4][5]=new Array();
menu_up[4][5][0]="/images/G_224_1.gif";
menu_up[4][5][1]="/images/G_224.gif";
menu_up[4][5][2]="117px";

/****************************************************************************************************************************/
var menu_down=new Array();

//japanese
menu_down[0]=new Array();
menu_down[0][1]=new Array();
menu_down[0][1][0]=new Array();
menu_down[0][1][0][0]="/images/G_124.gif";
menu_down[0][1][0][1]="/images/G_124_1.gif";
menu_down[0][1][0][2]="89px";
menu_down[0][1][1]=new Array();
menu_down[0][1][1][0]="/images/G_125.gif";
menu_down[0][1][1][1]="/images/G_125_1.gif";
menu_down[0][1][1][2]="99px";
menu_down[0][1][2]=new Array();
menu_down[0][1][2][0]="/images/G_126.gif";
menu_down[0][1][2][1]="/images/G_126_1.gif";
menu_down[0][1][2][2]="63px";
menu_down[0][1][3]=new Array();
menu_down[0][1][3][0]="/images/G_127.gif";
menu_down[0][1][3][1]="/images/G_127_1.gif";
menu_down[0][1][3][2]="75px";
menu_down[0][1][4]=new Array();
menu_down[0][1][4][0]="/images/G_128.gif";
menu_down[0][1][4][1]="/images/G_128_1.gif";
menu_down[0][1][4][2]="99px";
menu_down[0][1][5]=new Array();
menu_down[0][1][5][0]="/images/G_129.gif";
menu_down[0][1][5][1]="/images/G_129_1.gif";
menu_down[0][1][5][2]="65px";


//usa
menu_down[1]=new Array();
menu_down[1][1]=new Array();
menu_down[1][1][0]=new Array();
menu_down[1][1][0][0]="/images/G_130.gif";
menu_down[1][1][0][1]="/images/G_130_1.gif";
menu_down[1][1][0][2]="124px";
menu_down[1][1][1]=new Array();
menu_down[1][1][1][0]="/images/G_131.gif";
menu_down[1][1][1][1]="/images/G_131_1.gif";
menu_down[1][1][1][2]="151px";
menu_down[1][1][2]=new Array();
menu_down[1][1][2][0]="/images/G_132.gif";
menu_down[1][1][2][1]="/images/G_132_1.gif";
menu_down[1][1][2][2]="71px";
menu_down[1][1][3]=new Array();
menu_down[1][1][3][0]="/images/G_133.gif";
menu_down[1][1][3][1]="/images/G_133_1.gif";
menu_down[1][1][3][2]="145px";
menu_down[1][1][4]=new Array();
menu_down[1][1][4][0]="/images/G_134.gif";
menu_down[1][1][4][1]="/images/G_134_1.gif";
menu_down[1][1][4][2]="230px";
menu_down[1][1][5]=new Array();
menu_down[1][1][5][0]="/images/G_135.gif";
menu_down[1][1][5][1]="/images/G_135_1.gif";
menu_down[1][1][5][2]="59px";



//korea
menu_down[2]=new Array();
menu_down[2][1]=new Array();
menu_down[2][1][0]=new Array();
menu_down[2][1][0][0]="/images/G_136.gif";
menu_down[2][1][0][1]="/images/G_136_1.gif";
menu_down[2][1][0][2]="92px";
menu_down[2][1][1]=new Array();
menu_down[2][1][1][0]="/images/G_137.gif";
menu_down[2][1][1][1]="/images/G_137_1.gif";
menu_down[2][1][1][2]="99px";
menu_down[2][1][2]=new Array();
menu_down[2][1][2][0]="/images/G_138.gif";
menu_down[2][1][2][1]="/images/G_138_1.gif";
menu_down[2][1][2][2]="63px";
menu_down[2][1][3]=new Array();
menu_down[2][1][3][0]="/images/G_139.gif";
menu_down[2][1][3][1]="/images/G_139_1.gif";
menu_down[2][1][3][2]="75px";
menu_down[2][1][4]=new Array();
menu_down[2][1][4][0]="/images/G_140.gif";
menu_down[2][1][4][1]="/images/G_140_1.gif";
menu_down[2][1][4][2]="99px";
menu_down[2][1][5]=new Array();
menu_down[2][1][5][0]="/images/G_141.gif";
menu_down[2][1][5][1]="/images/G_141_1.gif";
menu_down[2][1][5][2]="59px";

//chinese
menu_down[3]=new Array();
menu_down[3][1]=new Array();
menu_down[3][1][0]=new Array();
menu_down[3][1][0][0]="/images/G_116.gif";
menu_down[3][1][0][1]="/images/G_116_1.gif";
menu_down[3][1][0][2]="75px";
menu_down[3][1][1]=new Array();
menu_down[3][1][1][0]="/images/G_117.gif";
menu_down[3][1][1][1]="/images/G_117_1.gif";
menu_down[3][1][1][2]="75px";
menu_down[3][1][2]=new Array();
menu_down[3][1][2][0]="/images/G_118.gif";
menu_down[3][1][2][1]="/images/G_118_1.gif";
menu_down[3][1][2][2]="63px";
menu_down[3][1][3]=new Array();
menu_down[3][1][3][0]="/images/G_119.gif";
menu_down[3][1][3][1]="/images/G_119_1.gif";
menu_down[3][1][3][2]="99px";
menu_down[3][1][4]=new Array();
menu_down[3][1][4][0]="/images/G_120.gif";
menu_down[3][1][4][1]="/images/G_120_1.gif";
menu_down[3][1][4][2]="168px";
menu_down[3][1][5]=new Array();
menu_down[3][1][5][0]="/images/G_121.gif";
menu_down[3][1][5][1]="/images/G_121_1.gif";
menu_down[3][1][5][2]="53px";



//spain
menu_down[4]=new Array();
menu_down[4][1]=new Array();
menu_down[4][1][0]=new Array();
menu_down[4][1][0][0]="/images/G_142.gif";
menu_down[4][1][0][1]="/images/G_142_1.gif";
menu_down[4][1][0][2]="183px";
menu_down[4][1][1]=new Array();
menu_down[4][1][1][0]="/images/G_143.gif";
menu_down[4][1][1][1]="/images/G_143_1.gif";
menu_down[4][1][1][2]="159px";
menu_down[4][1][2]=new Array();
menu_down[4][1][2][0]="/images/G_144.gif";
menu_down[4][1][2][1]="/images/G_144_1.gif";
menu_down[4][1][2][2]="72px";
menu_down[4][1][3]=new Array();
menu_down[4][1][3][0]="/images/G_145.gif";
menu_down[4][1][3][1]="/images/G_145_1.gif";
menu_down[4][1][3][2]="150px";
menu_down[4][1][4]=new Array();
menu_down[4][1][4][0]="/images/G_146.gif";
menu_down[4][1][4][1]="/images/G_146_1.gif";
menu_down[4][1][4][2]="168px";
menu_down[4][1][5]=new Array();
menu_down[4][1][5][0]="/images/G_147.gif";
menu_down[4][1][5][1]="/images/G_147_1.gif";
menu_down[4][1][5][2]="59px";

