/*
Helgi Vilberg Helgason
Febrúar 2006
*/
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY



function getMouseXY(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
		width=document.body.clientWidth;
		height=document.body.clientHeight;
		tempX = event.clientX + document.body.scrollLeft
		tempY = event.clientY + document.body.scrollTop
	} else {  // grab the x-y pos.s if browser is NS
		width=window.innerWidth;
		height=window.innerHeight;
		tempX = e.pageX
		tempY = e.pageY
	}  
	// catch possible negative values in NS4
	if (tempX < 0){tempX = 0}
	if (tempY < 0){tempY = 0} 
  
	c=Math.round(tempX/width*255)
	d=Math.round(tempY/height*255)

if (false)
{
	document.getElementById('colorbox').style.backgroundColor = "rgb("+(255-c)+","+(d)+","+(c)+")"
}

if (true)
{
	var elem = document.all ? document.all : document.getElementsByTagName('*');
	for (var i = 0; i < elem.length; i++)
	{
		elem[i].style.borderColor = "rgb("+(255-c)+","+(d)+","+(c)+")"
	}
}

if (true)
{
	l=0.02
	e=Math.sin(d*l) * Math.sin(c*l)
	document.body.style.backgroundColor = "rgb(" + 15 + ", " + 15 + ", " + (40 - Math.round(e * 20)) + ")"
}
	return true
}

