just looking at the code of my pages in frontpage and noticed this at the top function FP_swapImg() { var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length; n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm; elm.$src=elm.src; elm.src=args[n+1]; } } } function FP_preloadImgs() { var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array(); for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; } } function FP_getObjectByID(id,o) { var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id); else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el; if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c) for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; } f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements; for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } } return null; Code (markup):
Looks like the Frontpage version of Dreambeaver's MM_swap. You're going to run into more strangeness if you stay with Frontpage. Even MS abandoned it eventually. Anyway, what it looks like it does is change images on something when it's hovered over. A slow, bloated, code-heavy way of doing it. The only advantage to keeping it might be that hover will work on non-links in IE6 (because it needs some sort of scripting help in that department). Otherwise, if that image-change-on-hover isn't happening on the page anymore, delete it. You can use CSS to change background images on :hover or :focus anyway, and if it happens on links (the <a href="#"> part), nothing special is needed for IE6 anyway.
Not only is it unnecessary Javascript, it is crap Javascript. All you neeed for that is one function to detect the src of an image and change it onmouseover and onmouseou. Moral of the story: Uninstall front page, and look at a notepad substitute (Notepad++, Edit+)