/* ------------------------------------------------------
 * Letzte Änderung: 2006-02-13, Thomas Heinecke
 * 
 * Funktion: disableBackButton - NEW 
 * Funktion: disableSubmitButton - MODIFIED Ids geändert
 ------------------------------------------------------ */


function openWindow(url, titel, breite, hoehe, naviEtc)
{
	param = naviEtc ? "toolbar=yes,location=yes,status=yes,menubar=yes"
	                : "toolbar=no,location=no,status=no,menubar=no";

	window.open(url, titel, "width=" + breite + ",height=" + hoehe + ",scrollbars=yes,resizable=yes,copyhistory=no,personalbar=no," + param).focus();
}

//-----------------------------------------------------------------------------

/**
 * laesst eine SSL-Info-Seite aufpoppen (es sei denn, es handelt sich bei dem
 * Browser erkennbar um einen IE einer Version hoeher als 5.1) und
 * oeffnet ggf. die im optionalen Parameter targetURL enthaltene Adresse
 */
function checkSSL(targetURL) {

  //-------------------- Konfiguration --------------------

  /* mindestens vorausgesetzte IE-Version */
  var VERSION_REQUIRED = 5.1;

  /* Adresse der SSL-Hinweis-Seite */
  var INFO_URL         = "http://www.dak.de/content/dakhome/ssl_info.html";

  /* Breite des Popups fuer die SSL-Hinweis-Seite */
  var INFO_WIDTH       = 450;

  /* Hoehe des Popups fuer die SSL-Hinweis-Seite */
  var INFO_HEIGHT      = 600;

  //-------------------------------------------------------

  var sslOK = false;

  if(navigator.appVersion) {

    var ie = navigator.appVersion.indexOf('MSIE');


    if(ie != -1) {

      ieVersion = navigator.appVersion.substring(ie);
      var endOfIEVersion = ieVersion.indexOf(';');

      if(endOfIEVersion != -1) {

        ieVersion = ieVersion.substr(0, endOfIEVersion);
        ieVersion = ieVersion.charAt(4) == ' '
                    ? ieVersion.substring(5)
                    : ieVersion.substring(4);
        ieVersionNumber = parseFloat(ieVersion);

        if(ieVersionNumber != 0 && ieVersionNumber != NaN)
          sslOK = ieVersionNumber > VERSION_REQUIRED;
      }
    }
  }

  if(targetURL)
    window.location.href = targetURL;

 if(!sslOK)
    openWindow(INFO_URL, 'SSLHinweis', INFO_WIDTH, INFO_HEIGHT, false);

}

//-----------------------------------------------------------------------------

// Ersetzt oldS durch newS im neuen String fullS

function replaceString(oldS,newS,fullS)
{
	var i;
	for(i = 0; i < fullS.length; i++) {
		if (fullS.substring(i, i + oldS.length) == oldS) {
			fullS = fullS.substring(0, i) + newS + fullS.substring(i + oldS.length, fullS.length);
		}
	}
	return fullS;
}

//-----------------------------------------------------------------------------

function replaceEm(s)
{
	var tempS = s;
	tempS = replaceString (' ', '', tempS);
	tempS = replaceString (String.fromCharCode(228), 'ae', tempS);
	tempS = replaceString (String.fromCharCode(246), 'oe', tempS);
	tempS = replaceString (String.fromCharCode(252), 'ue', tempS);
	tempS = replaceString (String.fromCharCode(196), 'Ae', tempS);
	tempS = replaceString (String.fromCharCode(213), 'Oe', tempS);
	tempS = replaceString (String.fromCharCode(220), 'Ue', tempS);
	tempS = replaceString (String.fromCharCode(223), 'ss', tempS);
	return tempS;
}

//-----------------------------------------------------------------------------

/**
 * by Peter Belesis. v4.0.13 010712
 * Copyright (c) 2001 Peter Belesis. All Rights Reserved.
 */

