// Copyright (C) 1999,2001 Richard M. Smith, All rights reserved 

var lastError = null;
var gevents = "";
var gobjtypes = "";

var ActiveXSkipList = 
"/accessKey/align/altHtml/BaseHref/className/clientHeight/clientLeft/clientTop/clientWidth/code/codeBase" +
"/codeType/dataFld/dataFormatAs/dataSrc/height/hspace/id/innerHTML/innerText/isTextEdit/lang/language/name" +
"/offsetHeight/offsetLeft/offsetTop/offsetWidth/outerHTML/outerText/readyState/sourceIndex/tabIndex/tagName" +
"/title/type/vspace/width/all/children/document/filters/form/offsetParent/onafterupdate/onbeforeupdate/onblur" +
"/onclick/ondataavailable/ondatasetchanged/ondatasetcomplete/ondblclick/ondragstart/onerror/onerrorupdate" +
"/onfilterchange/onfocus/onhelp/onkeydown/onkeypress/onkeyup/onmousedown/onmousemove/onmouseout/onmouseover" +
"/onmouseup/onreadystatechange/onresize/onrowenter/onrowexit/onselectstart/parentElement/parentTextEdit" +
"/recordNumber/style/ActiveXSkipList/lastError/gevents/gobjtypes/";

function PageTitle(text)

{

	text = QuoteText(text);
	document.writeln("<title>", text, "</title>");
	document.writeln("<h3>", text, "</h3>");
	document.writeln("<hr>");
	return;

}

function DescStart()

{

	document.writeln("<table width=500><tr><td>");
	return;

}

function DescEnd()

{

	document.writeln("</td></tr></table>");
	return;

}

function MakeDoitButton(fname)

{

	document.writeln("<br>");
	document.writeln("<form><input type=button onclick='Doit(\"", fname, "\")' value='Try it!'></form>");
	document.writeln("<br>");
	return;

}

function Doit(fname)

{

	if(!confirm("Are you sure that you want to crash your computer?"))
		return;
	if(!confirm("Okay, here goes...."))
		return;
	eval(fname + "()");
	return;

}

function QuoteText(str)

{

	var temp;

	str = str + "";
	if(str.indexOf("&") >= 0)
	{
		temp = str.split("&");
		str = temp.join("&amp;");
	}
	if(str.indexOf("<") >= 0)
	{
		temp = str.split("<");
		str = temp.join("&lt;");
	}
	if(str.indexOf(">") >= 0)
	{
		temp = str.split(">");
		str = temp.join("&gt;");
	}
	return str;

}

function ShowFunc(fname)

{

	ShowSrc(FunctionText(fname));
	return;

}

function FunctionText(fname)

{

	var func;

	func = eval(fname);
	return func.toString();

}

function ShowSrc(text)

{

	document.writeln("<table border=1><th>JavaScript Source Code</th><tr><td><code><pre>");
	document.write(QuoteText(text));
	document.writeln("</code></pre></td></tr></table>");
	return;

}

function isIE()

{

	return navigator.appName == "Microsoft Internet Explorer";

}

function isNav()

{

	return navigator.appName == "Netscape";

}

function SSADirectoryLine()

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
 	document.write(" &gt; Server-side Assists");
	document.write("</b><br><br>");

}

function EmbeddedDirectoryLine()

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
 	document.write(" &gt; Embedded Web Devices");
	document.write("</b><br><br>");

}

function AccTrojDirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
	if(text == null)
	{
	 	document.write(" &gt; Accidental Trojan Horses");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>Accidental Trojan Horses</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function CPDRMDirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
	if(text == null)
	{
	 	document.write(" &gt; Copy Protection and DRM");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>Copy Protection and DRM</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function SecurityDirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
	if(text == null)
	{
	 	document.write(" &gt; Internet Security");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>Internet Security</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function SecurityLinksDirectoryLine()

{

	document.write("<br><b>");
 	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>Internet Security</a>");
 	document.write(" &gt; Links");
	document.write("</b><br><br>");

}

function SpamDirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
	if(text == null)
	{
	 	document.write(" &gt; Spam");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>Spam</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}


function AnonDirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
	if(text == null)
	{
	 	document.write(" &gt; Web Anonymizing Services");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>Web Anonymizing Services</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function AnthraxDirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
	if(text == null)
	{
	 	document.write(" &gt; Anthrax investigation");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>Anthrax investigation</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function TIADirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
	if(text == null)
	{
	 	document.write(" &gt; TIA");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>TIA</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function Nine11DirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../index.htm target=_top>Home</a>");	
	if(text == null)
	{
	 	document.write(" &gt; 9/11");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>9/11</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}



function CrashDirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>Internet Security</a>");
	if(text == null)
	{
 		document.write(" &gt; Browser Crashes");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>Browser Crashes</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function EmailDirectoryLine(text)

{

	document.write("<br><b>");
 	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>Internet Security</a>");
	if(text == null)
	{
 		document.write(" &gt; Email Security Hazards");
	}
	else
	{
	 	document.write(" &gt; <a href=index.htm target=_top>Email Security Hazards</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}	

function JSDirectoryLine(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; JavaScript");
	}
	else
	{
 		document.write("<a href=../../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=../index.htm target=_top>JavaScript</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}
	
function CookiesDirectoryLine(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; Cookies");
	}
	else
	{
 		document.write("<a href=../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=index.htm target=_top>Cookies</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function PythonDirectoryLine(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; Python");
	}
	else
	{
 		document.write("<a href=../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=index.htm target=_top>Python</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function JSBugsDirectoryLine(text)

{

	document.write("<br><b>");
	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>JavaScript</a>");
 	document.write(" &gt; <a href=index.htm target=_top>Bugs</a>");
	document.write(" &gt; ", text);
	document.write("</b><br><br>");

}

function JSMiscDirectoryLine(text)

{

	document.write("<br><b>");
	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>JavaScript</a>");
 	document.write(" &gt; <a href=index.htm target=_top>Misc.</a>");
	document.write(" &gt; ", text);
	document.write("</b><br><br>");

}

function JSURLDirectoryLine(text)

{

	document.write("<br><b>");
	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>JavaScript</a>");
 	document.write(" &gt; <a href=index.htm target=_top>URLs</a>");
	document.write(" &gt; ", text);
	document.write("</b><br><br>");

}

function JSLangDirectoryLine(text)

{

	document.write("<br><b>");
	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>JavaScript</a>");
 	document.write(" &gt; <a href=langref.htm target=_top>Language Reference</a>");
	document.write(" &gt; ", text);
	document.write("</b><br><br>");

}

function JSBOMDirectoryLine(text)

{

	document.write("<br><b>");
	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>JavaScript</a>");
 	document.write(" &gt; <a href=bomref.htm target=_top>Browser Object Model</a>");
	document.write(" &gt; ", text);
	document.write("</b><br><br>");

}

function JSDOMDirectoryLine(text)

{

	document.write("<br><b>");
	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>JavaScript</a>");
 	document.write(" &gt; <a href=domref.htm target=_top>Document Object Model</a>");
	document.write(" &gt; ", text);
	document.write("</b><br><br>");

}

function JSActiveXDirectoryLine(text)

{

	document.write("<br><b>");
	document.write("<a href=../../index.htm target=_top>Home</a>");	
 	document.write(" &gt; <a href=../index.htm target=_top>JavaScript</a>");
 	document.write(" &gt; <a href=index.htm target=_top>ActiveX Controls</a>");
	document.write(" &gt; ", text);
	document.write("</b><br><br>");

}

function JavaDirectoryLine(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; Java");
	}
	else
	{
 		document.write("<a href=../../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=../index.htm target=_top>Java</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function DLDirectoryLine(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; Dirty Laundry");
	}
	else
	{
 		document.write("<a href=../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=index.htm target=_top>Dirty Laundry</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function PrivacyDirectoryLine(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; Privacy");
	}
	else
	{
 		document.write("<a href=../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=index.htm target=_top>Privacy</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function PrivacyDirectoryLine2(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; Privacy");
	}
	else
	{
 		document.write("<a href=../../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=../index.htm target=_top>Privacy</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}


function BiometricsDirectoryLine(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; Biometrics");
	}
	else
	{
 		document.write("<a href=../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=index.htm target=_top>Biometrics</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function SleuthDirectoryLine(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; Internet Sleuthing Resources");
	}
	else
	{
 		document.write("<a href=../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=index.htm target=_top>Internet Sleuthing Resources</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function LoveBugDirectoryLine(text)

{

	document.write("<br><b>");
	if(text == null)
	{
	 	document.write("<a href=../index.htm target=_top>Home</a>");	
 		document.write(" &gt; LoveBug Virus");
	}
	else
	{
 		document.write("<a href=../index.htm target=_top>Home</a>");	
	 	document.write(" &gt; <a href=index.htm target=_top>LoveBug Virus</a>");
 		document.write(" &gt; ", text);
	}
	document.write("</b><br><br>");

}

function showObjectAsTable(name)

{

	var pass,obj,x,dx;

	obj = eval(name);
	for(pass = 1; pass <= 2; ++pass)
	{
		for (x in obj) 
		{
	                type = typeof(obj[x]);
			if(type == "function")
				continue;
			if(pass == 1 && type == "object")
				continue;
			if(pass == 2 && type != "object")
				continue;
			document.write("<tr><td align=center>&nbsp;" + name + "." + x + "&nbsp;</td>");
			if(type == "string" || type == "number" || type == "boolean")
			{
		        	dx = obj[x]; 
				document.writeln("<td align=center>&nbsp;" + QuoteText(dx) + "&nbsp;</td></tr>");
			}
			else 
			{
				if(type == "object" && x != "external")
	        		{
	        	  		dx = obj[x]; 
					if(dx == null)
					{
						document.writeln("<td align=center>&nbsp;" + dx + "&nbsp;</td></tr>");
						continue;
					}
				}
				document.writeln("<td align=center>&nbsp;<b>" + type + "</b>&nbsp;</td></tr>");
			}
		}
	}
	return;

}

function showObjectAsTable2(name, skiplist)

{

	showObjectAsTable3(document, name, eval(name), skiplist);
	return;

}

function showObjectAsTable3(output, name, obj, skiplist)

{

	var pass,foundf,x,dx;

	foundf = false;
	for(pass = 1; pass <= 2; ++pass)
	{
		for (x in obj) 
		{
			if(skiplist.indexOf("/" + x + "/") != -1)
				continue;
	                type = typeof(obj[x]);
			if(type == "function")
				continue;
			if(pass == 1 && type == "object")
				continue;
			if(pass == 2 && type != "object")
				continue;
			foundf = true;
			output.write("<tr><td align=center>&nbsp;", name, (name == "") ? "" : ".", x, "&nbsp;</td>");
			output.write("<td align=center><b>&nbsp;" + type + "&nbsp;</b></td>");
			if(type == "string" || type == "number" || type == "boolean")
			{
		        	dx = obj[x]; 
				output.writeln("<td align=center>&nbsp;" + QuoteText(dx) + "&nbsp;</td></tr>");
			}
			else 
			{
				if(type == "object" && x != "external")
	        		{
	        	  		dx = obj[x]; 
					if(dx == null)
					{
						output.writeln("<td align=center>&nbsp;" + dx + "&nbsp;</td></tr>");
						continue;
					}
				}
				output.writeln("<td align=center>&nbsp;<b>" + type + "</b>&nbsp;</td></tr>");
			}
		}
	}
	if(!foundf)
	{
		output.writeln("<tr><td align=center colspan=3>&nbsp;No members found", (name == "") ? "" : 
		               (" in <i>" + name + "</i>"), "&nbsp;</td></tr>");
	}
	return;

}

function ignoreHandler(msg, URL, lineno)

{

	lastError = new Object();
	lastError.msg = msg;
	lastError.URL = URL;
	lastError.lineno = lineno;
	return true;

}

function evalTableEntry(expr, comment)

{

	var err;

	try
	{
		evalTableEntryOutput(expr, QuoteText(eval(expr) + ""), comment);
	}
	catch(err)
	{
		evalTableEntryOutput(expr, "<b>Error:</b> " + err.message, comment);
	}
	return;

}

function noevalTableEntry(expr, comment)

{

	evalTableEntryOutput(expr, "---", comment);
	return;

}

function evalTableEntry_IENA(expr, comment)

{

	evalTableEntry(expr, comment);


}

function evalTableEntry_NNNA(expr, comment)

{

	evalTableEntry(expr, comment);


}

function evalTableEntryOutput(expr, result, comment)

{

	document.write("<tr><td align=center>&nbsp;" + QuoteText(expr) + "&nbsp;</td>");
	document.write("<td align=center>&nbsp;" + result + "&nbsp;</td>");
	if(comment != null)
		document.write("<td align=left>&nbsp;" + comment + "&nbsp;</td>");
	document.writeln("</tr>");
	return;

}

function descTableEntry(name, desc)

{

	document.write("<tr><td align=center>&nbsp;" + name + "&nbsp;</td>");
	document.write("<td align=center>&nbsp;" + desc + "&nbsp;</td>");
	document.writeln("</tr>");
	return;

}

function eventTable(objtype, events)

{

	gobjtype = objtype;
	gevents = events;

	eventTableStart();
	eventTableEntry("onabort", "");
	eventTableEntry("onafterupdate", "[IE4 only]");
	eventTableEntry("onbeforeupdate", "[IE4 only]");
	eventTableEntry("onblur", "Invoked when OBJTYPE looses focus");
	eventTableEntry("onchange", "Invoked when OBJTYPE changes");
	eventTableEntry("onclick", "Invoked when OBJTYPE is clicked on by the mouse");
	eventTableEntry("ondataavailable", "[IE4 only]");
	eventTableEntry("ondatasetchange", "[IE4 only]");
	eventTableEntry("ondatasetcomplete", "[IE4 only]");
	eventTableEntry("ondblclick", "Invoked when OBJTYPE is double-clicked on by the mouse");
	eventTableEntry("ondragdrop", "");
	eventTableEntry("ondragstart", "[IE4 only]");
	eventTableEntry("onerror", "Invoked when an error has occurred");
	eventTableEntry("onerrorupdate", "[IE4 only]");
	eventTableEntry("onfilterchange", "[IE4 only]");
	eventTableEntry("onfocus", "Invoked when OBJTYPE gets focus");
	eventTableEntry("onhelp", "");
	eventTableEntry("onkeydown", "Invoked when a key is first pressed");
	eventTableEntry("onkeypress", "Invoked when a key ");
	eventTableEntry("onkeyup", "Invoked when a key goes back up");
	eventTableEntry("onload", "Invoked when OBJTYPE is loaded");
	eventTableEntry("onmousedown", "Invoked when a mouse button is first pressed");
	eventTableEntry("onmousemove", "Invoked when the mouse cursor moves within OBJTYPE");
	eventTableEntry("onmouseout", "Invoked when the mouse cursor moves outside of OBJTYPE");
	eventTableEntry("onmouseover", "Invoked when the mouse cursor first moves over OBJTYPE");
	eventTableEntry("onmouseup", "Invoked when a mouse button is let go");
	eventTableEntry("onmove", "Invoked when OBJTYPE is moved");
	eventTableEntry("onreset", "Invoked when a form reset button is pushed");
	eventTableEntry("onresize", "Invoked when OBJTYPE is resized");
	eventTableEntry("onrowenter", "[IE4 only]");
	eventTableEntry("onrowexit", "[IE4 only]");
	eventTableEntry("onselectstart", "[IE4 only]");
	eventTableEntry("onreset", "Invoked when a form submit button is pushed");
	eventTableEntry("onunload", "Invoked when OBJTYPE is unloaded");
	eventTableEnd();

	events = "";
	return;

}


function eventTableStart()

{

	document.writeln('<table border=1>');
	document.writeln('<tr><th align=center>&nbsp;Event handler&nbsp;</th><th align=center>&nbsp;Usage&nbsp;</th></tr>');
	return;

}

function eventTableEnd()

{

	document.writeln('</table>');
	return;

}

function eventTableEntry(name, desc)

{

	var i;

	if(gevents != null)
	{
		i = gevents.search(name);
		if(i == -1)
			return;
		if(i > 0 && gevents.charAt(i - 1) != ",")
			return;
		if(i + name.length < gevents.length && gevents.charAt(i + name.length) != ",")
			return;
	}
	desc = desc.replace("OBJTYPE", gobjtype);
	descTableEntry(name, desc);
	return;

}

function tryTableEntry(name, method, desc)

{

	document.write("<tr><td align=center><a href=javascript:" + name + "()>Try&nbsp;it</a></td>");
	document.write("<td align=center>&nbsp;" + method + "&nbsp;</td>");
	document.write("<td align=center>&nbsp;" + desc + "&nbsp;</td>");
	document.writeln("</tr>");
	return;

}








