

var secLastDocWidth = null;

function Browser() {
	var b=navigator.appName
	if (b=="Netscape") this.b="ns"
	else if (b=="Microsoft Internet Explorer") this.b="ie"
	else this.b=b
	this.version=navigator.appVersion
	this.v=parseInt(this.version)
	this.ns=(this.b=="ns" && this.v>=4)
	this.ns4=(this.b=="ns" && this.v==4)
	this.ns5=(this.b=="ns" && this.v==5)
	this.ie=(this.b=="ie" && this.v>=4)
	this.ie4=(this.version.indexOf('MSIE 4')>0)
	this.ie5=(this.version.indexOf('MSIE 5')>0)
	this.ie55=(this.version.indexOf('MSIE 5.5')>0)
	this.dom=((document.createRange&&(document.createRange().createContextualFragment))?true:false)
	this.min=(this.ns||this.ie)
	var ua=navigator.userAgent.toLowerCase()
	if (ua.indexOf("win")>-1) this.platform="win32"
	else if (ua.indexOf("mac")>-1) this.platform="mac"
	else this.platform = "other"
}
is=new Browser()

if (!is.min) location.replace('tooOld.html');

// -----RESIZE-FIX FÜR LAYER BEI NETSCAPE:-----
if(navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 4) {
	origW = innerWidth;
	origH = innerHeight;

	onresize = reDo;
	var loc = location.href;
}

function reDo() {
  if(innerWidth != origW || innerHeight != origH) location.href = loc
}

lastLayer = "";

function setHeight(param) { parent.document.height = param }

function changeLayer(name) {
   if(navigator.appName == "Netscape"){
     if(document.layers) {
       if(document.layers[name].visibility != "show") {
		 document.layers[name].visibility = "show";
         if (lastLayer != "")
		   document.layers[lastLayer].visibility = "hide";
        }
      }
      else {
       if(document.getElementById(name).style.visibility != "visible") {
         document.getElementById(name).style.visibility = "visible";
         if(lastLayer != "") document.getElementById(lastLayer).style.visibility = "hidden"
       }
      }
   }
   else {
     if(document.all[name].style.visibility != "visible") {
       document.all[name].style.visibility = "visible";
       if(lastLayer != "") document.all[lastLayer].style.visibility = "hidden"
     }
   }
   lastLayer = name;
   
}

function showNavLayer(name1,name2) {
   if(navigator.appName == "Netscape"){
     if(document.layers) {
	   for(i = 1; i <= 6; i++){
	   var nl = 'navLayer'+i;
	   var sl = 'statLayer'+i;
       document.layers[nl].visibility="hide"; 
	   document.layers[sl].visibility="hide";
	   }
	   document.layers[name1].visibility="show";
	   document.layers[name2].visibility="show";
      }
      else {
       if(document.getElementById) {
	   for(i = 1; i <= 6; i++){
	   var nl = 'navLayer'+i;
	   var sl = 'statLayer'+i;
       document.getElementById(nl).style.visibility = "hidden";
	   document.getElementById(sl).style.visibility = "hidden";
	   }
	   document.getElementById(name1).style.visibility="visible";
	   document.getElementById(name2).style.visibility="visible";
      }
      }
   }
   else {
     if(document.all) {
	   for(i = 1; i <= 6; i++){
	   var nl = 'navLayer'+i;
	   var sl = 'statLayer'+i;
       document.all[nl].style.visibility = "hidden";
	   document.all[sl].style.visibility = "hidden";
	   }
	   document.all[name1].style.visibility="visible";
	   document.all[name2].style.visibility="visible";
     }
   }
   
}

function writeNav(id){
  var nl = 'navLayer'+id;
  var sl = 'statLayer'+id;
  var picname = 'norm'+id;
  var newpic = 'roll'+id;
  if(is.ns4){ 
    document.layers[sl].visibility="show"; 
    document.layers[nl].visibility="show";
	eval('document.images["' + picname + '"].src = '+ newpic + '.src');
  }
  else if(is.ie4){ 
    document.all[sl].style.visibility="visible"; 
    document.all[nl].style.visibility="visible";
	document.images[picname].src = eval(newpic + ".src");
  }
  else{
    document.getElementById(sl).style.visibility="visible";
    document.getElementById(nl).style.visibility="visible";
	document.images[picname].src = eval(newpic + ".src");
  }
}

