o: ActiveSupport::Cache::Entry	:@compressedF:@expires_in0:@created_atf1356306315.4068081:@value"�{I"
class:EFI"BundledAsset;�FI"logical_path;�FI"cytoplasm/cytoSlider.js;�FI"
pathname;�FI"g/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoSlider.js.erb;�FI"content_type;�FI"application/javascript;�FI"
mtime;�FI"2012-12-23T18:44:45-05:00;�FI"length;�FiI"digest;�F"%04c636fe8cb8cd781d38a00237273732I"source;�FI"// CytoSlider v0.5
// By MacKinley Smith
(function($){
	var defaults = {
		widget:{
			label:{
				css:{
					font:'12px Verdana'
				},
				html:"",
				readout:{
					css:{},
					unit:false
				}
			},
			slider:{
				css:{},
				options:{
					min:0,
					max:100,
					value:0,
					slide:function(e,ui){},
					change:function(e,ui){}
				}
			},
			wrapper:{
				css:{
					padding:"5px 0px"
				}
			}
		},
		events:{
			create:function(cy){},
			change:function(cy,event){},
			destroy:function(cy){}
		}
	};
	var methods = {
		init:function(options,reinit){
			if (reinit==null) reinit = false;
			return this.each(function(){
				var $this = $(this);
				if ($this.data('cytoSlider')!=null) return console.warn("You cannot reinstatiate cytoSlider before calling the destroy method.\nProtip: Use the refresh method to reinstantiate in one move.");
				if (!$this.hasClass('cytoSlider')) $this.addClass("cytoSlider");
				
				// Initialize settings
				var settings;
				if (!reinit) {
					settings = $.extend(true,{},defaults,options);
					if ($this.data('settings')!=null) settings = $.extend(true,{},settings,$this.data('settings'));
					if ($this.data('label')!=null) settings.widget.label.html = $this.data('label');
					if ($this.data('unit')!=null) settings.widget.label.readout.unit = $this.data('unit');
					if ($this.data('min')!=null) settings.widget.slider.options.min = $this.data('min');
					if ($this.data('max')!=null) settings.widget.slider.options.max = $this.data('max');
					if ($this.val()!=null && $this.val()!="") settings.widget.slider.options.value = parseInt($this.val());
				} else settings = options;
				
				// Generate widget
				settings.widget.wrapper.element = $this.wrap("<div></div>").parent().addClass('cytoSlider-wrapper').css(settings.widget.wrapper.css);
				settings.widget.label.element = $('<label />').attr("for",$this.attr("name")).addClass('cytoSlider-label').css(settings.widget.label.css).html(settings.widget.label.html+": ").prependTo(settings.widget.wrapper.element);
				settings.widget.label.readout.element = $('<span />').addClass("cytoSlider-label-readout").css(settings.widget.label.readout.css).appendTo(settings.widget.label.element);
				settings.widget.slider.element = $('<div />').addClass('cytoSlider-slider').css(settings.widget.slider.css).appendTo(settings.widget.wrapper.element);
				
				// Bindings
				$this.bind("change.cytoSlider",function(e){
					settings.widget.label.readout.element.html($(this).val());
					settings.events.change.apply($this,[settings,e]);
				});
				
				// Set up slider
				$.each(["slide","change"],function(i,v){
					var orig = settings.widget.slider.options[v];
					settings.widget.slider.options[v] = function(e,ui){
						$this.val($(this).slider("value")+settings.widget.label.readout.unit);
						orig.apply(this,arguments);
						$this.trigger("change.cytoSlider");
					};
				});
				settings.widget.slider.element.slider(settings.widget.slider.options).slider("value",settings.widget.slider.options.value);
				
				// Save settings data to input
				$this.data('cytoSlider',settings);
				methods.resize.apply($this);
				settings.events.create.apply($this,[settings]);
			});
		},
		destroy:function(){
			return this.each(function(){
				var $this = $(this);
				var settings = $this.data('cytoSlider');
				if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the destroy method!");
				
				// Destroy widget
				$this.unbind(".cytoSlider").removeClass("cytoSlider").data("cytoSlider",null).insertBefore(settings.widget.wrapper.element);
				settings.widget.wrapper.element.remove();
				
				settings.events.destroy.apply($this,[settings]);
			});
		},
		refresh:function(){
			return this.each(function(){
				var $this = $(this);
				var settings = $this.data('cytoSlider');
				if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the refresh method!");
				
				// Destroy and reinit
				methods.destroy.apply($this);
				methods.init.apply($this,[settings,true]);
				$this.trigger('change.cytoSlider');
			});
		},
		resize:function(){
			return this.each(function(){
				var $this = $(this);
				var settings = $this.data('cytoSlider');
				if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the resize method!");
				
				settings.widget.wrapper.element.width(0);
				setTimeout(function(){
					settings.widget.wrapper.element.width("auto");
				},1);
			});
		},
		value:function(set){
			if (set==null || set==undefined) set = false;
			var value;
			this.each(function(){
				var $this = $(this);
				var settings = $this.data('cytoSlider');
				if (!$this.hasClass('cytoSlider') || settings==null) return console.warn("You must instantiate $.cytoSlider before you call the value method!");
				
				if (set===false) value = $this.val();
				else {
					settings.widget.slider.element.slider("value",set);
					$this.trigger('change.cytoSlider');
				}
			});
			return (value!=null) ? value : this;
		},
		options:function(newOptions){
			if (newOptions!=null) {
				return this.each(function(){
					var $this = $(this);
					var settings = $this.data('cytoSlider');
					if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the options method!");
					$this.data('cytoSlider',$.extend(true,{},settings,newOptions));
					methods.refresh.apply($this);
				});
			} else {
				var returnVal;
				this.each(function(){
					var $this = $(this);
					var settings = $this.data('cytoSlider');
					if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the options method!");
					returnVal = settings;
				});
				return returnVal;
			}
		}
	};
	
	$.fn.cytoSlider=function(method){
		if (methods[method]) return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
		else if (typeof method == 'object' || !method) return methods.init.apply(this,arguments);
		else $.error('Method ' + method + ' does not exist on $.cytoSlider!');
	};
	
	$(window).resize(function(){$('.cytoSlider').cytoSlider('resize');});
	$.Cytoplasm("ready",function(){$('.cytoSlider').cytoSlider();});
})(jQuery);
;�FI"required_assets_digest;�F"%19b42296fdc61c5f94473d3d224a82d5I"
_version;�F"%6776f581a4329e299531e1d52aa59832