
function Favorites(url) {
	var _url = url;
	
	this.load = function(id) {
		if(id == '')
			load({}, 'GET');
		else
			load({G:id}, 'POST'); //später ändern auf ID
	}
	
	function load(post, rtype) {
		$.ajax({
  			type: rtype,
  			url: _url,
  			data: post,
  			success: function(data) {
				if($('#content', data).text() != '') {
					$('#ajaxcontent').html($('#content', data).html() );
					$('div.ModuleFavorites').slideDown("slow");
				}
			}
		});
	}
	
	this.del = function(id) {
		load({ID:id,TYPE:"delete"}, 'POST');
	}
	
	this.add = function(id) {
		load({ID:id,TYPE:"add"}, 'POST');
	}	
}

