// <SCRIPT>
/* NTX V2 client-side script library
	(C)2001-2000 iTrans, Inc. except where noted
	DOM-0 (works w/ IE4,Netscape4,Opera5,DOM-2)
*/

// root location of web (virtual root if applicable (e.g. "/NtxAdmin"))
// MUST be appropriately set prior to creating menuItem objects
var	NtxAppRoot = "";
// object arrays
var	NTX=new Object();
NTX.items = new Array();
// global browser detect
var	bDOM2=typeof(document.getElementById) != 'undefined';
var	bNE4=typeof(document.layers) != 'undefined' && !bDOM2;
var	bIE4=typeof(document.all) != 'undefined' && !bDOM2;

/////////////////////////////////////////////////////////////////////
// menu scripts

function showProps(obj,name)
{
	var	str="";
	for(var i in obj)
	{
		//str += name+"."+i+" = "+obj[i] + "<BR>";
		str += name+"."+i+" = "+obj[i] + "\n";
	}
	return str;
}

function findAssocElement(oSrc,sAssoc,id)
{
	var	oRet;
	var	asrc=oSrc[sAssoc];
	for(var i=0; i<asrc.length; i++)
	{
//document.writeln(showProps(asrc[i],sAssoc+'['+i+']')+"<BR>");
		if( asrc[i].id == id )
			return asrc[i];
/*		var	current=asrc[i];
		if( current[sAssoc] )
		{
			oRet=findAssocElement(current,sAssoc,id);
			if( oRet != null )
				return oRet;
		}
*/
	}
//document.writeln("<BR>");
	return null;
}
function findLayerElement(aLayers,id)
{
	var	oRet;
	var	i;
//document.writeln(aLayers.length);
	for(i=0; i<aLayers.length; i++)
	{
document.writeln(showProps(aLayers[i],'layer['+i+']')+"<BR>");
//		if( aLayers[i].id == id )
//			return aLayers[i];
		var	cur=aLayers[i];
		if( cur.layers )
		{
document.writeln("<HR>");
			oRet=findLayerElement(cur.layers,id);
			if( oRet != null )
				return oRet;
		}
	}
document.writeln("<BR>");
	return null;
}

function showAllElements()
{
	if(document.layers)
	{
//document.writeln(showProps(document,'document')+"<BR><BR>");
findElement('ZZZZ');
//		findLayerElement(document.layers);
//		findAssocElement(document,'links','');
//		findAssocElement(document,'images','');
//		findAssocElement(document,'embeds','');
//		findAssocElement(document,'forms','');
	}// end ifelse
	else if(document.all)
	{
		// IE4
	}
}

function findElement(id)
{
	if( document.getElementById )
	{
		return document.getElementById(id);
	}
	else if(document.layers)
	{
		// Netscape 4, the main problem here is there
		// is no heirarchy for getting html objects, thus
		// use positioned DIVs 
		var i,j;
//window.alert('Netscape layers');
//document.writeln(showProps(document,'document')+"<BR><BR>");
//document.writeln(showProps(document.layers[0],'layer0')+"<BR><BR>");
		with(document)
		{
			var	allLayers=new Array();
			for(i=0; i<layers.length; ++i)
			{
				if(layers[i].id == id)
					return layers[i];
				else
					allLayers[i] = layers[i];
			}
			for(i=0; i<allLayers.length; ++i)
			{
				if( allLayers[i].document && allLayers[i].document.layers )
				{
					for(j=0; j<allLayers[i].document.layers.length; ++j)
					{
						allLayers[allLayers.length]=allLayers[i].document.layers[j];
					}// for j
				}//endif
//document.writeln('['+i+'] '+allLayers[i].id+'<BR>');
//document.writeln(showProps(allLayers[i],'layer['+i+']')+"<BR>");
				if( allLayers[i].id == id )
					return allLayers[i];
			}//for i
			// check form elements
			for(i=0; i<forms.length; ++i)
			{
//window.alert("form: "+forms[i].name);
				if(forms[i].name == id)
					return forms[i];
				for(j=0; j<forms[i].length; ++j)
					if( forms[i][j].name == id)
						return forms[i][j];
			}
		}//end with
	}// end ifelse
	else if(document.all)
	{
		// IE4
		return document.all[id];
	}
	else
	{
		window.alert('findElement not supported for this browser!');
	}
	return null;
}
function showElement(oElement,bShow)
{
	if(typeof(bShow) == "undefined")
		bShow=true;
//window.alert(showProps(oElement,'Element'));
//window.alert('Element: '+oElement.id);
	if(oElement.style)
	{
//window.alert(showProps(oElement.style,'Element.style'));
//window.alert('style');
		if(bShow) oElement.style.display='block';
		else oElement.style.display='none';
	}
	else
	{
		if(oElement.hidden)
			oElement.hidden = !bShow;
		if(oElement.visibility)
			if(bShow)
				oElement.visibility=visible;
			else
				oElement.visibility=hidden;
	}
}
// set hidden/visible vars for Netscape 4 compatibility
if (document.layers)
{
  var hidden = "hide";
  var visible = "show";
}
else
{
  var hidden = "hidden";
  var visible = "visible";
}
var toggle = "toggle";
function changeVisibility()
{
  if (document.layers || document.all)
  {
    var inc, endInc=arguments.length;
    // run through the args (objects) and set the visibility of each
    for (inc=0; inc<endInc; inc+=2)
    {
      // get a good object reference
      var daObj = findElement(arguments[inc]);
      if (arguments[inc+1] == hidden)
      {
        // hide the object
        daObj.visibility = hidden;
      } else if (arguments[inc+1] == visible)
      {
        // show the object
        daObj.visibility = visible;
      } else if (arguments[inc+1] == toggle)
      {
        // toggle the object's visibility
        if (daObj.visibility == visible)
        {
          daObj.visibility = hidden;
        } else if (daObj.visibility == hidden)
        {
          daObj.visibility = visible;
        }
      }
    }
  }
}

