// JavaScript Document
function GoSearch(sstr) {
    var suchtext = document.getElementById('txtbox').value
    var v_url = 'default.aspx?search=' + suchtext + sstr;
    document.location.href = v_url;
}
function DownloadRA(url) {
    window.setTimeout("getSDK('" + url + "')", 2000);
}
function DownloadSDK(url) {
    window.setTimeout("getSDK('" + url + "')", 3000);
}
function getSDK(url) {
    document.location.href = url;
}
function GxPicOtherText(cbcID, txtID) {
    if (document.getElementById(cbcID).checked) {
        document.getElementById(txtID).disabled = false;
        document.getElementById(txtID).select();
    }
    else {
        document.getElementById(txtID).value = "";
        document.getElementById(txtID).className = "FieldValidationOk";
        document.getElementById(txtID).disabled = true;
    }
}
function setTitle(title) {

    document.title = title;//.replace('\'','"');
}
function checkKaVoCode() {
  //  alert('Check!');
    var code = document.getElementById('Text1').value;   
   // alert('code=' + code);
    if (code == "test" || code == "test1" || code == "test2" || code == "test3" || code == "test4" || code == "test5" || code == "test6" || code == "test7") {
      //  alert('Code OK');
        document.getElementById('checkimg').src = '/img_cpm/global/images/ids2007/banners/breitling.jpg';
       // document.getElementById('checkimg').display = 'block';
    }    
    else {
       // alert('Code Falsch!');
        document.getElementById('checkimg').src = '/img_cpm/global/images/produkte/imaging/3d_exam/3DeXam_navi.jpg';
}
return false;
}

function DownloadWithWarning(url, warning) {
    window.setTimeout("showDownWarning('" + url + "','" + warning + "')", 100);
}
function showDownWarning(url, warning) {
    if (document.getElementById('HinweisPnl') != null) {
        document.getElementById('NoteHDR').innerHTML = 'Note';
        document.getElementById('NoteDiv').innerHTML = warning;
        document.getElementById('downRef').onclick = function() { getSDK(url); };
        document.getElementById('HinweisPnl').style.display = 'block';
    }
}
function CheckNote(chk) {
    if (chk) {
        document.getElementById('downRef').style.display = '';
    }
    else {
        document.getElementById('downRef').style.display = 'none';
    }
}
function CloseNote(pnlID) {
    document.getElementById(pnlID).style.display = 'none';
}

//Add favorite in Browser
function add_favorite(a) {
    title = document.title;
    url = document.location;
    try {
        window.external.AddFavorite(url, title);
    }
    catch (e) {
        try {
            window.sidebar.addPanel(title, url, "");
        }
        catch (e) {
            if (typeof (opera) == "object") {
                a.rel = "sidebar";
                a.title = title;
                a.url = url;
                return true;
            }
            else {
                alert('Press Ctrl-D to add this site to your favorite');
            }
        }
    }
    return false;
}
//COOKIE SETZEN UND LESEN
function Schreiben(n, w, e) {
    var a = new Date();
    a = new Date(a.getTime() + e);
    document.cookie = n + '=' + w + '; expires=' + a.toGMTString() + ';';
}

function zin (name) { 
	name.style.backgroundColor = '#F5F5F5';
}
function zout (name) { 
	name.style.backgroundColor = '#FFFFFF';
}
function ShowWK(wk) { 

}

function ClearErrMsg(obj, Nr) {
    if (obj.value == "") {
        document.getElementById("SP_CodeMsg" + Nr).innerHTML = "";
    }
}
function Lesen(n) {
    a = document.cookie;
    res = '';
    while (a != '') {
        while (a.substr(0, 1) == ' ') { a = a.substr(1, a.length); }
        cookiename = a.substring(0, a.indexOf('='));
        if (a.indexOf(';') != -1)
        { cookiewert = a.substring(a.indexOf('=') + 1, a.indexOf(';')); }
        else { cookiewert = a.substr(a.indexOf('=') + 1, a.length); }
        if (n == cookiename) { res = cookiewert; }
        i = a.indexOf(';') + 1;
        if (i == 0) { i = a.length }
        a = a.substring(i, a.length);
    }
    return (res)
}

function Loeschen(n) {
    document.cookie = n + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
}
function NameHolen() {
    if (document.cookie) {
        Posi = Lesen('Pos');
    }
    else {
        Posi = 0;
    }
   }
   
function resizeDiv() {
    try {
        document.execCommand("BackgroundImageCache", false, true);
    }
    catch (err) { }

}
function checkrand() {

}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function Position() {
    var docEl = (
                 typeof document.compatMode != "undefined" &&
                 document.compatMode != "BackCompat"
                ) ? "documentElement" : "body";
    yPos = document[docEl].scrollTop;
    Schreiben('Pos', yPos, 1000 * 60 * 60 * 24);
}
function goTo(URL) {
    location.href = URL;
}

function OpenSendLinkWindow(url) {
    var width = 650;
    var height = 550;
    var iLeft = 0;
    var iTop = 0;
    var sOptions = "toolbar=no,status=no,resizable=no,dependent=no,scrollbars=no,menubar=no,location=no";
    sOptions += ",width=" + width;
    sOptions += ",height=" + height;
    sOptions += ",left=" + iLeft;
    sOptions += ",top=" + iTop;
    var PopUpFenster = window.open(url, 'URLWindow', sOptions);
    PopUpFenster.opener = self;
}
function openWin(URL) {
    fenster = window.open(URL, "", "");
}

function openUserWindow(url, w, h) {
    var width = w;
    var height = h;
    var iLeft = 0;
    var iTop = 0;
    var sOptions = "toolbar=no,status=no,resizable=no,dependent=no,scrollbars=no,menubar=no,location=no";
    sOptions += ",width=" + width;
    sOptions += ",height=" + height;
    sOptions += ",left=" + iLeft;
    sOptions += ",top=" + iTop;
    var PopUpFenster = window.open(url, 'URLWindow', sOptions);
    PopUpFenster.opener = self;
}
function openFlashWindow(url, w, h, t, l) {
    var width = w;
    var height = h;
    var iLeft = l;
    var iTop = t;
    var sOptions = "toolbar=no,status=no,resizable=no,dependent=no,scrollbars=no,menubar=no,location=no,directories=no";
    sOptions += ",width=" + width;
    sOptions += ",height=" + height;
    sOptions += ",left=" + iLeft;
    sOptions += ",top=" + iTop;
    var PopUpFenster = window.open(url, 'FlashWindow', sOptions);
    PopUpFenster.opener = self;
}

function TableAusblenden(table, headline, pfeil, org) {
    tables = document.getElementsByTagName("table");
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(table) > -1 && (tables[i].id.indexOf(table) + table.length) == tables[i].id.length) {
            document.getElementById(tables[i].id).style.display = 'none';
        }
    }
    images = document.getElementsByTagName("img");
    for (var i = 0; i < images.length; i++) {
        if (images[i].id.indexOf(pfeil) > -1 && (images[i].id.indexOf(pfeil) + pfeil.length) == images[i].id.length) {
            document.getElementById(images[i].id).onclick = function() { TableEinblenden(table, headline, pfeil, org); };
            if (pfeil != '') document.getElementById(images[i].id).src = '/images2/' + org + '/allg/Icons/plus.gif';
        }
    }
}

function TableEinblenden(table, headline, pfeil, org) {
    tables = document.getElementsByTagName("table");
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(table) > -1 && (tables[i].id.indexOf(table) + table.length) == tables[i].id.length) {
            document.getElementById(tables[i].id).style.display = 'block';
        }
    }
    images = document.getElementsByTagName("img");
    for (var i = 0; i < images.length; i++) {
        if (images[i].id.indexOf(pfeil) > -1 && (images[i].id.indexOf(pfeil) + pfeil.length) == images[i].id.length) {
            document.getElementById(images[i].id).onclick = function() { TableAusblenden(table, headline, pfeil, org); };
            if (pfeil != '') document.getElementById(images[i].id).src = '/images2/' + org + '/allg/Icons/minus.gif';
        }
    }
    checkrand();
}

function TableAusblendenTbl(table, tableSrc, pfeil, org) {
    tables = document.getElementsByTagName("table");
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(table) > -1 && (tables[i].id.indexOf(table) + table.length) == tables[i].id.length) {
            document.getElementById(tables[i].id).style.display = 'none';
        }
    }
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(tableSrc) > -1 && (tables[i].id.indexOf(tableSrc) + tableSrc.length) == tables[i].id.length) {
            document.getElementById(tables[i].id).onclick = function() { TableEinblendenTbl(table, tableSrc, pfeil, org); };
        }
    }
    images = document.getElementsByTagName("img");
    for (var i = 0; i < images.length; i++) {
        if (images[i].id.indexOf(pfeil) > -1 && (images[i].id.indexOf(pfeil) + pfeil.length) == images[i].id.length) {
            if (pfeil != '') document.getElementById(images[i].id).src = '/images2/' + org + '/allg/Icons/plus.gif';
        }
    }
}

function TableEinblendenTbl(table, tableSrc, pfeil, org) {
    tables = document.getElementsByTagName("table");
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(table) > -1 && (tables[i].id.indexOf(table) + table.length) == tables[i].id.length) {
            document.getElementById(tables[i].id).style.display = 'block';
        }
    }
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(tableSrc) > -1 && (tables[i].id.indexOf(tableSrc) + tableSrc.length) == tables[i].id.length) {
            document.getElementById(tables[i].id).onclick = function() { TableAusblendenTbl(table, tableSrc, pfeil, org); };
        }
    }
    images = document.getElementsByTagName("img");
    for (var i = 0; i < images.length; i++) {
        if (images[i].id.indexOf(pfeil) > -1 && (images[i].id.indexOf(pfeil) + pfeil.length) == images[i].id.length) {
            if (pfeil != '') document.getElementById(images[i].id).src = '/images2/' + org + '/allg/Icons/minus.gif';
        }
    }
}

function PresseAusblenden(table, table2, tableSrc, pfeil, org) {
    tables = document.getElementsByTagName("table");
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(table) > -1) {
            document.getElementById(tables[i].id).style.display = 'none';
        }
    }
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(table2) > -1) {
            document.getElementById(tables[i].id).style.display = 'block';
        }
    }
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(tableSrc) > -1) {
            document.getElementById(tables[i].id).onclick = function() { PresseEinblenden(table, table2, tableSrc, pfeil, org); };
        }
    }
    images = document.getElementsByTagName("img");
    for (var i = 0; i < images.length; i++) {
        if (images[i].id.indexOf(pfeil) > -1) {
            if (pfeil != '') document.getElementById(images[i].id).src = 'images2/' + org + '/allg/Icons/plus.gif';
        }
    }
}

