﻿var wndhr = 0;
function onOpenPopupEx( uuid, width, height, fscroll, bprint, btop, bclose )
{
   // if(wndhr.close) wndhr.close();
    if(wndhr && wndhr.closed==false) wndhr.close();   
    var top = 100;
    var left = 100;
    var target = "Popup_" + uuid;
    var url = "/index.cfm?uuid=" + uuid + "&width=" + width + "&height=" + height + "&fscroll=" + fscroll + "&bprint=" + bprint + "&btop=" + btop +"&bclose=" + bclose;        
      wndhr = window.open( url , target , "screenX=" + top + ",screenY=" + left + ",top=" + top +",left=" + left + ",width=" + width + ",height=" + height + ",dependent=yes,hotkeys=no,locationbar=no,menubar=yes,resizable=no,scrollbars=no");
    wndhr.moveTo(top,left);
    wndhr.focus();
}
function onOpenPopupFo( path, width, height)
{
   // if(wndhr.close) wndhr.close();
    if(wndhr && wndhr.closed==false) wndhr.close();   
    var top = 50;
    var left = 50;
    var target = "Popup";
    var url = path;        
      wndhr = window.open( url , target , "screenX=" + top + ",screenY=" + left + ",top=" + top +",left=" + left + ",width=" + width + ",height=" + height + ",dependent=yes,hotkeys=no,locationbar=yes,menubar=yes,resizable=yes,scrollbars=no");
    wndhr.moveTo(top,left);
    wndhr.focus();
}
/*Fragebogen Aesculap */
function onOpenPopupFb( path, width, height)
{
   // if(wndhr.close) wndhr.close();
    if(wndhr && wndhr.closed==false) wndhr.close();   
    var top = 40;
    var left = 40;
    var target = "Popup";
    var url = path;        
      wndhr = window.open( url , target , "screenX=" + top + ",screenY=" + left + ",top=" + top +",left=" + left + ",width=" + width + ",height=" + height + ",dependent=yes,hotkeys=no,locationbar=yes,menubar=yes,resizable=no,scrollbars=yes");
    wndhr.moveTo(top,left);
    wndhr.focus();
}
/* Kontakt */
function onOpenPopupKo( path, kontakt_id, width, height)
{
   // if(wndhr.close) wndhr.close();
    if(wndhr && wndhr.closed==false) wndhr.close();   
    var top = 100;
    var left = 100;
    var target = "Popup";
    var url = path+"?kontakt_id="+kontakt_id;        
      wndhr = window.open( url , target , "screenX=" + top + ",screenY=" + left + ",top=" + top +",left=" + left + ",width=" + width + ",height=" + height + ",dependent=yes,hotkeys=no,locationbar=yes,menubar=yes,resizable=yes,scrollbars=no");
    wndhr.moveTo(top,left);
    wndhr.focus();
}
/* Kontakt für Microsites -Footer-*/
function onOpenPopupKo2( path, kontakt_id, width, height)
{
   // if(wndhr.close) wndhr.close();
    if(wndhr && wndhr.closed==false) wndhr.close();   
    var top = 50;
    var left = 50;
    var target = "Popup";
    var url = path+"&kontakt_id="+kontakt_id;        
      wndhr = window.open( url , target , "screenX=" + top + ",screenY=" + left + ",top=" + top +",left=" + left + ",width=" + width + ",height=" + height + ",dependent=yes,hotkeys=no,locationbar=yes,menubar=yes,resizable=yes,scrollbars=no");
    wndhr.moveTo(top,left);
    wndhr.focus();
}
function onOpenPopupIf( uuid, width, height,sprache, fscroll, bprint, btop, bclose )
{
   // if(wndhr.close) wndhr.close();
    if(wndhr && wndhr.closed==false) wndhr.close();   
    var top = 100;
    var left = 100;
    var wwidth=width+94;
    var hheight=height+120;
    var target = "Popup_" + uuid;
    var url = "/formulare/imagefinder_popup.cfm?uuid=" + uuid + "&width=" + wwidth + "&height=" + hheight + "&sprache=" + sprache + "&fscroll=" + fscroll + "&bprint=" + bprint + "&btop=" + btop +"&bclose=" + bclose;        
      wndhr = window.open( url , target , "screenX=" + top + ",screenY=" + left + ",top=" + top +",left=" + left + ",width=" + wwidth + ",height=" + hheight + ",dependent=yes,hotkeys=no,locationbar=no,menubar=yes,resizable=no,scrollbars=no");
    wndhr.moveTo(top,left);
    wndhr.focus();
}

