sub HiScoreLoad
{
	if(SelectedDifficult=="Moderate")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAEasy[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAEasy2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBEasy[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBEasy2[i],0);
			}
		}
	}

	if(SelectedDifficult=="Extream")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuANormal[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuANormal2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBNormal[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBNormal2[i],0);
			}
		}
	}


	if(SelectedDifficult=="Apocalypse")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAHard[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAHard2[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBHard[i],0);
				Hiscore2[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBHard2[i],0);
			}
		}
	}
}

//----------------------------------------------------------------------------------------------------------------------
sub HiScoreSave
{
//	let score = GetScore();
	let score1 =ScoreNumber1;
	let score2 = ScoreNumber2;
	if(SelectedDifficult=="Moderate")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuAEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuAEasy2[j],score2);
					break;
				}

				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuAEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuAEasy2[j],score2);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBEasy2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBEasy[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBEasy2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBEasy[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBEasy2[j],score2);
					break;
				}
			}
		}
	}

	if(SelectedDifficult=="Extream")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuANormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuANormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuANormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuANormal2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuANormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuANormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuANormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuANormal2[j],score2);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBNormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBNormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBNormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBNormal2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBNormal[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBNormal2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBNormal[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBNormal2[j],score2);
					break;
				}
			}
		}
	}

	if(SelectedDifficult=="Apocalypse")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuAHard2[j],score2);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let j in 0..10)
			{
				if(score2 > Hiscore2[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[j],score2);
					break;
				}
				if(score2 == Hiscore2[j] && score1 >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBHard[i],Hiscore[i-1]);
						SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[i],Hiscore2[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBHard[j],score1);
					SetCommonDataEx(NsScore,NsHiScoreReimuBHard2[j],score2);
					break;
				}
			}
		}
	}
}