jQuery(document).ready(function ($) {
	if ( typeof isAuthenticated === 'function' && isAuthenticated() ) {
		$('form#webplatform-login-form').hide();
		$('form#webplatform-logout-form').show();
	} else {
		$('form#webplatform-login-form').show();
		$('form#webplatform-logout-form').hide();
	}
});

;

(function($){var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o){if(o===null){return'null';}
var type=typeof o;if(type==='undefined'){return undefined;}
if(type==='number'||type==='boolean'){return''+o;}
if(type==='string'){return $.quoteString(o);}
if(type==='object'){if(typeof o.toJSON==='function'){return $.toJSON(o.toJSON());}
if(o.constructor===Date){var month=o.getUTCMonth()+1,day=o.getUTCDate(),year=o.getUTCFullYear(),hours=o.getUTCHours(),minutes=o.getUTCMinutes(),seconds=o.getUTCSeconds(),milli=o.getUTCMilliseconds();if(month<10){month='0'+month;}
if(day<10){day='0'+day;}
if(hours<10){hours='0'+hours;}
if(minutes<10){minutes='0'+minutes;}
if(seconds<10){seconds='0'+seconds;}
if(milli<100){milli='0'+milli;}
if(milli<10){milli='0'+milli;}
return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array){var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i])||'null');}
return'['+ret.join(',')+']';}
var name,val,pairs=[];for(var k in o){type=typeof k;if(type==='number'){name='"'+k+'"';}else if(type==='string'){name=$.quoteString(k);}else{continue;}
type=typeof o[k];if(type==='function'||type==='undefined'){continue;}
val=$.toJSON(o[k]);pairs.push(name+':'+val);}
return'{'+pairs.join(',')+'}';}};$.evalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){return eval('('+src+')');};$.secureEvalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){var filtered=src.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered)){return eval('('+src+')');}else{throw new SyntaxError('Error parsing JSON, source is not valid.');}};$.quoteString=function(string){if(string.match(escapeable)){return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};})(jQuery);;
var WebPlatformBypassCache = {

  bypassCache: false,

  paths: ['^.*\/complete.*', '^/race/post'],

  bypassCacheUrls: [],

  init: function() {
    jQuery(document).ready(function() {
      if (window.EventDispatcher && window.BetSlip) {
        EventDispatcher.addListener('betslip_stage_changed', function(event, stage) {
          if (stage && stage == 'place-bet') {
            WebPlatformBypassCache.setBypassCache(true);
          } 
        });
      } else {
        WebPlatformBypassCache.checkBypassPage();
      }
    });
  },

  checkBypassPage: function() {
    var path = location.pathname;
    var paths = this.paths;

    for (var i = 0; i < paths.length; i++) {
      var re = new RegExp(paths[i]);
      if (re.test(path)) {
        this.setBypassCache(true);
        break;
      }
    }
  },
  
  checkBypassUrl: function(url) {	
	if (this.isBypassCache()) {
		var found = false;
		for (var i = 0; i < this.bypassCacheUrls.length; i++) {
			if (this.bypassCacheUrls[i] == url) {
				found = true;
				break;
			}		
		}	
		if (!found) {		
			this.bypassCacheUrls.push(url);
			url += ((url.indexOf('?') == -1) ? '?' : '&') + 'bypassCache=true';
		}
	}
	return url;
  },

  setBypassCache: function(value) {
    this.bypassCache = value;
  },

  isBypassCache: function() {
    return this.bypassCache;
  }

};
WebPlatformBypassCache.init();;
var WebPlatformLogger = {

  level : {
    INFO : "[INFO] ",
    WARNING: "[WARNING] ",
    ERROR: "[ERROR] "
  },

  info : function(message) {
    WebPlatformLogger.log(WebPlatformLogger.level.INFO, message);
  },

  warning : function(message) {
    WebPlatformLogger.log(WebPlatformLogger.level.WARNING, message);
  },

  error : function(message) {
    WebPlatformLogger.log(WebPlatformLogger.level.ERROR, message);
  },

  log : function(level, message) {
    if (window.console) {
      window.console.log(level + message);
    }
  }

};