function NTX_colorReverse(oElement,bSelect)
{
// compromise for color since style-sheet rules cannot be retrieved by name
	var color;
	var bgcolor;
	if( oElement.style )
	{
		color=oElement.style.color;
		bgcolor= oElement.style.backgroundColor;
	}
	else if( oElement.fgColor )
	{
		color=oElement.fgColor;
		bgcolor=oElement.bgColor;
	}
//	else
//		window.alert("no color support");
	if(bSelect)
	{
		color='#FFFFFF';
		bgcolor='#000000';
	}
	else
	{
		color='#000000';
		bgcolor='#FFFFFF';
	}
//	var	tmp=color;
//	color=bgcolor;
//	bgcolor=tmp;
	// check for schema
	if( oElement.className )
	{
/*	if( oElement.className.indexOf("toolbar") == -1 )
	{
		if( bSelect )
		{
			bgcolor = '#000080';
			color= '#FFFFFF';
		}
		else
		{
			bgcolor= '';
			color= '';
		}
	}
	else
	{
		if( bSelect )
		{
			//oElement.style.backgroundColor = '#C0C0C0';
			bgcolor = '#FFFFFF';
			color= '#000000';
		}
		else
		{
			bgcolor= '';
			color= '';
		}
	}
*/
	}//end if className schema
	if( oElement.style )
	{
		oElement.style.color=color;
		oElement.style.backgroundColor=bgcolor;
	}
	else if( oElement.fgColor )
	{
		oElement.fgColor=color;
		oElement.bgColor=bgcolor;
	}

/*	if( oElement.children.length )
	{
		// reverse all children
		var	i, count=oElement.children.length;
		for(i=0; i < count; ++i)
			NTX_colorReverse(oElement.children[i],bSelect);
	}
*/
}


