ddTo = -1;
hlTo = -1;
imgHl = new Object();
oldHl = new Object();

function Init()
{
	ie = (navigator.userAgent.toLowerCase().indexOf("msie") != -1);
	areaInfo = GetElem('a_Info');
	areaHl = GetElem('HighlightArea');
	imgHl = GetElem('HighlightImg');
	dds = GetElem('DropDown').style;
};

function GetElem(id)
{
	return document.getElementById(id);
};

function GetWidth()
{
	return Math.max(document.body.scrollWidth, 776);
};

function GetCentre()
{
	return Math.floor(GetWidth() / 2);
};

function NewWindow(name, ttl)
{
	var win = open('images/sert' + name + '.png', 'Sert', 'width=410,height=580,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0');
	var db = win.document.body;
	db.leftMargin = 0;
	db.rightMargin = 0;
	db.topMargin = 0;
	db.bottomMargin = 0;
	win.document.title = ttl;
	win.focus();
};

function ShowDD()
{
	dds = GetElem('DropDown').style;

	if (dds.visibility == 'visible') {
		areaInfo = GetElem('a_Info');
		ShowHl(areaInfo);
		clearTimeout(ddTo);
		clearTimeout(hlTo);}
	else {
		var sc = GetCentre();
		dds.left = Math.min(sc + 287, GetWidth() - 123);
		dds.top = '153';
		dds.visibility = 'visible';
	};
};

function ShowDD1()
{
	dds = GetElem('DropDown').style;

	if (dds.visibility == 'visible') {
		areaInfo = GetElem('a_Info');
		ShowHl(areaInfo);
		clearTimeout(ddTo);
		clearTimeout(hlTo);}
	else {
		var sc = GetCentre();
		dds.left = Math.min(sc + 287, GetWidth() - 123);
		dds.top = '171';
		dds.visibility = 'visible';
	};
};

function HideDD()
{
	dds = GetElem('DropDown').style;

if (dds.visibility != 'visible') return;
	
	ddTo = setTimeout('HideDDAbs(); if (oldHl == areaInfo) HideHl();', 100);
};

function HideDDAbs()
{
	clearTimeout(ddTo);

	dds = GetElem('DropDown').style;
	dds.visibility = 'hidden';
	dds.left = "0px";
};

function ShowHl(obj)
{
	clearTimeout(hlTo);

	if (obj == oldHl || imgHl == null) return;
	
	oldHl = obj;
	imgHl = GetElem('HighlightImg');
	imgHl.style.visibility = 'hidden';
	imgHl.src = 'images/' + obj.id + '.gif';
	areaHl = GetElem('HighlightArea');
	areaHl.alt = obj.alt;
	areaHl.href = obj.href;
	var sc = GetCentre();
	imgHl.style.left = sc - 388 + Number(obj.coords.split(',')[0] - 1);
	imgHl.style.top = '131';
	imgHl.style.visibility = 'visible';

	if (obj.id == 'a_Info') {ShowDD()} else {HideDDAbs()}
};

function ShowHl1(obj)
{
	clearTimeout(hlTo);

	if (obj == oldHl || imgHl == null) return;
	
	oldHl = obj;
	imgHl = GetElem('HighlightImg');
	imgHl.style.visibility = 'hidden';
	imgHl.src = 'images/' + obj.id + '.gif';
	areaHl = GetElem('HighlightArea');
	areaHl.alt = obj.alt;
	areaHl.href = obj.href;
	var sc = GetCentre();
	imgHl.style.left = sc - 388 + Number(obj.coords.split(',')[0] - 1);
	imgHl.style.top = '149';
	imgHl.style.visibility = 'visible';

	if (obj.id == 'a_Info') {ShowDD1()} else {HideDDAbs()}
};

function HideHl()
{
	imgHl = GetElem('HighlightImg');
	imgHl.style.visibility = 'hidden';
	oldHl = new Object();
};

function OverHl()
{
	if (oldHl.id == 'a_Info') ShowDD();
};

function OutHl()
{
	hlTo = setTimeout('HideHl();', 100);
	if (oldHl.id == 'a_Info') HideDD();
};

