
function createRequest ()
{
  var xmlHttp = false;
  // 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  = false;
      }
    }
  }
  return xmlHttp;
}

function postcss (message, sessionID)
{
  var client = createRequest ();
  client.open ("GET", "/all/changecss.jsp;jsessionid=" 
	       + sessionID + "?" + message);
  client.send ("");
}

function changecss (css, sessionID)
{
  if (document.styleSheets) {
    var sheets = document.styleSheets;
    var csslink = document.getElementById ("css-link1");
    var aA1 = document.getElementById ("aA1");
    var aA2 = document.getElementById ("aA2");
    if (css == "1") {
      csslink.href = "/css/fontsize.css";
      aA1.style.display = 'block';
      aA2.style.display = 'none';
    } else { 
      csslink.href = "/css/fontsize_big.css";
      aA1.style.display = 'none';
      aA2.style.display = 'block';
    }
    postcss ("newcss=" + css, sessionID);
  }
}
