var rootUrl = "/wonda/"

var link = [
	rootUrl + "ms/",
	rootUrl + "kb/",
	rootUrl + "zm/",
	rootUrl + "id/",
	rootUrl + "bk/",
	rootUrl + "lineup/",
	rootUrl + "cm/",
	rootUrl + "asakachi/",
	rootUrl + "guide/",
	rootUrl + "asakachi/result/"
];

function switch_cookie() {
	var cookie = $.cookie('counter');
	var menu;

	menu = $("#gmenu1");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[0]+"top.html";
				return false;
			});
		} else {
			menu.get(0).href = link[0]+"index.html";
			menu.unbind();
		}
	}
	menu = $("#gmenu2");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[1]+"top.html";
				return false;
			});
		} else {
			menu.get(0).href = link[1]+"index.html";
			menu.unbind();
		}
	}
	menu = $("#gmenu3");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[2]+"top.html";
				return false;
			});
		} else {
			menu.get(0).href = link[2]+"index.html";
			menu.unbind();
		}
	}
	menu = $("#gmenu4");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[3]+"top.html";
				return false;
			});
		} else {
			menu.get(0).href = link[3]+"index.html";
			menu.unbind();
		}
	}
	menu = $("#gmenu5");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[4]+"top.html";
				return false;
			});
		} else {
			menu.get(0).href = link[4]+"index.html";
			menu.unbind();
		}
	}
	menu = $("#gmenu6");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[5]+"top.html";
				return false;
			});
		} else {
			menu.get(0).href = link[5]+"index.html";
			menu.unbind();
		}
	}
	menu = $("#gmenu7");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[6]+"top.html";
				return false;
			});
		} else {
			menu.get(0).href = link[6]+"index.html";
			menu.unbind();
		}
	}
	menu = $("#gmenu8");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[7]+"top.html";
				return false;
			});
		} else {
			menu.get(0).href = link[7]+"index.html";
			menu.unbind();
		}
	}
	menu = $("#gmenu9");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[8]+"top.html";
				return false;
			});
		} else {
			menu.get(0).href = link[8]+"index.html";
			menu.unbind();
		}
	}
	menu = $("#gmenu10");
	if(menu.get(0) != undefined) {
		if(cookie == 1) {
			menu.get(0).href = "javascript:void(0);";
			menu.click(function(){
				location.href = link[9]+"nofla.html";
				return false;
			});
		} else {
			menu.get(0).href = link[9]+"index.html";
			menu.unbind();
		}
	}
}

$(function(){
	switch_cookie();
});

