var ie4=(document.all)?true:false;
var ns4=(document.layers)?true:false;
checking for browser. not the name of it, but for the document object model (dom) it uses. thus "ie4" and "ns4" refer more to the way a browser treats the document, not the browser's name itself.
function overThis(divID, overImg){
document.all[last].style.visibility = "hidden";
document.all[divID].style.visibility = "visible";

document.layers[last].visibility ="hide";
document.layers[divID].visibility ="show";
the function itself serves two different ways to show a css layer, based on the browser type. the code is simple by itself. the only thing to be mentioned is this "last" variable. this variable is used to register the last layer shown, so the next time this layer will be hidden.
var oM = "img"+overImg+"G";
document.images[lastIm].src = img0.src;
document.images[oM].src = eval("img"+[overImg]+".src");
last = divID;
lastIm = oM;
the same technique is used for rollovers. there is a variable "lastIm" to store the name of the last image which was changed (moused over or moused out). all images are preloaded and have names like "img2" and "img2G". the G images are identical in the source - an image to trigger on roll out.