jQuery.noConflict();

var plauditSite = (function($){
	
	var defaultMethods = function(){
		$("body").addClass("jsEnabled");
		$("tr:odd").addClass("odd");
		$(".searchForm input#query").focus(function(){ 
			$(this).data("inputValue",$(this).val()); // Store for use later if needed
			$(this).val("");
		});
		$('input').keydown(function(event){
			var input = $(this);
		    if (event.keyCode == 13) {
		    	input.closest("form").find(":submit:first, input.submit:first").first().click();
		        return false;
		    }
		});
	}();
	
	var mediaGallery = function(){
		
		var lightBoxOptions = {
			animationSpeed: 'normal',
			allowresize: false,
			showTitle: false,
			theme: 'light_rounded'	
		};
		
		var sliderOptions = {
			size: 1,
			clickable: false,
			next: "#next",
			prev: "#prev"
		};
		
		$("a[rel^='lightbox']").prettyPhoto(lightBoxOptions);
		$("#imageGallery").scrollable(sliderOptions);
	}();
	
	
	var fullGallery = function(){
		
		var galleryOptions = {
			size: 1,
			clickable: false,
			speed: 750,
			next: ".nextPage",
			prev: ".prevPage"
		};
		
		var navigatorOptions = {
			navi: '#galleryPager',
			naviItem: 'span'
		}
		
		$("#fullGallery")
			.scrollable(galleryOptions)
			.navigator(navigatorOptions);
	}();
	
	/*	
	var fullGallery = {
		
			
			
		init: function(){
			var pageCount = $(".galleryPage", $("#fullGalleryInner")).length;
			var galleryControls = $('<ul id="galleryPager"></ul>');
			var totalWidth = pageCount * 563;
			var currentControl;
			var obj = this; // cache object context
			
			obj.setTotalWidth(totalWidth);
			
			$("#fullGalleryInner").css("width",totalWidth + "px");
			
			// Create pager controls based on total page count
			for ( i = 1; i <= pageCount; i++) {
				currentControl = $("<li>", {
					html: $("<a/>", {
						href: "#page" + i,
						text: "Page " + i,
						rel: i,
						click: function() {
							obj.slideAnimation(obj.getNextPosition($(this)));
							obj.setActiveState($(this));
							return false;
						}
					}).addClass(i == 1 ? 'page currentPage' : 'page')
				});
				galleryControls.append(currentControl);
			};
			
			// Create previous page button
			var prevPage = $('<span>', {
				text: "prev",
				click: function(){
					obj.slideAnimation(obj.getCurrentPosition() + 563);
				}
			}).attr("id","prevPage");
			
			// Create next page button
			var nextPage = $('<span>', {
				text: "next",
				click: function(){
				obj.slideAnimation(obj.getCurrentPosition() - 563);
			}
			}).attr("id","nextPage");
			
			// Append all controls to page
			$("#content").append(galleryControls, nextPage, prevPage);
			
			$("#prevPage").hide();
			// Disabled Specific controls
		},
		
		totalWidth: null,
		
		getCurrentPosition: function(){
			return parseInt(($("#fullGalleryInner")).css("left"));
		},
		
		getNextPosition: function(elem){
			return ($("#galleryPager a").index(elem) * -563);
		},
		
		setTotalWidth: function(width){
			this.totalWidth = width;
		},
		
		setActiveState: function(elem){
			$("#galleryPager a").removeClass("currentPage");
			elem.addClass("currentPage");
		},
		
		
		
		
		enableDisableControls: function(){
			var totalWidth = this.totalWidth;
			var currentPosition = (this.getCurrentPosition() - 1126) * -1;
			console.log(currentPosition, this.totalWidth);
			
			if ( currentPosition === totalWidth){
				$("#nextPage").hide();
			} else {
				$("#nextPage").show();
				$("#prevPage").show();
			}
		},
		
		slideAnimation: function(pos){
			this.enableDisableControls();
			$("#fullGalleryInner").animate({left: pos}, 1500);
		}
		
	};
	
	fullGallery.init(); // Initialize Gallery
	*/
	return {
		// Return Public Methods Here
	}
})(jQuery);


