function load()
{
	var el = document.getElementById('returnlinks');
	if (location == top.location)
	{
		el.style.display = "block";
	}
	else
	{
		el.style.display = "none";
	}
}

// do not use location.pathname!!  on FP preview IE returns pathname with backslashes, like
// /D:\Web%20Tests\Test1Door\Test1Site\glossary.htm
function frm(pane)
{
	var l = location, dot, slash, base, par, bkm, idx, str, fn;
	if (l == top.location)
	{
     	dot = l.href.indexOf('.');
     	slash = l.href.indexOf('/', dot + 1);
     	base = l.href.substring(0, slash);
     	par = l.href.lastIndexOf('?');
     	bkm = l.href.lastIndexOf('#');
     	if (par == -1 && bkm == -1)
     		idx = -1;
     	else if (par == -1 && bkm != -1)
     		idx = bkm;
     	else if (par != -1 && bkm == -1)
     		idx = par;
     	else if (par != -1 && bkm != -1)
     		idx = Math.min(par, bkm);
     	// a topic cannot be the default web document (index.html is not a topic), hence the rule for obtaining fn.
     	if (idx == -1)
     		fn = l.href.slice(slash);
     	else
     		fn = l.href.substring(slash, idx);
		str = '/ksw/frameset.htm' + l.search + l.hash;
		if (bkm == -1) str += '#';
		location.href = base + str + '+' + pane + '.htm+..' + fn;	// frame addr called in /ksw/frameset.htm
	}
}

