var mpath = '/img/m/m';
var ppath = '/pict/rubric/';

function preload()
{
	for(i = 0; i < m.length; i++)
	{
		var t = new Image;
		t.src = mpath + m[i]  + 's.gif';
	}
}

var s = 0;

function on(n)
{
	if (s == n) { return; }

	if (s) 
	{
		document.getElementById('m' + s).src = mpath + s + '.gif';
	}
	document.getElementById('m' + n).src = mpath + n + 's.gif';
	s = n;
}

function off()
{
	if (s)
	{
		document.getElementById('m' + s).src = mpath + s + '.gif';
		s = 0;
	}
}

function onlight(n,m)
{
	if (s == n) { return; }

	if (s) 
	{
		document.getElementById('m' + s).src = ppath + n;
	}
	document.getElementById('m' + n).src = ppath + m;
	s = n;
}

function offlight()
{
	if (s)
	{
		document.getElementById('m' + s).src = ppath + s;
		s = 0;
	}
}

function get_top(o)
{
	var t = 0;
	while (1)
	{
		t += o.offsetTop;
		o = o.offsetParent;
		if (!o) { break; }
	}
	return t;
}
function get_left(o)
{
	var l = 0;
	while (1)
	{
		l += o.offsetLeft;
		o = o.offsetParent;
		if (!o) { break; }
	}
	return l;
}

function align_right()
{
	for(i = 1; i <= 2; i++)
	{
		var o = document.getElementById('no' + i);
		var l = get_left(o);
		var w = o.offsetWidth;

		var s = document.getElementById('mo' + i).style;
		s.left = l + w - 13;
		s.visibility = 'visible';
	}
}

var e;
function pi(img, w, h)
{
	e = window.open('', 'pic', 'scrollbars=no,width=' + w + ',height=' + h);
	if (window.focus) { e.focus(); }

	e.document.open();
	e.document.write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
	e.document.write('<img src=' + img + ' width=' + w + ' height=' + h + '><br>');
	e.document.close();
}

function ph(html, w, h)
{
	e = window.open(html, 'pic', 'scrollbars=no,width=' + w + ',height=' + h);
	if (window.focus) { e.focus(); }
}

