if (document.getElementById) {
    document.write('<style type="text/css"> div.dialog_second_form div.fields.cbDisabled { display:none; } </style>');
    document.write('<style type="text/css" media="screen, projection"> div#print p.drucken { display:block; } </style>');
    document.write('<style type="text/css" media="print"> div#print p.drucken { display:none; } </style>');
}
var floatMenu;
floatMenu = function()
{
  if (document.all && document.getElementById) {
    navRoot = document.getElementById("nav");

    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[ i ];

      if(node.nodeName=="LI") {
        node.onmouseover=function() { this.className += " over"; }
        node.onmouseout=function() { this.className = this.className.replace( " over", "" ); }
      }
    }
  }
}
document.getElementsByClassName = function(className, tagName)
{
 var elementsByClassName = [];
 if (this.getElementsByTagName)
 {
  var elements = (tagName) ? this.getElementsByTagName(tagName) : this.all || this.getElementsByTagName('*');
  var nrOfElements = elements.length;
  for (var i = 0; i < nrOfElements; i++)
  {
   var element = elements[i];
   var elementClassName = element.className;
   var elementHasClassName = false;
   if (className == elementClassName)
   {
    elementHasClassName = true;
   }
   else if (elementClassName.indexOf(' ') != -1)
   {
    var elementClassNames = elementClassName.split(' ');
    var nrOfClassNames = elementClassNames.length;
    for (var k = 0; k < nrOfClassNames; k++)
    {
     if (className == elementClassNames[k])
     {
      elementHasClassName = true;
      break;
     }
    }
   }
   if (elementHasClassName)
   {
    elementsByClassName.push(element);
   }
  }
 }
 return elementsByClassName;
};
if (!Array.prototype.push)
{
 Array.prototype.push = function()
 {
  for (var i = 0, ii = arguments.length; i < ii; i++)
  {
   this[this.length] = arguments[i];
  }
  return this.length;
 };
}
var EventBroadcaster = new Object();
EventBroadcaster.init = function(obj)
{
 obj._listeners = new Array();
 obj.broadcastMessage = this._broadcastMessage;
 obj.addListener = this._addListener;
 return obj;
};
EventBroadcaster._broadcastMessage = function(method)
{
 var listeners = this._listeners;
 var i = listeners.length;
 while (i--)
 {
  var listener = listeners[i];
  if (listener[method])
  {
   listener[method]();
  }
 }
};
EventBroadcaster._addListener = function(obj)
{
 this._listeners.push(obj);
 return true;
};
window.onload = function()
{
 this.broadcastMessage('onload');
};
EventBroadcaster.init(window);

var PopupInit = new Object();
window.addListener(PopupInit);
var global_width=440;
var global_height=320;
var helpcenter_width=800;
var helpcenter_height=600;
PopupInit.onload = function() {
  if (document.getElementById) {
    var allLinks=document.getElementsByTagName('a');
    for (var i=0; i<allLinks.length; i++) {
      if(allLinks[i].target=='dkvpopup') {
        var popuplink = new PopupLink(allLinks[i], global_width, global_height);
      }
      if(allLinks[i].target=='helpcenter') {
        var popuplink = new PopupLink(allLinks[i], helpcenter_width, helpcenter_height);
      }
    }
  }
};
var PopupLink = function(item, this_width, this_height) {
  this._link = item;
  this._target = item.target;
  this._href = item.href;
  this._width = this_width;
  this._height = this_height;
  this._link._obj = this;
  this._link.onclick = this._open;
};
PopupLink.prototype._open = function() {
  var fenster = window.open(this._obj._href, this._obj._target, 'width='+this._obj._width+',height='+this._obj._height+',location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');
  fenster.focus();
  return false;
};


var SearchForm = new Object();
window.addListener(SearchForm);
SearchForm.onload = function() {
 if (document.getElementById) {
  var item;
  var suche = document.getElementById('suchen');
  // Bugfixing: In IE the document.getElementById('suchen'); command finds also an elemenet with name "suchen"
  if ( suche && (suche.id=="suchen") ) {
    item = new handleDKVform(suche,'Suchbegriff');
  }
  // Bugfixing: In IE the document.getElementById('plz'); command finds also an elemenet with name "plz"
  var dkv_in_ihrer_naehe = document.getElementById('plz');
  if ( dkv_in_ihrer_naehe && (dkv_in_ihrer_naehe.id=="plz") ) {
   item = new handleDKVform(dkv_in_ihrer_naehe,'PLZ');
  }
 }
};

var handleDKVform = function(item,defaultWert) {
  this._suchfeld = item;
  this._form = this._suchfeld.form;
  this._form._open = this._open;
  this._form._suchfeld = this._suchfeld;
  this._suchfeld._defaultWert = defaultWert;
  this._suchfeld.value = defaultWert;
  this._suchfeld.onfocus = this._focus;
  this._suchfeld.onblur = this._blur;
  this._form.onsubmit = this._check;
};
handleDKVform.prototype._focus = function() {
    if(this.value==this._defaultWert) this.value='';
};
handleDKVform.prototype._blur = function() {
    if(this.value=='') this.value=this._defaultWert;
//    if(this.className=="error")this.className = "";
};
handleDKVform.prototype._check = function() {
/*
    if((this._suchfeld.value=='')||(this._suchfeld.value==this._suchfeld._defaultWert)) {
        this._suchfeld.className = "error";
        this._suchfeld.focus();
        return false;
    }
*/
    if (this.target=='helpcenter') this._open(); //window.open('', 'helpcenter', 'width='+helpcenter_width+',height='+helpcenter_height+',location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');
    return true;
};
handleDKVform.prototype._open = function() {
  var fenster = window.open('', 'helpcenter', 'width='+helpcenter_width+',height='+helpcenter_height+',location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');
  fenster.focus();
  return false;
};

