var NavigatorName = navigator.appName;
var NavigatorVersion = navigator.appVersion;
var browser_ok = ((NavigatorName != "Microsoft Internet Explorer") || (NavigatorVersion.substring(0,3) != "2.0"));
var images_enabled = document.images ? true : false;

var images = new Array();
var last_id = -1;

init();
function init()
{
	var i, image_url;
	deblinking();
	if (images_enabled && browser_ok)
	{
		for (i=0; i<15; i++)
		{
			image_url = (i==0) ? "/i/x.gif" : "/f/i/kantons/"+i+".gif";
			images[i] = new Image();
			images[i].src = image_url;
		}
	}
}

function mover(img_pic, id)
{
	last_id = id;
	if (images_enabled && browser_ok)
		document.images[img_pic].src = images[id].src;
	var aobj = document.getElementById('a'+id);
	if (aobj)
		aobj.className = "kanton_highlight";
	if (document.all)
		highlight();
}

function mout()
{
	if (last_id != -1)
	{
		var aobj = document.getElementById('a'+last_id);
		if (aobj)
			aobj.className = "";
		last_id = -1;
	}
	if (images_enabled && browser_ok)
		document.images['placeholder'].src = images[0].src;
	if (document.all && images_enabled && browser_ok)
	{
		clearInterval(highlighting);
		document.placeholder.filters.alpha.opacity = 0;
	}
}

function highlightit()
{
	if (images_enabled && browser_ok)
	{
		if (document.placeholder.filters.alpha.opacity < 100)
			document.placeholder.filters.alpha.opacity += 20;
		else
		{
			if (window.highlighting)
				clearInterval(highlighting);
		}
	}
}

function highlight()
{
	if (images_enabled && browser_ok)
		highlighting = setInterval("highlightit()", 30);
}

function deblinking()
{
	var i;
	if (document.all)
	{
		for (i in document.links)
			document.links[i].onfocus = document.links[i].blur;
		for (i=0; i<document.all.length; i++)
		{
			if (document.all(i).tagName.toLowerCase() == "input")
			{
				if ((document.all(i).type.toLowerCase() == "radio") || (document.all(i).type.toLowerCase() == "checkbox") || (document.all(i).type.toLowerCase() == "button") || (document.all(i).type.toLowerCase() == "submit") || (document.all(i).type.toLowerCase() == "reset") || (document.all(i).type.toLowerCase() == "image"))
					document.all(i).onfocus = document.all(i).blur;
			}
		}
	}
}