function getMouseXY(e){
	var MouseXY = Array();
	var x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	var y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	MouseXY[0] = x;		//pos.left
	MouseXY[1] = y; 	//pos.top;
	return MouseXY;
}

function setWindowSize(e){
	var xy = Array();
	xy = document.onmousedown =  getMouseXY;
	var mouseX = x;		// mouse.pos.left
	var mouseY = y;		// mouse.pos.top
	xy = getWindowInnerSize();
	x = xy[0];			//	window.inner.width
	y = xy[1];			//	window.inner.height
	
	if(mouseX - divwidth < 0){
		//window.alert('weite falsch  < 0');
		xy[0]= mouseX + 15;
	}else if(divwidth + mouseX > x){
		//window.alert('weite falsch > x: ' + x + ': ' + (divwidth + mouseX));
		xy[0] = mouseX - divwidth;
	}else {
		xy[0] = mouseX + 15;
	}
	
	if(mouseY - divheight < 0){
		//window.alert('höhe falsch < 0');
		xy[1]= mouseY;
	}else if(divheight + mouseY > y){
		//window.alert('höhe falsch > y');
		xy[1] = mouseY - divheight;
	}else {
		xy[1] = mouseY - divheight;
	}
	//window.alert(xy[0] + ' x ' + xy[1]);
	return xy;
}



/*
* Diese Funktion ermittelt die aktuelle Fenstergroesse
* gibt xy als array zurueck: [0] => width, [1] => height
*/			
function getWindowInnerSize(){
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	var xy = Array();
	xy[0] = x;
	xy[1] = y;
	xy[0]= parseInt(xy[0]);
	xy[1] = parseInt(xy[1]);
	return xy;
}


function updatehelpTip(e) {

	x = (document.all) ? window.event.x + document.body.scrollLeft: e.pageX ;
	y = (document.all) ? window.event.y + document.body.scrollTop: e.pageY ;
	if (helpTip != null) {
		var xy = Array();
		xy = getWindowInnerSize();
		windowwidth = xy[0];
		windowheight = xy[1];
		//window.alert(x);
		if(x + 80 > windowwidth){ x = x - 90; }
		helpTip.style.left = (x + 15)  + "px";
		helpTip.style.top = y + "px";
	}
}
function showHelp(id) {
	helpTip = document.getElementById(id);
	helpTip.style.display = "block";
}
			
function hideHelp(id) {
	document.getElementById(id).style.display = "none";
}

// position des DIV-emailform in die mitte innerhalb des Fensters ermitteln
var xy = Array();
var divwidth = '100%';
var divheight = '100%';
leftpos = 280;
toppos = 80;

// helptip box left und top aktualisieren
helpTip = null;
document.onmousemove = updatehelpTip;

