There is a code:
var i=document.createElement('img'); ia.appendChild(i); i.src=imgdir+'/'+id; i.rel='lightbox[roadtrip]';
The i.rel values do not substitute the values of the lightbox = (tried to do i.alt in this case works but the values are assigned to the attribute alt = ""