function hideLayer(id){
  if(is.ns4) document.layers[id].visibility="hide"
  else if(is.ie4) document.all[id].style.visibility="hidden"
  else document.getElementById(id).style.visibility="hidden"
  //lastLayer = null;
}

// -----POPUP-FENSTER:-----
function wopen(url,popupname,attributes) {
  win = window.open(url,popupname,attributes);
  win.focus();      
}

// -----DRUCKFUNKTION:-----
function drucken() {
if (is.mac){
alert("Sie arbeiten auf einem Mac. Dieser unterstützt diese Funktion leider nicht.\n\n Benützen Sie darum die Druckfunktion Ihres Browsers.");
}
else{
  var OLECMDID_PRINT= 6;
  var OLECMDEXECOPT_DONTPROMPTUSER= 2;
  var OLECMDEXECOPT_PROMPTUSER= 1;
  var WebBrowser= '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';

  if( parseFloat( navigator.appVersion ) < 4 ){      //parseFloat() schneidet nicht Zahlenzeichen einfach ab!
   alert('Your browser does not support this function. You can either update your browser or press "Ctrl" + "P" to print this page.');  
  }
  else {
    if( navigator.appName.indexOf( "Netscape" )!=-1 ) window.print()
    else {
      window.onerror = stopError
      self.focus();
      document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
      WebBrowser1.ExecWB( OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER );
      WebBrowser1.outerHTML= '';
    }
  }
}
}
function stopError() {return false;}

// -----BILDWECHSEL- UND PRELOAD-FUNKTION:-----
function preload(imgObj,imgSrc) {
  eval(imgObj + ' = new Image()');
  eval(imgObj + '.src = "' + imgSrc + '"');
}
function changeImage(layer,imgName,imgObj) {
  if ((navigator.appName == "Netscape") && layer!=null) eval('document.' + layer + '.document.images["' + imgName + '"].src = '+ imgObj + '.src');
  else document.images[imgName].src = eval(imgObj + ".src");
}

function showSpezImg(layer,imgName,imgObj) {
    if ((navigator.appName == "Netscape")  && layer!=null){
      for(i = 1; i <= 6; i++){
	    var picname = 'norm'+i;
	    var newpic = 'roll'+i;
        eval('document.' + layer + '.document.images["' + picname + '"].src = '+ picname + '.src');
      }
	eval('document.' + layer + '.document.images["' + imgName + '"].src = '+ imgObj + '.src');  
	}
    else
      for(i = 1; i <= 6; i++){
	    var picname = 'norm'+i;
	    var newpic = 'roll'+i; 
        document.images[picname].src = eval(picname + ".src");
      }
	document.images[imgName].src = eval(imgObj + ".src");
}


function showRegImg(layer,imgName,imgObj) {
    if ((navigator.appName == "Netscape")  && layer!=null){
      for(i = 1; i <= 4; i++){
	    var picname = 'regi'+i;
	    var newpic = 'rega'+i;
        eval('document.' + layer + '.document.images["' + picname + '"].src = '+ picname + '.src');
      }
	eval('document.' + layer + '.document.images["' + imgName + '"].src = '+ imgObj + '.src');  
	}
    else
      for(i = 1; i <= 4; i++){
	    var picname = 'regi'+i;
	    var newpic = 'rega'+i; 
        document.images[picname].src = eval(picname + ".src");
      }
	document.images[imgName].src = eval(imgObj + ".src");
}


// ------Seitenwechsel-------
function goTo(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if(restore) selObj.selectedIndex=0;
}

// ------Seitenwechsel Popup to Content
function linkz(x) {
  opener.location.href=x;
  window.close();
}

// ------Seitenwechsel Popup to Content, Popup bleibt offen
function goToUrl(url){
  if(url !="") opener.location.href = url
}


// ------------------- COOKIE-FUNKTIONEN (nur temporär) -------------------

