function chooseBubblesMenu(originalBGImage)
	local ovImg=Image.load("images/menus/skin_choose_bubbles.png")

	local nbBubbles=nil
	local i=0
	local prop=nil
	local currentSelection=1
	local names=nil
	if bubblesPreviews==nil then
		-- loading
		screen:blit(0, 0, originalBGImage, true)
		alert("loading")
		
		bubblesPreviews={}
		names=getFolderList("images/speechbubbles")
		nbBubbles=tableLength(names)
		for i=1,nbBubbles do
			bubblesPreviews[i]={}
			bubblesPreviews[i]["num"]=i
			bubblesPreviews[i]["previewImage"]=Image.load("images/speechbubbles/"..names[i].."/preview.png")
			prop=loadPropertiesFile("images/speechbubbles/"..names[i].."/speechbubbles.properties")
			bubblesPreviews[i]["author"]=prop["author"]
			bubblesPreviews[i]["name"]=prop["name"]
			bubblesPreviews[i]["description"]=prop["description"]
			bubblesPreviews[i]["copyright"]=prop["copyright"]
			bubblesPreviews[i]["folderName"]=names[i]
			if USERPREF["speechbubbles"]==names[i] then --this is what the user is using
				currentSelection=i
			end
		end
	else
		nbBubbles=tableLength(bubblesPreviews)
		for i=1,nbBubbles do
			if USERPREF["speechbubbles"]==bubblesPreviews[i]["folderName"] then --this is what the user is using
				currentSelection=i
			end
		end
	end
	
	drawBubblesMenu(originalBGImage, currentSelection, nbBubbles, 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=nbBubbles
			end
			drawBubblesMenu(originalBGImage, currentSelection, nbBubbles, ovImg)
		elseif inputFirstPress("right") or inputIsRepeating("right") then
			if currentSelection<nbBubbles then
				currentSelection=currentSelection+1
			else
				currentSelection=1
			end
			drawBubblesMenu(originalBGImage, currentSelection, nbBubbles, ovImg)
		elseif inputFirstPress("l") or inputIsRepeating("l") then
			if currentSelection>3 then --1+4
				currentSelection=currentSelection-3
			else
				currentSelection=1
			end
			drawBubblesMenu(originalBGImage, currentSelection, nbBubbles, ovImg)
		elseif inputFirstPress("r") or inputIsRepeating("r") then
			if currentSelection<nbBubbles-2 then
				currentSelection=currentSelection+3
			else
				currentSelection=nbBubbles
			end
			drawBubblesMenu(originalBGImage, currentSelection, nbBubbles, ovImg)
		end
		
		--selection
		if inputFirstPress("cross") or inputFirstPress("circle") then
			alert("loading...")
			selectBubblesSkin(bubblesPreviews[currentSelection]["folderName"])
			return "changed"
		end
		
		
		--usual inputs
		if inputFirstPress("start") then
			return "quitMenu"
		end
		
		if inputFirstPress("square") then
			return "cancel"
		end
		
	end
end

function drawBubblesMenu(originalBGImage, currentSelection, nbBubbles, ovImg)
	local xref=90
	local yref=85
	screen:blit(0, 0, originalBGImage, true)
	screen:blit(0, 0, ovImg, true)
	
	screen:blit(xref, yref+15, bubblesPreviews[currentSelection]["previewImage"], true)
	printBicolor(screen, xref+270, yref, currentSelection.."/"..nbBubbles, black, white)
	printBicolor(screen, xref, yref, bubblesPreviews[currentSelection]["name"], black, white)
	printBicolor(screen, xref+140, yref+30, "Author:", black, white)
	printBicolor(screen, xref+150, yref+40, bubblesPreviews[currentSelection]["author"], black, white)
	printWithCR(screen, xref, yref+65, bubblesPreviews[currentSelection]["description"], white, 8, black)
	printU(screen, xref, yref+106, bubblesPreviews[currentSelection]["copyright"], white, false, "default", 8, 8, 8, black)
	
	screen.flip()
	screen.waitVblankStart()
end














