function karte_ausgrauen(name, uid, aid, format)
{
	if(format == 'svg' || format == 'png')
	{
		width = 768;
		height = 512;
		link = 'http://travmap.shishnet.org';

		if(uid > 0) suche = '&player=id:'+uid;
		else suche = '&alliance=id:'+aid;

		url = 'http://travmap.shishnet.org/map.php?lang=de&server='+server_url+suche+'&lines=on&groupby=player&casen=on&caption='+name+'&dotsize=0.3&azoom=on&layout=spread&format='+format;

		if(format == 'svg') html = '<object data=\''+url+'\' type=\'image/svg+xml\' height=\'512\' width=\'768\'></object>';
		if(format == 'png') html = '<img width=\'768px\' height=\'512px\' src=\''+url+'\' alt=\'map image\'>';
	}
	else
	{
		width = 800;
		height = 800;
		link = 'http://travian-projekt.de';

		url = 'http://travian-projekt.de/travian/karte/minimap.php?server='+server_id+'&aid='+aid+'&uid='+uid+'&breite=800';
		html = '<img width=\'800px\' height=\'800px\' src=\''+url+'png\' alt=\'map image\'>';
	}

	show_karte_ausgrauen(width, height, url, html, link);
}

function show_karte_ausgrauen(x, y, url, html, link)
{
	ausgrauenStart();
	scroll(0,0);

	ausgrauenKarte = document.getElementById('ausgrauenKarte');
	if(ausgrauenKarte == null)
	{
		resolution = findResolution();
		ausgrauenKarte = document.createElement('div');
		ausgrauenKarte.setAttribute('id', 'ausgrauenKarte');
		ausgrauenKarte.setAttribute('class', 'loading');
		ausgrauenKarte.style.position = 'absolute';
		left = Math.floor(resolution[0]/2)-Math.floor(x/2);
		top = Math.floor(resolution[1]/2)-Math.floor(y/2);
		if(left < 16) left = 16;
		if(top < 16) top = 16;
		ausgrauenKarte.style.left = left;
		ausgrauenKarte.style.top = top;
		ausgrauenKarte.style.zIndex = 100;
		document.getElementsByTagName('body')[0].appendChild(ausgrauenKarte);
	}
	ausgrauenKarte.innerHTML = html;

	ausgrauenClose = document.getElementById('ausgrauenClose');
	if(ausgrauenClose == null)
	{
		position = findPos(ausgrauenKarte);
		ausgrauenClose = document.createElement('img');
		ausgrauenClose.setAttribute('id', 'ausgrauenClose');
		ausgrauenClose.setAttribute('src', '/travian/img/close.gif');
		ausgrauenClose.setAttribute('alt', 'close');
		ausgrauenClose.setAttribute('title', 'Close');
		ausgrauenClose.onclick = close_karte_ausgrauen;
		ausgrauenClose.style.position = 'absolute';
		ausgrauenClose.style.left = position[0]+x;
		ausgrauenClose.style.top = position[1]-16;
		ausgrauenClose.style.zIndex = 100;
		document.getElementsByTagName('body')[0].appendChild(ausgrauenClose);
	}

	ausgrauenLink = document.getElementById('ausgrauenLink');
	if(ausgrauenLink == null)
	{
		position = findPos(ausgrauenKarte);
		ausgrauenLink = document.createElement('a');
		ausgrauenLink.setAttribute('id', 'ausgrauenLink');
		ausgrauenLink.setAttribute('href', link);
		ausgrauenLink.setAttribute('target', '_blank');
		ausgrauenLink.innerHTML = 'powered by '+link;
		ausgrauenLink.style.position = 'absolute';
		ausgrauenLink.style.left = position[0]+Math.floor(x/2)-140;
		ausgrauenLink.style.top = position[1]-16;
		ausgrauenLink.style.zIndex = 100;
		document.getElementsByTagName('body')[0].appendChild(ausgrauenLink);
	}

	ausgrauenURL = document.getElementById('ausgrauenURL');
	if(ausgrauenURL == null)
	{
		position = findPos(ausgrauenKarte);
		ausgrauenURL = document.createElement('input');
		ausgrauenURL.setAttribute('id', 'ausgrauenURL');
		ausgrauenURL.setAttribute('type', 'text');
		ausgrauenURL.setAttribute('size', '100');
		ausgrauenURL.setAttribute('value', url);
		ausgrauenURL.style.position = 'absolute';
		ausgrauenURL.style.left = position[0]+Math.floor(x/2)-310;
		ausgrauenURL.style.top = position[1]+y;
		ausgrauenURL.style.zIndex = 100;
		document.getElementsByTagName('body')[0].appendChild(ausgrauenURL);
	}
}

function close_karte_ausgrauen()
{
	ausgrauenEnde();

	ausgrauenKarte = document.getElementById('ausgrauenKarte');
	if(ausgrauenKarte != null) ausgrauenKarte.parentNode.removeChild(ausgrauenKarte);

	ausgrauenClose = document.getElementById('ausgrauenClose');
	if(ausgrauenClose != null) ausgrauenClose.parentNode.removeChild(ausgrauenClose);

	ausgrauenLink = document.getElementById('ausgrauenLink');
	if(ausgrauenLink != null) ausgrauenLink.parentNode.removeChild(ausgrauenLink);

	ausgrauenURL = document.getElementById('ausgrauenURL');
	if(ausgrauenURL != null) ausgrauenURL.parentNode.removeChild(ausgrauenURL);
}