function selectBubblesSkin(folderName)
	USERPREF["speechbubbles"]=folderName
	BUBBLESPREF=loadPropertiesFile("images/speechbubbles/"..USERPREF["speechbubbles"].."/speechbubbles.properties")
	bubbleImages=loadBubbleImages(USERPREF["speechbubbles"])
	FONTS=loadFonts() --in case the user hot-installed a skin
end

function selectAvatar(folderName, playerNum)
	USERPREF["avatarPlayer"..playerNum]=folderName
	local prop=loadPropertiesFile("images/avatars/"..folderName.."/avatar.properties")
	players[playerNum]["avatar"]=loadAvatarImage(folderName)
	if playerNum==1 and USERPREF["usePersonalColor"]==true then
		--nothing, let him continue using his color
	else
		players[playerNum]["colorOut"]=prop["colorOut"]
		players[playerNum]["colorIn"]=prop["colorIn"]
	end
	
	if playerNum==1 and USERPREF["usePersonalName"]==true then --special case for player 1, who can use his name
		--nothin let him continue using his own name
	else
		players[playerNum]["name"]=prop["name"]
	end
end

function selectCards(folderName)
	USERPREF["cards"]=folderName
	CARDSPREF=loadPropertiesFile("images/cards/"..USERPREF["cards"].."/cards.properties")
	cardImages=loadCardImages(USERPREF["cards"])
end

function selectCarpet(folderName)
	USERPREF["carpet"]=folderName
	background=Image.load("images/carpets/"..USERPREF["carpet"].."/carpet.png")
	CARPETPREF=loadPropertiesFile("images/carpets/"..USERPREF["carpet"].."/carpet.properties")
	FONTS=loadFonts() --in case the user hot-installed a skin
end

function selectCursor(folderName)
	USERPREF["cursor"]=folderName
	CURSORPREF=loadPropertiesFile("images/cursors/"..USERPREF["cursor"].."/cursor.properties")
	ingameCursor["image"]=loadCursorImage(USERPREF["cursor"])
	if cursorIsAvailable() then
		replaceCursor()
	end
end

function selectPlayersNumIcons(folderName)
	USERPREF["playersNumIcons"]=folderName
	ICONSPREF["playersNum"]=loadPropertiesFile("images/icons/playersNum/"..USERPREF["playersNumIcons"].."/playersNumIcons.properties")
	iconImages["playersNum"]=loadPlayersNumIconImages(USERPREF["playersNumIcons"])
end

function selectRanksIcons(folderName)
	USERPREF["ranksIcons"]=folderName
	ICONSPREF["ranks"]=loadPropertiesFile("images/icons/ranks/"..USERPREF["ranksIcons"].."/ranksIcons.properties")
	iconImages["ranks"]=loadRankIconImages(USERPREF["ranksIcons"])
end

function selectStatesIcons(folderName)
	USERPREF["statesIcons"]=folderName
	ICONSPREF["states"]=loadPropertiesFile("images/icons/states/"..USERPREF["statesIcons"].."/statesIcons.properties")
	iconImages["states"]=loadStatesIconImages(USERPREF["statesIcons"])
end













