direction=getArgument(); if (direction=="Prev"){ if ( ojSelectedObject()!=0 && ojImageLink()!=0 ){ ojnum=ojSelectedObject(); //Real OJnum currentImage=ojImageLink(); ojnum=ojnum-ojFirstObject(currentImage)+1; if (ojnum!=1){ ojnum=ojnum-1; } if(ojnum >0) goToOjnumAll(ojnum); } }else if(direction=="Center"){ if (ojSelectedObject()!=0 && ojImageLink()!=0){ currentImage=ojImageLink(); ojnum=ojSelectedObject()-ojFirstObject(currentImage)+1; if(ojnum >0) goToOjnumAll(ojnum); } }else if direction=="Next"){ if (ojSelectedObject()!=0 && ojImageLink()!=0){ currentImage=ojImageLink(); ojnum=ojSelectedObject(); if (ojnum==ojNObjects()){ ojnum=ojFirstObject(currentImage); }else if (currentImage0) goToOjnumAll(ojnum); } } function goToOjnumAll(ojnum){ currentimage=ojImageLink(); firstoncurrentimage=ojFirstObject(currentimage); zoom=getZoom(); totalimages=ojNImages(); for (n=1; n<=totalimages; n++){ if(n != currentimage){ if(ojGetImageValue(n, "ID")!=0){ ojShowImage(n); firstonimage=ojFirstObject(n); ojToShow=ojnum+firstonimage-1; if (ojToShow<=ojLastObject(n)&& ojToShow>0) { ojShowObject(ojToShow); yoj=ojYPos(1); xoj=ojXPos(1); ojZoom(zoom,xoj,yoj); } } } // To return the view to the start } ojShowImage(currentimage); ojToShow=ojnum+firstoncurrentimage-1; if(ojToShow>0) ojShowObject(ojToShow); yoj=ojYPos(1); xoj=ojXPos(1); ojZoom(zoom,xoj,yoj); }