// Seite weiterempfehlen & Merkzettel
function neufenster(adresse,name,breite,hoehe) {
    fenster = null;
    window_left = (screen.width-breite)/2;
    window_top = (screen.height-hoehe)/2;
    fenster=window.open(adresse,name,"width="+breite+",height="+hoehe+",top="+window_top+",left="+window_left+",scrollbars=yes,resizable=yes");
    fenster.focus();
}

//Additional functions for BSK and DIIN

var PopUpFenster = new Array();
function openWin(URL, width, height, name, status, scroll){
    floater=null;
    if(!width) width=336;
    if(!height) height=224;
    if(!name) name="DKV";
    if(!status) status="yes";
    if(!scroll) scroll="yes";
    if (document.layers || document.all) {
        if (floater && !floater.closed){
            floater.focus();
        } else {
            if(document.layers){
                window.open(URL, name, 'WIDTH='+width+',HEIGHT='+height+',SCROLLBARS='+scroll+',TOOLBAR=0,LOCATION=0,DIRECTORIES=0,STATUS='+status+',RESIZABLE=0');
            } else {
                window.open(URL, name, 'WIDTH='+width+',HEIGHT='+height+',TOOLBAR=no,LOCATION=no,DIRECTORIES=no,STATUS='+status+',RESIZABLE=0,SCROLLBARS='+scroll+'');
            }
        }
    } else {
        window.open(URL, name, 'WIDTH='+width+',HEIGHT='+height+',TOOLBAR=no,LOCATION=no,DIRECTORIES=no,STATUS='+status+',RESIZABLE=0,SCROLLBARS='+scroll+'');
    }
}

function NeuesFenster(ID){
   for(i=0;i<PopUpFenster.length;i++){
       if(PopUpFenster[i][0]==ID) pop = openWin(PopUpFenster[i][1],PopUpFenster[i][2],PopUpFenster[i][3],PopUpFenster[i][3]);
   }
}

var tmpCounter = 0;
PopUpFenster[tmpCounter++] = new Array('1235','../versicherungsuebersicht/932.html',0,0);
PopUpFenster[tmpCounter++] = new Array('1248','../versicherungsuebersicht/932.html',0,0);
PopUpFenster[tmpCounter++] = new Array('1249','../versicherungsuebersicht/931.html',0,0);
PopUpFenster[tmpCounter++] = new Array('1251','../versicherungsuebersicht/941.html',0,0);
PopUpFenster[tmpCounter++] = new Array('1252','../versicherungsuebersicht/942.html',0,0);
PopUpFenster[tmpCounter++] = new Array('6807','../versicherungsuebersicht/gesundheitsreform_beispiel_azs.html',380,460);
PopUpFenster[tmpCounter++] = new Array('1576','../versicherungsuebersicht/855.html',0,0);

function change_lang(language) {
     if (language == 'en') {
        location.href='index.php?variante=-3';
    } else {
        location.href='index.php?variante=';
    }
}

function popup_drucken(adresse,name) {
    breite = 610;
    hoehe = 500;
    window_left = (screen.width-breite)/2;
    window_top = (screen.height-hoehe)/2;
    druckPopup=window.open(adresse,name,"width="+breite+",height="+hoehe+",top="+window_top+",left="+window_left+",location=0,directories=0,status=0,toolbar=1,menubar=1,resizable=yes,scrollbars=yes");
    druckPopup.focus();
}







/*
 *
 * AJAX functionality to get the "Beitrag" via the "XML-Schnittstelle" to display in on the product page
 *
 */

 /*
 * The class for an jax request
 */
function createAJAXRequest() {
    // Declare and initialize properties

    // Target URL for the ajax request
    this.url = "";

    // Parameters to be used (as key/value pairs, without the leading question mark)
    this.params = "";

    // The standard method to be used
    this.method = "GET";

    // The standard request timeout (milliseconds)
    this.timeout = 10000;

    // A flag  to indicate, whether a request has been stoped or not
    this.abortRequest = false;

    // A standard function to be used, if a timeout occured during the ajax request
    this.onTimeout    = function () {
        msg  = "The ajax request wasn't successfull within the specified timeout sequence.\n\n";
        msg += "Note: This message comes from the prototype standard onTimeout function.\n";
        msg += "Please define your own onTimeout function to handle timeouts.";
        alert(msg);
    };

    // A standard function to be used to handle the results, if the ajax request was successfull
    this.onSuccess = function (txt, xml) {
        msg = "";
        msg += (txt) ? txt : "";
        msg += (xml) ? xml : "";
        document.getElementById("rechner_anzeige").innerHTML = msg;
    }

    // A standard function to be used, if an error occured during the ajax request
    this.onError = function (errorMsg) {
        msg  = "The following error occured during the ajax request:\n" + errorMsg + "\n\n";
        msg += "Note: This message comes from the prototype standard onError function.\n";
        msg += "Please define your own onError function to handle errors.";
        alert(msg)
    };

    return false;
}

/*
 * The actual method to do a request
 */
