function rotateImage(objId, imgId, rotation)
  {
    var xmlHttp;
    try
    {
      // Firefox, Opera 8.0+, Safari
      xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {
      // Internet Explorer
      try
      {
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch (e)
      {
        try
        {
          xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e)
        {
          alert("Je browser heeft geen ondersteuning voor AJAX!");
          return false;
        }
      }
    }
    var url="/ajax/index.php";
    url=url+"?vars="+objId+"/rotate_image/"+imgId+"/"+rotation
	 xmlHttp.onreadystatechange=stateChanged 
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)  
    function stateChanged() 
    { 
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
    {
      response = xmlHttp.responseText;
		if (response == "ok")
      {
			var thumbId = "thumbnail-"+imgId;
			var date = new Date();
			var thumbSrc = "/photobook/thumbs/"+imgId+".jpg?t="+date.getTime();
			document.getElementById(thumbId).src = thumbSrc;
      }

		else if (response == "err no rights")
		{
			alert('Je hebt onvoldoende rechten voor deze actie.');
		}

      else
      {
			alert('Onbekende fout. \n\nFoutmelding: '+response);
      }
    }
  }
}
