// ------------
// Mausposition
// ------------
cpMousepos = function(name){
	var bodyelement=document.getElementsByTagName('body')[0];
	bodyelement.style.padding='0px';
	bodyelement.style.margin='0px';
	bodyelement.style.height='100%';
	bodyelement.style.width='100%';
	// public
	this.XPosition=0;
	this.YPosition=0;
	this.name=name;
	// private
	this.cp_ns6=document.getElementById&&!document.all;
	var self=this;
	if (document.addEventListener) {document.addEventListener("mousemove", function(e) { self.getpos(e); }, true); }
	else { document.body.onmousemove = function(e) { self.getpos(e); }; }

	this.getMouseXPos=function(Ereignis) { // X Position der Maus auslesen
	  if (document.layers||this.cp_ns6) {
	    return parseInt(Ereignis.pageX)
	  } else if (document.documentElement && document.documentElement.scrollLeft){
	    return parseInt(event.clientX) + parseInt(document.documentElement.scrollLeft);
	  } else {
		return (parseInt(event.clientX) + parseInt(document.body.scrollLeft))
	  }
	}

	this.getMouseYPos=function(Ereignis) { // Y Position der Maus auslesen
	  if (document.layers||this.cp_ns6) {
	    return parseInt(Ereignis.pageY)
	  } else if (document.documentElement && document.documentElement.scrollTop){
	    return parseInt(event.clientY) + parseInt(document.documentElement.scrollTop);
	  } else if (document.body){
	    return (parseInt(event.clientY) + parseInt(document.body.scrollTop))
	  }
	}

	this.getpos=function(Ereignis){
		this.XPosition=this.getMouseYPos(Ereignis);
		this.YPosition=this.getMouseXPos(Ereignis);
	}
}
