var viewer = {

	superexpress : {
		get : function(id, handler){
			$.ajax( {
				cache : false,
				// dataType : "json",
				processData : true,
				type : "POST",
				url : "ajax.php",
				data : {
					app : 'xUser',
					request : 'getsuperexpressticket',
					id : id
				},
				success : function(data){
					if(data == "" || data == undefined || data == null){
						alert('nothing to get back');
					}
					else{
						handler(data);
					}
				}
			});

		}
	},

	gamebets : {
		get : function(id, handler, stparam){
			var betscalc = stparam === undefined ? 0 : stparam;
			$.ajax( {
				cache : false,
				// dataType : "json",
				processData : true,
				type : "POST",
				url : "ajax.php",
				data : {
					app : 'xUser',
					request : 'gamebets',
					id : id,
					betscalc : betscalc
				},
				success : function(data){
					if(data == "" || data == undefined || data == null){
						alert('nothing to get back');
					}
					else{
						handler(data);
					}
				}
			});
		}
	},

	ticket : {
		getlist : function(criteria, preloader, handler){
			preloader();
			$.ajax( {
				cache : false,
				dataType : "json",
				processData : true,
				type : "POST",
				url : "ajax.php",
				data : {
					request : 'getticketlist',
					criteria : json_encode(criteria)
				},
				success : function(data){
					if(data == "" || data == undefined || data == null){
						alert('nothing to get back');
					}
					else{
						handler(data);
					}

				}
			});

		},
		get : function(id, handler){
			$.ajax( {
				cache : false,
				// dataType : "json",
				processData : true,
				type : "POST",
				url : "ajax.php",
				data : {
					app : 'xUser',
					request : 'getticket',
					id : id
				},
				success : function(data){
					if(data == "" || data == undefined || data == null){
						alert('nothing to get back');
					}
					else{
						handler(data);
					}
				}
			});

		}
	}
};