HM_DOM = (document.getElementById) ? true : false;
HM_NS4 = (document.layers) ? true : false;
HM_IE = (document.all) ? true : false;
HM_IE4 = HM_IE && !HM_DOM;
HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
HM_IE4M = HM_IE4 && HM_Mac;
HM_IsMenu = (HM_DOM || HM_NS4 || (HM_IE4 && !HM_IE4M));
HM_BrowserString = HM_NS4 ? "NS4" : HM_DOM ? "DOM" : "IE4";
HM_BrowserSpecific = HM_NS4 ? "/content/repository/HM_ScriptNS4.js" :
                     HM_DOM ? "/content/repository/HM_ScriptDOM.js" :
                              "/content/repository/HM_ScriptIE4.js";

if(window.event + "" == "undefined")
	event = null;

function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

// the following function is included to illustrate the improved JS
// expression handling of the left_position and top_position parameters
// you may delete if you have no use for it

function HM_f_CenterMenu(topmenuid)
{
	var MinimumPixelLeft = 0;
	var TheMenu = HM_DOM ? document.getElementById(topmenuid) : HM_IE4 ? document.all(topmenuid) : eval("window." + topmenuid);
	var TheMenuWidth = HM_DOM ? parseInt(TheMenu.style.width) : HM_IE4 ? TheMenu.style.pixelWidth : TheMenu.clip.width;
	var TheWindowWidth = HM_IE ? document.body.clientWidth : window.innerWidth;
	return Math.max(parseInt((TheWindowWidth - TheMenuWidth) / 2), MinimumPixelLeft);
}

//-----------------------------------------------------------------------------

// reloads the window if Nav4 resized