;
var WebPlatformAjax = {

  call : function(url, method, data, onSuccessCallback, onErrorCallback, onCompleteCallback) {

    // if (window.WebPlatformBypassCache) {
      // url = WebPlatformBypassCache.checkBypassUrl(url);
    // }

    var settings = {
      url : url,
      type: method,
      data : data,
      success : onSuccessCallback,
      error : onErrorCallback,
      complete: onCompleteCallback
    };

    if (jQuery.isArray(data)) {
      data = WebPlatformAjax.convertArrayIntoObject(data);
    }

    if (data!=null) {
      settings.data = jQuery.toJSON(data);
      settings.dataType = "json";
      settings.contentType = 'application/json; charset=utf-8';
    }

    WebPlatformAjax.doCall(settings);
  },

  convertArrayIntoObject : function(data) {
    var newObject = new Object;

    for(i = 0; i < data.length; i++) {
      newObject[data[i]['name']] = data[i]['value'];
    }

    return newObject;
  },

  doCall : function(settings) {
    if(!settings.success) {
      settings.success = WebPlatformAjax.onSuccessDefault;
    }
    if (!settings.error) {
      settings.error = WebPlatformAjax.onErrorDefault;
    }
    if (!settings.complete) {
      settings.complete = WebPlatformAjax.onCompleteDefault;
    }

    settings.traditional =  true;

    jQuery.ajax(settings);
  },

  onSuccessDefault : function(data, textStatus, jqXHR) {
    WebPlatformLogger.info("Success");
    WebPlatformLogger.info("data: " + data);
    WebPlatformLogger.info("textStatus: " + textStatus);
    WebPlatformLogger.info("jqXHR: " + jqXHR);
  },

  onErrorDefault : function(jqXHR, textStatus, errorThrown) {
     WebPlatformLogger.error("Error");
     WebPlatformLogger.error("jqXHR: " + jqXHR);
     WebPlatformLogger.error("textStatus: " + textStatus);
     WebPlatformLogger.error("errorThrown: " + errorThrown);
  },

  onCompleteDefault : function(jqXHR, textStatus) {
     WebPlatformLogger.info("Complete");
     WebPlatformLogger.info("jqXHR: " + jqXHR);
     WebPlatformLogger.info("textStatus: " + textStatus);
  }

};


;
var WebPlatformEvents = {

  bindToEvent : function (target, event, callback) {
    jQuery(target).bind(event, callback);
  },

  unbindFromEvent : function (target, event, callback) {
    jQuery(target).unbind(event, callback);
  },

  triggerEvent : function (target, event, data) {
    jQuery(target).trigger(event, data);
  },

  createTimer : function (timeIntervalMillis, callbackName) {
    return setInterval(callbackName, timeIntervalMillis);
  },

  destroyTimer : function (timerId) {
    clearInterval(timerId);
  },

  recreateTimer : function (timerId, timeIntervalMillis, callbackName) {
    if(timerId){
      WebPlatformEvents.destroyTimer(timerId);
    }
    return WebPlatformEvents.createTimer(timeIntervalMillis, callbackName);
  }

};


