anchor.diff:  </script>
   
   <!-- Page player main script -->
  -<script src="<%= ActionController::Base.helpers.asset_path("rglossa/speech/wfplayer.js") %>"></script>
  -<script type="text/javascript" src="http://tekstlab.uio.no/glossa/js/jquery/jquery-1.4.3.min.js"></script>
  +<%= javascript_include_tag ActionController::Base.helpers.asset_path("rglossa/speech/wfplayer.js") %>
  +<%= javascript_include_tag ActionController::Base.helpers.asset_path("jquery.min") %>
   
   </head>
   
  
positive.code:   } else {
      oSound.stopPos = curPos;
    }
    jQuery('#iframe').contents().find('#sel-stop').css({'width': '2px', 'height': '216px', 'backgroundColor': 'blue', 'left': event.pageX, 'position': 'absolute'});
    oSound.stop();
    oSound.setPosition(oSound.startPos);
    oSound.play();
  };
  </script>
  <form>
  <label><input type="checkbox" id="wfcb" checked onclick="if(jQuery('#wfcb').is(':checked')) { jQuery('#iframe').contents().find('.wave').css('visibility', 'visible'); } else { jQuery('#iframe').contents().find('.wave').css('visibility', 'hidden') }">waveform &amp; spectrogram</label> |
  <label><input type="checkbox" id="fmcb" checked onclick="if(jQuery('#fmcb').is(':checked')) { jQuery('#iframe').contents().find('.fmt').css('visibility', 'visible'); } else { jQuery('#iframe').contents().find('.fmt').css('visibility', 'hidden') }">formants: <span style="color: red">1</span> <span style="color: lightgreen">2</span> <span style="color: blue">3</span> <span style="color: orange">4</span></label> |
  <label><input type="checkbox" id="ptcb" checked onclick="if(jQuery('#ptcb').is(':checked')) { jQuery('#iframe').contents().find('.pitch').css('visibility', 'visible'); } else { jQuery('#iframe').contents().find('.pitch').css('visibility', 'hidden') }">pitch</label> |
  Problems? Switch to
  <script>
  
  
negative.code: <% end %>
  doc.write('</body></html>');
  doc.close();
  
  getPos = function(oSound, event) {
    return Math.floor(oSound.duration*event.pageX/<%= @total_imgwidth %>)
  };
  
  doc.body.onmousedown = function(event) {
    scrollMode = true;
    $('#iframe').contents().find('#sel').css('visibility', 'hidden');
    oSound = pagePlayer.lastSound;
    oSound.startX = event.pageX;
    oSound.startPos = getPos(oSound, event);
    oSound.setPosition(oSound.startPos);
    oSound.stop();
    var selStartCss = {'width': '2px', 'height': '216px', 'backgroundColor': 'blue',
                       'left': event.pageX, 'position': 'absolute'};
    $('#iframe').contents().find('#sel-start').css(selStartCss);
    return false;
  };
  
  doc.body.onmousemove = function(event) {
    if (scrollMode) {
      var selStopCss = {'width': '2px', 'height': '216px', 'backgroundColor': 'blue',
                        'left': event.pageX, 'position': 'absolute'};
      var selCss = {'width': Math.abs(event.pageX-oSound.startX)+'px', 'height': '216px',
                    'backgroundColor': 'rgba(0, 0, 0, 0.1)',
                    'left': Math.min(event.pageX, oSound.startX), 'position': 'absolute',
                    'visibility': 'visible'}
      $('#iframe').contents().find('#sel-stop').css(selStopCss);
      $('#iframe').contents().find('#sel').css(selCss);
    }
  }
  
  doc.body.onmouseup = function(event) {
    if (!scrollMode) return true;
    scrollMode = false;
  