document.onload = menulocator();
function menulocator (){
	var locationpath = location.href;
	if (locationpath.search(/\/products\//i) != -1) {
		if (locationpath.search(/\/eye_wear\//i) != -1) {
			document.getElementById("cmenu_4").style.backgroundPosition = 	"0 -37px";
		} else if (locationpath.search(/\/juzu_bracelet\//i) != -1) {
			document.getElementById("cmenu_5").style.backgroundPosition = 	"0 -37px";
		} else if (locationpath.search(/\/other_item\//i) != -1) {
			document.getElementById("cmenu_6").style.backgroundPosition = 	"0 -37px";
		} else if (locationpath.search(/\/sticker\//i) != -1) {
			document.getElementById("cmenu_7").style.backgroundPosition = 	"0 -37px";
		} else { }
		
	} else if(locationpath.search(/\/news\//i) != -1) {
		document.getElementById("cmenu_1").style.backgroundPosition = 	"0 -37px";
		
	} else if(locationpath.search(/\/about\//i) != -1) {
		document.getElementById("cmenu_3").style.backgroundPosition = 	"0 -37px";
		
	} else if(locationpath.search(/\/feature\//i) != -1 || locationpath.search(/\/column\//i) != -1) {
		document.getElementById("cmenu_2").style.backgroundPosition = 	"0 -37px";
		
	} else { }
}

function glbmnsact( id, flg )
{
	var locationpath = location.href;
	switch (id){
		case 'cmenu_1':
			if(locationpath.search(/\/news\//i) == -1) {
				if(flg){
					document.getElementById(id).style.backgroundPosition = 	"0 -17px";
				} else {
					document.getElementById(id).style.backgroundPosition = 	"0 3px";
				}
			}
			break;
		case 'cmenu_2':
			if(locationpath.search(/\/feature\//i) == -1 && locationpath.search(/\/column\//i) == -1) {
				if(flg){
					document.getElementById(id).style.backgroundPosition = 	"0 -17px";
				} else {
					document.getElementById(id).style.backgroundPosition = 	"0 3px";
				}
			}
			break;
		case 'cmenu_3':
			if(locationpath.search(/\/about\//i) == -1) {
				if(flg){
					document.getElementById(id).style.backgroundPosition = 	"0 -17px";
				} else {
					document.getElementById(id).style.backgroundPosition = 	"0 3px";
				}
			}
			break;
		case 'cmenu_4':
			if(locationpath.search(/\/eye_wear\//i) == -1) {
				if(flg){
					document.getElementById(id).style.backgroundPosition = 	"0 -17px";
				} else {
					document.getElementById(id).style.backgroundPosition = 	"0 3px";
				}
			}
			break;
		case 'cmenu_5':
			if(locationpath.search(/\/juzu_bracelet\//i) == -1) {
				if(flg){
					document.getElementById(id).style.backgroundPosition = 	"0 -17px";
				} else {
					document.getElementById(id).style.backgroundPosition = 	"0 3px";
				}
			}
			break;
		case 'cmenu_6':
			if(locationpath.search(/\/other_item\//i) == -1) {
				if(flg){
					document.getElementById(id).style.backgroundPosition = 	"0 -17px";
				} else {
					document.getElementById(id).style.backgroundPosition = 	"0 3px";
				}
			}
			break;
		case 'cmenu_7':
			if(locationpath.search(/\/sticker\//i) == -1) {
				if(flg){
					document.getElementById(id).style.backgroundPosition = 	"0 -17px";
				} else {
					document.getElementById(id).style.backgroundPosition = 	"0 3px";
				}
			}
			break;
		default:
			break;
	}
}