function popup_gtour()
{
bbraun = window.open("flash/bbraunGT.html","bbraunGT","width=800,height=600,screenX=0,screenY=0,top=0,left=0,scrollbars=no,locationbar=no,menubar=no,resizable=no");
 bbraun.focus();
}
function popup(ziel,breite,hoehe,xoff,yoff)
{
    fenster=open(ziel,"popup","width="+breite+",height="+hoehe+",screenX="+xoff+",screenY="+yoff);
    fenster.moveTo(xoff,yoff);
    fenster.focus();
}
/* Popup */
function onOpenPopupPath( target, url, width, height )
{
   // if(wndhr.close) wndhr.close();
    if(wndhr && wndhr.closed==false) wndhr.close();   
    var top = 100;
    var left = 100;
      wndhr = window.open( url , target , "screenX=" + top + ",screenY=" + left + ",top=" + top +",left=" + left + ",width=" + width + ",height=" + height + ",dependent=yes,hotkeys=no,locationbar=yes,menubar=yes,resizable=no,scrollbars=no");
    wndhr.moveTo(top,left);
    wndhr.focus();
}
/* öffnet dropdown value in neuem Fenster */
function changed(name)
{
value = name.options[name.selectedIndex].value;
if(value!="") window.open(value, 'New');
}
/* aktualisiert webcam bilder auf der website */
function reloadCam()
    {reload = new Date();
     reload = "?"+reload.getTime();
     document.images ["webcambild"].src = "http://www.bbraun.com/pharma_webcampix/web/pharma_cam.jpg"+reload;
     setTimeout("reloadCam()",10000); // zeit-in-ms
    }
    
function winopen(url)
{
  var trackWin = window.open(url, 'etracker', 'toolbar=no,menubar=no,width=10,height=10,left=0,top=0,');
  trackWin.close();  
}

// ################## RedDot Microsites ###############################
function searchSubmit(docFormName, formFieldName)
{
 //alert(docFormName + ' | ' + formFieldName);
 if (!searchValueFeld(docFormName,formFieldName,3)) return false;    
 eval("document."+docFormName+".submit();");
}
function searchValueFeld(docFormName,feldname,zeichenanzahl){
//alert(docFormName + ' | ' + feldname + '| MinChars = ' + zeichenanzahl);
//alert("document."+docFormName+"."+feldname);
//alert('value=' + eval("document."+docFormName+"."+feldname+".value"));
  var FE=eval("document."+docFormName+"."+feldname);
  var Fehlertext="Bitte geben Sie ein Suchwort ein";
  var Fehlertext2="Bitte tragen Sie in das Suchfeld mindestens " + zeichenanzahl + " Zeichen ein";
  if (FE.value==""){alert(Fehlertext);FE.focus();return false; }
  else if (FE.value.length<zeichenanzahl){alert(Fehlertext2);FE.focus();return false;}
  else return true;    
}
 
// ****************** bmi rechner **********************
var m0="Kommentar zu ihrem BMI:"
var m1="Sie haben Untergewicht"
var m2="Sie haben Normalgewicht"
var m3="Sie haben leichtes Uebergewicht"
var m4="Sie haben Uebergewicht (Adipositas Grad I)"
var m5="Sie haben deutliches Uebergewicht (Adipositas Grad II)"
var m6="Sie haben extremes Uebergewicht (Adipositas Grad III)"
function ClearForm(form){
    form.weight.value = "";
    form.height.value = "";
    form.bmi.value = "";
    form.my_comment.value = "";
}
function bmi(weight, height) {
          bmindx=weight/eval(height*height);
          return bmindx;
}
function checkform(form) {
       if (form.weight.value==null||form.weight.value.length==0 || form.height.value==null||form.height.value.length==0){
            alert("Bitte Gewicht und Groesse eingeben.");
            return false;
       }
       else if (parseFloat(form.height.value) <= 49||
                parseFloat(form.height.value) >=221||
                parseFloat(form.weight.value) <= 9||
                parseFloat(form.weight.value) >=201){
                alert("Eingabe-Fehler.\nIhr Gewicht bitte in kg (10-200) und\nIhre Groeße in cm (50-220) eingeben.");
                ClearForm(form);
                return false;
       }
       return true;
}
function computeform(form) {
       if (checkform(form)) {
       yourbmi=(bmi(form.weight.value, form.height.value/100));
       
    var x = yourbmi;
    var k = (Math.round(x * 100) / 100).toString();
      k += (k.indexOf('.') == -1)? '.00' : '';
    
    
    form.bmi.value=k;
    
          
       if (k > 40.00) {
          form.my_comment.value=m6;
       }
       else if (k >=35.00 && k <=39.99) {
          form.my_comment.value=m5;
       }
      else if (k >=30.00 && k <=34.99) {
          form.my_comment.value=m4;
       }
       else if (k >=25.00 && k <=29.99) {
          form.my_comment.value=m3;
       }
       else if (k >=18.50 && k <=24.99) {
          form.my_comment.value=m2;
       }
       else if (k <= 18.49) {
          form.my_comment.value=m1;
       }
       }
       return;
}// *******************************************************************
 
// Glossar Popup Layer

function LayerOn(divname){
document.getElementById ("menu"+divname).style.visibility='visible';
}
function LayerOff(divname){
document.getElementById("menu"+divname).style.visibility='hidden';
}