UserProfile.Favorites = {
	Tabs			: {
		artist		: null,
		indie		: null,
		radio		: null,
		track		: null,
		event		: null,
		klan		: null
	},
	LastOverItem : {
		artist 	: null
	},
	EventHandlers	: {}
};

UserProfile.Favorites.EventHandlers = {
	onTabClick : function (tab_name) {
		UserProfile.Favorites.Tabs[tab_name].show();
	}
};

// On DOM ready - Start
$(function() {
	// Add tab behaviour to all tabs
	$(".inner-tab-container").addTabBehaviour({callback:UserProfile.Favorites.EventHandlers.onTabClick});
	
	// Creating tab objects
	UserProfile.Favorites.Tabs.artist = new marvinList({ 
		div_id:"tab-content-artist", 
		api:"Artist.list", 
		apiParams:{
			type: 'favorite', 
			recordId: RequestedUserID, 
			limit: 15
		},
		template: Templates.Artist.ListItem,
		header: '<div class="line-list"><ul class="with-image">',
		footer: '</ul></div>',
		show:true,
		templateParameters:{'showRemove':ProfileOwner, 'onRemoveSuccess': function(){UserProfile.Favorites.Tabs.artist.reload()}}
	});
	UserProfile.Favorites.Tabs.radio = new marvinList({ 
		div_id:"tab-content-radio",
		api:"Radio.list", 
		apiParams:{
			type: 'favorite', 
			recordId: RequestedUserID, 
			limit: 4
		},
		template: Templates.Radio.ListItem,
		show:false,
		templateParameters:{'showRemove':ProfileOwner, 'onRemoveSuccess': function(){UserProfile.Favorites.Tabs.radio.reload()}}
	});
	UserProfile.Favorites.Tabs.track = new marvinList({ 
		div_id:"tab-content-track",
		api:"Song.list", 
		apiParams:{
			type: 'favorite', 
			recordId: RequestedUserID, 
			limit: 10
		},
		template: Templates.Track.LineListItem,
		header: '<div class="line-list"><ul>',
		footer: '</ul></div>',
		show:false,
		templateParameters:{'showRemove':ProfileOwner, 'onRemoveSuccess': function(){UserProfile.Favorites.Tabs.track.reload()}}
	});
	UserProfile.Favorites.Tabs.indie = new marvinList({ 
		div_id:"tab-content-indie",
		api:"Indie.list", 
		apiParams:{
			type: 'favorite', 
			recordId: RequestedUserID, 
			limit: 10
		},
		template: Templates.Indie.ListItem,
		header: '<div class="line-list"><ul class="with-image">',
		footer: '</ul></div>',		
		show:false,
		templateParameters:{'showRemove':ProfileOwner, 'onRemoveSuccess': function(){UserProfile.Favorites.Tabs.indie.reload()}}
	});
	UserProfile.Favorites.Tabs.klan = new marvinList({ 
		div_id:"tab-content-klan",
		api:"Klan.list", 
		apiParams:{
			type: 'favorite', 
			recordId: RequestedUserID, 
			limit: 10
		},
		template: Templates.Klan.ListItem,
		show:false,
		templateParameters:{'showRemove':ProfileOwner, 'onRemoveSuccess': function(){UserProfile.Favorites.Tabs.klan.reload()}}
	});
});
// On DOM ready - End
