/* FILE ARCHIVED ON 9:14:29 Nov 24, 2010 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 11:02:50 Dec 15, 2013. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ // script.aculo.us slider.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 // Copyright (c) 2005, 2006 Marty Haught, Thomas Fuchs // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: /web/20101124091429/http://script.aculo.us/ function K2Slider(handle, track, options) { var self = this; this.handle = jQuery(handle); this.track = jQuery(track); this.options = options || {}; this.value = this.options.value || 0; this.maximum = this.options.maximum || 1; this.minimum = this.options.minimum || 0; this.trackLength = this.track.width(); this.handleLength = this.handle.width(); this.handle.css('position', 'absolute'); this.active = false; this.dragging = false; this.setValue(this.value); this.handle.mousedown(function(event) { self.active = true; var pointer = self.pointerX(event); var offset = self.track.offset(); self.setValue( self.translateToValue( pointer-offset.left-(self.handleLength/2) ) ); var offset = self.handle.offset(); self.offsetX = (pointer - offset.left); }); this.track.mousedown(function(event) { var offset = self.track.offset(); var pointer = self.pointerX(event); self.setValue( self.translateToValue( pointer-offset.left-(self.handleLength/2) ) ); }); jQuery(document).mouseup(function(event){ if (self.active && self.dragging) { self.active = false; self.dragging = false; self.updateFinished(self); } self.active = false; self.dragging = false; }); jQuery(document).mousemove(function(event){ if (self.active) { if (!self.dragging) self.dragging = true; self.draw(event); // fix AppleWebKit rendering if (navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); } }); this.initialized = true; }; K2Slider.prototype.getNearestValue = function(value) { if (value > this.maximum) return this.maximum; if (value