// PLugin for nums
(function($) {
  $.fn.numPicker = function(opts) {
	
			var $t = $(this);
	//return this.each(function() {


		
		var defaults = { 
			minus:      '.minus',
			plus:		'.plus',
			box:		'#numBox',
			show:		'.num',
			minVal:		1,
			maxVal:		9
		  };  
		var opts = $.extend({}, defaults, opts); 

		// starting num
		var startNum = $t.find(opts.box).val();
		update();
		

		// Minus Button
		$t.find(opts.minus).click(function(){
			if(startNum > opts.minVal)
				startNum--;
			
			update();
		});
		
		// Plus Button
		$t.find(opts.plus).click(function(){
			if(startNum < opts.maxVal)
				startNum++;
			
			update();
		});
		
		
		function update()
		{

			$t.find(opts.show).html(startNum);
			$t.find(opts.box).val(startNum);
		}
		
		
	//});
	
  }
})(jQuery);


// Onload
$(function(){
	
});

