
_uacct = "UA-109830-1";
function MF_CallTracker()
{
var url = arguments[0];
var segmentName = (arguments.length > 1 ? arguments[1] : "");

	//alert("URL is: " + url + "\n\nSegment is: " + segmentName);

	urchinTracker(url);

	if (segmentName != "")
	{
		//alert("Segment is: " + segmentName);
		//__utmSetVar(segmentName);
	}
}

function linkTo(url, lang, w, h)
{
var props = "";

	if (arguments.length == 3)
	{
		document.location.href = url;
	}
	else
	{
		if (arguments.length > 2)
		{
			props = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1";
			props += ",width=" + w + ",height=" + h;
			props += ",left=" + (screen.width - w) / 2;
			props += ",top=" + (screen.height - h) / 2;
		}

		openPopup(url, "MFLink", props, lang);
	}
}

function openPopup(wUrl, wName, wProps, lang)
{
	var hWnd = window.open(wUrl, wName, wProps);
	if (hWnd) hWnd.focus();
	else alert((lang == "E") ? "This function requires you to allow popup windows for this site." : "Denne funksjonen trenger at du tillate 'Popup Windows' for dette webstedet.")
}

function openMap(lang) 
{
var url = "Map/kart.htm";
var props = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,top=0,left=0,width=";
	props += screen.width / 2 + ",height="  + screen.height / 2;
	openPopup(url, "MFMap", props, lang);
}

function refreshParent()
{
	if (window.opener && !window.opener.closed)
	{
		window.opener.refreshMe();
	}
}

function openWin(url)
{
	openWindow(url, '', 0, 0);
}

function openWindow(url, winName, winWidth, winHeight)
{
	if (url == '') alert('Not implemented yet');
	else
	{
		var windObj;
		var windOpts;

		if (winWidth == 0)
		{
			windHeight = screen.availHeight - 30;
			windWidth = screen.availWidth - 10;
			windLeft = 0;
			windTop = 0;		
		}
		else
		{
			windHeight = winHeight;
			windWidth = winWidth;
			windLeft = (screen.width - windWidth) / 2;
			windTop = (screen.height - windHeight) / 2;
		}

		windOpts = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0';
		windOpts = windOpts + ',width=' + windWidth + ',height=' + windHeight;
		windOpts = windOpts + ',top=' + windTop + ',left=' + windLeft;					
		
		windObj = window.open(url, '', windOpts);
		windObj.focus();
	}
}

function startDemoRef(mNum, langID, lang)
{
var windOpts, url;

	MF_CallTracker("/enable/Demo_Reference/Demo");

	url = 'enable.asp?mNum='+mNum+'&goto=MMENU&logon=guest&pass=guest&langID='+langID;
	windOpts = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0';
	openEnableWin(url, 'enable', windOpts);
}

function startDemoCourse(mNum, langID, lang)
{
var url, windOpts;

	MF_CallTracker("/enable/Demo_Course/Demo");

	url = 'enable.asp?mNum='+mNum+'&logon=guest&pass=guest&langID='+langID;
	windOpts = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0';
	openEnableWin(url, 'enableCourse', windOpts);
}

function openEnableWin(url, wName, windOpts, lang)
{
	url = 'http://litago.mediafarm.no/enable/program/' + url;
	openPopup(url, wName, windOpts, lang);
}

function setIm(Im, imNum)
{
var elObj;
	elObj = document.getElementById(Im);
	if (elObj) elObj.src = ImList[imNum].src;
}

function setVis(ID, vis)
{
var elObj;
	elObj = document.getElementById(ID);
	if (elObj) elObj.style.visibility = ((vis) ? "visible" : "hidden");
}

function bOver(bNum)
{
	setIm(('BIcon' + bNum), bNum + 1);
}

function bOut(bNum)
{
	setIm(('BIcon' + bNum), bNum);
}