function getCookies(cookie_str) {
  var cookies= new Object();
  var cList, name, value;
  
  cList = cookie_str.split( ";" );  
    for( var i= 0; i<cList.length; i++ ) {
      name= cList[i].substring( 0, cList[i].indexOf( "=" ) );
      value= unescape( cList[i].substring( cList[i].indexOf( "=" )+1 ) );
      cookies[name]= value;
    }
  return cookies;
}

/**
 * Setzt Cookie für diese Seite
 *
 * @param name    Names des Cookies (String)
 * @param value   Wert des Cookies (String)
 * @param exp     Anzahl Millisekunden, die das Cookie halten soll (Number)
 * @param sec     Soll Cookie nur bei SSL-Verbindung übertragen werden [yes|no] (String)
 * @param path    Pfad von wo ab das Cookie lesbar sein soll (String)
 * @param domain  Von welchen Domains das Cookie lesbar sein soll (String)
 *
 * @return Objekt mit den Cookies
 */

function setCookie( name, value, exp, sec, path, domain )  {
  var date= new Date();
  var cookie_str, expires;

  cookie_str= name+"="+escape( value )+";";

  if( exp!=null ) {
    expires= new Date( date.getTime()+exp );
    cookie_str+= "expires="+expires.toGMTString()+";";
  }
  if( sec!=null )    { cookie_str+= "secure="+sec+";"    }
  if( path!=null )   { cookie_str+= "path="+path+";"     }
  if( domain!=null ) { cookie_str+= "domain="+domain+";" }

  document.cookie= cookie_str;
 
  return getCookies(cookie_str);
}

/**
 * Löscht ein Cookie
 *
 * @param name Name des Cookies
 *
 * @return Objekt mit den Cookies
 */
function delCookie( name ) {
  document.cookie= name+"=null; expires=null";
  return getCookies();
}

