doing it line by line with explicit events and params is just silly. you should consider refactoring it a little. remove the explicit IDs, you should setup some class-based handler or at the very least, target the parent id and find the images to attach to as children, something like this:
<div id="example_6_frame">
<ul>
<li><a href="#"><img src="images/ex6_1t.jpg" alt="thumbnail 1" /></a></li>
<li><a href="#"><img src="images/ex6_2t.jpg" alt="thumbnail 2" /></a></li>
<li><a href="#"><img src="images/ex6_3t.jpg" alt="thumbnail 3" /></a></li>
<li><a href="#"><img src="images/ex6_4t.jpg" alt="thumbnail 4" /></a></li>
<li><a href="#"><img src="images/ex6_5t.jpg" alt="thumbnail 5" /></a></li>
<li><a href="#"><img src="images/ex6_6t.jpg" alt="thumbnail 6" /></a></li>
<li><a href="#"><img src="images/ex6_7t.jpg" alt="thumbnail 7" /></a></li>
</ul>
</div>
the js bits...
$("example_6_frame").getElements("img").each(function(el, i) {
el.addEvents({
click: function(e) {
ex6Carousel.goTo(i);
}
});
});
here's also a mootools liveEvent implementation, http://dev.k1der.net/dev/live-events-pour-moootools/ - you can adapt it easily to the above...
Element.implement({
addLiveEvent: function(event, selector, fn){
this.addEvent(event, function(e){
var t = $(e.target);
if (!t.match(selector)) return false;
fn.apply(t, [e]);
}.bindWithEvent(this, selector, fn));
}
});
just keep in mind that if the script uses the mootools scroll.js to find and scroll to elements, you may have to leave the specific ids in after all. having said that, this iCarousel is from the same bloke that wrote iMask so it ought to be well written...