var engine = {
	video: {
		_count: 0,
		_current: 1,
		run: function() {
			this._showFirst();
		},
		setBoxesVideoCount: function(count) {
			this._count = count;
		},
		_hideAll: function() {
			$('.boxesVideo-item').hide();	
		},
		_showFirst: function() {
			this.show(1);
		},
		show: function(page) {
			this._hideAll();
			$('#boxesVideo-'+page).show();
			this._setSelectedPage(page);
		},
		_setSelectedPage: function(page) {
			var className = 'boxesVideo-changePage-selected';
			$('.boxesVideo-changePage-link').removeClass(className);
			$('#boxesVideo-changePage-link-'+page).addClass(className);
			this._current = page;
		}
	},
	list: {
		run: function() {
			$('table.list_hover tr:even').addClass('even');
			$('table.list_hover tr').mouseover(function() { $(this).addClass('hover'); });
			$('table.list_hover tr').mouseout(function() { $(this).removeClass('hover'); });
		}
	},
	confirm: {
		run: function() {
			$('.confirm').click(function() {
				if (!confirm('Na pewno?'))
					return false;
			});
		}
	},
	todo: {
		run: function() {
			$('.todo').click(function() {
				alert('ToDo');
				return false;
			});
		}
	}
};

$(document).ready(function() {
	engine.video.run();
	engine.confirm.run();
	engine.todo.run();
	engine.list.run();
});