///////////////////////////////////////////////////////////////////////
// _NTX menuItem, toolBar, menu, menuItem
//
// basic menu object prototype:
//		properties: id, text, value, class, imageClosed,imageOpen
//			element = html element
//		methods: addItem, docWrite, trackItem
function ntxMenuItem(id,text,target, imgClose,imgOpen)
{
	var		_this= new Object;
	_this.id = id;
	_this.text = text;
	_this.className = "menu";
	_this.element = null;
	//_this.targetElement=null;
	_this.parent = null;
	_this.image = null;
	// value is menu array, function, url or 'eval' string
	if( typeof(target) == "undefined" )
		_this.target = null;
	else
		_this.target = target;
	// allow this object to have open/close images
	if( typeof(imgClose) == "string" )
	{
		if( imgClose.length )
			_this.imgClose= NtxAppRoot + imgClose;
		else
			_this.imgClose = NtxAppRoot + "/images/folder-closed.gif";
	}
	else
		_this.imgClose = null;
	if( typeof(imgOpen) == "string" )
	{
		if( imgOpen.length )
			_this.imgOpen= NtxAppRoot + imgOpen;
		else
			_this.imgOpen = NtxAppRoot + "/images/folder-open.gif";
	}
	else
		_this.imgOpen = null;

	// functions
	_this.addItem = ntxMenuItem_addItem;
	_this.docWrite = ntxMenuItem_docWrite;
	_this.trackItem = ntxMenuItem_trackItem;
	_this.onclick = ntxMenuItem_onclick;
	_this.onmouseover = ntxMenuItem_onmouseover;
	_this.onmouseout = ntxMenuItem_onmouseout;
	// append to list
	//NTX.items[_this.id]=_this;
	_this.index=NTX.items.length;
	NTX.items[NTX.items.length]=_this;
	return _this;
}
// add menuItem to submenu (value array)
function ntxMenuItem_addItem(oItem)
{
	if( this.target == null )
		this.target = new Array();
	else if( typeof(this.target) != "object" )
	{
		window.alert("target not a container and already set for "+this.id);
		return false;
	}
	oItem.className = this.className;
	oItem.parent = this;
	this.target[this.target.length] = oItem;
	return true;
}

function ntxMenuItem_docWrite()
{
	var	oElement;
	var	bHasSub = (this.target != null) && (typeof(this.target) == "object") && (this.target.length > 0);
	var	bUseImage=typeof(this.imgClose) == "string";
	var	sText="<SPAN ID='mnu"+ this.id +"' CLASS='"+ this.className +"' STYLE='POSITION:relative;DISPLAY:block'";
//	sText += " ONMOUSEOVER=\"this.menu.trackItem(true)\" ONMOUSEOUT=\"this.menu.trackItem(false)\"";
	//sText+= "' ONCLICK='return _do_onclick("+this.index+")'>";
	// span contents: [img], label
	if( bUseImage )
		sText += "<IMG ID='img"+ this.id +"' CLASS='"+ this.className +"' SRC='"+ this.imgClose +"'>";
	sText= "<A HREF='' ID='lbl"+ this.id +"' NAME='lbl"+ this.id +"' CLASS='"+ this.className
		+"' ONCLICK='_do_onclick("+this.index+"); return false'>";
	sText += "&nbsp;"+ this.text +"&nbsp;";
/*	sText = "<INPUT TYPE='button' ID='btn"+ this.id +"' NAME='btn"+ this.id
		+"' CLASS='"+ this.className +"' VALUE='";
	sText += "&nbsp;"+ this.text +"&nbsp;";
	//sText+= "' ONCLICK='return this._item.onclick()'>";
	sText+= "' ONCLICK='return _do_onclick("+this.index+")'>";
*/
//	if( bHasSub )
//		sText += "&nbsp;&nbsp;&nbsp;"+String.fromCharCode(187);
	sText += "</A>";
	//sText += "</SPAN>";
	document.write(sText);
	// attempt to get document element
	oElement = findElement("btn"+this.id);
//	if(oElement == null )
//	{	window.alert("No Element: "+this.id); return false; }
	// link element to menu object
	if(oElement)
	{
		this.element = oElement;
		oElement._item = this;
	// set element events
//	oElement.onclick = _do_onclick;
	//oElement.onmouseover = ntxMenuItem__onmouseover;
	//oElement.onmouseout = ntxMenuItem__onmouseout;
	}
	// check if target is a submenu
	//if( this.target != null && typeof(this.target) == "object" &&  typeof(this.target.length) == "number")
	if( bHasSub )
	{
		sText = "<DIV ID='sub"+ this.id + "' CLASS='"+ this.className +"' STYLE='DISPLAY:block;position:absolute'"
			+ " ONMOUSEOVER=\"this.menu.trackItem(true)\" ONMOUSEOUT=\"this.menu.trackItem(false)\""
			+ ">";
		document.write(sText);
		var	i, count = this.target.length;
		for(i=0; i < count; ++i)
		{
			this.target[i].docWrite();
		}// end for
		sText = "</DIV>";
		document.write(sText);
		var oSub = findElement("sub"+this.id);
		// set element events
		//oSub.onclick = ntxMenuItem_onclick;
		oSub.menu = this;
		this.child = oSub;
	}
	return oElement;
}

