SpeedMedia.PagingBulletsComponent = SpeedMedia.Event.extend({
	_construct :function(el) {
		this._super();
		
		this._el = $(el);
		
		this._itemTpl = this._el.find('li.bullet-template')
			.removeClass('bullet-template')
			.detach();
	},
	setTotal : function(url) {
		var index = 0;
		for (var i in url) {
			this._itemTpl.clone()
				.appendTo(this._el)
				.click(this._bulletClicked.bind(this))
				.find('.meta').html(url[i]);
		}
		this._el.find('li.bullet a').eq(0).addClass('active');
		
	},
	_bulletClicked : function(e) {
		if(e instanceof $.Event){
			var target = $(e.currentTarget);
			e.stopPropagation();
		}
		var imgUrl =  target.find('.meta').html();
		this._el.find('li.bullet a').removeClass('active');
		target.find('a').addClass('active');
		this.fireEvent(SpeedMedia.PagingBulletsComponent.CLICK, imgUrl);
	},
});
SpeedMedia.PagingBulletsComponent.CLICK = 'click';
