/*
** Scripting to support user interface.
*/
var agt=navigator.userAgent.toLowerCase();
var major = parseInt(navigator.appVersion);
var isNav  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));
var isIe   = (agt.indexOf("msie") != -1);
var isMac = (agt.indexOf('mac') != -1);

var supportsDescriptions = false;
if ((isNav && major >= 4) || (isIe && major >= 4)) 
	supportsDescriptions = true;
	
var supportsImageChanges = false;
if ((isNav && major >= 3) || (isIe && major >= 4))
	supportsImageChanges = true;
	
function loaded()
{
	if ((isNav && major >= 3) || (isIe && major >= 4))
		window.focus();
}	
  
var activeImage = null;
var no_img = null

function navOver(linki,no)
{
	if (supportsImageChanges == true)
	{
		navOut();
		activeImage = linki;
		no_img = no;
		eval('document.' + activeImage + no_img + '.src = ' + activeImage + 'On.src');
	}
}
function navOut()
{
	if (supportsImageChanges == true)
	{
		if (activeImage != null)
			eval('document.' + activeImage + no_img + '.src = ' + activeImage + 'Off.src');
		activeImage = null;
		no_img = null;
	}
}

// Popup Notes.
var activeId = null;

function descriptionOff() 
{
	if (supportsDescriptions == true && activeId != null)
	{
		if (isIe)
			document.all[activeId].style.visibility = "hidden";
		else if (isNav)
			document.layers[activeId].visibility = "hidden";
		activeId = null;
	}
}
  
function getXOffset(obj)
{
	if (isNav)  return obj.pageX;
	xOffset = obj.offsetLeft;
	return xOffset;
}

function getYOffset(obj)
{
	if (isNav)  return obj.pageY;
	yOffset = 0;
	yOffset = obj.offsetTop;
	return yOffset;
}

function descriptionOn(id, xOffset, yOffset) 
{
	if (!supportsDescriptions) return;
	if (activeId != null)
		descriptionOff();
	activeId = id;
	
	if (isIe) 
	{
		document.all[id].style.pixelTop = getYOffset(document.all[id + "Marker"]) + 18 + yOffset;
		document.all[id].style.pixelLeft = getXOffset(document.all[id + "Marker"]) + xOffset;
		
		if (document.all[id].style.pixelLeft + document.all[id].offsetWidth >= 640)
			document.all[id].style.pixelLeft = 640 - document.all[id].offsetWidth;
		
		document.all[id].style.visibility = "visible";
	}
	else if (isNav) 
	{
		document.layers[id].pageY = getYOffset(document.layers["" + id + "Marker"]) + 18 + yOffset;
		document.layers[id].pageX = getXOffset(document.layers["" + id + "Marker"]) + xOffset;
		
		if (document.layers[id].pageX + document.layers[id].clip.width >= 640)
			document.layers[id].pageX = 640 - document.layers[id].clip.width;
			
		document.layers[id].visibility = "visible";
	}
}

function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}