jQuery(function(){
	
	var cyberpower = {
	
		init: function() {
			this.utilMethods(); // Setup utility methods
			this.plauditPlugins.init(); // Setup plaudit made plugins
			this.scroller();
		},
	
		utilMethods: function() {
			jQuery("body").addClass("jsEnabled"); // We use this to style non-js
		},
		
		plauditPlugins: {
		
			init: function() {
				this.selectMenuClickOnChange();
			},
			
			selectMenuClickOnChange: function() {
				
				var selectMenuOnChange = function() {
					if ( jQuery("option:selected", jQuery(this)).text() !== '- Select a Model -') {
						jQuery(this).closest("form").children("input.submit").click();
					}
				}
				
				jQuery("form.upsForm select").change(selectMenuOnChange);
				jQuery("#regionsForm select").change(selectMenuOnChange);
			} // selectMenuClickOnChange
		},

		scroller: function(){
			var sliderOptions = {
				size: 1,
				clickable: false,
				next: "#next-image",
				prev: "#previous-image"
			};
			
			jQuery("#image-gallery").scrollable(sliderOptions);
		}

	};

cyberpower.init();
	
});

