var wpColors = new Array("B00000","EB7500","C7BD00","7DF8FA","2C9294","2C6294","7A7800","C7C300","686BB0","751A72","ABABAB","F74F1B","EBDF00","9E4F00","3D3D3D");

var changeColor = true;
var nbrWP = 6;

function changeWPold() {
	if (changeColor) {
		var currentColor = document.body.style.backgroundColor;
		var newColor = currentColor;
		while (newColor.toUpperCase() == currentColor.toUpperCase()) {
			 newColor = "#" + wpColors[Math.floor(Math.random() * wpColors.length)]; 
		}
		document.body.style.backgroundColor = newColor;
	} else {
		var currentWP = document.body.style.backgroundImage;
		var newWP = currentWP;
		while (newWP.toUpperCase() == currentWP.toUpperCase()) {
			 newWP = "url(images/WP_" + (Math.floor(Math.random() * nbrWP) +1) + ".png)"; 
		}
		document.body.style.backgroundImage = newWP;
	}
	changeColor = ! changeColor;
}


function changeWP() {
	ColorR = 80 + Math.floor(Math.random() * 120);
	ColorG = 80 + Math.floor(Math.random() * 120);
	ColorB = 80 + Math.floor(Math.random() * 120);
	newColor = "rgb(" + ColorR + ", " + ColorG + ", " + ColorB + ")";
	document.body.style.backgroundColor = newColor;
	var currentWP = document.body.style.backgroundImage;
	var newWP = currentWP;
	while (newWP.toUpperCase() == currentWP.toUpperCase()) {
		 newWP = "url(images/WP_" + (Math.floor(Math.random() * nbrWP) +1) + ".png)"; 
	document.body.style.backgroundImage = newWP;
	}
}