function ntxMenuItem_onmouseover()
{
	this.trackItem(true);
}
function ntxMenuItem_onmouseout()
{
	this.trackItem(false);
}

// call from ONMOUSEOVER (bIn=true), ONMOUSEOUT 
// to hilite and/or display sub-menu
function ntxMenuItem_trackItem(bIn)
{
	var		bHasSub = (this.target != null) && (typeof(this.target) == "object") && (this.target.length > 0);
	var		oTemp;
	NTX_colorReverse(this.element,bIn);
	oTemp = document.getElementById('lbl'+this.id);
	if( oTemp != null )
		NTX_colorReverse(oTemp);
	// check for contained images
	if( typeof(this.imgClose) == "string" )
	{
		var	oImg = document.getElementById("img"+this.id);
		if( bIn )
		{
			if( typeof(this.imgOpen) == "string" )
				oImg.src = this.imgOpen;
		}
		else
			oImg.src = this.imgClose;
	}// end images

	//oTemp=document.getElementById('sub'+this.id);
	//if( bHasSub )
	//if( oTemp != null )
	if( this.child != null )
	{
		if( bIn )
			this.child.style.display = 'block';
		else
			this.child.style.display = 'none';
	}
}

function ntxMenuItem_onclick()
{
	// display menu items
	var		value = this.target;
	var		bIsFunc = false;
	var		i, count;

	if( value == null )
	{
		window.alert("No Menu or value for "+this.id);
		return false;//no bubble
	}// if no target
	else if( typeof(value) == "function" )
	{
		value(this);
	}// end function
	else if( typeof(value) == "object" )
	{
/*		// this should be a sub-menu (another menu)
		if( typeof(value.length) != "number" )
		{
			window.alert("value is non-menu object:"+ value.id);
			return false;
		}
*/
/*		if( this.child != null )
		{
			// show sub-menu (always next sibling)
			var		oSub= this.child;
			if( oSub.style.display == "none" )
			{
				var		x,y;
				x=this.element.offsetLeft;
				y=this.element.offsetHeight;
				oSub.style.pixelLeft=x;
				//oSub.style.pixelTop=y;
				oSub.style.display = "block";
				//oSub.style.position= "absolute";
				oSub.style.position= "relative";
				//oSub.style.offsetLeft = this.offsetParent.clientWidth;
			}
			else
			{
				oSub.style.display = "none";
			}
		}// end if sub menu
*/
	}// end object
	else if( typeof(value) == "string" )
	{
		// function string or URL ?
		//if( value.indexOf("/") == -1 )
		var	pos1=value.indexOf("(");
		var	pos2=value.indexOf(".");
		if( pos1 == -1 )
			document.location = value;
		else if( pos2 != -1 && pos2 < pos1 )
			document.location = value;
		else
			eval(value);
	}// end string
	else
	{
		window.alert("Unknown target type: "+value.toString());
	}

	// no-pass to parent
	return false;
}

// helper functions for menuItem objects
function _do_onclick(id)
{
	//var	oItem=findElement(id);
	var	oItem=NTX.items[id];
	if(oItem==null)
		return true;
	
//	window.alert("do_onclick: "+oItem.id);
	oItem.onclick();
	return false;
}
function _do_onmouseover(id)
{
	var	oItem=findElement(id);
	if(oItem==null)
		return true;
	oItem._item.trackItem(true);
	return false;
}
function _do_onmouseout(id)
{
	var	oItem=findElement(id);
	if(oItem==null)
		return true;
	oItem._item.trackItem(false);
	return false;
}

// toolBar object prototype
function _NTX_toolBar(id,text, imgClose,imgOpen)
{
	var _this = new ntxMenuItem(id,text,null,imgClose,imgOpen);
	_this.className = "toolbar";

	// force target to be a menu
	_this.target= new Array();
	//override
	_this.docWrite= _NTX_toolBar_docWrite;
	return _this;
}