function PresseEinblenden(table, table2, tableSrc, pfeil, org) {
    tables = document.getElementsByTagName("table");
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(table) > -1) {
            document.getElementById(tables[i].id).style.display = 'block';
        }
    }
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(table2) > -1) {
            document.getElementById(tables[i].id).style.display = 'none';
        }
    }
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf(tableSrc) > -1) {
            document.getElementById(tables[i].id).onclick = function() { PresseAusblenden(table, table2, tableSrc, pfeil, org); };
        }
    }
    images = document.getElementsByTagName("img");
    for (var i = 0; i < images.length; i++) {
        if (images[i].id.indexOf(pfeil) > -1) {
            if (pfeil != '') document.getElementById(images[i].id).src = 'images2/' + org + '/allg/Icons/minus.gif';
        }
    }
}

function DocsEin(id) {
    document.getElementById("MB" + id).style.display = 'block';
    document.getElementById("MDoc" + id).style.display = 'none';
    checkrand();
}

function toggledisplay(idobj) {
    if (document.getElementById(idobj)) {
        var mydiv = document.getElementById(idobj);
        mydiv.style.display = (mydiv.style.display == 'block' ? 'none' : 'block');
    }
}

function toggleIFrameLink(idobj,inputid) {
    if (document.getElementById(idobj)) {
        var mydiv = document.getElementById(idobj);
        mydiv.style.display = (mydiv.style.display == 'block' ? 'none' : 'block');
        document.getElementById(inputid).select();
    }
}
//Allgemeine Prüfungsfunktionen
function checkIt(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if ((charCode < 48 || charCode > 57) && charCode != 8 && charCode != 46 && charCode != 37 && charCode != 39) {
        status = "This field accepts numbers only."
        return false
    }
    status = ""
    return true
}

function boxLeaveDay(box) {
    if (box != null) {
        var value = box.value;
        if (value.Trim() == '' || (value < 1 || value > 31)) {
            alert('Day must be between 1 and 31');
            box.focus();
        }
    }
}

function boxLeaveMonth(box) {
    if (box != null) {
        var value = box.value;
        if (value.Trim() == '' || (value < 1 || value > 12)) {
            alert('Month must be between 1 and 12');
            box.focus();
        }
    }
}

function boxLeaveYear(box) {
    if (box != null) {
        var value = box.value;
        if (value.Trim() == '' || (value < 1000 || value > 3000)) {
            alert('Year must be between 1000 and 3000');
            box.focus();
        }
    }
}

function clearBox(box) {
    if (box.defaultValue == box.value) box.value = "";
}


function NotEnter(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if (charCode == 13) {
        status = "Please click the button."
        return false
    }
    status = ""
    return true
}

function textCounter(field, countfield, maxlimit, txt) {
    if (field.value.length > maxlimit) {
        field.value = field.value.substring(0, maxlimit);
    }
    else {
        var chrs = maxlimit - field.value.length;
        countfield.innerHTML = '(' + txt + ': ' + chrs + ' )';
    }
}

String.prototype.Trim = function() {
    return (this.replace(/\s+$/, "").replace(/^\s+/, ""));                            // Funktion entfernt alle leerzeichen Links und Rechts des Strings
};

function IsFilledOutOther(sender, e) {
    cbs = document.getElementsByTagName("input");
    for (var i = 0; i < cbs.length; i++) {
        if (cbs[i].id.indexOf("otherTXTid") > -1) {
            otherTXT = document.getElementById(cbs[i].id).value;
        }

        if (cbs[i].id.indexOf("otherCB") > -1) {
            otherCB = document.getElementById(cbs[i].id).value;
        }
    }
    if (document.getElementById(otherCB).checked) {
        if (e.Value.Trim() == "") {
            var tables = document.getElementsByTagName("div");
            for (var i = 0; i < tables.length; i++) {
                if (tables[i].id.indexOf("JS_ErrorPanel") > -1) {
                    var div = document.getElementById(tables[i].id);
                    div.style.display = 'block';
                }
            }
            document.getElementById(otherTXT).className = "FieldValidationError";
            e.IsValid = false;                                                                      // Prüfung nicht i.O.
        }
        else {
            document.getElementById(otherTXT).className = "FieldValidationOk";
            e.IsValid = true;                                                                       // Prüfung  i.O.
        }
    }
    else {
        e.IsValid = true;
    }
}

function IsFilledOut(sender, e) {
    if (e.Value.Trim() == "") {
        var tables = document.getElementsByTagName("div");
        for (var i = 0; i < tables.length; i++) {
            if (tables[i].id.indexOf("JS_ErrorPanel") > -1) {
                var div = document.getElementById(tables[i].id);
                div.style.display = 'block';
            }
        }
        document.getElementById(sender.controltovalidate).className = "FieldValidationError";
        e.IsValid = false;                                                                    // Prüfung nicht i.O.
    }
    else {
        document.getElementById(sender.controltovalidate).className = "FieldValidationOk";
        e.IsValid = true;                                                                       // Prüfung  i.O.
    }

}

function IsPwdOK(sender, e) {
    if (e.Value.Trim() == "" && e.Value.Trim().length > 5) {
        document.getElementById(sender.controltovalidate).className = "FieldValidationError";
        e.IsValid = false;                                                                      // Prüfung nicht i.O.               
    }
    else {
        document.getElementById(sender.controltovalidate).className = "FieldValidationOk";
        e.IsValid = true;                                                                       // Prüfung  i.O.
    }
}

function IsFilledOutE80(sender, e) {
    if (e.Value.Trim() == "") {
        document.getElementById(sender.controltovalidate).className = "FieldValidationError";
        HinweisEinAus();
        e.IsValid = false;                                                                      // Prüfung nicht i.O.
    }
    else {
        document.getElementById(sender.controltovalidate).className = "FieldValidationOk";
        HinweisEinAus();
        e.IsValid = true;                                                                       // Prüfung  i.O.
    }
}

function IsDropDownSelected(sender, e) {
    var tb1 = document.getElementById(sender.controltovalidate);                       // Wert aus der TextBox in die Variable tb1 übernehmen
    if (tb1.options[tb1.selectedIndex].value.Trim() != "---")                                                      // Prüfen ob ein Wert existiert (Trim entfernt zuerst die Leerzeichen am Stringanfang und -end) 
    {
        tb1.className = "FieldValidationOkDD"; // DD steht für DropDown        
        e.IsValid = true;                                                                   // Prüfung i.O.
    }
    else {
        tb1.className = "FieldValidationErrorDD"; // DD steht für DropDown
        e.IsValid = false;                                                                  // Prüfung nicht i.O.
    }
}

function IsCheckBoxSelected(sender, e) {
    var chkListModules = document.getElementById(sender.id.replace('rfv_', ''));
    var chkListinputs = chkListModules.getElementsByTagName("input");
    for (var i = 0; i < chkListinputs.length; i++) {

        if (chkListinputs[i].checked) {
            chkListModules.className = "FieldValidationOkCBL";
            e.IsValid = true;
            return;
        }
    }
    chkListModules.className = "FieldValidationErrorCBL";
    e.IsValid = false;
}

function IsOptionsSelected(sender, e) {
    var chkListModules = document.getElementById(sender.id.replace('rfv_', ''));
    var chkListinputs = chkListModules.getElementsByTagName("input");
    for (var i = 0; i < chkListinputs.length; i++) {
        if (chkListinputs[i].checked) {
            chkListModules.className = "FieldValidationOkCBL";
            e.IsValid = true;
            return;
        }
    }
    chkListModules.className = "FieldValidationErrorCBL";
    e.IsValid = false;
}


function IsOptionsSelectedRAFG(sender, e) {
    var chkListModules = document.getElementById(sender.controltovalidate);
    var chkListinputs = chkListModules.getElementsByTagName("input");
    for (var i = 0; i < chkListinputs.length; i++) {
        if (chkListinputs[i].checked) {
            chkListModules.className = "FieldValidationOkCBL";
            e.IsValid = true;
            return;
        }
    }
    chkListModules.className = "FieldValidationErrorCBL";
    e.IsValid = false;
}


function checkLimit(obj, limit) {
    var num = 0;
    for (i = 0; i < obj.options.length; i++) { if (obj.options[i].selected) { num += 1; } }
    if (num > limit) { alert("Only " + limit + " please."); obj.options[obj.selectedIndex].selected = false; }

    var str = "";
    for (i = 0; i < obj.options.length; i++) {
        if (obj.options[i].selected) str = str + obj.options[i].text + "<br />";
    }
    var selDIV = null;
    cbs = document.getElementsByTagName("span");
    for (var i = 0; i < cbs.length; i++) {
        if (cbs[i].id.indexOf("sellans") > -1) {
            selDIV = document.getElementById(cbs[i].id);
        }
    }
    if (selDIV) {
         selDIV.innerHTML = str;
    }
}

function CheckExtLanCount(id, index) {
    var tb1 = document.getElementById(id);
    var cnt = 0;
    for (i = 0; i < tb1.options.length; i++) {
        if (tb1.options[i].selected) cnt++;
    }
    if (cnt > 3) {
        tb1.options[index].selected = false;
    }
    var str = "";
    for (i = 0; i < tb1.options.length; i++) {
        if (tb1.options[i].selected) str += tb1.options[i].text;
    }
    alert("sdsd");
    var selDIV = document.getElementById("sellans");
    if (selDIV) {
        alert("sdsd");
        selDIV.innerHTML = str;
    }
}




// Nur für dd.MM.yyyy
function IsDate(sender, e) {
    var TF = document.getElementById(sender.controltovalidate);
    Fehler = true;
    if (TF.value != "") {
        Data = TF.value.split(".");
        if (Data.length == 3) {
            Tag = Data[0];
            Monat = Data[1];
            Jahr = Data[2];
            if (!isNaN(Tag) && !isNaN(Monat) && !isNaN(Jahr)) {
                if (Datum = new Date(Jahr, Monat - 1, Tag)) {
                    if (Datum.getDate() == Tag && Datum.getMonth() == Monat - 1 && Jahr < 9999) {
                        if (Tag < 10 || Monat < 10 || Jahr.length < 4) {
                            if (Tag.length < 2) Tag = "0" + Tag;
                            if (Monat.length < 2) Monat = "0" + Monat;
                            if (Jahr < 1000) {
                                if (Jahr.length == 0) {
                                    T_Jahr = new Date();
                                    Jahr = T_Jahr.getYear();
                                }
                                else {
                                    if (Jahr.length == 1) {
                                        Jahr = "200" + Jahr;
                                    }
                                    else {
                                        if (Jahr.length == 2) {
                                            Jahr = "20" + Jahr;
                                        }
                                        else {
                                            Jahr = "2" + Jahr;
                                        }
                                    }
                                }
                            }
                            TF.value = Tag + "." + Monat + "." + Jahr;
                        }
                        Fehler = false;
                    }
                }
            }
        }
        if (Fehler) {
            document.getElementById(sender.controltovalidate).className = "dateERROR";
            e.IsValid = false;
        }
        else {
            document.getElementById(sender.controltovalidate).className = "dateOK";
            e.IsValid = true;
        }
    }
}

