We have a heavily customised ArcIMS application which we use to show demographic point and polygon data.

Recently the custodian of the system requested that I add in functionality to allow the user to drag and drop a box to select multiple points or polygons. The existing functionality was calling the IdentifyAll tool which meant you could only click one point on the map, whereas the new tool that I have added in uses the SelectBox tool which can select multiple objects.

The new tool works fine but I am having problems ensuring that a layer is active in the window when the tool is clicked.

The problem is that our TOC is, again, heavily customised and removes the need to click refresh in the TOC in order to switch on/off layers or make them active. There is a line of code that makes a layer visible and active as soon as the checkbox for that layer is clicked. Along with this code, there is an else statement (i.e. when a box is unchecked), that switches the layer off. However, the last layer that was checked remains active even if you uncheck it in the TOC.

So if you switch on layer A and then switch on layer B but then switch off layer B and try to use the select tool, ArcIMS still has layer B as the active layer and the select tool wont work. I need to make layer A (essentially the one before last layer that was active) the new active layer.

I have made a number of changes to the HTML, AXL and JavaScript that the site relies on, but the TOC was built prior to my arrival six months ago and despite my best efforts, I can't figure out how to 'refresh' the active layer in the map frame after one has been switched off.

Hi,
If I understand, Layer B is off, unvisible but active!
If so, then I would say that there might probably be a piece of code that clearly defaults the active layer to the last layer switched on when the page loads. That code can be anywhere but
I would suggest to look in the activelayer frame or in the tool frame.
Can you post the code that switches a layer on and makes it active along with the code in the "Else" statement?