function doRemoteRequest(url)
{
	var xmlHttp = null;
	// Mozilla, Opera, Safari sowie Internet Explorer 7
	if (typeof XMLHttpRequest != 'undefined') {
	    xmlHttp = new XMLHttpRequest();
	}
	if (!xmlHttp) {
	    // Internet Explorer 6 und älter
	    try {
	        xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch(e) {
	        try {
	            xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
	        } catch(e) {
	            xmlHttp  = null;
	        }
	    }
	}
	if (xmlHttp) {
	    xmlHttp.open('GET', url, true);
	    xmlHttp.send(null);
	}
}

function selectColor(color)
{
  changed = false;
  if(color == 'green')
  {
    document.body.style.backgroundColor = '#358E2A';
    changed = true;
  }

  if(color == 'blue')
  {
    document.body.style.backgroundColor = '#2a718e';
    changed = true;
  }

  if(color == 'yellow')
  {
    document.body.style.backgroundColor = '#cFa010';
    changed = true;
  }

  if(color == 'red')
  {
    document.body.style.backgroundColor = '#c73f18';
    changed = true;
  }

  if(color == 'dark')
  {
    document.body.style.backgroundColor = '#444444';
    changed = true;
  }
  if(changed)
  {  
    doRemoteRequest("/wp-content/themes/rutscherlebnis.de/colorselector_ajax.php?color=" + color);
  }
  return false;
}


