/* ------------------------------------------------------
 * 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();  
}

//-----------------------------------------------------------------------------

/**
 * Ist eine Funktion, die für jedes Formular implementiert werden muss
 * Die leere Funktion muss hier implementiert werden, da Sie bei jedem Submit-Button aufgerufen wird.
 */

function additionalActions()
{
}

