var thread_id = '';
function showOrHideThread(id)
{
	if (thread_id && thread_id != id)
	{
		obj = document.getElementById(thread_id);
		if (obj)
		{
			obj.className = 'hiddenThread';
		}
	}

	thread_id = id;
	obj = document.getElementById(id);

	if (obj)
	{
		if (obj.className == 'hiddenThread')
		{
			obj.className = 'visibleThread';
		}
		else
			obj.className = 'hiddenThread';
	}
}

/* NETDOC MENU */
function Showndmenu2()
{
	obj = document.getElementById('ndmenu2');
	if (obj)
	{
		obj.className = "over";
//		obj.style.display = 'block';
	}


	return false;
}

function Hidendmenu2()
{
	obj = document.getElementById('ndmenu2');
	if (obj)
	{
		obj.className="";
//		obj.style.display = 'none';
	}

	return false;
}

function NDMenuMOv()
{
	obj = document.getElementById('ndmenu');
	if (obj)
	{
		obj.style.backgroundColor = '#CCD';
	}
}

function NDMenuMOu()
{
	obj = document.getElementById('ndmenu');
	if (obj)
	{
		obj.style.backgroundColor = 'transparent';
	}
}

function OpenHelp(parameter, location)
{
	if (!location)
	{
		location = '';
	}

	if (!parameter)
	{
		parameter = '';
	}

	x = window.open(location+'starthelp.php?'+parameter+'&js=1','','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1, resizable=1,width=700,height=700');

	return !x;
}

function Quickhelp(grp, doc, id, e, location)
{	
	var goext = 0;

	if (!e) var e = window.event;
	if (!e) goext = 1;

	if (!document.getElementById) 
	{
		goext = 1;
	}
	else
	{
		obj = document.getElementById('qh_'+id);
		if (!obj) { goext = 1; }
	}

	if (goext)
	{
		x = window.open(location+'help.php?grp='+grp+'&doc='+doc+'&op=showt&id='+id,'','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1, resizable=1,width=700,height=700');
		return false;
	}

	var x,y;
	var xmax,ymax;

	if (e.pageX || e.pageY)
	{
		x = e.pageX;
		y = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		x = e.clientX;
		y = e.clientY;
	}

	// Frame size
	if (self.innerHeight) // all except Explorer
	{
		xmax = self.innerWidth;
		ymax = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		xmax = document.documentElement.clientWidth;
		ymax = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		xmax = document.body.clientWidth;
		ymax = document.body.clientHeight;
	}

	// Scrolling offset
	var scrollx,scrolly;
	if (self.pageYOffset) // all except Explorer
	{
		scrollx = self.pageXOffset;
		scrolly = self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
		// Explorer 6 Strict
	{
		scrollx = document.documentElement.scrollLeft;
		scrolly = document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		scrollx = document.body.scrollLeft;
		scrolly = document.body.scrollTop;
	}

	x = x + scrollx - 20;
	y = y + scrolly - 150;

	if (x + 430 > xmax)
	{
		x = xmax - 430;
	}

	if (obj)
	{
		obj.style.display = 'block';
		obj.style.top = y+'px';
		obj.style.left = x+'px';
		return false;
	}
}

function HideQuickhelp(id, e)
{
	if (!e) var e = window.event;
	if (!e) goext = 1;

	obj = document.getElementById('qh_'+id);
	if (obj)
	{
		obj.style.display = 'none';
		obj.style.top = '100px';
		obj.style.left = '100px';
		return false;
	}
}

NDRot13 = {
    map: null,

    convert: function(a) {
        NDRot13.init();

        var s = "";
        for (i=0; i < a.length; i++) {
            var b = a.charAt(i);
            s += ((b>='A' && b<='Z') || (b>='a' && b<='z') ? NDRot13.map[b] : b);
        }
        return s;
    },

    init: function() {
        if (NDRot13.map != null)
            return;
              
        var map = new Array();
        var s   = "abcdefghijklmnopqrstuvwxyz";

        for (i=0; i<s.length; i++)
            map[s.charAt(i)] = s.charAt((i+13)%26);
        for (i=0; i<s.length; i++)
            map[s.charAt(i).toUpperCase()] = s.charAt((i+13)%26).toUpperCase();

        NDRot13.map = map;
    },

    write: function(a) {
        document.write(NDRot13.convert(a));
    }
}

function ShowThumbnail(parameter, location)
{
	x = window.open(location+parameter,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0, resizable=1,width=500,height=500');

	return !x;
}