function _NTX_toolBar_docWrite()
{
	var		oMenu;
	var		oElement;
	var		sText, sMenuPrefix="", sMenuSuffix= "";
	var		i, count;
	// add object prefix to id
	//sText= "<DIV ID='frm"+this.id+"' CLASS='"+this.className+"' STYLE='DISPLAY:block;POSITION:relative;WIDTH:600px;HEIGHT:16pt'>";
	//sText="";
	sText="<FORM ID='frm"+ this.id + "' NAME='frm"+ this.id +"' CLASS='"+ this.className +"'>"
	document.write(sText);
	count= this.target.length;
	for(i=0; i < count; ++i)
	{
		oMenu= this.target[i];
		document.write(sMenuPrefix);
		oMenu.docWrite();
		document.write(sMenuSuffix);
	}// end for menu
	document.write("</FORM>");
return;
	// attempt to get document element and link
	//this.element = document.getElementById("tbr"+this.id);
	this.element = findElement("frm"+this.id);
	if(this.element == null )
	{	window.alert("No Form Element: "+this.id); return false; }
	this.element._item = this;
}


// end of menu scripts
/////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////
// form scripts
function formOpen(url,bDialog,width,height)
{
	var	parms="";
	if(typeof(width) != "undefined")
		parms += "width="+width+",";
	if(typeof(height) != "undefined")
		parms += "height="+height+",";
	if(bDialog)
		parms += "directories=0,location=0,menubar=0,resizable=1,scrollbars=1,toolbar=0";
	else
		parms += "directories=1,location=0,menubar=1,resizable=1,scrollbars=1,toolbar=1";
	window.open(url,'',parms);
	return false;
}
function dialogOpen(url,width,height)
{
	var	parms="";
	if(typeof(width) != "undefined")
		parms += "width="+width+",";
	if(typeof(height) != "undefined")
		parms += "height="+height+",";
	parms += "directories=0,location=0,menubar=0,resizable=1,toolbar=0";
	window.open(url,'',parms);
	return false;
}

function windowMaxSize(x,y)
{
	if(x > window.screen.width)
		x=window.screen.width;
	if(y > window.screen.height)
		y=window.screen.height;
	window.resizeTo(x,y);
	return false;
}
function windowMinSize(x,y)
{
	if(x < document.body.style.pixelWidth)
		x=document.body.style.pixelWidth;
	if(y < document.body.style.pixelHeight)
		y=document.body.style.pixelHeight;
	window.resizeTo(x,y);
	return false;
}

function tableDisplayRows(idTable,startRow,nRows,bShow)
{
	var objTable, objRow;
	var i;
	if( typeof(startRow) == 'string' )
		objRow= document.getElementById(startRow);
	else if( typeof(startRow) == 'number' )
	{
		if( typeof(idTable) == 'object' )
			objTable= idTable;
		else if( typeof(idTable) == 'string' )
			objTable= document.getElementById(idTable);
		if( objTable == null )
			return true;
		objRow= objTable.rows[startRow];
	}
	if( objRow == null )
		return true;
	if( typeof(nRows) == 'undefined' )
		nRows= 1;
	if( typeof(bShow) == 'undefined' )
		bShow= true;
	for(i=0; i < nRows; ++i)
	{
		if( bShow )
			objRow.style.display= '';
		else
			objRow.style.display= 'none';
		objRow= objRow.nextSibling;
	}
	return false;
}

// end form scripts
/////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////
// database scripts
function dbObjectDelete(Type,ID,sName,sLabel)
{
	var sMsg="OK to Delete";
	if( typeof(sLabel) == 'string' && sLabel.length )
		sMsg += " "+sLabel;
	if( typeof(sName) == 'string' && sName.length )
		sMsg += " \""+sName+"\"";
	else
	{
		sMsg += " ("+ID.toString()+")";
	}
	sMsg += " ?";
	if( window.confirm(sMsg) == false )
		return;
	var url= NtxAppRoot + "/_NtxLib/DeleteObject.asp?Type="+Type.toString()
		+ "&ID="+ID.toString();
	if( sName.length )
		url += "&Name="+sName;
	document.location= url;
}
// end database scripts
/////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////
// miscellaneous scripts

function getTimeIntStr(n)
{
	if( n < 10 )
		return "0"+n.toString();
	else
		return n.toString();
}

function getTimeStampStr(oDate)
{
	var	sTS;
	sTS = "{TS '"+oDate.getFullYear().toString() +"-"
		+ getTimeIntStr(oDate.getMonth()+1) +"-"+ getTimeIntStr(oDate.getDate())
		+ " " + getTimeIntStr(oDate.getHours()) + ":" + getTimeIntStr(oDate.getMinutes())
		+ ":" + getTimeIntStr(oDate.getSeconds())	+"'}";
	return sTS;
}

