$(document).ready(function() {

	$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
	$("#topnav li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 

	$("#topnav li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});

});

function ShowMenu(i) {
	if(i==0){
		$("#container").load("top/top.html");
		$("#lmenu").load("menu/menu0.html");
	} else if(i==1){
		$("#container").load("outline/outline.html");
		$("#lmenu").load("menu/menu1.html");
	} else if(i==2){
		$("#container").load("greeting/greeting.html");
		$("#lmenu").load("menu/menu2.html");
	} else if(i==3){
		$("#container").load("organization/organization.html");
		$("#lmenu").load("menu/menu3.html");
	} else if(i==4){
		$("#container").load("meeting/meeting.html");
		$("#lmenu").load("menu/menu4.html");
	} else if(i==5){
		$("#container").load("committee/committee.html");
		$("#lmenu").load("menu/menu5.html");
	} else if(i==6){
		$("#container").load("research/research.html");
		$("#lmenu").load("menu/menu0.html");
	} else if(i==7){
		$("#container").load("report/report.html");
		$("#lmenu").load("menu/menu7.html");
	} else if(i==8){
		$("#container").load("link.html");
		$("#lmenu").load("menu/menu0.html");
	} else if(i==9){
		$("#logpass").load("login.html");
//		$("#lmenu").load("menu/menu0.html");
	}
	$("#topix").load("topix/topix.html");
	$("#banner").load("banner/banner.html");
};

function ShowOutline(i){
	if(i==1){
		$("#container").load("outline/loadmap.html");
	} else if(i==2){
		$("#container").load("outline/office.php?view=on");
	} else if(i==3){
		$("#container").load("outline/associate.html");
	}
};

function ShowPage(i,f,y,t){
	var fnm = f +"/" + f + y + "." + t;
	if(t == "php"){
		fnm = fnm + "?view=on";
		$("#lmenu").load("menu/menu0.html");
	}
	$("#"+i).load(fnm);
};

function ShowKouhou(y){
	if(y == "2009"){
		$("#container").load("committee/magazine2009.html");
	} else if(y == "2010"){
		$("#container").load("committee/magazine2010.html");
	}
};

