preventing an event from running

preventing an event from running

there are 2 event functions that are used in the script. 1 is to expand all sections and the other expands sections 1 by one. The issue i'm having is that the href link, when pressed closes the section. I was reading up on the stop() function, but can't figure out where to place it without screwing up the other functions. Here is the code I'm using:

  1. $(function() {
  2.   jQuery('a.popup').live('click', function(){
  3. newwindow=window.open($(this).attr('href'),'','height=540,width=960, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=1, copyhistory=0');
  4. window.moveTo(screen.width/2,screen.height/2);
  5. if (window.focus) {newwindow.focus()}
  6.         return false;
  7.     });
  8. });
  9. chaptitle = $(data).find("chapter").attr("label");
  10. filenum = $(data).find("file").attr("label");
  11. $(function() {
  12.        /* be sure data is defined here */
  13.     $( data ).find("chapter").each(function() {
  14.         var $chapter = $('<li class="chaptertitle"/>')
  15.         .append('<img class="img-swap" src="/demo/images/plus.png" class="img-swap" />')
  16.         .append('<p align="left" class="pc-left">' + $(this).attr("label") + '<p align="right" class="pc-right">Duration</p>')
  17.         .append('<ul/>')
  18.         .appendTo( '#screens' );
  19.         $(this).find('screen').each(function() {
  20. time=$(this).find('mobile').attr('duration')
  21. $("#screens").append(time)
  22. $('#screens ul:last')
  23.              .append('<li class="screentitle"/>')
  24.              .find('li:last').append('<p align="left" class="p-left"><a href="http://sandbox.kalliance.com/demo/player.swf?streamer=rtmp://184.172.28.227/'+filenum+'/&amp;file=' + $(this).attr('path') + '&amp;allowscriptaccess=true&amp;autostart=true&amp;stretch=fill&amp;plugins=captions-2&amp;captions.back=true&amp;captions.file=/demo/xml/'+chaptitle+'/captions.xml&amp;allowFullScreen=true" class="popup">' + $(this).attr('label') + '</a></p><p align="right" class="p-right">'+ $(this).attr("duration")+'</p>');
  25.  
  26.         });       
  27.     });
  28. });
  29.  $('.show, .hide').click(function(event){
  30.     // grab the image, its src, and whether the src is currently a plus...
  31.     var $img = $('.img-swap'),
  32.         src = $img.attr('src'),
  33.         canExpand = src.indexOf('plus.png') > -1;
  34.     // test for (ExpandAll AND is a plus) OR (CollapseAll AND is a minus)...
  35.     if($(this).hasClass('show') === canExpand){
  36.         // show (is a plus) or hide (is a minus) the title...
  37.         $(".screentitle")[ canExpand ? 'show' : 'hide' ]('normal');
  38.         // replace plus with minus, or vice versa...
  39.         $img.attr('src', canExpand ? src.replace('plus', 'minus') : src.replace('minus', 'plus'));
  40.         // if you have additional processing : canExpand TRUE means you're expanding
  41.     }
  42.    
  43. });
  44. $(".chaptertitle").click( function(event){
  45. $(".screentitle", this).slideToggle("normal")
  46. var $img = $(".img-swap", this);
  47.     if ($img.attr('src').indexOf("plus.png") > -1) {
  48.         $img.attr('src', $img.attr('src').replace('plus', 'minus'));
  49.     } else {
  50. $img.attr('src', $img.attr('src').replace('minus', 'plus'));
  51.  
  52. }
  53. }); 

  54. Basically, when the link is clicked for the new popup window, I don't want it to run the slidetoggle function.
a working demo can be found here