// JavaScript Document

var preLoad_array 	= [
	"/NR/rdonlyres/2E11C9E4-7FA8-4848-8231-DF1BE6C93237/0/healthy_arrow.gif",
	"/NR/rdonlyres/520AF97C-76C2-48FF-9969-05A73CE4CD49/0/healthy_img0.jpg",
	"/NR/rdonlyres/9590C27D-ECE6-4A23-847C-86435BD8BEBD/0/healthy_img1.jpg",
	"/NR/rdonlyres/B42FF04A-AF53-434E-BF51-37E1369E4025/0/healthy_img2.jpg",
	"/NR/rdonlyres/E1675401-C966-4B19-8E27-33CE9785493D/0/healthy_img3.jpg",
	"/NR/rdonlyres/75BC5091-C261-4B3B-817A-9717CEB5316C/0/healthy_img4.jpg",
	"/NR/rdonlyres/FCA1E320-CF06-4007-8274-CAF2C0E65D2F/0/healthy_img5.jpg",
	
	"/NR/rdonlyres/7E9B10C6-EFA9-4A8C-8473-861611056FF3/0/product_arrow.gif",
	"/NR/rdonlyres/248E4EDB-3B2B-40DA-8E75-261A0C6ECCBF/0/product_img0.jpg",
	"/NR/rdonlyres/693711F7-9909-4FF0-8F70-2A5A33940165/0/product_img1.jpg",
	"/NR/rdonlyres/F31F35DB-D926-4934-B56E-392E1922E6B3/0/product_img2.jpg",
	"/NR/rdonlyres/ABB852A5-1BB7-4E52-B0AC-9E22CA8096AE/0/product_img3.jpg",
	
	"/NR/rdonlyres/6A396CD3-3C2F-4BA1-8AB4-F932E957CCEA/0/recipe_arrow.gif",
	"/NR/rdonlyres/A18BDCB5-D4B5-45D1-B4D7-D00E689C2620/0/recipe_img0.jpg",
	"/NR/rdonlyres/755E31F1-3D40-4328-A8DC-582A07752E47/0/recipe_img1.jpg",
	"/NR/rdonlyres/2C622314-9EFB-44AD-844C-08C5F81A9365/0/recipe_img2.jpg",
	"/NR/rdonlyres/E621DDF1-0E18-490C-AC71-29F62DCBD046/0/recipe_img3.jpg",
	"/NR/rdonlyres/0D23F097-0623-4068-A742-148C5BFAFA29/0/recipe_img4.jpg",
	"/NR/rdonlyres/5FD01614-A19F-45F1-8232-EF0F56966370/0/recipe_img5.jpg",
	"/NR/rdonlyres/393D5004-2748-4979-8ADE-B8B43EFCF585/0/recipe_img6.jpg"

];
var compLoad_array 	= [];
for( var i = 0; i < preLoad_array.length; i++ ){
	var img 	= new Image();
	img.src 	= preLoad_array[i];
	compLoad_array.push( img );
}




var loadComp 		= false;

var activeType 		= "typeSyokuzai";

window.onload 	= function(){
	loadComp 	= true;
}

function clickTypeNaviBtn(obj){
	if( loadComp == true ){
		activeType 		= obj.id;
		
		clearTypeNaviBtnOv();
		
		if( obj.id == "typeSyokuzai" ){
			obj.style.backgroundPosition 	= "0px -69px";
		}else if( obj.id == "typeRecipe" ){
			obj.style.backgroundPosition 	= "-197px -69px";
		}else if( obj.id == "typeProduct" ){
			obj.style.backgroundPosition 	= "-393px -69px";
		}else if( obj.id == "typeHealthy" ){
			obj.style.backgroundPosition 	= "-590px -69px";
		}
		
		clearSearchContent();
		
		document.getElementById(obj.id.split("type").join("detailSearch")).style.display 	= "block";
	}
}
function overTypeNaviBtn(obj){
	if( loadComp == true ){
		
		if( obj.id == "typeSyokuzai" ){
			obj.style.backgroundPosition 	= "0px -69px";
		}else if( obj.id == "typeRecipe" ){
			obj.style.backgroundPosition 	= "-197px -69px";
		}else if( obj.id == "typeProduct" ){
			obj.style.backgroundPosition 	= "-393px -69px";
		}else if( obj.id == "typeHealthy" ){
			obj.style.backgroundPosition 	= "-590px -69px";
		}
	}
}
function outTypeNaviBtn(obj){
	if( loadComp == true ){
		if( obj.id != activeType ){
			if( obj.id == "typeSyokuzai" ){
				obj.style.backgroundPosition 	= "0px 0px";
			}else if( obj.id == "typeRecipe" ){
				obj.style.backgroundPosition 	= "-197px 0px";
			}else if( obj.id == "typeProduct" ){
				obj.style.backgroundPosition 	= "-393px 0px";
			}else if( obj.id == "typeHealthy" ){
				obj.style.backgroundPosition 	= "-590px 0px";
			}
		}
	}
}
function clearTypeNaviBtnOv(){
	
	document.getElementById("typeSyokuzai").style.backgroundPosition 	= "0px 0px";
	document.getElementById("typeRecipe").style.backgroundPosition 		= "-197px 0px";
	document.getElementById("typeProduct").style.backgroundPosition 	= "-393px 0px";
	document.getElementById("typeHealthy").style.backgroundPosition 	= "-590px 0px";
	
}
function clearSearchContent(){
	
	document.getElementById("detailSearchSyokuzai").style.display 		= "none";
	document.getElementById("detailSearchRecipe").style.display 		= "none";
	document.getElementById("detailSearchProduct").style.display 		= "none";
	document.getElementById("detailSearchHealthy").style.display 		= "none";
	
}