// Nur für dd.MM.yyyy
function IsBirthDate(sender, e) {
    var TF = document.getElementById(sender.controltovalidate);
    Fehler = true;
    if (TF.value != "") {
        Data = TF.value.split(".");
        if (Data.length == 3) {
            Tag = Data[0];
            Monat = Data[1];
            Jahr = Data[2];
            if (!isNaN(Tag) && !isNaN(Monat) && !isNaN(Jahr)) {
                if (Datum = new Date(Jahr, Monat - 1, Tag)) {
                    if (Datum.getDate() == Tag && Datum.getMonth() == Monat - 1 && Jahr < 9999) {
                        if (Tag < 10 || Monat < 10 || Jahr.length < 4) {
                            if (Tag.length < 2) Tag = "0" + Tag;
                            if (Monat.length < 2) Monat = "0" + Monat;
                            if (Jahr < 1000) {
                                if (Jahr.length == 0) {
                                    T_Jahr = new Date();
                                    Jahr = T_Jahr.getYear();
                                }
                                else {
                                    if (Jahr.length == 1) {
                                        Jahr = "200" + Jahr;
                                    }
                                    else {
                                        if (Jahr.length == 2) {
                                            Jahr = "20" + Jahr;
                                        }
                                        else {
                                            Jahr = "2" + Jahr;
                                        }
                                    }
                                }
                            }
                            TF.value = Tag + "." + Monat + "." + Jahr;
                        }
                        Fehler = false;
                    }
                }
            }
        }
        if (Fehler) {
            document.getElementById(sender.controltovalidate).className = "dateERROR";
            e.IsValid = false;
        }
        else {
            document.getElementById(sender.controltovalidate).className = "dateOK";
            e.IsValid = true;
        }
    }
}

// Nur für dd.MM.yyyy
function IsBirthDateFG(sender, e) {
    var TF = document.getElementById(sender.controltovalidate);
    var ObjName = TF.id.replace('_Day', '');
    Fehler = true;
    if (TF.value != "") {
        Data = true;
        if (Data) {
            Tag = TF.value;
            Monat = document.getElementById(ObjName + '_Month').value;
            Jahr = document.getElementById(ObjName + '_Year').value;
            if (!isNaN(Tag) && !isNaN(Monat) && !isNaN(Jahr)) {
                if (Datum = new Date(Jahr, Monat - 1, Tag)) {
                    if (Datum.getDate() == Tag && Datum.getMonth() == Monat - 1 && Jahr < 9999) {
                        if (Tag < 10 || Monat < 10 || Jahr.length < 4) {
                            if (Tag.length < 2) Tag = "0" + Tag;
                            if (Monat.length < 2) Monat = "0" + Monat;
                            if (Jahr < 1000) {
                                if (Jahr.length == 0) {
                                    T_Jahr = new Date();
                                    Jahr = T_Jahr.getYear();
                                }
                                else {
                                    if (Jahr.length == 1) {
                                        Jahr = "200" + Jahr;
                                    }
                                    else {
                                        if (Jahr.length == 2) {
                                            Jahr = "20" + Jahr;
                                        }
                                        else {
                                            Jahr = "2" + Jahr;
                                        }
                                    }
                                }
                            }
                        }
                        Fehler = false;
                    }
                }
            }
        }
        if (Fehler) {
            document.getElementById(sender.controltovalidate).className = "FieldValidationError";
            document.getElementById(ObjName + '_Month').className = "FieldValidationError";
            document.getElementById(ObjName + '_Year').className = "FieldValidationError";
            e.IsValid = false;
        }
        else {
            document.getElementById(sender.controltovalidate).className = "FieldValidationOk";
            document.getElementById(ObjName + '_Month').className = "FieldValidationOk";
            document.getElementById(ObjName + '_Year').className = "FieldValidationOk";
            e.IsValid = true;
        }
    }
}

var ValidateWert = 0;
var ValidateSumm = "";
var ValidateSummEMail = "";
var CName = "";

function HinweisEinAus() {
    tables = document.getElementsByTagName("div");
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf("HinweisMsg") > -1) {
            ValidateWert = 0;
            TBs = document.getElementsByTagName("input");
            for (var k = 0; k < TBs.length; k++) {
                if (TBs[k].id.indexOf("k_sne80") > -1 || TBs[k].id.indexOf("k_tel") > -1 || TBs[k].id.indexOf("k_land") > -1 || TBs[k].id.indexOf("k_ort") > -1 || TBs[k].id.indexOf("k_plz") > -1 || TBs[k].id.indexOf("k_strasse") > -1 || TBs[k].id.indexOf("k_firma") > -1 || TBs[k].id.indexOf("k_name") > -1) {
                    if (document.getElementById(TBs[k].id).className == "FieldValidationError") {
                        ValidateWert = ValidateWert + 1;
                    }
                }
            }
            if (ValidateWert > 0) {
                ValidateSumm = "Bitte f&uuml;llen Sie noch das/die rot markierten Felder aus.";
            }
            else {
                ValidateSumm = "";
            }
            document.getElementById(tables[i].id).innerHTML = ValidateSumm;
            if (ValidateSumm != "") {
                document.getElementById(tables[i].id).style.display = 'block';
            }
            else {
                document.getElementById(tables[i].id).style.display = 'none';
            }
        }
    }
}

function HinweisEMailEinAus(wert) {
    tables = document.getElementsByTagName("div");
    for (var i = 0; i < tables.length; i++) {
        if (tables[i].id.indexOf("HinweisEmail") > -1) {
            if (wert == true) {
                ValidateSummEMail = "Bitte geben Sie eine g&uuml;ltige E-Mail Adresse ein.";
            }
            else {
                ValidateSummEMail = "";
            }
            document.getElementById(tables[i].id).innerHTML = ValidateSummEMail;
            if (ValidateSummEMail != "") {
                document.getElementById(tables[i].id).style.display = 'block';
            }
            else {
                document.getElementById(tables[i].id).style.display = 'none';
            }
        }
    }
}

function IsEMail(sender, e) {

    // Überprüfen ob die EMail Adresse richtig eingegeben wurde (ist kein Pflichfeld)

    // Prüfen ob ein Zeichen vor dem @ Zeichen ist und es kein Leerzeichen ist
    // Prüfen ob zwischen dem @ Zeichen und dem . ein Zeichen ist und kein Leerzeichen ist
    // Prüfen ob nach dem . ein Zeichen kommt und es kein Leerzeichen ist

    var Error; 	    															// Ist 1 wenn ein Fehler gefunden wurde
    var EMail; 																	// Variable für Inhalt aus Textbox
    var PosStr; 																	// Variabel zur speicherung der Position des gesuchten Zeichens

    Error = 0; 																	// ist 0 solange keine Fehler gefunden wurden

    EMail = e.Value.toLowerCase();    // Text aus Textbox holen und in Variable speichern
    EMail = EMail.Trim();                                                       // Leerzeichen links und rechts vom String werden entfernt. Prüfung an dieser Stelle um einen Fehler zu erzwingen.
    PosStr = EMail.indexOf('@'); 											// Position des gesuchten Zeichen

    if (PosStr <= 0)																// Wurde das Zeichen nicht gefunden enthält PosStr den Wert -1
    {
        Error = 1; 															// Variable Error wird 1 zugewiesen -> Ein Fehler wurde gefunden
    }
    else {
        EMail = EMail.substr(PosStr + 1); 										// Der Wert wird bis zut ermittelten Position abgeschnitten
        EMail = EMail.Trim();                                                   // Leerzeichen links und rechts vom String werden entfernt. Prüfung an dieser Stelle um einen Fehler zu erzwingen.
        PosStr = EMail.indexOf('.'); 										// Reststring wird auf einen . durchsucht

        if (PosStr <= 0)															// Wurde das Zeichen nicht gefunden enthält PosStr den Wert -1
        {
            Error = 1; 														// Variable Error wird 1 zugewiesen -> Ein Fehler wurde gefunden
        }
        else {
            EMail = EMail.substr(PosStr);
            if (EMail.length <= 1) {
                Error = 1;
            }
        }
    }
    if (Error == 1)																// wurde ein Fehler gefunden, ist Error mit dem Wert 1 belget 
    {
        if (document.getElementById) {
            document.getElementById(sender.controltovalidate).className = "FieldValidationError";
            HinweisEMailEinAus(true);
            e.IsValid = false;
            return false;
        }
    }
    else {
        document.getElementById(sender.controltovalidate).className = "FieldValidationOk";
        document.getElementById(sender.controltovalidate).value = document.getElementById(sender.controltovalidate).value.toLowerCase();
        HinweisEMailEinAus(false);
        e.IsValid = true;
        return true;
    }
}

function IsEMails(sender, e) {

    // Überprüfen ob die EMail Adresse richtig eingegeben wurde (ist kein Pflichfeld)

    // Prüfen ob ein Zeichen vor dem @ Zeichen ist und es kein Leerzeichen ist
    // Prüfen ob zwischen dem @ Zeichen und dem . ein Zeichen ist und kein Leerzeichen ist
    // Prüfen ob nach dem . ein Zeichen kommt und es kein Leerzeichen ist

    var Error; 	    															// Ist 1 wenn ein Fehler gefunden wurde
    var EMail; 																	// Variable für Inhalt aus Textbox
    var EMails; 																	// Variable für Inhalt aus Textbox
    var PosStr; 																	// Variabel zur speicherung der Position des gesuchten Zeichens

    Error = 0; 																	// ist 0 solange keine Fehler gefunden wurden

    EMails = e.Value.toLowerCase().split(";");    // Text aus Textbox holen und in Variable speichern
    if (EMails.length == 0) Error = 1;
    for (var i = 0; i < EMails.length; i++) {

        EMail = EMails[i].Trim();                                                       // Leerzeichen links und rechts vom String werden entfernt. Prüfung an dieser Stelle um einen Fehler zu erzwingen.
        PosStr = EMail.indexOf('@'); 											// Position des gesuchten Zeichen

        if (PosStr <= 0)																// Wurde das Zeichen nicht gefunden enthält PosStr den Wert -1
        {
            Error = 1; 															// Variable Error wird 1 zugewiesen -> Ein Fehler wurde gefunden
        }
        else {
            EMail = EMail.substr(PosStr + 1); 										// Der Wert wird bis zut ermittelten Position abgeschnitten
            EMail = EMail.Trim();                                                   // Leerzeichen links und rechts vom String werden entfernt. Prüfung an dieser Stelle um einen Fehler zu erzwingen.
            PosStr = EMail.indexOf('.'); 										// Reststring wird auf einen . durchsucht

            if (PosStr <= 0)															// Wurde das Zeichen nicht gefunden enthält PosStr den Wert -1
            {
                Error = 1; 														// Variable Error wird 1 zugewiesen -> Ein Fehler wurde gefunden
            }
            else {
                EMail = EMail.substr(PosStr);
                if (EMail.length <= 1) {
                    Error = 1;
                }
            }
        }
    }

    if (Error == 1)																// wurde ein Fehler gefunden, ist Error mit dem Wert 1 belget 
    {
        if (document.getElementById) {
            document.getElementById(sender.controltovalidate).className = "FieldValidationError";
            HinweisEMailEinAus(true);
            e.IsValid = false;
            return false;
        }
    }
    else {
        document.getElementById(sender.controltovalidate).className = "FieldValidationOk";
        document.getElementById(sender.controltovalidate).value = document.getElementById(sender.controltovalidate).value.toLowerCase();
        HinweisEMailEinAus(false);
        e.IsValid = true;
        return true;
    }
}
/* --- DIV MIT FLASHPOPUP AUSBLENDEN ------------------------------- */
function closeFPU() {
    document.getElementById('FlashPopUp').style.display = 'none';
}

