intentalo asi a ver:
Código javascript
:
Ver originaldocument.observe('dom:loaded', function() {
$$('.links').each(function(val,index){
var btn = document.createElement('img');
btn.src = 'ampliar.png';
//Attach to DOM
if(this.next()!=undefined)
this.insert({top:btn})
else
this.insert({bottom:btn})
Element.extend(btn)
//Position icon
btn.setStyle({'position':'absolute'});
var pos = btn.previous().down().cumulativeOffset();
var size = btn.previous().down().getDimensions();
btn.setStyle({'rigth':'0','bottom':'0'});
//Attach action to icon
btn.observe('click', function() {
showPhoto(this.previous()
})
}
)
});