//getHTML_functionViewerPad()		- gets the html(and function) for displaying function in popup by viewing source, function passed as  'func'. does not work with NS6
//browser object def
//Obj()								- dhtml object constructor as used with 'div' and 'span'
//getObjectProperties(msg,obj,winname)

function getObjectProperties(msg,obj,winname) {
	 var s="MSG = <b>" + msg + "</b><br><br><br>"
	 for (prop in document.getElementById("test")) {
	 	s+= prop + " = " + document[prop] + "<br>"
	}
	var win = window.open('',winname)
	win.document.open()
	win.document.write(s)
	win.document.close()
	win.focus()
}

function getHTML_functionViewerPad() {
	var s = "", f = "", w;
	s+="<html><head><title>Function Viewer</title>\n"
	s+="</head><body>\n"
	s+="<table border=0 cellspacing=0 cellpadding=0>\n"
	s+="<tr><td><b>Function Pad Viewer</b></td></tr>\n"
	s+="<tr><td>view source of this html document and scroll to see function.</td></tr>\n"
	s+="<tr class='text9'><td><br>[ <b><a href=# onclick='window.close()'>close</a></b>] </td></tr>\n"
	s+="</table>\n"

	if (typeof(document.all) !="undefined") s+="<script language=javascript><!--\n"
	s+="\n"
	for (var i=0;i<arguments.length;i++) {
		if (f != "") f+="\n\n\n"
		f+="/*\n"
		f+= arguments[i] + ""
		f+="\n*/\n"
	} 

	s+=f
	s+="\n"	 
	if (typeof(document.all) !="undefined") s+="--></script>\n" 
	if ((browser.version > 4) && (browser.Name="Netscape")) {
		s+="sorry, doesnt work in N6<br>"
	}
	s+="</body>"
	s+="</html>"
	w = window.open('','funcViewer','width=200,height=140,menubar=yes')
	w.document.open()
	w.document.write(s)
	w.document.close()

	w.focus()
}

//browser object def
var browser = new Object()
browser.version = parseInt(navigator.appVersion)
browser.name = navigator.appName

function Obj() { 
	if (document.layers) {//name: comma separated for Netscape4: topdiv,innerdiv1,innerdiv2,...
		var s = ""
		for (var i=0;i<arguments.length;i++) { if (s != "") s += "."; s += "document['" + arguments[i] + "']";}
		this.obj = eval(s)
		this.style = this.obj
		if (typeof(this.obj) != "object") alert('function Obj: problem with this object, check it exists='+name)
	} else if (typeof(document.getElementById) != "undefined") { //NS6, I5
		var name=arguments[arguments.length-1]
		this.obj = document.getElementById(name)
		if (typeof(this.obj) != "object") alert('function Obj: problem with this object, check it exists='+name)
		this.style = this.obj.style
	} else {//IE4
		var name=arguments[arguments.length-1]
		this.obj = document.all[name]
		if (typeof(this.obj) != "object") alert('function Obj: problem with this object, check it exists='+name)
		this.style = document.all[name].style
	}

	this.Content = new Function('do_nothing','if (document.layers) {return ("//not avaiable for netscape, see div " + this.obj.name)} else {return ("see div " + this.obj.id + "\\n\\n\\n" + this.obj.innerHTML)}')
	this.Form = new Function('name','if (document.layers) {return this.obj.document.forms[name]} else {return document.forms[name]}')
	this.X = parseInt(this.style.left); this.Y = parseInt(this.style.top);
	this.Hide = new Function('do_nothing','this.style.visibility = "hidden"')
	this.Show = new Function('do_nothing','this.style.visibility = "visible"')
	this.Print = new Function('s','if (document.layers) {this.obj.document.open();this.obj.document.write(s);this.obj.document.close()} else {this.obj.innerHTML = s};return')
	this.MoveTo = new Function('X,Y','this.style.left = X;this.style.top = Y;this.X=X;this.Y=Y')
}
