var newmatchid = 0;
$(function(){
	
	
	
	$("#leftnav").setTemplateURL("../templates/leftnav.htm");
	$("#leftnav").processTemplate();

	$("#mainnav").setTemplateURL("../templates/header.htm");
	$("#mainnav").processTemplate();

	$("#rightcontents").setTemplateURL("../templates/rightcontents.htm");
	$("#rightcontents").processTemplate();


	$("#logofooter").setTemplateURL("../templates/footer.htm");
	$("#logofooter").processTemplate();

	$("#banner01").setTemplateURL("../templates/banner.htm");
	$("#banner01").processTemplate();

	$("#banner").setTemplateURL("../templates/banner.htm");
	$("#banner").processTemplate();
	
	$("#fanzonebanner").setTemplateURL("../templates/fanzonerightbanner.htm");
	$("#fanzonebanner").processTemplate();

	$("#accessfooter").setTemplateURL("../templates/accessfooter.htm");
	$("#accessfooter").processTemplate();

	$.postJSON("../PHP/json.php/Thematch/selectNewMatchData",function(json) {
		newmatchid = json.match_id;
		$("#newMatch").html("<a href='../match/"+newmatchid+".html'>最新マッチレポート</a>")
		$("#newMatch2").html("<a href='../match/"+newmatchid+".html'>最新マッチレポート</a>")
	});

	var urls = location.href;
	url = urls.split("/")
//	alert(url[3])
	if(url[3] == "news"){
		$("#newsbtn").addClass("active");
	}else if(url[3] == "match"){
		$("#match").addClass("active");
	}else if(url[3] == "first-team"){
		$("#first").addClass("active");
	}else if(url[3] == "club"){
		$("#club").addClass("active");
	}else if(url[3] == "history"){
		$("#history").addClass("active");
	}else if(url[3] == "fanzone"){
		$("#fanzone").addClass("active");
	}else if(url[3] == "member"){
		$("#member").addClass("active");
	}

});