createAJAXRequest.prototype.doRequest = function() {
    // Check the URL
    if (!this.url) {
        this.onError("Es wurde kein URL angegeben. Der Request wird abgebrochen. / No URL specified. The request will be aborted.");
        return false;
    }

    // Check the method
    this.method = !this.method ? "GET" : this.method.toUpperCase();

    // Set the flag for abortion to false
    this.abortRequest = false;

    // Enable access to the class methods for the functions readyStateHandler and timeoutHandler
    var _this = this;

   // Create a XMLHttpRequest object
    var xmlHttpRequest = getXMLHttpRequest();
    if (!xmlHttpRequest) {
        this.onError("Es konnte kein XMLHttpRequest-Objekt erstellt werden. / Error during creating a XMLHttpRequest object.");
        return false;
    }

    // Distinction of cases for the method
    switch (this.method) {
        case "GET":
            xmlHttpRequest.open(this.method, this.url + "?" + this.params, true);
            xmlHttpRequest.onreadystatechange = readyStateHandler;
            xmlHttpRequest.send(null);
            if (this.timeout) {
                if (xmlHttpRequest.timeout) {
                    xmlHttpRequest.timeout = window.setTimeout(timeoutHandler, this.timeout);
                }
            }
            break;
        case "POST":
            xmlHttpRequest.open(this.method, this.url, true);
            xmlHttpRequest.onreadystatechange = readyStateHandler;
            xmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            xmlHttpRequest.send(this.params);
            if (this.timeout) {
                if (xmlHttpRequest.timeout) {
                    xmlHttpRequest.timeout = window.setTimeout(timeoutHandler, this.timeout);
                }
            }
            break;
    }

    // Method to handle the response data
    function readyStateHandler() {
        // Check, if the request is finished
        if (xmlHttpRequest.readyState < 4) {
            return false;
        }
        // Check, if the request should be stopped
        if (xmlHttpRequest.abortRequest) {
            xmlHttpRequest.abort();
        } else {
            // If the server status was 200 (OK), clear the timeouts and call the onSuccess function
            if (xmlHttpRequest.status == 200) {
                if (xmlHttpRequest.timeout) {
                    window.clearTimeout(xmlHttpRequest.timeout);
                }
                _this.onSuccess(xmlHttpRequest.responseText, xmlHttpRequest.responseXML);
            // If the server status was not OK, clear the timeouts and call the onError function
            } else {
                if (xmlHttpRequest.timeout) {
                    window.clearTimeout(xmlHttpRequest.timeout);

                }
                var errMsg = "Status: " + xmlHttpRequest.status + "\nBeschreibung: " + xmlHttpRequest.statusText;
                _this.onError(errMsg);
            }
        }
    }

    // Method to handle the timeout error
    function timeoutHandler() {
        // Set the flag for abortion to true and stop the request
        xmlHttpRequest.abortRequest = true;
        xmlHttpRequest.abort();
        // Call the onTimeout function
        _this.onTimeout();
    }
}

// Returns a browser independant XMLHttpRequest object
function getXMLHttpRequest() {
    var xmlHttp = null;
    // Mozilla, Opera, Safari sowie Internet Explorer 7
    if (typeof XMLHttpRequest != 'undefined') {
        xmlHttp = new XMLHttpRequest();
    }
    if (!xmlHttp) {
        // Internet Explorer 6 und älter
        try {
            xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e) {
            try {
                xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
            } catch(e) {
                xmlHttp  = null;
            }
        }
    }
    return xmlHttp;
    //return false;
}
// Create a new ajax request
var myAjax = new createAJAXRequest();

