
xInclude('x/x_core.js', 'x/x_event.js');

function ranOnResize() {
	var a = Math.round( (xClientWidth()-xWidth('sacrifice'))/2 );
	var b = Math.round( (xClientHeight()-xHeight('sacrifice'))/2 );
	xMoveTo('sacrifice',a,b);
}

var random_hex_digits = "0123456789abcdef";

function ranColor() {
	var color = '#';
	for(i=0; i<6; ++i)
		color += random_hex_digits.charAt(Math.floor(Math.random()*16));
	return color;
}


function ranGoCrazy() {
	xColor('sacrifice', ranColor());
	xBackground('body', ranColor());
	setTimeout(ranGoCrazy,50);
}


window.onload = function() {
	ranOnResize();
	ranGoCrazy();
	xAddEventListener(window,'resize',ranOnResize,false);
	
	return;
};



