///<reference path=".#ts/client.d.ts" />

interface Templates {
	gameBox: Template;
}

Template.gameBox.helpers({

	showCasinoJackpot: function () {
		var game = <Casino.GameClient> this;
		var settings = game.siteSetting();
		return Session.get('showCasinoJackpot') && settings && settings.jackpotAmount > 0;
	},

	gameExists: function () {
		var game = <Casino.GameClient> this;
		return game._id ? true : false;
	}

});

Template.gameBox.events({

	'click a': function() {

		var gameName = this.name;
		var gameType = this.category.fetch().name;

		googleSend({
			'eventCategory': 'Gaming',
			'eventAction': 'Clicked Casino Game',
			'eventLabel': gameName,
			'pageGameName': gameName,
			'pageVertical': 'Gaming',
			'pageProduct': gameType,
			'pageEventArea': 'Main',
			'clickedPlayForReal': 1
		});
	}

});