var symboltab = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8704,0,8707,0,0,
                 8715,0,0,8727,0,0,8722,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                 0,0,0,0,8773,913,914,935,8710,917,934,915,919,921,
                 977,922,923,924,925,927,928,920,929,931,932,933,962,
                 8486,926,936,918,0,8756,0,8869,0,8254,945,946,967,
                 948,949,966,947,951,953,981,954,955,956,957,959,960,
                 952,961,963,964,965,982,969,958,968,950,0,0,0,8764,0,
                 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                 0,0,0,0,0,0,0,978,8242,8804,8725,8734,402,9827,9830,
                 9829,9824,8596,8592,8593,8594,8595,176,177,8243,
                 8805,215,8733,8706,8226,247,8800,8801,8776,8230,0,
                 0,8629,8501,8465,8476,8472,8855,8853,8709,8745,8746,
                 8835,8839,8836,8834,8838,8712,8713,8736,8711,174,169,
                 8482,8719,8730,8901,172,8743,8744,8660,8656,8657,
                 8658,8659,9674,9001,174,169,8482,8721,61670,61671,61672,0,0,0,0,
                 0,0,0,0,9002,8747,8992,0,8993,61686,61687,61688,0,0,0,0,0,0,0];

function convNode(n, Myview){
var n1;
if (n == null) return;
if (n.nodeType == 3) { elem = n.parentNode;
var st = Myview.getComputedStyle(elem, null); var val =
st.getPropertyValue('font-family'); if
(val.toLowerCase() == 'symbol') { var s0 = n.data,
s1 = '', len = s0.length, ch; for (i = 0; i < len;
i++) { ch = s0.charCodeAt(i); if (ch < 256 &&
symboltab[ch] != 0) ch =
symboltab[ch]; s1 += String.fromCharCode(ch);
} n.data = s1; } } n1 = n.firstChild; while (n1 !=
null) { convNode(n1, Myview); n1 = n1.nextSibling; }
}

function getInternetExplorerVersion()
{
    var rV = -1; // Return value assumes failure.

    if (navigator.appName == 'Microsoft Internet Explorer' || navigator.appName == 'Netscape') {
        var uA = navigator.userAgent;
        var rE = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");

        if (rE.exec(uA) != null) {
            rV = parseFloat(RegExp.$1);
        }
        /*check for IE 11*/
        else if (!!navigator.userAgent.match(/Trident.*rv\:11\./)) {
            rV = 11;
        }
    }
    return rV;
}

function local_check_pagestyle() {
    window.addEventListener('message', function(event) {
      if (event.data === '1'){
        location.replace(document.getElementById("go_ba_ck").href)
      } else if (event.data === '2'){
        location.replace(document.getElementById("go_for_ward").href)
      } else if (event.data === '3'){
        location.reload();
      }
    });
    document.forscreen = true;
    if (getInternetExplorerVersion()<0) {convNode(document,document.defaultView)};
    const daten = document.cookie;
    //console.log('MC'+daten);
    if (daten.indexOf('fs=0')>=0){document.forscreen = false};
    if (!document.forscreen) {
       document.getElementsByTagName("body")[0].style.background = 'url("")';
       document.getElementsByTagName("body")[0].style.backgroundColor = '#ffffff'};
    if (document.forscreen){
	    for (var i = 0; i < document.getElementsByTagName("table").length; i++) {
          mytab = document.getElementsByTagName("table")[i];
  	  myname = mytab.className;
  	  if (myname.substr(0,3) == "W__"){
  	     mytab.width = myname.substr(3,myname.length-3)}
  	  else if (myname.substr(0,4) == "WS__"){
  	     mytab.width = myname.substr(4,myname.length-4);
  	     mytab.cellPadding = "20px";
         mytab.style.marginTop = "20px";
         mytab.style.marginBottom = "20px"}
  	  else if (myname.substr(0,4) == "WI__"){
  	     if (myname.length>4){mytab.width = myname.substr(4,myname.length-4)};
            mytab.style.marginTop = "20px";
            mytab.style.marginBottom = "20px"}
  	  else if (myname.substr(0,5) == "WII__"){
  	     if (myname.length>5){mytab.width = myname.substr(5,myname.length-5)};
            mytab.style.marginTop = "40px";
            mytab.style.marginBottom = "40px"}
      }
    }
}

function cs(img){
if (!img.sl){
      img.height = img.height * 2;
      img.width  = img.width  * 2;
      img.title  = 'click to reduce size';
	   img.sl = true;}
else {
      img.height = img.height / 2;
      img.width  = img.width  / 2;
      img.title  = 'click to enlarge size';
	   img.sl = false;}
}

function rot_text(docu, mytext){
docu.writeln('<canvas id="mwCanvas" width="25" height="125"></canvas>');
var c = docu.getElementById("mwCanvas");
var ctx = c.getContext("2d");
ctx.rotate( Math.PI * 1.5 );
ctx.font = "bold 24px Arial";
if (mytext=="Hidden"){
ctx.fillStyle = "#EEEE00"}
else {ctx.fillStyle = "#CC0044"};
ctx.fillText(mytext, -125, 19);
}

document.addEventListener("DOMContentLoaded", local_check_pagestyle);
