I picked this one up a while ago. It's been pretty useful.<br><br><HTML><HEAD><br><br><SCRIPT LANGUAGE="JavaScript"><br><!-- Original: Cyanide_7 (<A HREF="mailto:leo7278@hotmail.com">leo7278@hotmail.com</A>) --><br><!-- Web Site: <A HREF="
TARGET="_new">
--><br><br><!-- This script and many more are available free online at --><br><!-- The JavaScript Source!! <A HREF="
TARGET="_new">
--><br><br><!-- Begin<br>var objects = new Array(), browser = null, expanded = null;<br><br>// begin objects array with the document<br>objects[0] = new Array(document, "_document", false);<br><br>function openDOMBrowser(activeElement){<br>// finds index of incoming object by its key<br>activeIndex = arrayIndexOf(objects, activeElement, 1);<br>// toggles its expanded boolean<br>objects[activeIndex][2] = !objects[activeIndex][2];<br>// opens/reopens the window<br>args = "width=500,height=600,left=20,top=20,scrollbars,resizable,top=0,left=0";<br>browser = window.open('',"DOMBrowser",args);<br>browser.focus();<br>// clears the expanded array (to avoid infinate loops in the DOM)<br>expanded = new Array();<br>// document is about to be expanded<br>expanded["_document"] = true;<br>// writes HTML to the window<br>browser.document.open("text/html","replace"

;<br>browser.document.writeln("<HTML><HEAD><TITLE>DOM Browser</TITLE></HEAD>"

;<br>browser.document.writeln("<BODY BGCOLOR=BBBBBB link=FFFFF vlink=FFFFF>"

;<br>browser.document.writeln("<h3>document:</h3><ul>"

;<br>// calls recurrsive property writing function<br>getProps(document);<br>// finishes writing HTML and closes<br>browser.document.writeln("</ul></BODY></HTML>"

;<br>browser.document.close();<br>// returns false for event handlers<br>return false;<br>}<br>// recurrsive function to get properties of objects<br>function getProps(obj){<br>// for loop to run through properties of incoming object<br>for(var prop in obj){<br>browser.document.writeln("<li>"

;<br>// if the property is an object itself, but not null...<br>if(typeof(obj[prop])=="object" && obj[prop]!=null){<br>// get index of object in objects array<br>valIndex = arrayIndexOf(objects, obj[prop], 0);<br>// if not in index array, add it and create its key<br>if(valIndex==-1){<br>valIndex = objects.length;<br>key = ((new Date()).getTime()%10000) + "_" + (Math.floor(Math.random()*10000));<br>objects[valIndex] = new Array(obj[prop], key, false);<br>}<br>// write link for this object to call openDOMBrowser with its key<br>browser.document.writeln("<b>"+prop+<br>"</b> : <a href=\"javascript:void(0)\" onClick=\"window.opener.openDOMBrowser('"+<br>objects[valIndex][1]+"');return false;\">"+(new String(obj[prop])).replace(/</g,"<"

+"</a>"

;<br>// determine whether object should be expanded/was already expanded<br>if(objects[valIndex][2] && !expanded[objects[valIndex][1]]){<br>// if it needs to be expanded, add to expanded array<br>expanded[objects[valIndex][1]] = true;<br>// write nested list tag and recurrsive call to getProps<br>browser.document.writeln("<ul>"

;<br>getProps(obj[prop]);<br>browser.document.writeln("</ul>"

;<br> }<br>} else<br>// if not an object, just write property, value pair<br>browser.document.writeln("<b>"+prop+"</b> : " + (new String(obj[prop])).replace(/</g,"<"

);<br>browser.document.writeln("</li>"

;<br> }<br>}<br>// function to find object in an array by field value<br>function arrayIndexOf(array, value, field){<br>var found = false;<br>var index = 0;<br>while(!found && index < array.length){<br>// field may be object reference or key<br>if(array[index][field]==value)<br>found = true;<br>else<br>index++;<br>}<br>return (found)?index:-1;<br>}<br>// End --><br></script><br></HEAD><br><br><!-- STEP TWO: Copy this code into the BODY of your HTML document --><br><br><BODY><br><br><center><br><form><br><input type=button value="Open DOM Browser" onClick="openDOMBrowser('_document');"><br></form><br></center><br></body></html><br><br> <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>