/* --- DIV MIT FLYING FLASH AUSBLENDEN ----------------------------- */
function closeFF() {
    document.getElementById('FLYINGFLASH').style.display = 'none';
}

/* --- DIV MIT FLYING FLASH EINBLENDEN ----------------------------- */
function openFF() {
    document.getElementById('FLYINGFLASH').style.display = 'block';
}
/* --- DIV FÜR FLASHGALLERY  --------------------------------------- */
function openDiv() {
    if (window.innerWidth) {																			// Prüfen, ob Netscape, Mozilla, Opera
        width = window.innerWidth;
        height = window.innerHeight; 															// Breite setzen
    }
    else {																								// oder IE
        width = window.document.body.offsetWidth; 												// Breite setzen
        height = window.document.body.offsetHeight; 												// Breite setzen		
    }
    document.getElementById('FGalleryPU').style.height = height + 'px';
    document.getElementById('FGalleryPU').style.width = width + 'px';
    document.getElementById('flashgalleryPU').style.height = height + 'px';
    document.getElementById('flashgalleryPU').style.width = width + 'px';
}

function closeFGalleryPU() {
    document.getElementById('FGalleryPU').style.height = 1 + 'px';
    document.getElementById('FGalleryPU').style.width = 1 + 'px';
    document.getElementById('flashgalleryPU').style.height = 1 + 'px';
    document.getElementById('flashgalleryPU').style.width = 1 + 'px';
}
/* --- AKTIV SCHALTEN DES FLYING FLASH ----------------------------- */
function enableActiveX(containerID) {
    if (getInternetExplorerVersion() != -1) {
        var container = document.getElementById(containerID);
        var html = container.innerHTML;
        container.innerHTML = html;
    }
}
function getInternetExplorerVersion() {
    var rv = -1;
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null) {
            rv = parseFloat(RegExp.$1);
        }
    }
    return rv;
}

var timeo = null;
var timerMainPic = null;
var timerNavLevel1 = null;
var timerNavLevel1Pic = null;
var timerNavLevel2 = null;
var MainID = null;
var MainPicID = null;
var LVL1ID = null;
var LVL1PicID = null;

function ShowHideWellcome(id, sh) {
    if (sh == "1") {
        if (document.getElementById(id) != null) document.getElementById(id).style.display = 'block';
    }
    else {
        if (document.getElementById(id) != null) document.getElementById(id).style.display = 'none';
    }
}

function HideMenuElement(id) {
    if (document.getElementById(id) != null) document.getElementById(id).style.display = 'none';
}

function HideMenuImages(id, idTwo) {
    if (document.getElementById(id) != null) document.getElementById(id).style.display = '';
    if (document.getElementById(idTwo) != null) document.getElementById(idTwo).style.display = 'none';
}

function ShowMenuImages(id, idTwo) {
    if (document.getElementById(id) != null) document.getElementById(id).style.display = 'none';
    if (document.getElementById(idTwo) != null) document.getElementById(idTwo).style.display = '';
}
var iterationCount = 25;
function CloseAllMainNav(MainNr) {
    var imgId = '';
    var imgOverId = '';
    var id = '';
    var id2 = '';
    var idSp = '';
    var i = MainNr;
    imgId = 'mnav' + i;
    imgOverId = 'mnav' + i + 'o';
    id = 'ddlvl1_' + i;
    idSp = 'spacer_' + i;
    if (document.getElementById(imgId) != null) HideMenuImages(imgId, imgOverId);
    for (j = 0; j < iterationCount; j++) {
        imgId = 'ImgLVL1_' + i + '_' + j;
        imgOverId = 'ImgLVL1o_' + i + '_' + j;
        if (document.getElementById(imgId) != null) HideMenuImages(imgId, imgOverId);
        if (document.getElementById(idSp) != null) HideMenuElement(idSp);
        id2 = 'ddlvl2_' + i + '_' + j;
        for (k = 0; k < iterationCount; k++) {
            imgId = 'ImgLVL2_' + i + '_' + j + '_' + k;
            imgOverId = 'ImgLVL2o_' + i + '_' + j + '_' + k;
            if (document.getElementById(imgId) != null) HideMenuImages(imgId, imgOverId);
        }
        if (document.getElementById(id2) != null) document.getElementById(id2).style.display = 'none';
    }
    if (document.getElementById(id) != null) document.getElementById(id).style.display = 'none';
}

function CloseAllLVL1Nav(MainNr) {
    var imgId = '';
    var imgOverId = '';
    var id = '';
    for (i = 0; i < iterationCount; i++) {
        imgId = 'ImgLVL1_' + MainNr + '_' + i;
        imgOverId = 'ImgLVL1o_' + MainNr + '_' + i;
        id = 'ddlvl2_' + MainNr + '_' + i;
        if (document.getElementById(imgId) != null) HideMenuImages(imgId, imgOverId);
        if (document.getElementById(id) != null) document.getElementById(id).style.display = 'none';
    }
}

function MainOver(MainNr) {
    window.clearTimeout(timeo);
    CloseAllMainNav(MainID);
    var imgId = 'mnav' + MainNr;
    var imgOverId = 'mnav' + MainNr + 'o';
    ShowMenuImages(imgId, imgOverId);
    var id = 'ddlvl1_' + MainNr;
    var idSp = 'spacer_' + MainNr;
    MainID = MainNr;
    if (document.getElementById(id) != null) {
      //  alert(id+' id');
        document.getElementById(id).style.display = '';
        
    }
    if (document.getElementById(idSp) != null) document.getElementById(idSp).style.display = '';
}

function MainOut(MainNr) {
    
    var id = 'ddlvl1_' + MainNr;
    var imgId = 'mnav' + MainNr;
    var imgOverId = 'mnav' + MainNr + 'o';
    MainID = MainNr;
    timeo = window.setTimeout("CloseAllMainNav(" + MainNr + ")", 1000);
}

function NavLVL1Over(MainNr, LVL1Nr) {    
    window.clearTimeout(timeo);
    CloseAllLVL1Nav(MainNr);
    var imgId = 'ImgLVL1_' + MainNr + '_' + LVL1Nr;
    var imgOverId = 'ImgLVL1o_' + MainNr + '_' + LVL1Nr;
    ShowMenuImages(imgId, imgOverId);
    var id = 'ddlvl2_' + MainNr + '_' + LVL1Nr;
    if (document.getElementById(id) != null) document.getElementById(id).style.display = '';
    }

    function NavLVL2Over(MainNr, LVL1Nr, LVL2Nr) {

        window.clearTimeout(timeo);
    }

    function NavLVL2Out(MainNr, LVL1Nr) {

        timeo = window.setTimeout("CloseAllMainNav(" + MainNr + ")", 1000);

    }


    function NavLVL1Out(MainNr, LVL1Nr) {

        timeo = window.setTimeout("CloseAllMainNav(" + MainNr + ")", 1000);

    }

    function StopAllTimers() {
        window.clearTimeout(timeo);
    }

function SelectAllCBs() {
                var checkedVar = false;
                cbs = document.getElementsByTagName("input");
                for (var i = 0; i < cbs.length; i++) {
                if (cbs[i].id.indexOf("AllCheck") > -1) {
                checkedVar = document.getElementById(cbs[i].id).checked;
                }
                }
                for (var i = 0; i < cbs.length; i++) {
                if (cbs[i].id.indexOf("CheckBoxD") > -1) {
                document.getElementById(cbs[i].id).checked = checkedVar;
                }
                }
                for (var i = 0; i < cbs.length; i++) {
                if (cbs[i].id.indexOf("CheckBoxDI") > -1) {
                document.getElementById(cbs[i].id).checked = checkedVar;
                }
                }
                }

function nodeToXML2(node, indentation, out) {
    out += indentation + "<" + node.nodeName.toLowerCase();
    if (node.attributes != null) {
        for (var i = 0; i < node.attributes.length; i++) {
            var item = node.attributes.item(i);
            var value = item.nodeValue;
            if (value == null) value = "";
            if (value != "") out += " " + item.nodeName + "=\"" + value + "\"";
        }
    }
    out += ">\n";
    for (var i = 0; i < node.childNodes.length; i++) {
        var item = node.childNodes.item(i);
        out = nodeToXML2(item, indentation + "   ", out);
    }
    if (node.nodeValue != null)
        out += indentation + "   " + node.nodeValue + "\n";
    out += indentation + "</" + node.nodeName.toLowerCase() + ">\n";

    out = out.replace('<#document>', '');
    out = out.replace('</#document>', '');
    out = out.replace('<#text>', '');
    out = out.replace('</#text>', '');
    out = out.replace('<#comment>', '');
    out = out.replace('</#comment>', '');
    return out;
}

