//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Vorladen von Images
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
var dhtml = 'nicht' ;
var is_loaded=true;

if (document.layers)
{
dhtml = "ns4";
}
if (document.getElementById)
{
dhtml = "ie4";  // bei nn5 und ie5
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function go2(func)
{
 document.nuk.func.value = func;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function chgColor(nr, bnr)
{
 document.getElementById("row" + nr).bgColor = bnr;
}

function chgColorBack(nr, bnr)
{
 document.getElementById("row" + nr).bgColor = bnr;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function getSumme()
{
 var op1 = 0;
 var op2 = 0;
 
 op1 = document.nuk.item_34_1.value;  
 op2 = document.nuk.item_34_2.value;
 
 if (op1 && op2)
 {
  for (i=0; i<op2; i++)
  {
   op1++;
  }
 
  document.nuk.gg_summe.value = op1;
 }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function patient_loeschen(idcode)
{
 var msg="Soll der Patient \""+idcode+"\" und alle seine Daten wirklich geloescht werden?";

 if (confirm(msg))
 {
  document.nuk.page.value = "nukdb_pat_del";
  document.nuk.submit();
 }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function popupVorschau(session, skid)
{
 //window.open('http://www.google.de', 'Cibus - Karten-Vorschau', 'width=650,height=400,scrollbars=yes,resizeable=yes,left=100,top=100,status=no,menubar=no,hotkeys=no');
 window.open('../php/next.php?page=karten_preview&akt_skid='+skid+'&akt_spid=1&sessionid='+session, '','width=650,height=600,scrollbars=yes,resizeable=yes,left=100,top=100,status=no,menubar=no,hotkeys=no');
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function BilderVorladen()
{
    document.Vorladen = new Array();

    if(document.images)
    {
        for(var i = 0; i < BilderVorladen.arguments.length; i++)
        {
            document.Vorladen[i] = new Image();
            document.Vorladen[i].src = BilderVorladen.arguments[i];
        }
    }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function preloadImg()
{
  var d=document;
  if(d.images)
  {
   if(!d.macu_p)
    d.macu_p=new Array();
    var i,j=d.macu_p.length,a=preloadImg.arguments;
    for(i=0; i<a.length; i++)
     if (a[i].indexOf("#")!=0)
     {
      d.macu_p[j]=new Image();
      d.macu_p[j++].src=a[i];
     }
  }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function swapImage()
{
  var i,j=0,x,a=swapImage.arguments;
  document.macu_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null)
   {
    document.macu_sr[j++]=x;
    if(!x.oSrc)
     x.oSrc=x.src;
     x.src=a[i+2];
   }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function findObj(n, d)
{
  var p,i,x;
  if(!d)
   d=document;
   if((p=n.indexOf("?"))>0&&parent.frames.length)
   {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);
   }
   if(!(x=d[n])&&d.all) x=d.all[n];
   for (i=0;!x&&i<d.forms.length;i++)
    x=d.forms[i][n];
   for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=findObj(n,d.layers[i].document);
    return x;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function swapImgRestore()
{
  var i,x,a=document.macu_sr;
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
  x.src=x.oSrc;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function displayStatusMsg(msgStr)
{
  status=msgStr;
  document.returnValue = true;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function Go()
{
 window.location.href = document.bc.schemata.value;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
LayerId="";
function HideLayer(LayerName)
{
if(dhtml != "nicht")
{
if (LayerId != "")
{
if ( dhtml == "ie4" )
{
eval('document.getElementById("'+LayerId+'").style.visibility =  "hidden"');
} else {
eval('document.layers["'+LayerId+'"].visibility="hidden"');
}
}
if(LayerName != "")
{
if(dhtml == "ie4")
{
eval('document.getElementById("' + LayerName + '").style.visibility =  "hidden"')  ;
} else {

eval('document.layers["'+LayerName+'"].visibility="hidden"');
}
}
LayerId=LayerName;
} else {
LayerId = "";
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
PullLayerId="";
function ShowPullLayer(LayerName)
{
 if(is_loaded)
 {
  if(dhtml != "nicht")
  {
   if (PullLayerId != "")
   {
    if ( dhtml == "ie4" )
    {
     eval('document.getElementById("'+PullLayerId+'").style.visibility =  "hidden"')  ;
    }
    else
    {
     eval('document.layers["'+PullLayerId+'"].visibility="hidden"');
    }
   }
   if(LayerName != "")
   {
    if(dhtml == "ie4")
    {
     eval('document.getElementById("' + LayerName + '").style.visibility =  "visible"')  ;
    }
    else
    {
     eval('document.layers["'+LayerName+'"].visibility="visible"');
    }
   }
   PullLayerId=LayerName;
  }
  else
  {
   PullLayerId = "";
  }
 }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

function openWindow(theURL,winName,features)
{
  window.open(theURL,winName,features);

}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

