/**
 * @author sjorek
 */

(function($){
	application.factory.Feeds = function(appId,appFeeds,appOpts){
		var app = function(id,feeds,opts){
			this.id=application.control(id,this);
			this.feeds = feeds;
			if (typeof(opts)=='object') {
				this.options = $.extend(1,this.options,opts);
			}
			var self = this;
			$(application).bind('ready.google',function(e){self.render();});
		};

		app.prototype.id;
		app.prototype.feeds = [];
		app.prototype.results = [];
		app.prototype._instance = null;
		app.prototype.options = {
			sortByDate: true,
			stacked : false,
			horizontal : false,
			title : ""
		};
		app.prototype.render = function() {
			this._instance = new GFiconicFeedControl(this.feeds, this.id, this.options);
		}
		return new app(appId,appFeeds,appOpts);
	};
})(jQuery);
