function chooseCursorMenu(originalBGImage)
	local ovImg=Image.load("images/menus/skin_choose_cursor.png")
	
	local nbCursors=nil
	local i=0
	local prop=nil
	local currentSelection=1
	local names=nil
	if cursorsPreviews==nil then
		-- loading
		screen:blit(0, 0, originalBGImage, true)
		alert("loading")
		
		cursorsPreviews={}
		names=getFolderList("images/cursors")
		nbCursors=tableLength(names)
		for i=1,nbCursors do
			cursorsPreviews[i]={}
			cursorsPreviews[i]["num"]=i
			cursorsPreviews[i]["previewImage"]=Image.load("images/cursors/"..names[i].."/preview.png")
			prop=loadPropertiesFile("images/cursors/"..names[i].."/cursor.properties")
			cursorsPreviews[i]["author"]=prop["author"]
			cursorsPreviews[i]["name"]=prop["name"]
			cursorsPreviews[i]["description"]=prop["description"]
			cursorsPreviews[i]["copyright"]=prop["copyright"]
			cursorsPreviews[i]["folderName"]=names[i]
			if USERPREF["cursor"]==names[i] then --this is what the user is using
				currentSelection=i
			end
		end
	else
		nbCursors=tableLength(cursorsPreviews)
		for i=1,nbCursors do
			if USERPREF["cursor"]==cursorsPreviews[i]["folderName"] then --this is what the user is using
				currentSelection=i
			end
		end
	end
	
	drawCursorsMenu(originalBGImage, currentSelection, nbCursors, ovImg)
	
	while true do
		updateInputs(Controls.read())
		

		--specific inputs
		if inputFirstPress("left") or inputIsRepeating("left") then
			if currentSelection>1 then
				currentSelection=currentSelection-1
			else
				currentSelection=nbCursors
			end
			drawCursorsMenu(originalBGImage, currentSelection, nbCursors, ovImg)
		elseif inputFirstPress("right") or inputIsRepeating("right") then
			if currentSelection<nbCursors then
				currentSelection=currentSelection+1
			else
				currentSelection=1
			end
			drawCursorsMenu(originalBGImage, currentSelection, nbCursors, ovImg)
		elseif inputFirstPress("l") or inputIsRepeating("l") then
			if currentSelection>3 then --1+4
				currentSelection=currentSelection-3
			else
				currentSelection=1
			end
			drawCursorsMenu(originalBGImage, currentSelection, nbCursors, ovImg)
		elseif inputFirstPress("r") or inputIsRepeating("r") then
			if currentSelection<nbCursors-2 then
				currentSelection=currentSelection+3
			else
				currentSelection=nbCursors
			end
			drawCursorsMenu(originalBGImage, currentSelection, nbCursors, ovImg)
		end
		
		--selection
		if inputFirstPress("cross") or inputFirstPress("circle") then
			alert("loading...")
			selectCursor(cursorsPreviews[currentSelection]["folderName"])
			return "changed"
		end
		
		--usual inputs
		if inputFirstPress("start") then
			return "quitMenu"
		end
		
		if inputFirstPress("square") then
			return "cancel"
		end
	end
end

function drawCursorsMenu(originalBGImage, currentSelection, nbCursors, ovImg)
	local xref=90
	local yref=85
	screen:blit(0, 0, originalBGImage, true)
	screen:blit(0, 0, ovImg, true)
	
	screen:blit(xref, yref, cursorsPreviews[currentSelection]["previewImage"], true)
	printBicolor(screen, xref+270, yref, currentSelection.."/"..nbCursors, black, white)
	printBicolor(screen, xref+80, yref+10, cursorsPreviews[currentSelection]["name"], black, white)
	printBicolor(screen, xref+80, yref+30, "Author:", black, white)
	printBicolor(screen, xref+90, yref+40, cursorsPreviews[currentSelection]["author"], black, white)
	printWithCR(screen, xref, yref+68, cursorsPreviews[currentSelection]["description"], white, 8, black)
	printU(screen, xref, yref+106, cursorsPreviews[currentSelection]["copyright"], white, false, "default", 8, 8, 8, black)
	
	screen.flip()
	screen.waitVblankStart()
end