function nix() {

}
    function showM(org, lan, thishref, adr, printtext, wdh, hgh) {
                var browser = "mo";
                var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
                if (isIE == 1) browser = "ie";
                var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;

                var s = document.body.innerHTML;
                var hfval = s.substring(s.indexOf("<!--[rurl]") + 10 , s.indexOf("[/rurl]-->")).replace('Default.aspx','DruckDefault.aspx');
                s = s.substring(s.indexOf("<!--Start_Print_Area-->"), s.indexOf("<!--END_Print_Area-->"));
                s = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" +
                "<html xmlns=\"http://www.w3.org/1999/xhtml\" >" +
                "<head id=\"ctl00_ctl00_Head1\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><meta name=\"robots\" content=\"noindex, follow\" />" +
                "<title>Print site.</title>" +
                "<link href=\"/css/" + org + "/raster.css\" rel=\"stylesheet\" type=\"text/css\" />" +
                "<link href=\"/css/" + org + "/navigation.css\" rel=\"stylesheet\" type=\"text/css\" />" +
                "<link href=\"/css/" + org + "/content.css\" rel=\"stylesheet\" type=\"text/css\" />" +
                "<link href=\"/css/" + org + "/raster_" + browser + ".css\" rel=\"stylesheet\" type=\"text/css\" />" +
                "</head>" +
                "<body id=\"PRINTBODY\" onload=\"resizeDiv(); alert(window.location.href); if (window.name != 'neugeladen'){window.name = 'neugeladen';window.location.href=" + hfval + ";}\">" +
               // "<body id=\"PRINTBODY\" onload=\"resizeDiv(); if (window.name != 'neugeladen'){window.name = 'neugeladen';window.location.reload();}\">" +
                "    <form name=\"aspnetForm\" method=\"post\" id=\"aspnetForm\">" +
                "<script src=\"/Scripts2/GeneralScript.js\" type=\"text/javascript\" ></script>" +
                "<script src=\"/Scripts2/" + org + "/AC_RunActiveContent.js\" type=\"text/javascript\" ></script>" +
                "<script src=\"/Scripts2/" + org + "/ufo.js\" type=\"text/javascript\" ></script>" +
                "<script src=\"/Scripts2/" + org + "/Script.js\" type=\"text/javascript\" ></script>" +
                "<script src=\"/Scripts2/" + org + "/CalendarJSEn.js\" type=\"text/javascript\" ></script>" +
                "<div id=\"PRINT\">" +
                "<table cellpadding=\"0\" cellspacing=\"0\" id=\"PRINTHEADER\">" +
                "   <tr>" +
                "       <td class=\"adr\">" + adr + "</td>" +
                "       <td class=\"log\"><a href=\"/Default.aspx?navid=0&oid=" + org + "&lid=" + lan + "\"><img src=\"/images2/" + org + "/allg/logo.gif\" alt=\"\" /></a></td>" +
                "   </tr>" +
                "   <tr>" +
                "       <td colspan=\"2\" class=\"links\"><a href=\"#\" onclick=\"javascript: window.print();\" >" + printtext + "</a></td>" +
                "   </tr>" +
                "</table>" +
                "<table cellpadding=\"0\" cellspacing=\"0\" id=\"MiddlePrint\"><tr>" + s;
                s += " </tr></table></div></form></body></html>";
                var w = window.open('', 'Druckfenster', 'width=' + wdh + ',height=' + hgh + ',left=100,top=200,scrollbars=yes');
                w.document.open();
                w.document.write(s);
                w.document.close();
                return false;
                }


function showM2(org, lan, thishref) {
    var s = document.body.innerHTML;
    s = s.substring(s.indexOf("<!--Start_Print_Area-->"), s.indexOf("<!--END_Print_Area-->"));
    MeinFenster = window.open(thishref, 'Druckfenster', 'width=540,height=600,left=100,top=200,scrollbars=yes');
    if (MeinFenster.document.readyState == 4) {
        MeinFenster.document.open();
        MeinFenster.document.close();
        MeinFenster.document.open();
        alert(MeinFenster.document.body.innerHTML);
        MeinFenster.document.write(MeinFenster.document.body.innerHTML);
        MeinFenster.focus();
    }
    return false;
}

function showM3(org, lan, thishref) {
                var s = document.body.innerHTML;
                s = s.substring(s.indexOf("<!--Start_Print_Area-->"), s.indexOf("<!--END_Print_Area-->"));
                s = "<body id=\"PRINTBODY\" onload=\"resizeDiv(); if (window.name != 'neugeladen'){window.name = 'neugeladen';window.location.reload();}\">" +
                "    <form name=\"aspnetForm\" method=\"post\" id=\"aspnetForm\">" +
                "<script src=\"/Scripts2/GeneralScript.js\" type=\"text/javascript\" ></script>" +
                "<script src=\"/Scripts2/" + org + "/AC_RunActiveContent.js\" type=\"text/javascript\" ></script>" +
                "<script src=\"/Scripts2/" + org + "/ufo.js\" type=\"text/javascript\" ></script>" +
                "<script src=\"/Scripts2/" + org + "/Script.js\" type=\"text/javascript\" ></script>" +
                "<script src=\"/Scripts2/" + org + "/CalendarJSEn.js\" type=\"text/javascript\" ></script>" +
                "<div id=\"PRINT\">" +
                "<table cellpadding=\"0\" cellspacing=\"0\" id=\"PRINTHEADER\">" +
                "   <tr>" +
                "       <td class=\"adr\">KaVo Adresse</td>" +
                "       <td class=\"log\"><a href=\"/Default.aspx?navid=0&oid=" + org + "&lid=" + lan + "\"><img src=\"/images2/" + org + "/allg/logo.gif\" alt=\"\" /></a></td>" +
                "   </tr>" +
                "   <tr>" +
                "       <td colspan=\"2\" class=\"links\"><a href=\"#\" onclick=\"javascript: window.print();\" >Seite drucken</a></td>" +
                "   </tr>" +
                "</table>" +
                "<table cellpadding=\"0\" cellspacing=\"0\" id=\"MiddlePrint\"><tr>" + s;
                s += " </tr></table></div></form></body>";
                MeinFenster = window.open(thishref, 'Druckfenster', 'width=540,height=600,left=100,top=200,scrollbars=yes');
                MeinFenster.document.body.innerHTML = s;
                return false;
                }


function GetVideo() {
                for (i = 0; i < 10; i++) {
                if (document.getElementById('PP' + i)) {
                var parsestr = document.getElementById('PP' + i).innerHTML;
                var movie = parsestr.substr(parsestr.indexOf("movie:'") + 7, parsestr.indexOf("',width:") - (parsestr.indexOf("movie:'") + 7));
                var width = parsestr.substr(parsestr.indexOf("width:'") + 7, parsestr.indexOf("',height:") - (parsestr.indexOf("width:'") + 7));
                var height = parsestr.substr(parsestr.indexOf("height:'") + 8, parsestr.indexOf("',majorversion:") - (parsestr.indexOf("height:'") + 8));
                var majorversion = parsestr.substr(parsestr.indexOf("majorversion:'") + 14, parsestr.indexOf("',build:") - (parsestr.indexOf("majorversion:'") + 14));
                var build = parsestr.substr(parsestr.indexOf("build:'") + 7, parsestr.indexOf("',bgcolor:") - (parsestr.indexOf("build:'") + 7));
                var bgcolor = parsestr.substr(parsestr.indexOf("bgcolor:'") + 9, parsestr.indexOf("',allowfullscreen:") - (parsestr.indexOf("bgcolor:'") + 9));
                var allowfullscreen = parsestr.substr(parsestr.indexOf("allowfullscreen:'") + 17, parsestr.indexOf("',flashvars:") - (parsestr.indexOf("allowfullscreen:'") + 17));
                var flashvars1 = parsestr.substr(parsestr.indexOf("flashvars:'") + 11, (parsestr.indexOf("=images2/") - 1) - (parsestr.indexOf("flashvars:'") + 11));
                var flashvars2 = parsestr.substr(parsestr.indexOf("=images2/"), parsestr.lastIndexOf("'") - (parsestr.indexOf("=images2/")));
                var flashvars3 = "";
                var flashvars4 = "";
                if (flashvars2.indexOf("autostart") > -1) {
                flashvars2 = parsestr.substr(parsestr.indexOf("=images2/"), parsestr.lastIndexOf("autostart") - 5 - (parsestr.indexOf("=images2/")));
                flashvars3 = parsestr.substr(parsestr.indexOf("autostart"), parsestr.lastIndexOf("'") - (parsestr.indexOf("autostart")));
                if (flashvars3.indexOf("displayheight") > -1) {
                flashvars3 = parsestr.substr(parsestr.indexOf("autostart"), parsestr.lastIndexOf("displayheight") - 5 - (parsestr.indexOf("autostart")));
                flashvars4 = parsestr.substr(parsestr.indexOf("displayheight"), parsestr.lastIndexOf("'") - (parsestr.indexOf("displayheight")));
                }
                }
                var PP1 = new Object();
                PP1.movie = movie;
                PP1.width = width;
                PP1.height = height;
                PP1.majorversion = majorversion;
                PP1.build = build;
                PP1.bgcolor = bgcolor;
                PP1.allowfullscreen = allowfullscreen;
                var params = flashvars1 + "&image" + flashvars2;
                if (flashvars3 != "") params += "&" + flashvars3;
                if (flashvars4 != "") params += "&" + flashvars4;
                PP1.flashvars = params;
                UFO.create(PP1, "pplayer" + i);
                }
                }

}        
        
                var DShow = null;        
                var dsPos = 0;
                function DoDiaShow(sec) {
                if (document.getElementById('CONTAINER1')) {
                cbs = document.getElementsByTagName("div");
                var cnt = 0;
                for (var i = 0; i < cbs.length; i++) {
                if (cbs[i].id.indexOf("CONTAINER") > -1) {
                cnt++;
                }
                }
                dsPos++;
                if (dsPos == cnt + 1) dsPos = 1;
                opacity("CONTAINER" + dsPos + "", 0, 100, 1000);
                DShow = setTimeout("DoDiaShow(" + sec + "," + cnt + ")", sec);
                }
                }

function GoToContLink() {
                var alteId = '';
                for (k = 1; k <= 15; k++) {
                if (document.getElementById('CONTAINER' + k)) {
                var obj = document.getElementById('CONTAINER' + k);
                if (obj.style.zIndex == 10) {
                alteId = obj.id;
                }
                }
                }
                if (alteId != '') {
                var IdNr = alteId.replace(/CONTAINER/, "");

        if (document.getElementById('CONTLINK' + IdNr)) {
                if (document.getElementById('CONTLINK' + IdNr).innerHTLM != '#') document.getElementById(alteId).onclick();
                }
                }
                }

function stopDS() {
                if (DShow != null) clearTimeout(DShow);
                }


function opacity(id, opacStart, opacEnd, millisec) {
                var speed = Math.round(millisec / 100);
                var timer = 0;
                var alteId = 'CONTAINER1';
                for (k = 1; k <= 15; k++) {
                if (document.getElementById('CONTAINER' + k)) {
                var obj = document.getElementById('CONTAINER' + k);
                if (obj.style.zIndex == 10) {
                alteId = obj.id;
                }
                }
                }
                if (id != alteId) {
                var object = document.getElementById(id).style;
                var IdNr = id.replace(/CONTAINER/, "");
                for (k = 1; k <= 15; k++) {
                if (document.getElementById('CONTAINER' + k)) {
                var obj = document.getElementById('CONTAINER' + k);
                if (obj.style.zIndex == 10) {
                obj.style.zIndex = 5;
                }
                else {
                obj.style.zIndex = 0;
                }
                }
                if (document.getElementById('CPG' + k)) {
                var cpg = document.getElementById('CPG' + k);
                cpg.className = "";
                }

            if (document.getElementById('title' + k)) {
                var cpg = document.getElementById('title' + k);
                cpg.className = "Tinactive";
                }

            if (document.getElementById('BtnTblCSp' + k)) {
                var cpg = document.getElementById('BtnTblCSp' + k);
                cpg.className = "containerThumb";
                }
                }
                if (document.getElementById('CPG' + IdNr)) document.getElementById('CPG' + IdNr).className = "active";
                if (document.getElementById('BtnTblCSp' + IdNr)) document.getElementById('BtnTblCSp' + IdNr).className = "containerThumbAct";
                if (document.getElementById('title' + IdNr)) document.getElementById('title' + IdNr).className = "Tactive";
                object.opacity = 0;
                object.MozOpacity = 0;
                object.KhtmlOpacity = 0;
                object.filter = "alpha(opacity=0)";
                object.zIndex = 10;
                if (opacStart > opacEnd) {
                for (i = opacStart; i >= opacEnd; i--) {
                setTimeout("changeOpac(" + i + ",'" + id + "')", (timer * speed));
                timer++;
                }
                } else if (opacStart < opacEnd) {
                for (i = opacStart; i <= opacEnd; i++) {
                setTimeout("changeOpac(" + i + ",'" + id + "')", (timer * speed));
                timer++;
                }
                }
                }
                }

