<!--

function RollOverImageRead()
{
	self.top.name = "main";
}

var MenuImg = new Array();
var MenuSelected = new Array();
var TargetID = new Array();
previous_select = 0;

for( i=0; i<5; i++ ){
	MenuImg[i] = new Array(); MenuImg[i][0] = new Image(); MenuImg[i][1] = new Image();
	MenuSelected[i] = false;
}
TargetID[0] = "jsde_logo";
TargetID[1] = "sitemap";
TargetID[2] = "japanese";
TargetID[3] = "english";
TargetID[4] = "home";

MenuImg[0][0].src = "title/jsde-logo_black.jpg";
MenuImg[0][1].src = "title/jsde-logo_white.jpg";
MenuImg[1][0].src = "title/sitemap.jpg";
MenuImg[1][1].src = "title/sitemap_bright.jpg";
MenuImg[2][0].src = "title/japanese.jpg";
MenuImg[2][1].src = "title/japanese_bright.jpg";
MenuImg[3][0].src = "title/english.jpg";
MenuImg[3][1].src = "title/english_bright.jpg";
MenuImg[4][0].src = "title/home.jpg";
MenuImg[4][1].src = "title/home_bright.jpg";

function ChangeButton( target_num, n )
{
	if( document.getElementById){
		if( n == 0 ){
			document.getElementById(TargetID[target_num]).src = MenuImg[target_num][n].src;
		}
		else if( !MenuSelected[target_num] ){
			document.getElementById(TargetID[target_num]).src = MenuImg[target_num][n].src;
		}
	}
}

function PushButton( target_num )
{
	if( document.getElementById){
		document.getElementById(TargetID[previous_select]).src = MenuImg[previous_select][1].src;
		for( i=0; i<4; i++ )
			MenuSelected[i] = false;
		document.getElementById(TargetID[target_num]).src = MenuImg[target_num][0].src;
		MenuSelected[target_num] = true;
		previous_select = target_num;
	}
}

function ChangeLanguage(destlang)
{
	Location  = top.article.location.href;

	// **** Exceptions of language switching (Show home page) ****
	ifjournal    = Location.lastIndexOf("journal.html");			// Journal
	ifjissues    = Location.lastIndexOf("shuppan-");
	ifpubfee     = Location.lastIndexOf("fee.html");				// publication fee

	if( (ifjournal == -1 && ifjissues == -1)  || ifpubfee != -1 )
	{
		if (destlang == "english")
		{
			SeparateString = "japanese/";
			TargetDirectory = "../english/";
		}
		else
		{
			SeparateString = "english/";
			TargetDirectory = "../japanese/";
		}

		ifresearch   = Location.lastIndexOf("research_investigation");		// Research and Investigation
		ifboard      = Location.lastIndexOf("board");						// Board Activities
		ifhow2update = Location.lastIndexOf("howtoupdate.html");			// Update Manual of JSDE website
		ifsample     = Location.lastIndexOf("sample.html");					// Sample Page related to the update manual
		ifsoukai     = Location.lastIndexOf("soukaishiryou.html");			// Sample Page related to "soukaishiryou"

		Separator  = Location.lastIndexOf(SeparateString);

		if( Separator== -1 || ifresearch != -1 || ifboard != -1 || ifhow2update != -1 || ifsample != -1 || ifsoukai != -1 || ifpubfee != -1 )
			TargetPage = "top.php";
		else
			TargetPage = Location.substring(Separator + SeparateString.length);

		window.open(TargetDirectory + "title.html", "title"  );
		window.open(TargetDirectory + "menu.html" , "menu"   );
		window.open(TargetDirectory + TargetPage  , "article");
	}
	else if( ifjournal != -1 )
	{
		if (destlang == "english")
		{
			TargetDirectory = "../english/";
			TargetDirectory2 = "../shuppan-e/";
		}
		else
		{
			TargetDirectory = "../japanese/";
			TargetDirectory2 = "../shuppan-j/";
		}

		window.open(TargetDirectory + "title.html", "title"  );
		window.open(TargetDirectory + "menu.html" , "menu"   );
		window.open(TargetDirectory2 + "journal.html", "article");
	}
	else
	{
		if (destlang == "english")
		{
			TargetDirectory = "../english/";
			Location2 = Location.replace( "shuppan-j", "shuppan-e" );
		}
		else
		{
			TargetDirectory = "../japanese/";
			Location2 = Location.replace( "shuppan-e", "shuppan-j" );
		}

		window.open( TargetDirectory + "title.html", "title" );
		window.open( TargetDirectory + "menu.html" , "menu"  );
		window.open( Location2, "article" );
	}

}

//-->


