var VideoGallery = {
	page: 1,
	perPage: 3,
	
	init: function(player) {
		$('#video_left_arrow').bind('click', function() {
			VideoGallery.prevPage();
		});

		$('#video_right_arrow').bind('click', function() {
			VideoGallery.nextPage();
		});
	
		$('#video_left_arrow').css({display: 'none'});
		
		if (this.total_pages <= 1)
			$('#video_right_arrow').css({display: 'none'});
	},

	prevPage: function() {
		if (this.page <= 1)
			return;
		
		$('#video_gallery_page_'+ this.page).css({display:'none'});
		
		this.page--;
		
		$('#video_gallery_page_'+ this.page).css({display:''});
		
		if (this.page <= 1)
			$('#video_left_arrow').css({display: 'none'});
		
		if (this.page <= this.total_pages)
			$('#video_right_arrow').css({display: ''});
	},
	
	nextPage: function() {
		if (this.page >= this.total_pages)
			return;
	
		$('#video_gallery_page_'+ this.page).css({display:'none'});
	
		this.page++;
		
		$('#video_gallery_page_'+ this.page).css({display:''});
		
		if (this.page > 1)
			$('#video_left_arrow').css({display: ''});
		
		if (this.page >= this.total_pages)
			$('#video_right_arrow').css({display: 'none'});
	}
};