function MM_reloadPage(init)
{
	if(init == true) {
		if((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) {
			document.MM_pgW = innerWidth;
			document.MM_pgH = innerHeight;
			onresize = MM_reloadPage;
		}
	}
	else
		if(innerWidth != document.MM_pgW || innerHeight != document.MM_pgH)
			location.reload();
}

MM_reloadPage(true);

//-----------------------------------------------------------------------------

/**
 * Letzte Änderung: 2006-02-13, Thomas Heinecke
 * Deaktivieren den Submit- oder Back-Buttom eines Formulars,
 * damit das Formular nur einmal abgeschickt oder nur einmal auf 
 * den Zurück-Button gedrückt wird.
 * Funktioniert fuer einige aeltere Browser nicht.
 */

function disableSubmitButton() {
	if(document.getElementById && document.getElementById("submitButtonId")) {
		document.getElementById("submitButtonId").style.display = "none";
		document.getElementById("submitWaitButtonId").style.display = "inline";
	}
	else {
		if (document.all && document.all.submitButtonId) {
		document.all.submitButtonId.style.display = "none";
		document.all.submitWaitButtonId.style.display = "inline";
	}
	}
}


function disableBackButton() {
	if(document.getElementById && document.getElementById("backButtonId")) {
		document.getElementById("backButtonId").style.display = "none";
		document.getElementById("backWaitButtonId").style.display = "inline";
	}
	else {
		if (document.all && document.all.backButtonId) {
		document.all.backButtonId.style.display = "none";
		document.all.backWaitButtonId.style.display = "inline";
	}
	}
}




//-----------------------------------------------------------------------------

/**
 * Fragt text ab und leitet nur auf target weiter, wenn etwas eingegeben wird.
 */

function abfrage(text, target) {
    var eingabe = prompt(text, '');
    if(eingabe)
        window.location.href = target;
}


//-----------------------------------------------------------------------------

/**
 * Oefnnet ein neues Fenster fuer die Hansemerkur - Features
 */

function popup_merkur(url)
  
{
    
	windowName = window.open(url, "OnlineAbschluss", "height=590,width=740,resizable=yes,toolbar=no,scrollbars=yes,menubar=no,status=yes");
    	windowName.focus();
  
}


/*

Orginalscript von einfach-fuer-alle.de thx

*/

var fontgr = 10;

var containers = [	
				  
			["rahmen",1,0],
			["button",1,0],
			
		]


var cookiename = "zielvereinbarung";

function stero() {
	ladeEinstellungen();
	setzeFontGr(fontgr);
}

function modFontGr(neu) {
	fontgr= fontgr + neu;
	if (fontgr>15)	fontgr=15;
	if (fontgr<5)	fontgr=5;
	setzeFontGr(fontgr);
}

function setzeFontStandard(neu) {

	var curr,obj,tagArray,name,isId,size,num;
	var limit = containers.length;
	fontgr = 10;

	for (var i = 0; i < limit; i++) {

		curr = containers[i];
		name = curr[0];
		isId = curr[1];
		size = (neu);
		
		if (isId) {
			obj = document.getElementById(name);
			if (obj && (typeof obj == "object")) obj.style.fontSize = (size * .1) + "em";
		} else {
			tagArray = document.getElementsByTagName(name);
			num = tagArray.length;
			for (var n = 0; n < num; n++) {
				obj = tagArray.item(n);
				if (obj && (typeof obj == "object")) obj.style.fontSize = (size * .1) + "em";
			}
		}
	}

	fontgr=size;
	sichereEinstellungen();
}


function setzeFontGr(neu) {

	var curr,obj,tagArray,name,isId,size,num;
	var limit = containers.length;

	for (var i = 0; i < limit; i++) {

		curr = containers[i];
		name = curr[0];
		isId = curr[1];
		size = (neu);
		
		if (isId) {
			obj = document.getElementById(name);
			if (obj && (typeof obj == "object")) obj.style.fontSize = (size * .1) + "em";
		} else {
			tagArray = document.getElementsByTagName(name);
			num = tagArray.length;
			for (var n = 0; n < num; n++) {
				obj = tagArray.item(n);
				if (obj && (typeof obj == "object")) obj.style.fontSize = (size * .1) + "em";
			}
		}
	}

	fontgr=size;
	sichereEinstellungen();
}

function ladeEinstellungen() {

	var cookiearray = new getCookieArray(cookiename);
	if (cookiearray[1]){fontgr = parseInt(cookiearray[1]);}

}

function sichereEinstellungen() {
	var cookiearray = new setCookieArray(cookiename, fontgr);
}

// cookies

function getCookie(name){
	var doccok=document.cookie; 
	var coknam=name+"=";
	var coklen=doccok.length;
	var cokbeg=0;
		while(cokbeg<coklen){
		var valbeg=cokbeg+coknam.length;
		if (doccok.substring(cokbeg,valbeg)==coknam) { 
			var valend=doccok.indexOf(";",valbeg);
			if(valend==-1)valend=coklen;
			return unescape(doccok.substring(valbeg, valend));
		}
		cokbeg = doccok.indexOf(" ", cokbeg) + 1;
		if (cokbeg == 0) break;
	}
	return null;
}

function setCookie (name, value, expires) {
	if (!expires) expires = new Date();
	expires.setTime (expires.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
	document.cookie = name + "=" + escape (value) + "; expires=" + expires.toGMTString() +  "; path=/";
}

function setCookieArray(name){
	this.length = setCookieArray.arguments.length - 1;
	for (var i = 0; i < this.length; i++) {
		this[i + 1] = setCookieArray.arguments[i + 1]
		setCookie (name + i, this[i + 1]);
	}
}

function getCookieArray(name){
	var i=0;
	while (getCookie(name + i) != null) {
		this[i + 1] = getCookie(name + i);
		i++; this.length = i; 
	}
}

function boostfont(sens){
var taille=parseInt(document.getElementsByTagName('body')[0].style.fontSize);
if (sens==1){
taille++;
}
else {taille--;}
taille+='px';
document.getElementsByTagName('body')[0].style.fontSize = taille;
}