function changeOpac(opacity, id) {
                var object = document.getElementById(id).style;
                object.opacity = (opacity / 100);
                object.MozOpacity = (opacity / 100);
                object.KhtmlOpacity = (opacity / 100);
                object.filter = "alpha(opacity=" + opacity + ")";
                }

function cntActive(name) {
                name.className = "containerThumbAct"
                }

function cntInactive(name) {
                name.className = "containerThumb"
                }
                // ersetzt getElementById
                function get(ID) {
                return document.getElementById(ID);
                }
                // macht ein Tag-Element sichtbar ueber display (darf nicht ueber eine Styledatei gesetzt sein
                function showDiv( ID ) {
                if( Div = get( ID ) ) {
                Div.style.display	=	"";
                }
                }
                // macht ein Tag-Element unsichtbar ueber display (darf nicht ueber eine Styledatei gesetzt sein
                function hideDiv( ID ) {
                if( Div = get( ID ) ) {
                Div.style.display	=	"none";
                }
                }
                function changeDiv( ID ) {
                if( Div = get( ID ) ) {
                if( Div.style.display == "none" ) {
                showDiv( ID );
                if( get('plusbild') ) {
                get('plusbild').style.display	=	"none";
                }
                if( get('minusbild') ) {
                get('minusbild').style.display	=	"";
                }
                }
                else {
                hideDiv( ID );
                if( get('plusbild') ) {
                get('plusbild').style.display	=	"";
                }
                if( get('minusbild') ) {
                get('minusbild').style.display	=	"none";
                }
                }
                }
                }
                // Suchformular Studien und Abstracts - Produktgruppe wird ausgewaehlt, Produkte werden eingelesen
                function checkProductChoice( ID, ID2 ) {
                if( SF = get( ID ) ) {
                if( Produkt = Produkte[ SF.options[ SF.selectedIndex ].value ] ) {
                if( SF2 = get( ID2 ) ) {
                while( SF2.options.length > 0 ) {
                SF2.options[ SF2.options.length - 1 ] = null;
                }
                for( i=0; i<Produkt.length; i++ ) {
                NeuerEintrag	=	new	Option( Produkt[ i ][ 1 ], Produkt[ i ][ 0 ] );
                SF2.options[ i ]	=	NeuerEintrag;
                }
                }
                }
                }
                }
                SubmitClientID	=	"";
                function setSubmitClientID( ID ) {
                SubmitClientID	=	ID;
                }

function submitEnter( Ereignis ) {
                if( !Ereignis ) {
                Ereignis	=	window.event;
                }
                if( Ereignis.keyCode == 13 ) {
                if( Button = get( SubmitClientID ) ) {
                Button.click();
                }
                return	false;
                }
                }

TICKER_RIGHTTOLEFT = false;
                TICKER_SPEED = 2;
                TICKER_PAUSED = false;

function ticker_start(idnr) {
                var tickerSupported = false;
                TICKER_CONTENT = document.getElementById("TICKER" + idnr).innerHTML;
                TICKER_WIDTH = document.getElementById("TICKER" + idnr).style.width;
                var img = "<img src='images2/002/allg/spacer.gif' width=" + TICKER_WIDTH + " height=0>";

    // Firefox
                if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Safari") != -1) {
                document.getElementById("TICKER" + idnr).innerHTML = "<TABLE  cellspacing='0' cellpadding='0' style='width:100%;'><TR><TD nowrap='nowrap'>" + img + "<SPAN ID='TICKER_BODY" + idnr + "' style='width:100%;'>&nbsp;</SPAN>" + img + "</TD></TR></TABLE>";
                tickerSupported = true;
                }
                // IE
                if (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Opera") == -1) {
                document.getElementById("TICKER" + idnr).innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>" + img + "<SPAN ID='TICKER_BODY" + idnr + "' style='width:100%;'></SPAN>" + img + "</DIV>";
                tickerSupported = true;
                }
                if (!tickerSupported) document.getElementById("TICKER" + idnr).outerHTML = ""; else {
                document.getElementById("TICKER" + idnr).scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER" + idnr).scrollWidth - document.getElementById("TICKER" + idnr).offsetWidth : 0;
                document.getElementById("TICKER_BODY" + idnr).innerHTML = TICKER_CONTENT;
                document.getElementById("TICKER" + idnr).style.display = "block";
                TICKER_tick(idnr);
                }
                }

function TICKER_tick(idnr) {
                if (!TICKER_PAUSED) document.getElementById("TICKER" + idnr).scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
                /*if(TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0) document.getElementById("TICKER").scrollLeft = document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth;*/
    if (!TICKER_RIGHTTOLEFT && document.getElementById("TICKER" + idnr).scrollLeft >= document.getElementById("TICKER" + idnr).scrollWidth - document.getElementById("TICKER" + idnr).offsetWidth) document.getElementById("TICKER" + idnr).scrollLeft = 0;
    window.setTimeout("TICKER_tick('" + idnr + "')", 30);
}


function DeleteRADivs(Nr, HFid) {
    switch (Nr) {
        case 1:
            get('Instrument_1').style.display = "none";
            get('DelInstr_1').style.display = "none";
            break;
        case 2:
            get('Instrument_2').style.display = "none";
            get('DelInstr_2').style.display = "none";
            get('AddInstr_2').style.display = "none";
            get(HFid).value = get(HFid).value.replace(',2,', '');
            break;
        case 3:
            get('Instrument_3').style.display = "none";
            get('DelInstr_3').style.display = "none";
            get('AddInstr_3').style.display = "none";
            get(HFid).value = get(HFid).value.replace(',3,', '');
            break;
        case 4:
            get('Instrument_4').style.display = "none";
            get('DelInstr_4').style.display = "none";
            get('AddInstr_4').style.display = "none";
            get(HFid).value = get(HFid).value.replace(',4,', '');
            break;
        case 5:
            get('Instrument_5').style.display = "none";
            get('DelInstr_5').style.display = "none";
            get(HFid).value = get(HFid).value.replace(',5,', '');
            break;

    }
    j = Nr + 1;
    for (i = j; i < 6; i++) {
        if (get('Instrument_' + i).style.display == "block") {
            CopyRAFields(i, Nr);
            get(HFid).value = get(HFid).value.replace(',' + i + ',', '');
            get('Instrument_' + i).style.display = "none";
            get('DelInstr_' + i).style.display = "none";
            if (i < 5) get('AddInstr_' + i).style.display = "none";
            get(HFid).value = get(HFid).value + ',' + Nr + ',';
            get('Instrument_' + Nr).style.display = "block";
            get('DelInstr_' + Nr).style.display = "block";
            Nr++;
        }
    }
    OpenRADivs(HFid);
}

function ShowHideRADivs(Nr, HFid) {
    switch (Nr) {
        case "1":
            get('Instrument_2').style.display = "block";
            get('AddInstr_2').style.display = "block";
            get('AddInstr_1').style.display = "none";
            get('DelInstr_2').style.display = "block";
            get(HFid).value = get(HFid).value + ',2,';
            ClearRAFields('2');
            get('DelInstr_1').style.display = "block";
            break;
        case "2":
            get('Instrument_3').style.display = "block";
            get('AddInstr_3').style.display = "block";
            get('AddInstr_2').style.display = "none";
            get('DelInstr_3').style.display = "block";
            get(HFid).value = get(HFid).value + ',3,';
            ClearRAFields('3');
            get('DelInstr_1').style.display = "block";
            break;
        case "3":
            get('Instrument_4').style.display = "block";
            get('AddInstr_4').style.display = "block";
            get('AddInstr_3').style.display = "none";
            get('DelInstr_4').style.display = "block";
            get(HFid).value = get(HFid).value + ',4,';
            ClearRAFields('4');
            get('DelInstr_1').style.display = "block";
            break;
        case "4":
            get('Instrument_5').style.display = "block";
            get('AddInstr_4').style.display = "none";
            get('DelInstr_5').style.display = "block";
            get(HFid).value = get(HFid).value + ',5,';
            ClearRAFields('5');
            get('DelInstr_1').style.display = "block";
            break;
    }
}

function ClearRAFields(Nr) {
    cbs = document.getElementsByTagName("input");
    for (var i = 0; i < cbs.length; i++) {
        if (cbs[i].id.indexOf("_Bez" + Nr) > -1 || cbs[i].id.indexOf("_SN" + Nr) > -1 || (cbs[i].id.indexOf("_BW_" + Nr) > -1 && cbs[i].id.indexOf("RB_BW_" + Nr) == -1)) {
            document.getElementById(cbs[i].id).value = '';
        }

        if (cbs[i].id.indexOf("_RB_SR_" + Nr) > -1) {
            document.getElementById(cbs[i].id).checked = true;
        }
    }

    cbs = document.getElementsByTagName("textarea");
    for (var i = 0; i < cbs.length; i++) {
        if (cbs[i].id.indexOf("_FB_" + Nr) > -1) {
            document.getElementById(cbs[i].id).value = '';
        }
    }
}

