//  Popups
// (c) Tobi Schäfer - www.tobischaefer.net - 2007

var temp = 0;
var temp1 = 0;
// Popup zur Maus
function set_div_to_mouse(e)
{
	if ( temp == 0)
	{
		var docX, docY;
		if(e)
		{
			if(typeof(e.pageX) == 'number') { docX = e.pageX; docY = e.pageY;}
			else {docX = e.clientX; docY = e.clientY;}
		}
		else
		{
			e = window.event;
			docX = e.clientX; docY = e.clientY;
			if(document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft))
			{
				docX += document.documentElement.scrollLeft; docY += document.documentElement.scrollTop;
			}
			else if(document.body && (document.body.scrollTop || document.body.scrollLeft))
			{
				docX += document.body.scrollLeft; docY += document.body.scrollTop;
			}
		}
		document.getElementById('popup').style.left = (docX - 150) + "px";
		document.getElementById('popup').style.top    = (docY + 20) + "px";
		temp = 1;
	}
}


// Popup verstecken
function hidepopup1()
{
	temp = 0;
	if(temp1 == 0)
	{
		hidepopup()
	}
}


function hidepopup()
{
	temp = 0;
	document.getElementById('popup').style.display='none';
}


// Popup anzeigen
function showpopup(text)
{
	hidepopup();
	document.getElementById('popup').style.display='block';
	document.getElementById('popuptext').innerHTML = text;
	document.getElementById('BildPopupTitel').innerHTML = 'Quelle:' + '<img src="../Tools/close.gif" align="right" alt="" />';

//	document.onclick = set_div_to_mouse;
	document.getElementById('popup').style.left = "500px";

		if(navigator.appName == 'Microsoft Internet Explorer')
		{
			document.getElementById('popup').style.top = (document.documentElement.scrollTop + 500) + "px";
		}
		else
		{
			document.getElementById('popup').style.top = (window.pageYOffset + 500) + "px";
	}

	setTimeout("hidepopup1()",30000);
	temp1 = 0;
}


function showimageup(text, alt)
{
	hidepopup();
	document.getElementById('popup').style.display='block';
	document.getElementById('popuptext').innerHTML = text;
	document.getElementById('BildPopupTitel').innerHTML = alt + '&nbsp;&nbsp;<img src="../Tools/close.gif" align="right" alt="" />';

	if(navigator.appName == 'Microsoft Internet Explorer')
	{
		document.getElementById('popup').style.top = (document.documentElement.scrollTop + 20) + "px";
	}
	else
	{
		document.getElementById('popup').style.top = (window.pageYOffset + 20) + "px";
	}
	document.getElementById('popup').style.left = "100px";

	temp1 = 1;
}