// -------------------------------------------------------------------------------------------------------
// load stylesheets
// -------------------------------------------------------------------------------------------------------

var op = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var ie = (navigator.userAgent.indexOf("MSIE") != -1 && !op) ? true : false;
var ns6 = (navigator.userAgent.indexOf("Netscape") != -1) ? true : false;
var sa = (navigator.userAgent.indexOf("Safari") != -1) ? true : false;
var ff = (navigator.userAgent.indexOf("Firefox") != -1) ? true : false;
var ns = (navigator.appName.indexOf("Netscape") != -1 && !ns6 && !sa && !ff) ? true : false;
var mac = (navigator.userAgent.indexOf("Mac") != -1) ? true : false;
var win = (navigator.userAgent.indexOf("Win") != -1) ? true : false;

var host = window.location.hostname;
if(host == 'localhost' || host == '192.168.0.1') var pfad = "/server_gt-powerweb/powerweb/website";
else if(document.location.href.indexOf('/powerweb/') != -1) var pfad = "/powerweb";
else var pfad = "";

function setStylesheet() {
  if(ns && !mac) sheet = '<link rel="stylesheet" href="' + pfad + '/css/netscape.css" type="text/css">';
  else if(ns && mac) sheet = '<link rel="stylesheet" href="' + pfad + '/css/mac_ns.css" type="text/css">';
  else sheet = '<link rel="stylesheet" href="' + pfad + '/css/default.css" type="text/css">';
  return sheet;
}

document.write(setStylesheet());
document.write('<link rel="stylesheet" href="' + pfad + '/css/farben.css" type="text/css">');

// -------------------------------------------------------------------------------------------------------
// global functions
// -------------------------------------------------------------------------------------------------------

var gtpw_main_popup = gtpw_img_popup = 0;

function goTo(src) {
  document.location.href = src;
}

function goToTop(src) {
  top.location.href = src;
}

function newWindow(url, breite, hoehe, left, top, scroll, menu, tool, resizable) {
  if(gtpw_main_popup && !gtpw_main_popup.closed) gtpw_main_popup.close();
  if(!left && !top) {
    left = (screen.width - breite) / 2;
    top = (screen.height - hoehe) / 2;
  }
  gtpw_main_popup = window.open(url, "gtpw_main_popup", "width=" + breite + ",height=" + hoehe +
                        ",left=" + left + ",top=" + top + ",scrollbars=" + scroll +
                        ",menubar=" + menu + ",toolbar=" + tool + ",resizable=" + resizable);
  gtpw_main_popup.focus();
}

function bild(url, breite, hoehe, titel) {
  var left = (screen.width - breite) / 2;
  var top = (screen.height - hoehe) / 2;
  if(gtpw_img_popup && !gtpw_img_popup.closed) gtpw_img_popup.close();
  gtpw_img_popup = window.open("", "img", "width=" + breite + ",height=" + hoehe + ",left=" + left + ",top=" + top);
  gtpw_img_popup.document.writeln('<html><head><title>' + (titel ? titel : 'Image') + '</title></head>');
  gtpw_img_popup.document.writeln('<body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>');
  gtpw_img_popup.document.writeln('<table border=0 cellspacing=0 cellpadding=0 width=100% height=100%><tr><td align=center>');
  gtpw_img_popup.document.writeln('<a href="javascript:self.close()"><img src="' + url + '" border=0></a>');
  gtpw_img_popup.document.writeln('</td></tr></table>');
  gtpw_img_popup.document.writeln('</body></html>');
  gtpw_img_popup.focus();
}

function show(layer, inhalt) {
  if(document.getElementById) {
    document.getElementById(layer).innerHTML = inhalt;
  }
  else if(document.all) {
    if(inhalt) document.all[layer].innerHTML = inhalt;
  }
  else if(document.layers) {
    document.ns.document.layers[layer].document.write(inhalt);
    document.ns.document.layers[layer].document.close();
  }
}

// -------------------------------------------------------------------------------------------------------