function CopyRAFields(SrcNr, TargetNr) {
    Bez = '';
    SN = '';
    BW = '';
    RB_SR = true;
    RB_BW = false;
    RB_KV = false;
    FB = '';
    cbs = document.getElementsByTagName("input");
    for (var i = 0; i < cbs.length; i++) {
        if (cbs[i].id.indexOf("_Bez" + SrcNr) > -1) {
            Bez = document.getElementById(cbs[i].id).value;
        }
        if (cbs[i].id.indexOf("_SN" + SrcNr) > -1) {
            SN = document.getElementById(cbs[i].id).value;
        }
        if ((cbs[i].id.indexOf("_BW_" + SrcNr) > -1 && cbs[i].id.indexOf("RB_BW_" + SrcNr) == -1)) {
            BW = document.getElementById(cbs[i].id).value;
        }
        if (cbs[i].id.indexOf("_RB_SR_" + SrcNr) > -1) {
            RB_SR = document.getElementById(cbs[i].id).checked;
        }
        if (cbs[i].id.indexOf("_RB_BW_" + SrcNr) > -1) {
            RB_BW = document.getElementById(cbs[i].id).checked;
        }
        if (cbs[i].id.indexOf("_RB_KV_" + SrcNr) > -1) {
            RB_KV = document.getElementById(cbs[i].id).checked;
        }
    }
    for (var i = 0; i < cbs.length; i++) {
        if (cbs[i].id.indexOf("_Bez" + TargetNr) > -1) {
            document.getElementById(cbs[i].id).value = Bez;
        }
        if (cbs[i].id.indexOf("_SN" + TargetNr) > -1) {
            document.getElementById(cbs[i].id).value = SN;
        }
        if ((cbs[i].id.indexOf("_BW_" + TargetNr) > -1 && cbs[i].id.indexOf("RB_BW_" + TargetNr) == -1)) {
            document.getElementById(cbs[i].id).value = BW;
        }
        if (cbs[i].id.indexOf("_RB_SR_" + TargetNr) > -1) {
            document.getElementById(cbs[i].id).checked = RB_SR;
        }
        if (cbs[i].id.indexOf("_RB_BW_" + TargetNr) > -1) {
            document.getElementById(cbs[i].id).checked = RB_BW;
        }
        if (cbs[i].id.indexOf("_RB_KV_" + TargetNr) > -1) {
            document.getElementById(cbs[i].id).checked = RB_KV;
        }
    }
    cbs = document.getElementsByTagName("textarea");
    for (var i = 0; i < cbs.length; i++) {
        if (cbs[i].id.indexOf("_FB_" + SrcNr) > -1) {
            FB = document.getElementById(cbs[i].id).value;
        }
    }
    for (var i = 0; i < cbs.length; i++) {
        if (cbs[i].id.indexOf("_FB_" + TargetNr) > -1) {
            document.getElementById(cbs[i].id).value = FB;
        }
    }
}

function OpenRADivs(HFid) {
    if (get(HFid)) {
        var hv = get(HFid).value;
        k = 0;
        m = 0;
        h = 0;
        for (i = 5; i > 1; i--) {
            if (hv.indexOf('' + i + '') > -1) {
                get('Instrument_' + i).style.display = "block";
                h = 1;
            }
        }
        if (h == 1) {
            get('DelInstr_1').style.display = "block";
        }
        else {
            get('DelInstr_1').style.display = "none";
        }
        get('AddInstr_1').style.display = "none";
        for (i = 5; i > 0; i--) {
            if (hv.indexOf('' + i + '') > -1 || i == 1) {
                get('Instrument_' + i).style.display = "block";
                if (i == 5) k = 1;
                if (k == 0) {
                    get('AddInstr_' + i).style.display = "block";
                    k = 1;
                }
                if (m == 0 && i != 1) {
                    get('DelInstr_' + i).style.display = "block";
                }
            }
        }
    }
}

//------------ FLASH DETECTION ---------------------------------
// Flash Player Version Detection - Rev 1.6
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion() {
    var version;
    var axo;
    var e;
    // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
    try {
        // version will be set for 7.X or greater players
        axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
        version = axo.GetVariable("$version");
    } catch (e) {
    }
    if (!version) {
        try {
            // version will be set for 6.X players only
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
            // installed player is some revision of 6.0
            // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
            // so we have to be careful. 
            // default to the first public version
            version = "WIN 6,0,21,0";
            // throws if AllowScripAccess does not exist (introduced in 6.0r47)		
            axo.AllowScriptAccess = "always";
            // safe to call for 6.0r47 or greater
            version = axo.GetVariable("$version");

        } catch (e) {
        }
    }
    if (!version) {
        try {
            // version will be set for 4.X or 5.X player
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
            version = axo.GetVariable("$version");
        } catch (e) {
        }
    }
    if (!version) {
        try {
            // version will be set for 3.X player
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
            version = "WIN 3,0,18,0";
        } catch (e) {
        }
    }
    if (!version) {
        try {
            // version will be set for 2.X player
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
            version = "WIN 2,0,0,11";
        } catch (e) {
            version = -1;
        }
    }
    return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer() {
    // NS/Opera version >= 3 check for Flash plugin in plugin array
    var flashVer = -1;

    if (navigator.plugins != null && navigator.plugins.length > 0) {
        if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
            var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
            var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
            var descArray = flashDescription.split(" ");
            var tempArrayMajor = descArray[2].split(".");
            var versionMajor = tempArrayMajor[0];
            var versionMinor = tempArrayMajor[1];
            var versionRevision = descArray[3];
            if (versionRevision == "") {
                versionRevision = descArray[4];
            }
            if (versionRevision[0] == "d") {
                versionRevision = versionRevision.substring(1);
            } else if (versionRevision[0] == "r") {
                versionRevision = versionRevision.substring(1);
                if (versionRevision.indexOf("d") > 0) {
                    versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
                }
            }
            var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
            //alert("flashVer="+flashVer);
        }
    }
    // MSN/WebTV 2.6 supports Flash 4
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
    // WebTV 2.5 supports Flash 3
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
    // older WebTV supports Flash 2
    else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
    else if (isIE && isWin && !isOpera) {
        flashVer = ControlVersion();
    }
    return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) {
    versionStr = GetSwfVer();
    if (versionStr == -1) {
        return false;
    } else if (versionStr != 0) {
        if (isIE && isWin && !isOpera) {
            // Given "WIN 2,0,0,11"
            tempArray = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
            tempString = tempArray[1]; 		// "2,0,0,11"
            versionArray = tempString.split(","); // ['2', '0', '0', '11']
        } else {
            versionArray = versionStr.split(".");
        }
        var versionMajor = versionArray[0];
        var versionMinor = versionArray[1];
        var versionRevision = versionArray[2];

        // is the major.revision >= requested major.revision AND the minor version >= requested minor
        if (versionMajor > parseFloat(reqMajorVer)) {
            return true;
        } else if (versionMajor == parseFloat(reqMajorVer)) {
            if (versionMinor > parseFloat(reqMinorVer))
                return true;
            else if (versionMinor == parseFloat(reqMinorVer)) {
                if (versionRevision >= parseFloat(reqRevision))
                    return true;
            }
        }
        return false;
    }
}

function AC_AddExtension(src, ext) {
    if (src.indexOf('?') != -1)
        return src.replace(/\?/, ext + '?');
    else
        return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) {
    var str = '';
    if (isIE && isWin && !isOpera) {
        str += '<object ';
        for (var i in objAttrs)
            str += i + '="' + objAttrs[i] + '" ';
        for (var i in params)
            str += '><param name="' + i + '" value="' + params[i] + '" /> ';
        str += '></object>';
    } else {
        str += '<embed ';
        for (var i in embedAttrs)
            str += i + '="' + embedAttrs[i] + '" ';
        str += '> </embed>';
    }
    document.write(str);
}

function AC_FL_RunContent() {
    var ret =
    AC_GetArgs
    (arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
    AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType) {
    var ret = new Object();
    ret.embedAttrs = new Object();
    ret.params = new Object();
    ret.objAttrs = new Object();
    for (var i = 0; i < args.length; i = i + 2) {
        var currArg = args[i].toLowerCase();

        switch (currArg) {
            case "classid":
                break;
            case "pluginspage":
                ret.embedAttrs[args[i]] = args[i + 1];
                break;
            case "src":
            case "movie":
                args[i + 1] = AC_AddExtension(args[i + 1], ext);
                ret.embedAttrs["src"] = args[i + 1];
                ret.params[srcParamName] = args[i + 1];
                break;
            case "onafterupdate":
            case "onbeforeupdate":
            case "onblur":
            case "oncellchange":
            case "onclick":
            case "ondblClick":
            case "ondrag":
            case "ondragend":
            case "ondragenter":
            case "ondragleave":
            case "ondragover":
            case "ondrop":
            case "onfinish":
            case "onfocus":
            case "onhelp":
            case "onmousedown":
            case "onmouseup":
            case "onmouseover":
            case "onmousemove":
            case "onmouseout":
            case "onkeypress":
            case "onkeydown":
            case "onkeyup":
            case "onload":
            case "onlosecapture":
            case "onpropertychange":
            case "onreadystatechange":
            case "onrowsdelete":
            case "onrowenter":
            case "onrowexit":
            case "onrowsinserted":
            case "onstart":
            case "onscroll":
            case "onbeforeeditfocus":
            case "onactivate":
            case "onbeforedeactivate":
            case "ondeactivate":
            case "type":
            case "codebase":
                ret.objAttrs[args[i]] = args[i + 1];
                break;
            case "id":
            case "width":
            case "height":
            case "align":
            case "vspace":
            case "hspace":
            case "class":
            case "title":
            case "accesskey":
            case "name":
            case "tabindex":
                ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i + 1];
                break;
            default:
                ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i + 1];
        }
    }
    ret.objAttrs["classid"] = classid;
    if (mimeType) ret.embedAttrs["type"] = mimeType;
    return ret;
}
//------------ END FALSH DETECTION -----------------------------
// ----Detect Plugins ------
function getPlugins() {
    var Count = navigator.plugins.length;
    Erg = "";
    PlugIns = Array();
    for (i = 0; i < Count; i++) {
        if (PlugIn = navigator.plugins[i]) {
            Name = PlugIn.name;
            if (getIndexOf(PlugIns, Name) == -1) {
                PlugIns.push(Name);
            }
        }
    }
    PlugIns.sort();
    for (i = 0; i < PlugIns.length; i++) {
        if (Erg != "") {
            Erg += ",\n";
        }
        Erg += PlugIns[i];
    }
    return Erg;
}

function getIndexOf(Liste, Element) {
    for (j = 0; j < Liste.length; j++) {
        if (Liste[j] == Element) {
            return j;
        }
    }
    return -1;
}

function GetEventFile(id, art) {
    document.location.href = "/functions/GetICSEvent.aspx?evid=" + id + "&art=" + art;
}

function showRegion(target) {
    hideRegions();
    document.getElementById(target).style.display = 'block';
}

function hideRegion(target) {
    hideRegions();
}

