//cookie ::: allgemeine Funktionen
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name) {
  setCookie(name,'','','/');
  window.top.location.reload();
}

//cookie ::: css
var expDate = new Date();
expDate.setTime(expDate.getTime() + 365*24*60*60*1000);

function usecss(name)
{ css = name;
  setCookie('fli4l',css,expDate,'/');
  window.top.location.reload();
}

//css-browser
bVer = parseInt(navigator.appVersion);
bName = navigator.appName;

NN3 = (bName == "Netscape" && bVer < 4);
NN4 = (bName == "Netscape" && bVer == 4);
NN6 = (bName == "Netscape" && bVer >= 5);
IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
IE4 = (bName == "Microsoft Internet Explorer" && bVer == 4);
IE6 = (bName == "Microsoft Internet Explorer" && bVer >= 5);

if (window.name=="druckansicht")
{ document.writeln("<link REL='stylesheet' HREF='../html/css/_print.css' TYPE='text/css'>");
}
else if (!getCookie('fli4l'))
{ document.writeln("<link REL='stylesheet' HREF='../html/css/_default.css' TYPE='text/css'>");
}
else document.writeln("<link REL='stylesheet' HREF='../html/css/" + getCookie('fli4l') + "' TYPE='text/css'>");

// Fixes für IE
if (IE4 || IE6)
{ if (screen.width > 800)
  { document.writeln
    ("<style type='text/css'><!--BODY {width: 98%;}BODY.edge, BODY.jump, BODY.left {width: 100%;}--></style>");
  }
  else
  { document.writeln
    ("<style type='text/css'><!--BODY {width: 96%;}BODY.edge, BODY.jump, BODY.left {width: 100%;}--></style>");
  }
}

// Fixes für NN
else if (NN4)
{ document.writeln
    ("<style type='text/css'><!--BODY.jump TD {line-height: 10px;}--></style>");
}
