function showHighScores(originalBGImage, part, highLightPlaceHS, highLightPlaceR)
	if part==nil then
		currentSelection=HS
	else
		currentSelection=part
	end
	local ovImg={}
	ovImg["main"]=Image.load("images/menus/highscores.png")
	ovImg["top1"]=Image.load("images/menus/highscores_top_1.png")
	ovImg["top2"]=Image.load("images/menus/highscores_top_2.png")
	local i=0
	local HS=1 --highscores
	local R=2 --reigns
	local currentSelection=HS
	
	drawHighScoresMenu(originalBGImage, ovImg, currentSelection, highLightPlaceHS, highLightPlaceR)
	
	
	--main loop to get the input
	while true do
		updateInputs(Controls.read())
		

		--specific inputs
		if inputFirstPress("left") or inputFirstPress("l") then
			currentSelection=1
			drawHighScoresMenu(originalBGImage, ovImg, 1, highLightPlaceHS, highLightPlaceR)
		elseif inputFirstPress("right") or inputFirstPress("r") then
			currentSelection=2
			drawHighScoresMenu(originalBGImage, ovImg, 2, highLightPlaceHS, highLightPlaceR)
		end
		

		if inputFirstPress("cross") or inputFirstPress("circle") or inputFirstPress("square") then
			return "cancel"
		end

		if inputFirstPress("start") then
			return "quitMenu"
		end
		
		
	end
end

function drawHighScoresMenu(originalBGImage, ovImg, part, highLightPlaceHS, highLightPlaceR)
	local xref=120
	local yref=65
	local col=nil
	screen:blit(0, 0, originalBGImage, true)
	screen:blit(108, 33, ovImg["top"..part], true)
	screen:blit(0, 0, ovImg["main"], true)
	
	if part==1 then
		printBicolor(screen, xref, yref-22, "HIGHSCORES", black, white)
		screen:print(xref+130, yref-22, "REIGNS", grey)
		for i=1, 10 do
			if highLightPlaceHS~=nil and highLightPlaceHS==i then
				col=red
			else
				col=white
			end
			printBicolor(screen, xref, yref+(i-1)*15, i..".", black, col)
			printBicolor(screen, xref+28, yref+(i-1)*15, replaceCRsWithSpaces(SCORES["hsname"..i]), black, col)
			printBicolor(screen, xref+150, yref+(i-1)*15, SCORES["hs"..i], black, col)
		end
		printBicolor(screen, xref, yref+155, "Current score: "..(totalScore+handScore)*10, black, white)
	else
		printBicolor(screen, xref+130, yref-22, "REIGNS", black, white)
		screen:print(xref, yref-22, "HIGHSCORES", grey)
		for i=1, 10 do
			if highLightPlaceR~=nil and highLightPlaceR==i then
				col=red
			else
				col=white
			end
			printBicolor(screen, xref, yref+(i-1)*15, i..".", black, col)
			printBicolor(screen, xref+28, yref+(i-1)*15, replaceCRsWithSpaces(SCORES["rname"..i]), black, col)
			printBicolor(screen, xref+150, yref+(i-1)*15, SCORES["r"..i], black, col)
		end
		printBicolor(screen, xref, yref+155, "Current reign: "..STATE["currentReign"], black, white)
	end
	
	
	
	screen.flip()
	screen.waitVblankStart()
end