function overSyokuzaiBtn(obj){
	if( loadComp == true ){
		document.getElementById("syokuzaiBtnListA0").style.backgroundPosition 	= "0px 0px";
		document.getElementById("syokuzaiBtnListA1").style.backgroundPosition 	= "-145px 0px";
		document.getElementById("syokuzaiBtnListA2").style.backgroundPosition 	= "-214px 0px";
		document.getElementById("syokuzaiBtnListA3").style.backgroundPosition 	= "-331px 0px";
		document.getElementById("syokuzaiBtnListA4").style.backgroundPosition 	= "-464px 0px";
		document.getElementById("syokuzaiBtnListA5").style.backgroundPosition 	= "-566px 0px";
		document.getElementById("syokuzaiBtnListA6").style.backgroundPosition 	= "-669px 0px";
		
		document.getElementById("syokuzaiContentDefault").style.display 		= "none";
		document.getElementById("syokuzaiContent0").style.display 				= "none";
		document.getElementById("syokuzaiContent1").style.display 				= "none";
		document.getElementById("syokuzaiContent2").style.display 				= "none";
		document.getElementById("syokuzaiContent3").style.display 				= "none";
		document.getElementById("syokuzaiContent4").style.display 				= "none";
		document.getElementById("syokuzaiContent5").style.display 				= "none";
		document.getElementById("syokuzaiContent6").style.display 				= "none";
		
		if( obj.id == "syokuzaiBtnListA0" ){
			document.getElementById("syokuzaiBtnListA0").style.backgroundPosition 	= "0px -60px";
			document.getElementById("syokuzaiContent0").style.display 				= "block";
		}else if( obj.id == "syokuzaiBtnListA1" ){
			document.getElementById("syokuzaiBtnListA1").style.backgroundPosition 	= "-145px -60px";
			document.getElementById("syokuzaiContent1").style.display 				= "block";
		}else if( obj.id == "syokuzaiBtnListA2" ){
			document.getElementById("syokuzaiBtnListA2").style.backgroundPosition 	= "-214px -60px";
			document.getElementById("syokuzaiContent2").style.display 				= "block";
		}else if( obj.id == "syokuzaiBtnListA3" ){
			document.getElementById("syokuzaiBtnListA3").style.backgroundPosition 	= "-331px -60px";
			document.getElementById("syokuzaiContent3").style.display 				= "block";
		}else if( obj.id == "syokuzaiBtnListA4" ){
			document.getElementById("syokuzaiBtnListA4").style.backgroundPosition 	= "-464px -60px";
			document.getElementById("syokuzaiContent4").style.display 				= "block";
		}else if( obj.id == "syokuzaiBtnListA5" ){
			document.getElementById("syokuzaiBtnListA5").style.backgroundPosition 	= "-566px -60px";
			document.getElementById("syokuzaiContent5").style.display 				= "block";
		}else if( obj.id == "syokuzaiBtnListA6" ){
			document.getElementById("syokuzaiBtnListA6").style.backgroundPosition 	= "-669px -60px";
			document.getElementById("syokuzaiContent6").style.display 				= "block";
		}
	}
	
}








