var posX, posY;
document.onmousemove = function(e) {
   try {
   	if (!e) var e = window.event;
    if (e.pageX || e.pageY) {
		posX = e.pageX;
		posY = e.pageY;
	}
	else if (e.clientX || e.clientY) {
		posX = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft);
		posY = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop);
	}
  } catch (er) {}
}

function ShowElement(id){
  document.getElementById(id).style.display = "block";
}

function PosToMouseElement(id) {
  	x =  (posX) ? posX : 0;
	y = ((posY) ? posY : 0);
    PosElement(id, x, y);
}

function HideElement(id){
   document.getElementById(id).style.display = "none";
}

function WriteToElement(id,inhalt){
  document.getElementById(id).firstChild.nodeValue=inhalt;
}

function PosElement(id, x, y) {
	if(id && x) {
		document.getElementById(id).style.left = x + 'px';;
	}
	if(id && y) {
		document.getElementById(id).style.top = y + 'px';;
	}
}

function IframeIflayer(name, loc)
{
  if(asl = document.getElementById(name))
  {
	asl.style.display = (asl.style.display == 'block') ? 'none' : 'block';
	asl.style.overflow = 'hidden';
  }
  if(asli = document.getElementById( name + '-inner' ))
  {
	if(asl.style.display == 'block')
	{
		asli.src = loc;
		y = 10 + (document.documentElement.scrollTop || document.body.scrollTop);
  		if(y > 10) {
  			PosElement(name, false, y);
  		}
	}
  }
}

/**
* Ajax functions, requires Prototype
*/
function reportError(e) {}
function Helpbox(module, key) 
{ 
  var url = '/micro/help_' + module + '/' + key; 
  var params = ''; 
  ShowElement('helpbox');
  PosToMouseElement('helpbox');
  new Ajax.Updater( {success: 'helpbox'}, url, { method: 'get', parameters: params }); 
  /*new Draggable('helpbox', {} );*/
}

