var dorthin = null;
var width = 0;
var height = 0;
function OpenWindow(imagesource,width,height) {
	if (window.screen) {
		var hori = screen.availWidth;
		var verti = screen.availHeight;
		dorthin = window.open("image.php?source=" + imagesource,'popup','width='+ width +',height='+ height +',left='+((hori - width- 10)* .5) +',top='+((verti - height- 30)* .5)+',scrollbars=1')
		dorthin.focus()
	}
}

function OpenGalerie(folder,width,height,number) {
	if (window.screen) {
		var hori = screen.availWidth;
		var verti = screen.availHeight;
		dorthin = window.open("galerie.php?folder=" + folder + "&number=" + number,'popup','width='+ width +',height='+ height +',left='+((hori - width- 10)* .5) +',top='+((verti - height- 30)* .5)+',scrollbars=0')
		dorthin.focus()
	}
}

var Initialisierung = 0
var Ex, Ey, TitelFarbe, TextFarbe, ContentInfo;

TitelFarbe = "blue"
TextFarbe = "white"


function ToolTipBewegen(layerName, FromTop, FromLeft, e)
{
	document.getElementById(layerName).style.top = FromTop;
	document.getElementById(layerName).style.left = FromLeft + 15;
}

function Aktivieren()
{
	Initialisierung=1;
}

function Deaktivieren()
{
	Initialisierung=0;
}

function Starten(e)
{
	if(Initialisierung)
	{
		Ex = document.all ? window.event.x : e.pageX;
		Ey = document.all ? window.event.y : e.pageY;
		ToolTipBewegen("ToolTip", Ey, Ex, e);
		document.getElementById('ToolTip').style.visibility = "visible";
	}
	else
	{
		ToolTipBewegen("ToolTip", 0, 0);
		document.getElementById('ToolTip').style.visibility = "hidden";
	}
}

function ToolTip(layerName, TTitel, TInhalt)
{
	ContentInfo = '<table border="0" width="150" cellspacing="0" cellpadding="0">'+'<tr><td width="100%" bgcolor="#000000">'+'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+'<tr><td width="100%" bgcolor='+TitelFarbe+'>'+'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+'<tr><td width="100%">'+'<font class="ToolTipTitel"> '+TTitel+'</font>'+'</td></tr>'+'</table>'+'</td></tr>'+'<tr><td width="100%" bgcolor='+TextFarbe+'>'+'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+'<tr><td width="100%">'+'<font class="ToolTipInhalt">'+TInhalt+'</font>'+'</td></tr>'+'</table>'+'</td></tr>'+'</table>'+'</td></tr>'+'</table>';
	document.getElementById(layerName).innerHTML = ContentInfo;
}
