/*
 *
 *  Gallery.js: 
 *
 *  uses a plugin called Scrollable from 
 *  http://flowplayer.org
 *
 *  For an overview of the unminified source view:
 *  http://flowplayer.org/js/tools/tools.scrollable-1.0.4.js
 *
 *
 */

//
//
//  Gallery Front-end
//
//
var Gallery = function(){
	return {

		scroller: null,
		gallery_div: "#projectGallery",

		init: function(){

			// initialze scrolling window
			Gallery.scroller = $(this.gallery_div).scrollable(
				{ 
					// get api
					api: true,

					// basic params
					size: 1,
					items: "#galleryFrame",
					vertical: false,
					loop: false,
					clickable: false,
					interval: 0,
					activeClass: "selected",
					disabledClass: "disabled",
					keyboard: true,
					hoverClass: "over",

					// Easing settings
					easing: 'swing',
					speed: 0, // no easing, becasue there's not an option for 'none'

					// Navigation
					next: ".next",
					prev: ".previous",
					nextPage: ".next",
					prevPage: ".previous",
					navi: "#galleryNav",
					naviItem: ".item"

				}
			);

			$("#gallery-navigation .next").click(Gallery.next);
			$("#gallery-navigation .previous").click(Gallery.previous);

	  	},

		next: function(){
			Gallery.scroller.next();
		},

		previous: function(){
			Gallery.scroller.prev();
		}

	};
}();

function init_gallery(){
	Gallery.init();
}
$(document).ready(init_gallery);
