script breaks after more than two links: don't know why

script breaks after more than two links: don't know why

What i am trying to do is attach a link or make "clickable to another URL" an image when it briefly comes across the screen that points to the SITE. every time i try to link more than two URL's using the <a> tag to the images and or the menu (unordered list) the script breaks. its giving me the blues.Every time it works when I link the first two images and list items but on the third it breaks every freakin' time. I just don't get it.I have successfully managed to change other aspects of the script but this has me stumped. 


The second thing I am trying to effect is I want to flip the slideshow so that the second slide is on the right and underneath the first. The top slide represents major contributors our partners. the 2nd is for those links associated with our missions and lend support. I tried on my own but have had a rough go at this too.

It is an old slideshow but I really like the look for what I'm trying to do.
The slideshow also uses a applet (i guess that's what it is) called MOO TOOLS. It seems not to work without it. I've installed the latest update for this app. If needed I will provide the .js for the two scripts for mootools-1.2.5-core-nc and mootools-1.2.5.1-more

I'm not looking for anyone to do my work but to tell me why it continues to break and where and why. I may encounter these issues on some other occasion. I really want to learn. Show me the how to effectively write this script. I will learn. I have another sites that I am going to change to jQuery as soon as I finish this. BabiesNMovies.com & SBHorizons.com. jQuery are the perfect platforms for these types of presentations it so appears.
Thank you, all.

GoGreen Computer Services Partners

It takes so much to bring about the results we hope to achieve:

sustaining our environment by extending the life of our computers just that much longer.

 

Many assist us on our mission to get to our goal and are soon to be partners, not just assists

We Thank all of our assistant for getting us there.

Join us and be listed as one who really takes an active stance to really sustain our environment

 

 

 

 

 

 

 

 

 

  1.  */the BarackSlideshowWithMorphlist.js */ 
  2. /*
  3. Script: Fx.MorphList.js
  4. Animates lists of objects with a morphing background.

  5. License:
  6. MIT-style license.

  7. Authors:
  8. Guillermo Rauch
  9. */

  10. Fx.MorphList = new Class({   
  11. Implements: [Events, Options],
  12. options: {/*             
  13. onClick: $empty,
  14. onMorph: $empty,*/
  15. bg: {'class': 'background', html: '<div class="inner"></div>', morph: {link: 'cancel'}}
  16. },
  17. initialize: function(element, options){
  18. var self = this;
  19. this.setOptions(options);
  20. this.element = $(element);
  21. this.items = this.element.getChildren().addEvents({
  22. mouseenter: function(){ self.morphTo(this); },
  23. mouseleave: function(){ self.morphTo(self.current); },
  24. click: function(ev){ self.onClick(ev, this); }
  25. });       
  26. this.bg = new Element('li', this.options.bg).inject(this.element).fade('hide');
  27. this.setCurrent(this.element.getElement('.current'));
  28. },

  29. onClick: function(ev, item){
  30. this.setCurrent(item, true).fireEvent('click', [ev, item]);
  31. },
  32. setCurrent: function(el, effect){  
  33. if (el && !this.current){
  34. this.bg.set('styles', el.getCoordinates(this.element));
  35. (effect) ? this.bg.fade('in') : this.bg.fade('show');
  36. }
  37. if (this.current) this.current.removeClass('current');
  38. if (el) this.current = el.addClass('current');    
  39. return this;
  40. },         
  41.          
  42. morphTo: function(to){
  43. if (to){
  44. var c = to.getCoordinates(this.element);
  45. delete c['right']; delete c['bottom'];
  46. this.bg.morph(c);
  47. this.fireEvent('morph', to);
  48. }
  49. return this;
  50. }

  51. });
  52. /*
  53. Script: BarackSlideshow.js
  54. Lightweight slideshow script, based on Fx.MorphList

  55. License:
  56. MIT-style license.

  57. Authors:
  58. Guillermo Rauch
  59. */

  60. var BarackSlideshow = new Class({
  61.   
  62.   Extends: Fx.MorphList,
  63.   // Implements: [Events, Options],
  64.   
  65.   options: {/*
  66.     onShow: $empty,*/
  67.     auto: true,
  68.     autostart: false,
  69.     autointerval: 2000,
  70.     transition: 'fade',
  71.     tween: { duration: 700 }
  72.   },
  73.   
  74.   initialize: function(menu, images, loader, options){
  75.       this.parent(menu, options);
  76.     this.images = $(images);
  77.     this.imagesitems = this.images.getChildren().fade('hide');
  78.     $(loader).fade('in');
  79.     new Asset.images(this.images.getElements('img').map(function(el) { return el.setStyle('display', 'none').get('src'); }), { onComplete: function() {
  80.       this.loaded = true;      
  81.       $(loader).fade('out');
  82.       if (this.current) this.show(this.items.indexOf(this.current));
  83.       else if (this.options.auto && this.options.autostart) this.progress();
  84.     }.bind(this) });
  85.     if ($type(this.options.transition) != 'function') this.options.transition = $lambda(this.options.transition);
  86.   },
  87.   
  88.   auto: function(){
  89.     if (!this.options.auto) return false;
  90.     $clear(this.autotimer);
  91.     this.autotimer = this.progress.delay(this.options.autointerval, this);
  92.   },
  93.  
  94.   onClick: function(event, item){
  95.     this.parent(event, item);
  96.     event.stop();
  97.     this.show(this.items.indexOf(item));
  98.     $clear(this.autotimer);
  99.   },
  100.   
  101.   show: function(index) {
  102.     if (!this.loaded) return;
  103.     var image = this.imagesitems[index];    
  104. if (image == this.curimage) return;
  105.     image.set('tween', this.options.tween).dispose().inject(this.curimage || this.images.getFirst(), this.curimage ? 'after' : 'before').fade('hide');
  106. image.getElement('img').setStyle('display', 'block');
  107.     var trans = this.options.transition.run(null, this).split('-');
  108.     switch(trans[0]){
  109.       case 'slide': 
  110.         var dir = $pick(trans[1], 'left');
  111.         var prop = (dir == 'left' || dir == 'right') ? 'left' : 'top';
  112.         image.fade('show').setStyle(prop, image['offset' + (prop == 'left' ? 'Width' : 'Height')] * ((dir == 'bottom' || dir == 'right') ? 1 : -1)).tween(prop, 0); 
  113.         break;
  114.       case 'fade': image.fade('in'); break;
  115.     }
  116.     image.get('tween').chain(function(){ 
  117.       this.auto();
  118.       this.fireEvent('show', image); 
  119.     }.bind(this));
  120.     this.curimage = image;
  121.     this.setCurrent(this.items[index])
  122.     this.morphTo(this.items[index]);
  123. return this;
  124.   },
  125.   
  126.   progress: function(){
  127.     var curindex = this.imagesitems.indexOf(this.curimage);
  128.     this.show((this.curimage && (curindex + 1 < this.imagesitems.length)) ? curindex + 1 : 0);
  129.   }
  130.   
  131. });
  132. new BarackSlideshow('menu', 'pictures', 'loading', {transition: 'slide-left', auto: true,autostart:false});


  1. */the css*/
  2. #slideshow * { margin: 0; padding: 0; }
  3. #slideshow { background: url('http://www.devthought.com/wp-content/projects/mootools/barackslideshow/Source/images/bg_shadow.gif') no-repeat top; position: relative; padding: 14px 0 15px; width: 603px; height: 306px; }
  4. #slideshow #menu, #slideshow #pictures, #slideshow #loading { position: absolute; }
  5. #slideshow #loading { background: url('http://www.devthought.com/wp-content/projects/mootools/barackslideshow/Source/images/spinner.gif'); display: block; top: 158px; left: 205px; text-indent: -5000px; width: 24px; height: 24px; visibility: hidden; z-index: 5; }
  6. #slideshow #pictures { background: url('http://dummyimage.com/437x277&text=Start+Poster+(437x277)'); width: 437px; height: 277px; left: 0; overflow: hidden; }
  7. #slideshow #pictures li { display: block; position: absolute; top: 0; width: 437px; }
  8. #slideshow #pictures li img { display: block; position: relative; bottom: 0; }
  9. #slideshow #menu { background: url('http://dummyimage.com/166x257/111111/eeee00&text=+++++++menu+bg (166x257)'); list-style-type: none; width: 166px; height: 257px; right: 0; padding-top: 20px; }
  10. #slideshow #menu li { display: block; z-index: 1000; position: relative; zoom: 1; }
  11. #slideshow #menu li a { display: block; font: 11px "Lucida Grande", "Verdana"; text-decoration: none; padding: 7px 0 7px 28px; z-index: 1000; color: #ccc; line-height: 14px; vertical-align: middle; zoom: 1; }
  12. #slideshow #menu li a:focus { outline: 0; }
  13. #slideshow #menu li a:hover { color: #fff; }
  14. #slideshow #menu li.current a { font: 15px "Georgia"; color: #fff; padding: 5px 0 5px 28px; line-height: 18px; }
  15. #slideshow #menu li.background { background: url('http://www.devthought.com/wp-content/projects/mootools/barackslideshow/Source/images/arrow.gif') no-repeat left center; position: absolute; font-size: 1px; height: 7px; width: 4px; z-index: 5; }

  16. */THANKS!!!*/