sub HiScoreLoad
{
	if(SelectedDifficult=="Easy")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAEasy[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBEasy[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaAEasy[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaBEasy[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreOthersEasy[i],0);
			}
		}
	}

	if(SelectedDifficult=="Normal")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuANormal[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBNormal[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaANormal[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaBNormal[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreOthersNormal[i],0);
			}
		}
	}


	if(SelectedDifficult=="Hard")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAHard[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBHard[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaAHard[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaBHard[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreOthersHard[i],0);
			}
		}
	}


	if(SelectedDifficult=="Lunatic")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuALunatic[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBLunatic[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaALunatic[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaBLunatic[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreOthersLunatic[i],0);
			}
		}
	}


	if(SelectedDifficult=="Extra")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAExtra[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBExtra[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaAExtra[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreMarisaBExtra[i],0);
			}
		}
		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let i in 0..10)
			{
				Hiscore[i] = GetCommonDataDefaultEx(NsScore,NsHiScoreOthersExtra[i],0);
			}
		}
	}
}

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

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

		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaAEasy[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaAEasy[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaBEasy[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaBEasy[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreOthersEasy[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreOthersEasy[j],score);
					break;
				}
			}
		}
	}

	if(SelectedDifficult=="Normal")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuANormal[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuANormal[j],score);
					break;
				}
			}
		}

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

		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaANormal[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaANormal[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaBNormal[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaBNormal[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreOthersNormal[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreOthersNormal[j],score);
					break;
				}
			}
		}
	}

	if(SelectedDifficult=="Hard")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAHard[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAHard[j],score);
					break;
				}
			}
		}

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

		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaAHard[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaAHard[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaBHard[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaBHard[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreOthersHard[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreOthersHard[j],score);
					break;
				}
			}
		}
	}

	if(SelectedDifficult=="Lunatic")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuALunatic[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuALunatic[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBLunatic[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBLunatic[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaALunatic[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaALunatic[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaBLunatic[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaBLunatic[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreOthersLunatic[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreOthersLunatic[j],score);
					break;
				}
			}
		}
	}

	if(SelectedDifficult=="Extra")
	{
		if(SelectedCharacter==DefinedPlayer1)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuAExtra[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuAExtra[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer2)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreReimuBExtra[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreReimuBExtra[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer3)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaAExtra[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaAExtra[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer4)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreMarisaBExtra[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreMarisaBExtra[j],score);
					break;
				}
			}
		}

		if(SelectedCharacter==DefinedPlayer5)
		{
			ascent(let j in 0..10)
			{
				if(score >= Hiscore[j])
				{
					ascent(let i in j+1..10)
					{
						SetCommonDataEx(NsScore,NsHiScoreOthersExtra[i],Hiscore[i-1]);
					}
					SetCommonDataEx(NsScore,NsHiScoreOthersExtra[j],score);
					break;
				}
			}
		}
	}
}