var ImageGallery=Class.create();ImageGallery.steps={prev:"-1",next:"+1"};ImageGallery.run=function(obj,imageCount,path,type,captions,images,captionText,SarchResPage,callback){try{var img,labels;img=$(obj).up().up().getElementsBySelector("img")[0];labels=$(obj).up().getElementsBySelector("label");ImageGallery.move(img,labels[0],path,imageCount,ImageGallery.steps[type],captions,images,captionText,SarchResPage,callback)}catch(e){}},ImageGallery.move=function(image,pag,path,imageCount,type,captions,images,captionText,SarchResPage,callback){var currentImage=parseInt(pag.innerHTML);if(currentImage==1&&type=="-1")currentImage=imageCount;else if(currentImage==imageCount&&type=="+1")currentImage=1;else currentImage=eval(currentImage+type);var hashCaptions=$H(captions),hashImages=$H(images);if(hashCaptions.size()>=currentImage&&SarchResPage==0)$(captionText).innerHTML=hashCaptions.get(currentImage);image.alt=hashCaptions.get(currentImage);pag.innerHTML=currentImage;image.src=hashImages.get(currentImage);if(callback.length>0){var callbackFunction=eval(callback);callbackFunction(currentImage)}return false},ImageGallery.moveTo=function(image,pag,path,imageCount,index,captions,images,captionText,SarchResPage,callback){var currentImage=index;currentImage>0&&currentImage<=imageCount&&ImageGallery.changeTo(image,pag,path,imageCount,currentImage,captions,images,captionText,SarchResPage,callback);return false},ImageGallery.changeTo=function(image,pag,path,imageCount,currentImage,captions,images,captionText,SarchResPage,callback){var hashCaptions=$H(captions),hashImages=$H(images);if(hashCaptions.size()>=currentImage&&SarchResPage==0)$(captionText).innerHTML=hashCaptions.get(currentImage);image.alt=hashCaptions.get(currentImage);pag.innerHTML=currentImage;image.src=hashImages.get(currentImage);if(callback.length>0){var callbackFunction=eval(callback);callbackFunction(currentImage)}},ImageGallery.runTo=function(obj,imageCount,path,index,captions,images,captionText,SarchResPage,callback){try{var img,labels;img=$(obj).up().up().getElementsBySelector("img")[0];labels=$(obj).up().getElementsBySelector("label");ImageGallery.moveTo(img,labels[0],path,imageCount,index,captions,images,captionText,SarchResPage,callback)}catch(e){}};