;
var WebPlatformAccountServices = {

  accountSignup : function (data, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/signup",
      'POST',
      data,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  updatePasswordDTO : function (oldPassword, newPassword) {
      this.oldPassword = oldPassword;
      this.newPassword = newPassword;
  },

  getProfile : function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
	  WebPlatformAjax.call("/services/api/account/profile",
		'GET',
	    null,
	    onSuccessCallback,
	    onErrorCallback,
	    onCompleteCallback);
  },

  onGetProfileSuccess: function (data, textStatus, jqXHR) {
	    // Display Form
	    jQuery('div#webplatform-service-input').html('')
	      //Create a form with the required fields and a submit button
	      .append(jQuery('<p />')
	        .append(jQuery('<form id="webplatform-service-form" />')
	          // Hidden fields
	  	      .append('<em>Email: </em>')
		      .append('<input name="email" type="text" value="' + data.email + '"/><br/>')
		      .append('<em>Address Line 1: </em>')
	          .append('<input name="addressLine1" type="text" value="' + data.addressLine1 + '"/><br/>')
	          .append('<em>Address Line 2: </em>')
	          .append('<input name="addressLine2" type="text" value="' + data.addressLine2 + '"/><br/>')
	          .append('<em>City: </em>')
	          .append('<input name="city" type="text" value="' + data.city + '"/><br/>')
	          .append('<em>State / Province: </em>')
	          .append('<input name="state" type="text" value="' + data.state +  '"/><br/>')
	          .append('<em>Postal Code: </em>')
	          .append('<input name="zipcode" type="text" value="' + data.zipcode +  '"/><br/>')
	          .append('<em>Country of residence: </em>')
	          .append('<input name="country" type="text" value="' + data.country + '"/><br/>')
	          .append('<em>Primary Phone Number: </em>')
	          .append('<input name="primaryPhone" type="text" value="' + data.primaryPhone + '"/><br/>')
	          .append('<em>Primary Phone Number Ext: </em>')
	          .append('<input name="primaryPhoneExt" type="text" value="' + data.primaryPhoneExt + '"/><br/>')
	          .append('<em>Primary Phone Number Usage: </em>')
	          .append('<input id="primaryPhoneUse" type="text" value="' + data.primaryPhoneUse + '"/><br/>')
	          .append('<em>Other Phone Number: </em>')
	          .append('<input name="otherPhone" type="text" value="' + data.otherPhone + '"/><br/>')
	          .append('<em>Other Phone Number Ext: </em>')
	          .append('<input name="otherPhoneExt" type="text" value="' + data.otherPhoneExt + '"/><br/>')
	          .append('<em>Other Phone Number Usage: </em>')
	          .append('<input name="otherPhoneUse" type="text" value="' + data.otherPhoneUse + '"/><br/>')
	          .append('<em>Fax: </em>')
	          .append('<input name="fax" type="text" value="' + data.fax + '"/><br/>')
	          .append('<em>Mother’s Maiden Name: </em>')
	          .append('<input name="secureAnswer1" type="text"/><br/>')
	          .append(jQuery('<input type="button" id="webplatform-service-submit" value="Submit"/>')
	             //Link the submit button to the ajax call
	            .click(function(data){
	              WebPlatformAccountServices.changeAddress(jQuery('form#webplatform-service-form').serializeArray(), WebPlatformAccountServices.onChangeAddressSuccessful, WebPlatformAccountServices.onError, WebPlatformAccountServices.onComplete);
	              return false;
	            })
	          )
	        )
	      ).show();

	      // Add country list
//	      WebPlatformWebsiteServices.getWebsiteCountries(WebPlatformWhitelabelUtils.addListOfCountriesToSignUpForm, null, null);
//	      WebPlatformWhitelabelUtils.populatePromoCodeInput();
  },

  changeAddress : function (data, onSuccessCallback, onErrorCallback, onCompleteCallback) {
	  WebPlatformAjax.call("/services/api/account/update",
	    'POST',
	    data,
	    onSuccessCallback,
	    onErrorCallback,
	    onCompleteCallback);
  },

  onChangeAddressSuccessful : function (data, textStatus, jqXHR) {
	    var html = '';
		if(data == null) {
			html = '<p><em>Profile was not properly updated</em></p>';
		} else if (data.success != null) {
			html = '<p><em>Profile has been updated successfully</em></p>';
		} else if (data.error != null){
			html = '<p><em>An error happened while updating the account</em></p>';
			html += '<p><em>Error Code: ' + data.errorCode + '</em></p>';
		}
		WebPlatformAccountServices.displayMessage(html);
	  },

  updatePassword : function (oldPassword, newPassword, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    data = new WebPlatformAccountServices.updatePasswordDTO(oldPassword, newPassword);
    WebPlatformAjax.call("/services/api/account/updatePassword",
      'POST',
      data,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  accountNumberRecovery : function(email, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/accountRecovery/" + email,
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  accountPasswordReset : function(data, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/resetPassword",
      'POST',
      data,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  accountPasswordRenew : function(data, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/newPassword",
      'POST',
      data,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },
  
  accountContactUs: function(data, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/contactus",
      'POST',
      data,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountSummary: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/summary",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountEcashBalance: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/balance/ecash",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountBonusBalance: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/balance/bonus",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountMessages: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/messages",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  acknowledgeAccountMessages: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/messages",
      'PUT',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountECashStatements: function (numberOfDays, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/statements/ecash?numberOfDays=" + numberOfDays,
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountBonusStatements: function (numberOfDays, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/statements/bonus?numberOfDays=" + numberOfDays,
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  claimSportsBonus : function (bonusId, onSuccessCallback, onErrorCallback, onCompleteCallback) {
	 WebPlatformAjax.call("/services/api/account/sportsbonus/claim/" + bonusId,
	  'GET',
	  null,
	  onSuccessCallback,
	  onErrorCallback,
	  onCompleteCallback);
  },

  getAccountOpenBets: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/wager/openbets",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountBetHistory: function (numberOfDays, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/wager/bethistory/" + numberOfDays,
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountReferralNumber: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/referralnumber",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountSportsBonuses: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/sportsbonus",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountPreferredTimezone: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/timezone",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  accountUpdateTimezone: function(data, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/account/timezone/update",
      'PUT',
      data,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getAccountBalances: function( onSuccessCallback, onErrorCallback, onCompleteCallback ) {
    WebPlatformAjax.call("/services/api/account/balance",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },
  
  getSubscriptions : function(onSuccessCallback, onErrorCallback, onCompleteCallback) {
	WebPlatformAjax.call("/services/api/account/subscriptions",
		      'GET',
		      null,
		      onSuccessCallback,
		      onErrorCallback,
		      onCompleteCallback);
  },
  
  getAccountSubscriptions : function(onSuccessCallback, onErrorCallback, onCompleteCallback) {
	WebPlatformAjax.call("/services/api/account/subscriptions/user",
		      'GET',
		      null,
		      onSuccessCallback,
		      onErrorCallback,
		      onCompleteCallback);
  },
  
  updateAccountSubscriptions : function(data, onSuccessCallback, onErrorCallback, onCompleteCallback) {
	WebPlatformAjax.call("/services/api/account/subscriptions/user",
		      'PUT',
		      data,
		      onSuccessCallback,
		      onErrorCallback,
		      onCompleteCallback);
  },

  keepAlive: function( onSuccessCallback, onErrorCallback, onCompleteCallback ) {
    WebPlatformAjax.call("/services/api/account/keep-alive",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  onError: function (jqXHR, textStatus, errorThrown) {
	  WebPlatformAccountServices.displayMessage('Error: ' + jqXHR.status + ' (' + jqXHR.statusText + ')');
  },

  onComplete: function (jqXHR, textStatus) {
  },

  displayMessage: function (message) {
	  jQuery('div#webplatform-service-output').html(message).show();
  }


};


;
var WebPlatformAccountServicesEvents = {
  BALANCE_UPDATED_EVENT :  'balanceUpdatedEvent',
  TIMEZONE_UPDATED_EVENT :  'timeZoneUpdatedEvent',
  USER_PROFILE_READY_EVENT :  'userProfileReadyEvent',

  triggerBalanceChangedEvent : function (newBalance) {
    WebPlatformEvents.triggerEvent(document, WebPlatformAccountServicesEvents.BALANCE_UPDATED_EVENT, newBalance);
  },

  bindToBalanceChangedEvent : function (onBalanceChangedCallback) {
    WebPlatformEvents.bindToEvent(document, WebPlatformAccountServicesEvents.BALANCE_UPDATED_EVENT, onBalanceChangedCallback);
  },

  unbindFromBalanceChangedEvent : function (onBalanceChangedCallback) {
    WebPlatformEvents.unbindFromEvent(document, WebPlatformAccountServicesEvents.BALANCE_UPDATED_EVENT, onBalanceChangedCallback);
  },
  
  triggerTimeZoneChangedEvent : function () {
    WebPlatformEvents.triggerEvent(document, WebPlatformAccountServicesEvents.TIMEZONE_UPDATED_EVENT, null);
  },

  bindToTimeZoneChangedEvent : function (onTimeZoneChangedCallback) {
    WebPlatformEvents.bindToEvent(document, WebPlatformAccountServicesEvents.TIMEZONE_UPDATED_EVENT, onTimeZoneChangedCallback);
  },

  unbindFromTimeZoneChangedEvent : function (onTimeZoneChangedCallback) {
    WebPlatformEvents.unbindFromEvent(document, WebPlatformAccountServicesEvents.TIMEZONE_UPDATED_EVENT, onTimeZoneChangedCallback);
  },
  
  triggerUserProfileReadyEvent : function () {
    WebPlatformEvents.triggerEvent(document, WebPlatformAccountServicesEvents.USER_PROFILE_READY_EVENT, null);
  },

  bindToUserProfileReadyEvent : function (onUserProfileReadyCallback) {
    WebPlatformEvents.bindToEvent(document, WebPlatformAccountServicesEvents.USER_PROFILE_READY_EVENT, onUserProfileReadyCallback);
  },

  unbindFromUserProfileReadyEvent : function (onUserProfileReadyCallback) {
    WebPlatformEvents.unbindFromEvent(document, WebPlatformAccountServicesEvents.USER_PROFILE_READY_EVENT, onUserProfileReadyCallback);
  }


};


;
var WebPlatformCasinoServices = {
		
	updateCasinoAmountDTO : function (amount) {
		this.amount = amount;
	},
	
	updateCasinoUrlsDTO : function (playForRealUrl, playAgainUrl) {
		this.playForRealUrl = playForRealUrl;
		this.playAgainUrl = playAgainUrl;
	},

	getCasinoChips: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
		WebPlatformAjax.call("/services/api/casino/chips",
			'GET',
			null,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	},


	getWithdrawableChips: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
		WebPlatformAjax.call("/services/api/casino/chips/withdrawable",
			'GET',
			null,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	},

	purchaseCasinoChips: function (amount, onSuccessCallback, onErrorCallback, onCompleteCallback) {
		data = new WebPlatformCasinoServices.updateCasinoAmountDTO(amount);
		WebPlatformAjax.call("/services/api/casino/chips/purchase",
			'POST',
			data,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	},

	redeemCasinoCoupon: function (code, onSuccessCallback, onErrorCallback, onCompleteCallback) {
		WebPlatformAjax.call("/services/api/casino/coupon/" + code,
			'POST',
			null,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	},

	getGameDescription: function (gameId, onSuccessCallback, onErrorCallback, onCompleteCallback) {
		WebPlatformAjax.call("/services/api/casino/lobby/gamedescription/" + gameId,
			'GET',
			null,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	},
	
	getGameDetails: function (gameId, playMode, denomination, playForRealUrl, playAgainUrl, onSuccessCallback, onErrorCallback, onCompleteCallback) {
		var data = { playForRealUrl: playForRealUrl, playAgainUrl: playAgainUrl },
			endpointUrl = "/services/api/casino/lobby/game/" + gameId + "/" + playMode;
		
		if( denomination === null ) {
			denomination = "";
		} else {
			denomination = "/" + denomination;
		}
		
		WebPlatformAjax.call( endpointUrl + denomination,
			'POST',
			data,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	},

	updatePlayChips : function (numberOfChips) {
		this.amount = numberOfChips;
	},

	setFunChips: function (numberOfChips, onSuccessCallback, onErrorCallback, onCompleteCallback) {
		data = new WebPlatformCasinoServices.updatePlayChips(numberOfChips);
		WebPlatformAjax.call("/services/api/casino/chips/funpurchase",
			'POST',
			data,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	},

	updateCasinoChips : function (numberOfChips) {
		this.amount = numberOfChips;
	},

	cashoutCasinoChips: function (amount, onSuccessCallback, onErrorCallback, onCompleteCallback) {
		data = new WebPlatformCasinoServices.updateCasinoAmountDTO(amount);
		WebPlatformAjax.call("/services/api/casino/chips/cashout",
			'POST',
			data,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	},

	getCasinoBonusChipsBalance: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
		WebPlatformAjax.call("/services/api/casino/bonus",
			'GET',
			null,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	},

	/**
	* Retrieve All Casino-related Account balances
	*/
	getCasinoAccountBalances: function (onSuccessCallback, onErrorCallback, onCompleteCallback ) {
		WebPlatformAjax.call("/services/api/casino/account",
			'GET',
			null,
			onSuccessCallback,
			onErrorCallback,
			onCompleteCallback);
	}

};
;
var WebPlatformWebsiteServices = {

  getWebsiteCountries: function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/website/countries",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },

  getWebsiteStates: function (countryCode, onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/website/states/" + countryCode,
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  },
  
  getTimezones : function (onSuccessCallback, onErrorCallback, onCompleteCallback) {
    WebPlatformAjax.call("/services/api/website/timezones",
      'GET',
      null,
      onSuccessCallback,
      onErrorCallback,
      onCompleteCallback);
  }

};


;