// The error function
var errorFunc = function(errMsg) {
    msg = "Es ist ein Fehler aufgetreten:\n\n";
    msg += errMsg  +"\n\n";
    alert(msg);
}
// The success function
var success = function (txt, xml) {
    msg = (txt) ? txt : xml;
    var result = msg.split("|");
    var geschlecht = result[0];
    var alter = result[1];
    var tarifKuerzel = result[2];
    var beitrag = result[3];
    var tarifBezeichnung = result[4];
    var berufsgruppe = result[5];
    var versicherungswunsch = result[6];
    var tagegeldhoehe = result[7];
    if (beitrag == -1) {
        msg = "Fehler";
        document.getElementById("rechner_anzeige").innerHTML = msg;
        document.getElementById("rechner_anzeige_text").innerHTML = "<strong>Bei der Berechnung ist ein Fehler aufgetreten<strong>";
    } else {

        var beitragsTextVollversicherungArbeitnehmer = "";
        var beitragsTextVollversicherungAndere = "";
        var beitragsTextAndere = "";
        if ( (tarifBezeichnung.indexOf("BM4")>0) || (tarifBezeichnung.indexOf("BM5")>0) ) {
            beitragsTextVollversicherungArbeitnehmer = "* mtl. Beitrag für eine###SPECIFIC1### ###ALTER###-jährige###SPECIFIC1### Arbeitnehmer###SPECIFIC2### (Arbeitnehmeranteil) im Tarif " + tarifKuerzel + " inkl. Tarif TC/TU (100,- &euro;) ab dem 43. Tag der Arbeitsunf&auml;higkeit.";
            beitragsTextVollversicherungAndere = "* mtl. Beitrag für eine###SPECIFIC1### ###ALTER###-jährige###SPECIFIC1### ###GESCHLECHT### im Tarif " + tarifKuerzel;
            beitragsTextAndere = "* mtl. Beitrag für eine###SPECIFIC1### ###ALTER###-jährige###SPECIFIC1### ###GESCHLECHT### im Tarif " + tarifKuerzel;
        } else {
            beitragsTextVollversicherungArbeitnehmer = "* mtl. Beitrag für eine###SPECIFIC1### ###ALTER###-jährige###SPECIFIC1### Arbeitnehmer###SPECIFIC2### (Arbeitnehmeranteil) im Tarif " + tarifBezeichnung + " inkl. Tarif TC/TU (100,- &euro;) ab dem 43. Tag der Arbeitsunf&auml;higkeit.";
            beitragsTextVollversicherungAndere = "* mtl. Beitrag für eine###SPECIFIC1### ###ALTER###-jährige###SPECIFIC1### ###GESCHLECHT### im Tarif " + tarifBezeichnung;
            beitragsTextAndere = "* mtl. Beitrag für eine###SPECIFIC1### ###ALTER###-jährige###SPECIFIC1### ###GESCHLECHT### im Tarif " + tarifBezeichnung;
        }
        var beitragsTextZusatzKrankentagegeldTN = " (50 EUR ab dem ###BEREICH### der Arbeitsunfähigkeit).";
        var beitragsTextZusatzKrankentagegeldTU = " (10 EUR ab dem ###BEREICH### der Arbeitsunfähigkeit).";
        var beitragsText;
        if ((berufsgruppe == "Arbeitnehmer") && (versicherungswunsch == "KKV")) {
            beitragsText = beitragsTextVollversicherungArbeitnehmer;
        } else if ((berufsgruppe != "Arbeitnehmer") && (versicherungswunsch == "KKV")) {
            beitragsText = beitragsTextVollversicherungAndere;
        } else {
            beitragsText = beitragsTextAndere;
        }
        if ( (tarifBezeichnung == "TU") || (tarifBezeichnung == "TC") || (tarifBezeichnung == "TN2") || (tarifBezeichnung == "TN3") ) {
            if ( (tarifBezeichnung == "TN2") || (tarifBezeichnung == "TN3") ) {
                beitragsText += beitragsTextZusatzKrankentagegeldTN;
            } else {
                beitragsText += beitragsTextZusatzKrankentagegeldTU;
            }
            if ( (tarifBezeichnung == "TU") || (tarifBezeichnung == "TC") ) {
                beitragsText = beitragsText.replace(/###BEREICH###/g, "43. Tag");
            } else {
                beitragsText = beitragsText.replace(/###BEREICH###/g, "29. Tag");
            }
        }
        if (geschlecht=="w") {
            beitragsText = beitragsText.replace(/###SPECIFIC1###/g, "");
            beitragsText = beitragsText.replace(/###SPECIFIC2###/g, "in");
            beitragsText = beitragsText.replace(/###ALTER###/, alter);
            beitragsText = beitragsText.replace(/###GESCHLECHT###/, "Frau");
        } else {
            beitragsText = beitragsText.replace(/###SPECIFIC1###/g, "n");
            beitragsText = beitragsText.replace(/###SPECIFIC2###/g, "");
            beitragsText = beitragsText.replace(/###ALTER###/, alter);
            beitragsText = beitragsText.replace(/###GESCHLECHT###/, "Mann");
        }
        if (tarifBezeichnung == "PET") {
            if (tagegeldhoehe > 0) {
                beitragsText += " mit " + tagegeldhoehe + " EUR Pflegetagegeld";
            } else {
                beitragsText += " mit 50 EUR Pflegetagegeld";
            }
        }
        document.getElementById("rechner_anzeige").innerHTML = beitrag + "<sup>*</sup>";
        document.getElementById("rechner_anzeige_text").innerHTML = beitragsText;

        // For BKK FTE
        if (document.angebot_anfordern) {
            document.getElementById("contact_geschlecht").value = geschlecht;
            document.getElementById("contact_alter").value = alter;
            document.getElementById("contact_beitrag").value = beitrag;
            document.getElementById("contact_pflegetagegeld").value = tagegeldhoehe;
            document.getElementById("contact_beitragsText").value = beitragsText;
        }

    }
}

// Set the success and error functions
myAjax.onError = errorFunc;
myAjax.onSuccess= success;

// The method
myAjax.method = "POST";
// The timeout
myAjax.timeout = 5000;
function doAjaxRequest(server) {
    // The URL  to be called
    myAjax.url = server + "/berater/inc/getBeitragFromXML.php";
    if (isForwardedPage == true) {
        myAjax.url = "http://" + forwardedHost + "/inc/getBeitragFromXML.php";
    }
    var tarifKuerzel = document.getElementById("tarifKuerzel").value;
    var tarifBezeichnung = document.getElementById("tarifBezeichnung").value;
    var geburtsjahr = document.getElementById("geburtsjahr")[document.getElementById("geburtsjahr").selectedIndex].value;
    var berufsgruppe = "";
    if (document.getElementById("berufsgruppe")) {
        berufsgruppe = document.getElementById("berufsgruppe")[document.getElementById("berufsgruppe").selectedIndex].value;
    }
    if (document.getElementById("tarif")) {
        tarifKuerzel = document.getElementById("tarif")[document.getElementById("tarif").selectedIndex].value;
    }
    var geschlecht = document.getElementById("gender_m").checked ? "m" : "w";
    var versicherungsWunsch = document.getElementById("versicherungsWunsch").value;
    var tagegeldhoehe = "";
    if (document.getElementById("tagegeldhoehe")) {
        tagegeldhoehe = document.getElementById("tagegeldhoehe")[document.getElementById("tagegeldhoehe").selectedIndex].value;
    }
    var params = "tarifKuerzel=" + tarifKuerzel;
    params += "&geburtsjahr=" + geburtsjahr;
    params += "&berufsgruppe=" + berufsgruppe;
    params += "&geschlecht=" + geschlecht;
    params += "&versicherungsWunsch=" + versicherungsWunsch;
    params += "&tarifBezeichnung=" + tarifBezeichnung;
    params += "&tagegeldhoehe=" + tagegeldhoehe;
    myAjax.params = params;
    document.getElementById("rechner_anzeige").innerHTML = "Bitte warten ...";
    // Do the ajax request
    myAjax.doRequest();
}


/* B Produktlayer */


/*
 * Pages for Omniture for BKKFTE
 *   1   Startseite  Initialer Aufruf
 *   2   Kompaktansicht  onClick() auf "Detailansicht"
 *   3   Kompaktansicht  onClick() auf "Ihr Plus .."
 *   4   Kompaktansicht  onClick() auf "Beitrag berechnen"
 *   5   Kompaktansicht  onClick() auf "Angebot anfordern"
 *   6   Detailansicht   onClick() auf "Kompaktansicht"
 *   7   Detailansicht   onClick() auf "Ihr Plus .."
 *   8   Detailansicht   onClick() auf "Beitrag berechnen"
 *   9   Detailansicht   onClick() auf "Angebot anfordern"
 *  10  Ihr Plus    onClick() auf "Kompaktansicht"
 *  11  Ihr Plus    onClick() auf "Ihr Plus .."
 *  12  Ihr Plus    onClick() auf "Beitrag berechnen"
 *  13  Ihr Plus    onClick() auf "Angebot anfordern"
 *  14  Kontaktformular Aufruf
 *  15  Kontaktformular Absenden mit Fehlermeldung
 *  16  Kontaktformular onClick() auf "zurück"
 *  17  Kontaktformular Absenden ohne Fehlermeldung
 *  18  Kontaktformular Danke   Aufruf
 */

// BKKFTE specific
omnitureErrorMessage = "";
function omnitureBKKFTE(page){
    var s = s_gi("dkvbkkfte");
    s.pageName = "";
    s.server = "";
    s.channel = "";
    s.pageType = "";
    s.prop1 = "";
    s.prop2 = "";
    s.prop3 = "";
    s.prop4 = "";
    s.prop5 = "";
    s.prop6 = "";
    s.prop7 = "";
    s.prop8 = "";
    s.prop9 = "";
    s.prop10 = "";
    s.eVar1 = "";
    s.eVar2 = "";
    s.eVar3 = "";
    s.eVar4 = "";
    s.eVar5 = "";
    s.events = "";
    s.products = "";
    switch (page) {
        case 1:
            s.pageName = 'Kompaktansicht';
            break;
        case 2:
            s.prop1 = 'Kompaktansicht';
            s.prop2 = 'Detailansicht';
            break;
        case 3:
            s.prop1 = 'Kompaktansicht';
            s.prop2 = 'IhrPlus';
            break;
        case 4:
            // will be handled specially in the PHP file
            break;
        case 5:
            s.prop1 = 'Kompaktansicht';
            s.prop2 = 'Angebot anfordern';
            break;
        case 6:
            s.prop1 = 'Detailansicht';
            s.prop2 = 'Kompaktansicht';
            break;
        case 7:
            s.prop1 = 'Detailansicht';
            s.prop2 = 'IhrPlus';
            break;
        case 8:
            s.prop1 = 'Detailansicht';
            s.prop2 = 'Beitrag berechnen';
            break;
        case 9:
            s.prop1 = 'Detailansicht';
            s.prop2 = 'Angebot anfordern';
            break;
        case 10:
            s.prop1 = 'IhrPlus';
            s.prop2 = 'Kompaktansicht';
            break;
        case 11:
            s.prop1 = 'IhrPlus';
            s.prop2 = 'Detailansicht';
            break;
        case 12:
            s.prop1 = 'IhrPlus';
            s.prop2 = 'Beitrag berechnen';
            break;
        case 13:
            s.prop1 = 'IhrPlus';
            s.prop2 = 'Angebot anfordern';
            break;
        case 14:
            // will be handel specially in the PHP file
            break;
        case 15:
            s.prop1 = 'Kontaktformular';
            s.prop2 = 'Fehlermeldung';
            s.prop10 = omnitureErrorMessage;
            break;
        case 16:
            s.prop1 = 'Kontaktformular';
            s.prop2 = 'zurück';
            break;
        case 17:
            s.prop1 = 'Kontaktformular';
            s.prop2 = 'Absenden';
            break;
        case 18:
            // will be handled specially in the PHP file
            break;
    }
    s_code=s.t();
    if(s_code)document.write(s_code);
    omnitureErrorMessage = "";
}


function detailBKKFTE(page) {
    document.getElementById('kompaktansicht').style.display = 'none';
    document.getElementById('detailansicht').style.display = 'block';
    document.getElementById('ihr_plus').style.display = 'none';
    document.getElementById('center_right_content').style.display = 'block';
    if (document.getElementById('anfordern')) {
        document.getElementById('anfordern').style.display = '';
    }
    if (document.getElementById('center_right_content_2')) {
        document.getElementById('center_right_content_2').style.display = 'none';
    }
    omnitureBKKFTE(page);
}

function kompaktBKKFTE(page) {
    document.getElementById('kompaktansicht').style.display = 'block';
    document.getElementById('detailansicht').style.display = 'none';
    document.getElementById('ihr_plus').style.display = 'none';
    document.getElementById('center_right_content').style.display = 'block';
    if (document.getElementById('anfordern')) {
        document.getElementById('anfordern').style.display = '';
    }
    if (document.getElementById('center_right_content_2')) {
        document.getElementById('center_right_content_2').style.display = 'none';
    }
    omnitureBKKFTE(page);
}

function ihr_plusBKKFTE(page) {
    document.getElementById('kompaktansicht').style.display = 'none';
    document.getElementById('detailansicht').style.display = 'none';
    document.getElementById('ihr_plus').style.display = 'block';
    document.getElementById('center_right_content').style.display = 'block';
    if (document.getElementById('anfordern')) {
        document.getElementById('anfordern').style.display = '';
    }
    if (document.getElementById('center_right_content_2')) {
        document.getElementById('center_right_content_2').style.display = 'none';
    }
    omnitureBKKFTE(page);
}




function detail()
        {
            document.getElementById('kompaktansicht').style.display = 'none';
            document.getElementById('detailansicht').style.display = 'block';
            document.getElementById('ihr_plus').style.display = 'none';
            document.getElementById('center_right_content').style.display = 'block';
            if (document.getElementById('anfordern')) {
                document.getElementById('anfordern').style.display = '';
            }
            if (document.getElementById('center_right_content_2')) {
                document.getElementById('center_right_content_2').style.display = 'none';
            }
        }

function kompakt()
        {
            document.getElementById('kompaktansicht').style.display = 'block';
            document.getElementById('detailansicht').style.display = 'none';
            document.getElementById('ihr_plus').style.display = 'none';
            document.getElementById('center_right_content').style.display = 'block';
            if (document.getElementById('anfordern')) {
                document.getElementById('anfordern').style.display = '';
            }
            if (document.getElementById('center_right_content_2')) {
                document.getElementById('center_right_content_2').style.display = 'none';
            }
        }

function ihr_plus()
        {
            document.getElementById('kompaktansicht').style.display = 'none';
            document.getElementById('detailansicht').style.display = 'none';
            document.getElementById('ihr_plus').style.display = 'block';
            document.getElementById('center_right_content').style.display = 'block';
            if (document.getElementById('anfordern')) {
                document.getElementById('anfordern').style.display = '';
            }
            if (document.getElementById('center_right_content_2')) {
                document.getElementById('center_right_content_2').style.display = 'none';
            }
        }

function beitrag_berechnen()
        {
            document.getElementById('center_right_content').style.display = 'none';
            document.getElementById('anfordern').style.display = 'none';
            if (document.getElementById('center_right_content_2')) {
                document.getElementById('center_right_content_2').style.display = 'block';
            }

            //TEST Nur zum Testen der übergebenen Werte !!LÖSCHEN!!

            document.getElementById('rechner_test').style.display = 'block';
            document.getElementById('geb').innerHTML = document.getElementById('geburtsjahr').options[document.getElementById('geburtsjahr').selectedIndex].value;

            if (document.getElementById("Radio1").checked == true)
            {
               document.getElementById('gesch').innerHTML = document.getElementById('Radio1').value ;
            }
            else if (document.getElementById("Radio2").checked == true)
            {
               document.getElementById('gesch').innerHTML = document.getElementById('Radio2').value ;
            }
           //Ende TEST
        }

 /* E Produktlayer */



/* B Schnellzugriff */

var overLists = new Object();
window.addListener(overLists);
overLists.onload = function() {
 if (document.getElementById && document.getElementsByTagName && document.getElementsByClassName) {
  var arrOverLists = document.getElementsByClassName('overList','p');
  var nrOfElements = arrOverLists.length;
  for (var i = 0; i < nrOfElements; i++)
  {
    var item = new overList(arrOverLists[i]);
  }
 }
};
var overList = function(element) {
    this._activator = element;
    this._activator._obj = this;
    this._activator.onclick = this._activateClick;

    this._ulList = document.getElementById(element.id + "List");
    this._createSensitivity(this._ulList);
    this._allUlLists = document.getElementsByClassName("schnellzugriff","ul");
};
overList.prototype._createSensitivity = function(obj)
{
    obj._obj = this;
    obj.onmouseover = this._activateClick;
    obj.onmouseout = this._deactivateClick;

    for (var chldNode in obj.childNodes)
    {
        this._createSensitivity(chldNode);
    }
};
overList.prototype._activateClick = function()
{
    this._obj._activate();
};
overList.prototype._deactivateClick = function()
{
    this._obj._deactivate();
};
overList.prototype._activate = function()
{
    this._deactivate();
    this._ulList.className += " visible";
};
overList.prototype._deactivate = function()
{
    for (var i = 0; i < this._allUlLists.length; i++)
    {
        this._allUlLists[i].className = this._allUlLists[i].className.replace(" visible", "");
    }
};

/* E Schnellzugriff */






var rightColTeaser = new Object();
window.addListener(rightColTeaser);
rightColTeaser.onload = function() {
 if (document.getElementById && document.getElementsByTagName && document.getElementsByClassName) {
  var arrRightColTeaser = document.getElementsByClassName('rightColTeaser','form');
  var nrOfElements = arrRightColTeaser.length;
  for (var i = 0; i < nrOfElements; i++)
  {
    var item = new openingTeaser(arrRightColTeaser[i]);
  }
  document._oneIsLocked = false;
  document._lockedObj = false;
 }
};
var openingTeaser = function(element)
{
    this._form = element;
    this._createSensitivity(this._form);

    this._formList = document.getElementsByClassName('rightColTeaser','form');
    this._deactivator = document.createElement("img");
    this._form.appendChild(this._deactivator);
    this._deactivator._obj = this;
    this._deactivator.className = "deactivator";
    this._deactivator.setAttribute("src", "img/sidebar/rightColTeaserPin.gif");
    this._deactivator.onclick = this._releaseClick;

    this._moreInfoArea = document.getElementById(this._form.id + "MoreInfoArea");
    this._moreInfoArea._obj = this;

    this._followingSidebox = document.getElementsByClassName('sidebox','div')[0];
    this._followingSidebox._obj = this;
};
openingTeaser.prototype._createSensitivity = function(obj)
{
    obj._obj = this;
    obj.onmouseover = this._activateClick;
    obj.onmouseout = this._deactivateClick;
    obj.onmousedown = this._lockClick;

    for (var chldNode in obj.childNodes)
    {
        this._createSensitivity(chldNode);
    }
};
openingTeaser.prototype._activateClick = function()
{
    if(!document._oneIsLocked) this._obj._activate();
};
openingTeaser.prototype._deactivateClick = function()
{
    if(!document._oneIsLocked) this._obj._deactivate();
};
openingTeaser.prototype._lockClick = function()
{
    if(document._lockedObj && (document._lockedObj != this._obj))
    {
        var obj = document._lockedObj;
        obj._deactivator.className = "deactivator";
        document._oneIsLocked = false;
        document._lockedObj = false;
        for (var i = 0; i < obj._formList.length; i++)
        {
            document.getElementById(obj._formList[i].id + "MoreInfoArea").className = "moreInfoArea";
            obj._formList[i].className = obj._formList[i].className.replace(" invisible","");
        }
        document.getElementsByClassName('sidebox','div')[0].className = document.getElementsByClassName('sidebox','div')[0].className.replace(" invisible","");
        this._obj._activate();
    }
    if(!document._oneIsLocked)
    {
        document._oneIsLocked = true;
        this._obj._deactivator.className = "visible";
        document._lockedObj = this._obj;
    }
};
openingTeaser.prototype._releaseClick = function()
{
    document._oneIsLocked = false;
    this._obj._deactivator.className = "deactivator";
    document._lockedObj = false;
};
openingTeaser.prototype._activate = function()
{
    var makeInvisible = false;
    for (var i = 0; i < this._formList.length; i++)
    {
        if(makeInvisible) this._formList[i].className += " invisible";
        makeInvisible = (makeInvisible || this._formList[i] == this._form);
    }
    this._followingSidebox.className += " invisible";
    this._moreInfoArea.className = "moreInfoAreaVisible";
};
openingTeaser.prototype._deactivate = function()
{
    for (var i = 0; i < this._formList.length; i++)
    {
        document.getElementById(this._formList[i].id + "MoreInfoArea").className = "moreInfoArea";
        this._formList[i].className = this._formList[i].className.replace(" invisible","");
    }
    document.getElementsByClassName('sidebox','div')[0].className = document.getElementsByClassName('sidebox','div')[0].className.replace(" invisible","");
};


function initOverLabels () {
  if (!document.getElementById) return;
  var labels, id, field;
  // Set focus and blur handlers to hide and show
  // labels with 'overlabel' class names.
  labels = document.getElementsByTagName('label');
  for (var i = 0; i < labels.length; i++) {
    if (labels[i].className == 'overlabel') {
      // Skip labels that do not have a named association
      // with another field.
      id = labels[i].htmlFor || labels[i].getAttribute('for');
      if (!id || !(field = document.getElementById(id))) {
        continue;
      }
      // Change the applied class to hover the label
      // over the form field.
      labels[i].className = 'overlabel-apply';
      // Hide any fields having an initial value.
      if (field.value !== '') {
        hideLabel(field.getAttribute('id'), true);
      }
      // Set handlers to show and hide labels.
      field.onfocus = function () {
        hideLabel(this.getAttribute('id'), true);
      };
      field.onblur = function () {
        if (this.value === '') {
          hideLabel(this.getAttribute('id'), false);
        }
      };
      // Handle clicks to label elements (for Safari).
      labels[i].onclick = function () {
        var id, field;
        id = this.getAttribute('for');
        if (id && (field = document.getElementById(id))) {
          field.focus();
        }
      };
    }
  }
};
function hideLabel (field_id, hide) {
  var field_for;
  var labels = document.getElementsByTagName('label');
  for (var i = 0; i < labels.length; i++) {
    field_for = labels[i].htmlFor || labels[i].getAttribute('for');
    if (field_for == field_id) {
      labels[i].style.textIndent = (hide) ? '-1000px' : '0px';
      return true;
    }
  }
}
var OverlabelInit = new Object();
window.addListener(OverlabelInit);
OverlabelInit.onload = function () {
  setTimeout(initOverLabels, 50);
};

function check_filter(cb) {
  if(cb.checked) {
    //alle Filter einschalten und deaktivieren
    document.getElementById("le_filter_1").checked = true;
    document.getElementById("le_filter_2").checked = true;
    document.getElementById("le_filter_3").checked = true;

    document.getElementById("le_filter_1").disabled = true;
    document.getElementById("le_filter_2").disabled = true;
    document.getElementById("le_filter_3").disabled = true;
  } else {
    //alle Filter aktivieren
    document.getElementById("le_filter_1").disabled = false;
    document.getElementById("le_filter_2").disabled = false;
    document.getElementById("le_filter_3").disabled = false;
  }
}

function sound_icon(val)
{
    if(val == 'on')
    {
        document.getElementById("sound_on").src = "img/navi/lautsprecher_an_n.gif";
        document.getElementById("sound_off").src = "img/navi/lautsprecher_aus.gif";
        document.getElementById("sound_on").className = "passiv";
        document.getElementById("sound_off").className = "";
    }

    if(val == 'off')
    {
        document.getElementById("sound_on").src = "img/navi/lautsprecher_an.gif";
        document.getElementById("sound_off").src = "img/navi/lautsprecher_aus_n.gif";
        document.getElementById("sound_on").className = "";
        document.getElementById("sound_off").className = "passiv";
    }
    var ablauf = new Date();
    var inEinemJahr = ablauf.getTime() + (365 * 24 * 60 * 60 * 1000);
    ablauf.setTime(inEinemJahr);
    document.cookie = "DKV_soundState=" + val + "; expires=" + ablauf.toGMTString();
}

function checkSound()
{
    var soundState = "on";
    if (document.cookie)
    {
        var DKVcookies = document.cookie.split(";");
        for (var i = 0; i<DKVcookies.length; i++)
        {
            if (DKVcookies[i].split("=")[0] == "DKV_soundState") soundState = DKVcookies[i].split("=")[1];
        }
    }
    return soundState;
}

/*
var SoundInit = new Object();
window.addListener(SoundInit);
SoundInit.onload = function ()
{
    document.getElementById("sound_on").onclick = function() { sound_icon('on') };
    document.getElementById("sound_off").onclick = function() { sound_icon('off') };
    sound_icon(checkSound());
};
*/


function popup_abb()
        {
                if (document.getElementById('popup_schnell_shadow').style.display = 'block')
                {
                    document.getElementById('popup_schnell_shadow').style.display = 'none' ;
                    document.getElementById('popup_abb_shadow').style.display = 'block' ;
              }
        };

function schliessen_abb()
        {
            document.getElementById('popup_abb_shadow').style.display = 'none' ;
        };

function popup_schnell()
        {
                if (document.getElementById('popup_abb_shadow').style.display = 'block')
                {
                    document.getElementById('popup_abb_shadow').style.display = 'none' ;
                    document.getElementById('popup_schnell_shadow').style.display = 'block' ;
              }
        };

function schliessen_schnell()
        {
            document.getElementById('popup_schnell_shadow').style.display = 'none' ;
        };


function absenden()
        {
            if (document.getElementById("Radio_01").checked == true)
            { return true; }
            if (document.getElementById("Radio_02").checked == true)
            { return true; }
            if (document.getElementById("Radio_03").checked == true)
            { return true;}
            if (document.getElementById("Radio_04").checked == true)
            { return true;}
            if (document.getElementById("Radio_05").checked == true)
            {
                if(document.getElementById('Radio_05_Text').value == "")
                {
                    window.alert('Bitte geben Sie einen Grund ein!');
                    return false;
                    document.getElementById('Text1').focus();
                }
                else
                {
                    return true;
                }
            }
                 schliessen_abb();
                 schliessen_schnell();
         };


function showPrintPage(){
    document.printPage.beitrag.value = document.getElementById("rechner_anzeige").innerHTML;
    document.printPage.beitragstext.value = document.getElementById("rechner_anzeige_text").innerHTML;
    document.printPage.submit();
}


// Will be set in the top.inc.noflash (that means, a flash at the top is running)
var noFlashContent = "";
// Will be filled with the flash content, if a flash at the top is running
var flashContent = "";
var topFlashIsHidden = false;
// The function will called via the portrait video. If a video at the top of the page is running
// store this flash content and replace it with noflash content
// The second function does the vice versa
function hideTopFlash() {
    doAjaxTracking(ad_pnr, 0, "hideTopFlash");
    if (noFlashContent != "") {
        noFlashContent = noFlashContent.replace(/&quot;/g, '"');
        noFlashContent = noFlashContent.replace(/&#039;/g, "'");
        document.getElementById("teaserFlash").innerHTML = noFlashContent;
        topFlashIsHidden = true;
    }
}
function showTopFlash() {
    /*
    if (topFlashIsHidden) {
        topFlashIsHidden = false;
        document.getElementById("teaserFlash").innerHTML = "";
        var fo1 = null;
        fo1 = new SWFObject(flashFile, "videoFlash", 762, 202, "8", "#EEEEEE");
        fo1.addParam("scale", "noscale");
        fo1.addParam("salign", "t");
        fo1.addParam("allowScriptAccess", "always");
        // Veränderter Wert für Tracking auf AD-Homepages
        fo1.addVariable("omniture_account","dkvadhomepages");
        // Neue Variablen für Flash-Aufruf auf AD-Homepages
        fo1.addVariable("ad_flash_path",ad_flash_path);  // das ist der Pfad zu den Flash-Files
        fo1.addVariable("ad_bezeichnung", ad_bezeichnung);
        fo1.addVariable("ad_bueroname", ad_bueroname);
        fo1.addVariable("ad_urlprodukte", ad_urlprodukte);
        fo1.addVariable("ad_pnr", ad_pnr);
        fo1.addVariable("ad_email", ad_email);
        fo1.setAttribute("redirectUrl", redirectUrl);
        fo1.write("teaserFlash");
    }
    */
}

function openTeilnahmebedingungen() {
  window.open('../flash/popup_teilnahmebedingungen.htm','popup','width=637,height=700');
}

function doAjaxTracking(pnr, kindOfVideo, funcName){
    $.ajax({
        type: "POST",
        url: "../inc/trackVideoportrait.php",
        data: "pnr=" + pnr + "&kindOfVideo=" + kindOfVideo + "&funcName=" + funcName,
        dataType: 'html',
        error: function(XMLHttpRequest, textStatus, errorThrown){
            // Do nothing
        },
        success: function(html){
            // Do nothing
        }
    })
}

function trackVideo(pnr) {
    doAjaxTracking(pnr, 1, 'trackVideo');
}

function initDatePicker(startYear, endYear, maxSelectableDate) {
    // Set default values
    range ="'" + startYear + ":" + endYear + "'";
    $.datepicker.setDefaults(
        {
            showOn: 'both',
            buttonImageOnly: true,
            buttonImage: '../img/calendar.gif',
            buttonText: 'Kalendar',
            defaultDate: null,
            yearRange: range
        }
    );
    setYearRange = "$.datepicker.setDefaults({yearRange: " + range + "});";
    setMaxSelectabledate = "$.datepicker.setDefaults({maxDate: '" + maxSelectableDate + "'});";
    eval(setYearRange);
    eval(setMaxSelectabledate);

    // Attach the datepicker to dateinput after document is ready
    $("#startDate").datepicker();
    $("#endDate").datepicker();
    $("#endDate").datepicker();

    /* German initialisation for the jQuery UI date picker plugin. */
    /* Written by Milian Wolff (mail@milianw.de). */
    jQuery(function($) {
        $.datepicker.regional['de'] = {
            clearText: 'l&ouml;schen',
            clearStatus: 'aktuelles Datum l&ouml;schen',
            closeText: 'schlie&szlig;en',
            closeStatus: 'ohne &Auml;nderungen schlie&szlig;en',
            prevText: '&#x3c;zur&uuml;ck',
            prevStatus: 'letzten Monat zeigen',
            nextText: 'Vor&#x3e;',
            nextStatus: 'n&auml;chsten Monat zeigen',
            currentText: 'heute',
            currentStatus: '',
            monthNames: ['Januar','Februar','M&auml;rz','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'],
            monthNamesShort: ['Jan','Feb','M&auml;r','Apr','Mai','Jun', 'Jul','Aug','Sep','Okt','Nov','Dez'],
            monthStatus: 'anderen Monat anzeigen',
            yearStatus: 'anderes Jahr anzeigen',
            weekHeader: 'Wo',
            weekStatus: 'Woche des Monats',
            dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
            dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
            dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
            dayStatus: 'Setze DD als ersten Wochentag',
            dateStatus: 'W&auml;hle D, M d',
            dateFormat: 'dd.mm.yy',
            firstDay: 1,
            initStatus: 'W&auml;hle ein Datum',
            isRTL: false
        };
        $.datepicker.setDefaults($.datepicker.regional['de']);
    });
}

function gotoBKKFTEKontakt(page) {
    omnitureBKKFTE(page);
    document.angebot_anfordern.submit();
}