//------------------ FUNKTION FUER FORMULAR-TEXT-FELDER (Field Size) ------------------
function inputSize(name,maxlength,pwd) {
  if(document.all) {
    if(pwd == "pwd") document.write('<input type="password" name="'+ name +'" size="31" maxlength="'+ maxlength +'">')
    else document.write('<input type="text" name="'+ name +'" size="31" maxlength="'+ maxlength +'">')
  }
  if(navigator.appName == "Netscape") {
    if(pwd == "pwd") document.write('<input type="password" name="'+ name +'" size="17" maxlength="'+ maxlength +'">')
    else document.write('<input type="text" name="'+ name +'" size="17" maxlength="'+ maxlength +'">')
  }
}	
function inputSizeValue(name,maxlength,value) {
 	if(is.ie) {
		if(maxlength == "1") document.write('<input class="input" type="text" name="'+ name +'" size="7" maxlength="'+ maxlength + '" value="' + value + '">')
    	if(maxlength == "2") document.write('<input class="input" type="text" name="'+ name +'" size="7" maxlength="'+ maxlength + '" value="' + value + '">')
    	if(maxlength == "10") document.write('<input class="input" type="text" name="'+ name +'" size="7" maxlength="'+ maxlength + '" value="' + value + '">')
    	if(maxlength == "20") document.write('<input class="input" type="text" name="'+ name +'" size="17" maxlength="'+ maxlength + '" value="' + value + '">')
    	if(maxlength == "30") document.write('<input class="input" type="text" name="'+ name +'" size="31" maxlength="'+ maxlength + '" value="' + value + '">')
	   	if(maxlength == "40") document.write('<input class="input" type="text" name="'+ name +'" size="44" maxlength="'+ maxlength + '" value="' + value + '">')
	   	if(maxlength == "50") document.write('<input class="input" type="text" name="'+ name +'" size="55" maxlength="'+ maxlength + '" value="' + value + '">')
		if(maxlength == "15") document.write('<textarea class="input" name="'+ name +'" cols="15" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "25") document.write('<textarea class="input" name="'+ name +'" cols="25" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "45") document.write('<textarea class="input" name="'+ name +'" cols="35" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "65") document.write('<textarea class="input" name="'+ name +'" cols="46" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "512") document.write('<input class="input" type="text" name="'+ name +'" size="45" maxlength="'+ maxlength + '" value="' + value + '">')
		if(maxlength == "1000") document.write('<input class="input" type="text" name="'+ name +'" size="30" maxlength="'+ maxlength + '" value="' + value + '">')
	}
	if(is.ns4) {
 		if(maxlength == "1") document.write('<input class="input" type="text" name="'+ name +'" size="4" maxlength="'+ maxlength + '"value="' + value + '">')
 		if(maxlength == "2") document.write('<input class="input" type="text" name="'+ name +'" size="4" maxlength="'+ maxlength + '"value="' + value + '">')
 		if(maxlength == "10") document.write('<input class="input" type="text" name="'+ name +'" size="4" maxlength="'+ maxlength + '"value="' + value + '">')
 		if(maxlength == "20") document.write('<input class="input" type="text" name="'+ name +'" size="10" maxlength="'+ maxlength + '"value="' + value + '">')
 		if(maxlength == "30") document.write('<input class="input" type="text" name="'+ name +'" size="17" maxlength="'+ maxlength + '"value="' + value + '">')
 		if(maxlength == "40") document.write('<input class="input" type="text" name="'+ name +'" size="24" maxlength="'+ maxlength + '"value="' + value + '">')
 		if(maxlength == "50") document.write('<input class="input" type="text" name="'+ name +'" size="30" maxlength="'+ maxlength + '"value="' + value + '">')
		if(maxlength == "15") document.write('<textarea class="input" name="'+ name +'" cols="10" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')			
		if(maxlength == "25") document.write('<textarea class="input" name="'+ name +'" cols="18" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "45") document.write('<textarea class="input" name="'+ name +'" cols="25" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "65") document.write('<textarea class="input" name="'+ name +'" cols="33" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "512") document.write('<input class="input" type="text" name="'+ name +'" size="27" maxlength="'+ maxlength + '" value="' + value + '">')
		if(maxlength == "1000") document.write('<input class="input" type="text" name="'+ name +'" size="17" maxlength="'+ maxlength + '" value="' + value + '">')
	}
 	if(is.ns5) {
		if(maxlength == "1") document.write('<input class="input" type="text" name="'+ name +'" size="7" maxlength="'+ maxlength + '" value="' + value + '">')
    	if(maxlength == "2") document.write('<input class="input" type="text" name="'+ name +'" size="7" maxlength="'+ maxlength + '" value="' + value + '">')
    	if(maxlength == "10") document.write('<input class="input" type="text" name="'+ name +'" size="7" maxlength="'+ maxlength + '" value="' + value + '">')
    	if(maxlength == "20") document.write('<input class="input" type="text" name="'+ name +'" size="10" maxlength="'+ maxlength + '" value="' + value + '">')
    	if(maxlength == "30") document.write('<input class="input" type="text" name="'+ name +'" size="15" maxlength="'+ maxlength + '" value="' + value + '">')
	   	if(maxlength == "40") document.write('<input class="input" type="text" name="'+ name +'" size="44" maxlength="'+ maxlength + '" value="' + value + '">')
	   	if(maxlength == "50") document.write('<input class="input" type="text" name="'+ name +'" size="55" maxlength="'+ maxlength + '" value="' + value + '">')
		if(maxlength == "15") document.write('<textarea class="input" name="'+ name +'" cols="15" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "25") document.write('<textarea class="input" name="'+ name +'" cols="25" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "45") document.write('<textarea class="input" name="'+ name +'" cols="30" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "65") document.write('<textarea class="input" name="'+ name +'" cols="46" rows="5" wrap="virtual" maxlength="'+ maxlength + '" value="' + value + '"></textarea>')
		if(maxlength == "512") document.write('<input class="input" type="text" name="'+ name +'" size="45" maxlength="'+ maxlength + '" value="' + value + '">')
		if(maxlength == "1000") document.write('<input class="input" type="text" name="'+ name +'" size="30" maxlength="'+ maxlength + '" value="' + value + '">')
	}
}



//------------------- Oeffne neues Fenster aus PopUp-Link------

function wechsle(url){
	win = window.open(url,"");
	window.close();
} 

