$(document).ready(function () {
    $('#calculate').mouseover(function(){ $(this).css('cursor', 'pointer'); });
		$('#calculate').click(function () {
				var qtn = parseFloat($('#productQuantity').val());
				if(isNaN(qtn)) {
				    alert('The Quantity must be a number');
						return false;
				}
				var gid = $('#gameId').val();
				var serverId = $('#serverId').val();
				$.ajax({
				    timeout: 10000,
						type: 'POST',
						url: 'ajax/fit.gold.retail.ajax.php', 
						data: {'gid':gid, 'serverId':serverId, 'qtn':qtn}, 
						dataType: 'json',
						error: function (a, b) {
						    alert('Sorry, request timeout, click confirm to reload this page.');
								window.location.reload(document.URL);
						},
						beforeSend: function () { 
						    
						},
						success: function (data) { $('#price').val(data.toFixed(2)); }
				});
		});
});