function hideRegions() {
    var hf_reg = getHValueByID("HF_Region");
    if (hf_reg != "1") document.getElementById("TRENTINO").style.display = 'none';
    if (hf_reg != "2") document.getElementById("LOMBARDIA").style.display = 'none';
    if (hf_reg != "3") document.getElementById("VENETO").style.display = 'none';
    if (hf_reg != "4") document.getElementById("GIULIA").style.display = 'none';
    if (hf_reg != "5") document.getElementById("PIEMONTE").style.display = 'none';
    if (hf_reg != "6") document.getElementById("VALLEE_DAOSTE").style.display = 'none';
    if (hf_reg != "7") document.getElementById("LIGURIA").style.display = 'none';
    if (hf_reg != "8") document.getElementById("EMILIA_ROMAGNA").style.display = 'none';
    if (hf_reg != "9") document.getElementById("TOSCANA").style.display = 'none';
    if (hf_reg != "10") document.getElementById("MARCHE").style.display = 'none';
    if (hf_reg != "11") document.getElementById("UMBRIA").style.display = 'none';
    if (hf_reg != "12") document.getElementById("LAZIO").style.display = 'none';
    if (hf_reg != "13") document.getElementById("ABRUZZO").style.display = 'none';
    if (hf_reg != "14") document.getElementById("MOLISE").style.display = 'none';
    if (hf_reg != "15") document.getElementById("CAMPANIA").style.display = 'none';
    if (hf_reg != "16") document.getElementById("PUGLIA").style.display = 'none';
    if (hf_reg != "17") document.getElementById("BASILICATA").style.display = 'none';
    if (hf_reg != "18") document.getElementById("CALABRIA").style.display = 'none';
    if (hf_reg != "19") document.getElementById("SICILIA").style.display = 'none';
    if (hf_reg != "20") document.getElementById("SARDEGNA").style.display = 'none';
}

function GetElementByIDMask(id) {
    cbs = document.getElementsByTagName("input");
    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf(id);
        if (ind > -1) {
            return cbs[i];
        }
    }
}

function RegionClick(regName) {
    setHValueByID("HF_Region", regName)
    var obj = GetElementByIDMask("ibtn_spacer");
    if (obj != null) obj.click();
}

function setHValueByID(id, val) {
    var idD = "";
    cbs = document.getElementsByTagName("input");
    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf(id);
        if (ind > -1) {
            cbs[i].value = val;
        }
    }
}

function getHValueByID(id) {
    var idD = "";
    cbs = document.getElementsByTagName("input");
    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf(id);
        if (ind > -1) {
            idD = cbs[i].value;
        }
    }
    return idD;
}

function disableAnchor(objId, disable) {
    disable = !disable;
    var obj = document.getElementById(objId);
    if (obj != null) {
        if (disable) {
            var href = "https://www.mydanaher.com/authentication/login.do"; //obj.getAttribute("href");
            var onclick = obj.getAttribute("onclick");
            if (href && href != "" && href != null) {
                obj.setAttribute('href_bak', href);
            }
            if (onclick != null) {
                obj.setAttribute('onclick_back', onclick);
                obj.setAttribute('onclick', "void(0);");
            }
            obj.removeAttribute('href');
        }
        else {
            var hrefBack = "https://www.mydanaher.com/authentication/login.do"; ;  //obj.getAttribute("href_bak");
            var onclickBack = obj.getAttribute("onclick_back");
            if (onclickBack != null) {
                obj.setAttribute('onclick', onclickBack);
                obj.removeAttribute('onclick_back');
            }
            if (hrefBack != null) {
                obj.setAttribute('href', hrefBack);
                obj.removeAttribute('href_bak');
            }
        }
    }
}

//-------------- FUNKTION ZUM ANZEIGEN/AUSBLENDEN DER ANIMATION FÜR DAS COMPLIANCE TRAINING ----------------
function showAniCT() {
    var aniDIV = document.getElementById('ANICT');
    var layerDIV = document.getElementById('WHITELAYER');
    aniDIV.style.display = 'block';
    layerDIV.style.display = 'block';
}

function hideAniCT() {
    var aniDIV = document.getElementById('ANICT');
    var layerDIV = document.getElementById('WHITELAYER');
    aniDIV.style.display = 'none';
    layerDIV.style.display = 'none';
}

//JS für Extranettemplates

function SHowPrevPic(path) {
    document.getElementById('PrevImgDiv').innerHTML = "<img src='" + path + "' />";
    document.getElementById('PrevImgDiv').style.display = 'block';

}

function HidePrevPic() {
    document.getElementById('PrevImgDiv').style.display = 'none';
}

function GetPICQuery(id, idFull) {
    //setHValueByID('PQ_id', id);
    //setHValueByID('PQ_dorg', org);
    setHValueByID('PQ_key', idFull);
    setHValueByID('PQ_PrevKey', id);
    document.getElementById('BtnsPicQ').style.display = 'block';

}

function GetPICnA() {
    id = getHValueByID('PQ_PrevKey');
    document.getElementById(id).click();
}

function GetPIC() {
    id = getHValueByID('PQ_key');
    document.getElementById(id).click();
}

function ClickIT(id) {
    document.getElementById(id).click();
}

function GetZIP() {

    var checkedIDs = "";
    cbs = document.getElementsByTagName("input");
    var ind = 0;
    var PicCnt = 0;
    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDD");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);
                //alert('idD=' + idD );
                var iddd = getHValueByID(idD + "_DD_id");

                if (iddd != "") checkedIDs += iddd + ",";
            }
        }
    }

    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDI");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);

                var iddd = getHValueByID(idD + "_DI_id");

                if (iddd != "") {
                    checkedIDs += iddd + ",";
                }
            }
        }
    }
    //  alert('checkedIDs=' + checkedIDs );
    if (checkedIDs != "") {
        checkedIDs += ")";
        checkedIDs = checkedIDs.replace(",)", "");

        window.location.href = "/functions/downloadAsZIP4Docs.aspx?ids=" + checkedIDs;
    }
}

function GetZIPnA() {

    var checkedIDs = "";
    cbs = document.getElementsByTagName("input");
    var ind = 0;
    var PicCnt = 0;
    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDD");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);
                //alert('idD=' + idD );
                var iddd = getHValueByID(idD + "_DD_id");

                if (iddd != "") checkedIDs += iddd + ",";
            }
        }
    }

    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDI");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);

                var iddd = getHValueByID(idD + "_DI_id");

                if (iddd != "") {
                    checkedIDs += iddd + ",";
                }
            }
        }
    }
    //   alert('checkedIDs=' + checkedIDs );
    if (checkedIDs != "") {
        checkedIDs += ")";
        checkedIDs = checkedIDs.replace(",)", "");

        window.location.href = "/functions/downloadAsZIP4Docs.aspx?lowRes=1&ids=" + checkedIDs;
    }
}

function GetZIPQuery() {

    var checkedIDs = "";
    cbs = document.getElementsByTagName("input");
    var ind = 0;
    var PicCnt = 0;
    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDD");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);
                //alert('idD=' + idD );
                var iddd = getHValueByID(idD + "_DD_id");

                if (iddd != "") checkedIDs += iddd + ",";
            }
        }
    }

    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDI");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);

                var iddd = getHValueByID(idD + "_DI_id");

                if (iddd != "") {
                    checkedIDs += iddd + ",";
                    PicCnt++;
                }
            }
        }
    }
    //  alert('checkedIDs=' + checkedIDs );
    if (checkedIDs != "") {
        if (PicCnt == 0) {
            checkedIDs += ")";
            checkedIDs = checkedIDs.replace(",)", "");

            window.location.href = "/functions/downloadAsZIP4Docs.aspx?ids=" + checkedIDs;
        }
        else {
            document.getElementById('BtnsZIP').style.display = 'block';
        }
    }
}

function GetZIPQuery(org, lan, navid) {

    var checkedIDs = "";
    cbs = document.getElementsByTagName("input");
    var ind = 0;
    var PicCnt = 0;
    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDD");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);
                //alert('idD=' + idD );
                var iddd = getHValueByID(idD + "_DD_id");

                if (iddd != "") checkedIDs += iddd + ",";
            }
        }
    }

    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDI");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);

                var iddd = getHValueByID(idD + "_DI_id");

                if (iddd != "") {
                    checkedIDs += iddd + ",";
                    PicCnt++;
                }
            }
        }
    }
    //  alert('checkedIDs=' + checkedIDs );
    if (checkedIDs != "") {
        if (PicCnt == 0) {
            checkedIDs += ")";
            checkedIDs = checkedIDs.replace(",)", "");

            window.location.href = "/functions/downloadAsZIP4Docs.aspx?oid=" + org + "&lid=" + lan + "&navid=" + navid + "&ids=" + checkedIDs;
        }
        else {
            document.getElementById('BtnsZIP').style.display = 'block';
        }
    }
}

function GetZIP(org, lan, navid) {

    var checkedIDs = "";
    cbs = document.getElementsByTagName("input");
    var ind = 0;
    var PicCnt = 0;
    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDD");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);
                //alert('idD=' + idD );
                var iddd = getHValueByID(idD + "_DD_id");

                if (iddd != "") checkedIDs += iddd + ",";
            }
        }
    }

    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDI");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);

                var iddd = getHValueByID(idD + "_DI_id");

                if (iddd != "") {
                    checkedIDs += iddd + ",";
                }
            }
        }
    }
    //  alert('checkedIDs=' + checkedIDs );
    if (checkedIDs != "") {
        checkedIDs += ")";
        checkedIDs = checkedIDs.replace(",)", "");

        window.location.href = "/functions/downloadAsZIP4Docs.aspx?oid=" + org + "&lid=" + lan + "&navid=" + navid + "&ids=" + checkedIDs;
    }
}

function GetZIPnA(org, lan, navid) {

    var checkedIDs = "";
    cbs = document.getElementsByTagName("input");
    var ind = 0;
    var PicCnt = 0;
    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDD");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);
                //alert('idD=' + idD );
                var iddd = getHValueByID(idD + "_DD_id");

                if (iddd != "") checkedIDs += iddd + ",";
            }
        }
    }

    for (var i = 0; i < cbs.length; i++) {
        ind = cbs[i].id.indexOf("_CheckBoxDI");
        if (ind > -1) {
            if (document.getElementById(cbs[i].id).checked) {
                var idD = cbs[i].id;
                idD = idD.substr(0, ind);
                ind = idD.lastIndexOf("_");
                idD = idD.substr(ind, idD.length);

                var iddd = getHValueByID(idD + "_DI_id");

                if (iddd != "") {
                    checkedIDs += iddd + ",";
                }
            }
        }
    }
    //   alert('checkedIDs=' + checkedIDs );
    if (checkedIDs != "") {
        checkedIDs += ")";
        checkedIDs = checkedIDs.replace(",)", "");
        // alert("functions/downloadAsZIP4Docs.aspx?oid="+org+"&lid="+lan+"&navid="+navid+"&lowRes=1&ids=" + checkedIDs)  ;
        window.location.href = "/functions/downloadAsZIP4Docs.aspx?oid=" + org + "&lid=" + lan + "&navid=" + navid + "&lowRes=1&ids=" + checkedIDs;
    }
   }

   function changeLP_Overlay() {

   		
   			if (Div = get("LP_OVERLAY")) {

   				if (Div2 = get("LP_OVERLAYCONTENT")) {

   					if (Div2.style.display == "none") {
   						Div.style.display = "block";
   						Div2.style.display = "block";
   					}
   					else {
   						Div.style.display = "none";
   						Div2.style.display = "none";
   					}
   				}
   			}
   		
		return false;
	}


//END - JS für Extranettemplates 
