$(document).ready(function(){	
	$(window).resize(centerContent);
	centerContent();
})

function centerContent()
{
	if($(window).height() < $('#content').height()) {
		$('#content').css({'margin-top': '0', 'top': '0'});
	} else {
		$('#content').css({'margin-top': ($('#content').height()/2) * -1, 'top': '50%'});
	}	
}

function launchGame(gameObj, forMoney) {
	
	$('body').addClass('game');
	$('div.game').css({'display': 'block'});
	$('div.lobby').css({'top': '-600px', 'opacity': '0'});
	flashembed('gameFlash',{
		src: 'http://files.lockcasino.com/casino/games/mini_flash_client.swf',
		base: 'http://files.lockcasino.com/casino/games/',
		wmode: 'transparent'
	},{ 
		user : '',
		sPassword : '',
		token : '',
		encrypted : 'false',
		forReal : 'false',
		IP : '216.152.173.49',
		portBase : '0',
		returnURL : '',
		casinoName : 'Lock Casino',
		errorURL : '',
		useLegacySystem: 0,
		gameid: gameObj.gameID,
		machid: gameObj.machID,
		handcount: gameObj.hands,
		denom: 25,
		showVersion: 'false'
	});

}
function closeGame() {
	$('body').removeClass('game');
	$('div.lobby').css({'top': '0', 'opacity': '1'});
	$('div.game').css({'display': 'none'});
}
function launchCashier()
{
	var platform = (navigator.platform.match('Mac')) ? 'mac' : 'windows';

	if(confirm('Are you ready to download Lock Casino and have an unrivaled casino experience?')) {
		window.location = '/download/' + platform;
	}
}
