function homeBtnEnabled(mainScene)
{
	if(mainScene.cache.json.get('config').homeBtnEnabled != null && mainScene.cache.json.get('config').homeBtnEnabled === "0")//disable home button for all casinos
	{
		return false;
	}
	
	let casinoId = document.getElementById('casinoId').value;
	
	let config = mainScene.cache.json.get('config').casinoUrls;//list of any casinos with predefined home url

	if(config != null)//take precedence before all home button checks..
	{
		for(let i = 0; i < config.length; ++i)
		{
			if(parseInt(config[i].casinoId) === parseInt(casinoId))
			{
				if(config[i].homeBtnEnabled != null && config[i].homeBtnEnabled === "0")
				{
					return false;
				}
			}
		}
	}

	let lobbyEnabled = !!+mainScene.cache.json.get('config').lobbyEnabled;
	
	if(lobbyEnabled)//internal lobby is enabled
	{
		return true;
	}

	let lobbyUrl = document.getElementById('lobbyUrl').value;

	if(lobbyUrl != null && lobbyUrl !== "" )//external home button url is provided
	{
		return true;
	}
        
	if(config != null)
	{
		for(let i = 0; i < config.length; ++i)
		{
			if(parseInt(config[i].casinoId) === parseInt(casinoId))
			{
				return config[i].url !== "";
			}
		}
	}
		
	return false;
}