I'm working with this code which sets an object to visible when clicked. Trouble is the previous object hasn't been set to hidden so they overlap each other. How can I get this function to hide the previous object before showing the next ? Thanks function MM_showHideLayers() { //v6.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='show')?'hidden':v; } obj.visibility=v; } Code (markup):