function getCookie(sName)
{
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if( sName == unescape(aCrumb[0]) ) 
      return unescape(aCrumb[1]);
  }
  // a cookie with the requested name does not exist
  return null;
}

function NTX_getCrumb(sName)
{
	var		sCookie = getCookie("NTX_INFO");
	if( sCookie != null )
	{
		// components are separated by colon
		var	aInfo = sCookie.split(":");
		var	i;
		for(i=0; i < aInfo.length; ++i)
		{
			// a name/value pair is separated by a comma
			var aValue = aInfo[i].split(",");
			if( sName == unescape(aValue[0]) ) 
			{
				// return value if specified else return empty string
				if( aValue.length > 1 )
					return unescape(aValue[1]);
				else
					return "";
			 }
		}// end for
	}
	return null;
}

function NTX_checkModule(sName)
{
	var		sCookie = NTX_getCrumb(sName);
	if( sCookie != null )
	{
		if( parseInt(sCookie) == 0 ) 
			return false;
		else
			return true;
	}
	// fail safe?
	if( sName == "ACS" || sName == "NTXDB" )
		return true;
	return false;
}

function NTX_checkGroup(nMask)
{
	var	sCookie = NTX_getCrumb("GRP");
	if( sCookie != null )
	{
		if( parseInt(sCookie) & nMask ) 
			return true;
		else
			return false;
	}
	return false;
}

/////////////////////////////////////////////////////////////////////
// NTX miscellaneous scripts
function NTX_showAdminHome()
{
	// check for frames just in case?
	document.location = "/NtxAdmin/default.asp";
}

function NTX_showNewsgroups(Topic)
{
	var		sFeatures="directories=0,location=1,toolbar=1,resizable=1,height=400,width=600";
	var		url="http://www.itrans.com/newsgroups.htm";
	if( typeof(Topic) == "string" )
	{
		url="news://news.itrans.com/NTXV2."+Topic;
	}
	window.open(url,null,sFeatures,false);
	return false;
}

function NTX_showHelp(TopicID)
{
	var		sFeatures="directories=0,location=0,toolbar=1,resizable=1,height=400,width=600";
	var		url= NtxAppRoot + "/Help/NtxAdminHelp.htm";

	// locate at upper-left of current window?
	if( typeof(TopicID) == "string" && TopicID.length )
	{
		// replace spaces w/ underscore
		TopicID = TopicID.replace(" ","_");
		url += "?Topic="+TopicID;
	}
	var	oHelpWin;
	if( typeof(window.oHelpWin) == "object" )
	{
		oHelpWin = window.oHelpWin;
		//window.alert("HelpWin is open");
	}
	else
	{
		oHelpWin= window.open(url,null,sFeatures,false);
		if( typeof(oHelpWin) == "object" )
			window.oHelpWin = oHelpWin;
	}
	if( typeof(oHelpWin) == "object" )
		oHelpWin.focus();
	//window.alert(oHelpWin.location);
	return false;	
}

// called by initial help page to redirect to topic name
// as necessary (return true if redirected)
function NTX_checkHelpContext()
{
	// we assume nominal WebHelp left/right frames
	// treat hash as bookmark to topic name?
	//if( document.location.hash.length > 0 )
	if( document.frames.parent.location.search.length > 0 )
	{
		var	sPath= document.location.pathname;
		var	nPos=sPath.lastIndexOf("/");
		if( nPos != -1 )
			sPath = sPath.substr(0,nPos+1);
		//var	sTopicName= document.frames.parent.location.hash;
		var	sTopicName= document.frames.parent.location.search;
		// replace spaces w/ underscore here?
		if( sTopicName.indexOf("Topic") == -1 )
			return false;
		nPos=sTopicName.indexOf("=");
		if( nPos != -1 )
			sTopicName = sTopicName.substr(nPos+1);
		if( sTopicName.indexOf(".") == -1 )
			sTopicName += ".htm";
		//window.alert("Topic: "+sPath+sTopicName);
		document.location.replace( sPath + sTopicName );
		return true;
	}
	return false;
}
// end miscellaneous scripts
/////////////////////////////////////////////////////////////////////


//</SCRIPT>