

	/** Pulse Radio User object (GLOBAL) **/
	var PulseAccount = base2.Base.extend({
		constructor: function(options) {
			this.SetOptions(options);
			this.Init();
		},
		
		Defaults: {
			autoload: false
		},
		
		User: null,
		
		Loaded: false,
		
		SetOptions: function(options) {
			this.Options = jQuery.extend({}, this.Defaults, options);
		},
		
		Init: function() {
			if (this.Options.autoload) {
				this.GetCurrentUser();
			}
		},
		
		GetCurrentUser: function() {
			this.API_GetCurrentUser(jQuery.proxy(this.GetCurrentUser_Handler, this));
			this.API_GetCurrentProfile(jQuery.proxy(this.GetCurrentProfile_Handler, this));
		},
		
		GetCurrentUser_Handler: function(response) {
			if (response.result) {
				this.User = response.value.User;
				this.Loaded = true;
			}
		},
		
		GetCurrentProfile_Handler: function(response) {
			if (response.result) {

			}
		},
		
		API_GetCurrentUser: function(callback) {
			
			var apiHandler = new APIHandler({
				Url: "/web_services/get_current_user",
				Method: APIMETHODS.GET,
				Callback: callback,
				Async: true
			});
			
			return apiHandler.Response;
			
		},
		API_GetCurrentProfile: function(callback) {
			
			var apiHandler = new APIHandler({
				Url: "/web_services/get_profile",
				Method: APIMETHODS.GET,
				Callback: callback,
				Async: true
			});
			
			return apiHandler.Response;
			
		},
	});
	
	$(document).ready(function() {
		window.pulse_user = new PulseAccount({ autoload: true});
	});

