function preloadImages()
{
  var d=document;
  if(d.images)
  {
    if(!d.bilder)
       d.bilder=new Array();
    var i, j=d.bilder.length, a=preloadImages.arguments;
    for(i=0; i<a.length; i++)
       if (a[i].indexOf("#")!=0)
       {
          d.bilder[j]=new Image;
          d.bilder[j++].src=a[i];
       }
  }
}

function ersetze(text,find,repl)
{
        spzzchn=  "*+-./_@";
        var found = text.indexOf(find);
        var retVal= ""; var start = 0;
        while(found != -1)
        {
                retVal +=text.substring(start,found) +repl;
                start = found+find.length;
                found =text.indexOf(find,start);
        }
        retVal +=text.substring(start,text.length);
        return retVal;
}

function StringToName(eingabe)
{
        spzzchn=  "*+-./_@";
        var a=escape(eingabe);
        for(var i=0;i<spzzchn.length;i++)
        a=ersetze(a,spzzchn.charAt(i),"%X"+i);
        a=ersetze(a,"%","_");
        return a;
}

function NameToString()
{
        var b=""+self.name;
        b=ersetze(b,"_","%");
        for(var i=0;i<spzzchn.length;i++)
                b=ersetze(b,"%X"+i,spzzchn.charAt(i));
        b=unescape(b);
        return b;
}

function StringAusFormular()
{
        formstring = "form" + "~";
        formstring += document.Bestellformular.an_Bestellung1.checked + "~";
        formstring += document.Bestellformular.ao_Bestellung2.checked + "~";
        formstring += document.Bestellformular.ap_Bestellung3.checked + "~";
        formstring += document.Bestellformular.aq_Bestellung4.checked + "~";
        formstring += document.Bestellformular.ar_Bestellung5.checked + "~";
        formstring += document.Bestellformular.as_Bestellung6.checked + "~";
        formstring += document.Bestellformular.at_Bestellung7.checked + "~";
        formstring += document.Bestellformular.au_Bestellung8.checked + "~";
        formstring += document.Bestellformular.av_Bestellung9.checked + "~";
        formstring += document.Bestellformular.ac_Vorname.value + "~";
        formstring += document.Bestellformular.ab_Name.value + "~";
        formstring += document.Bestellformular.ad_Strasse.value + "~";
        formstring += document.Bestellformular.ae_Land.value + "~";
        formstring += document.Bestellformular.af_PLZ.value + "~";
        formstring += document.Bestellformular.ag_Ort.value + "~";
        formstring += document.Bestellformular.ah_Telefon.value + "~";
        formstring += document.Bestellformular.ai_Email.value;
        return formstring;
}

function FuelleFormular()
{
        felder = NameToString().split("~");
        if( felder[1] == "true" ) document.BestellDruck.elem1.checked = true;
        if( felder[2] == "true" ) document.BestellDruck.elem2.checked = true;
        if( felder[3] == "true" ) document.BestellDruck.elem3.checked = true;
        if( felder[4] == "true" ) document.BestellDruck.elem4.checked = true;
        if( felder[5] == "true" ) document.BestellDruck.elem5.checked = true;
        if( felder[6] == "true" ) document.BestellDruck.elem6.checked = true;
        if( felder[7] == "true" ) document.BestellDruck.elem7.checked = true;
        if( felder[8] == "true" ) document.BestellDruck.elem8.checked = true;
        if( felder[9] == "true" ) document.BestellDruck.elem9.checked = true;
        document.BestellDruck.elem10.value = felder[10];
        document.BestellDruck.elem11.value = felder[11];
        document.BestellDruck.elem12.value = felder[12];
        document.BestellDruck.elem13.value = felder[13];
        document.BestellDruck.elem14.value = felder[14];
        document.BestellDruck.elem15.value = felder[15];
        document.BestellDruck.elem16.value = felder[16];
        document.BestellDruck.elem17.value = felder[17];
}

function DruckBestellFenster()
{

        Fenster=window.open("druck_bestell.html","Downloadformular","width=660,height=440,scrollbars,menubar=yes,resizable=no");
        Fenster.name=StringToName(StringAusFormular());
}

function DemoLizenzFenster()
{
    Fenster= window.open("lizenz_demo.html","Lizenzvereinbarung","width=480,height=540,scrollbars,menubar=yes");
}

function VollLizenzFenster()
{
    Fenster= window.open("lizenz_voll.html","Lizenzvereinbarung","width=480,height=540,scrollbars,menubar=yes");
}

function CheckBestellFormular()
{
  if(document.Bestellformular.ab_Name.value == "")
    {
       alert("Bitte Ihren Namen eingeben!");
       document.Bestellformular.ab_Name.focus();
       return false;
    }
  if(document.Bestellformular.ad_Strasse.value == "")
    {
       alert("Bitte Ihre Anschrift eingeben!");
       document.Bestellformular.ad_Strasse.focus();
       return false;
    }
  if(document.Bestellformular.ae_Land.value == "")
    {
       alert("Bitte Ihr Land eingeben!");
       document.Bestellformular.ae_Land.focus();
       return false;
    }
  if(document.Bestellformular.af_PLZ.value == "")
    {
       alert("Bitte Ihre Postleitzahl eingeben!");
       document.Bestellformular.af_PLZ.focus();
       return false;
    }
  if(document.Bestellformular.ag_Ort.value == "")
    {
       alert("Bitte Ihren Ort eingeben!");
       document.Bestellformular.ag_Ort.focus();
       return false;
    }
  if(document.Bestellformular.ah_Telefon.value == "")
    {
       alert("Bitte Ihre Telefonnummer eingeben!");
       document.Bestellformular.ah_Telefon.focus();
       return false;
    }
  if((document.Bestellformular.aw_Zahlung[0].checked == false) && (document.Bestellformular.aw_Zahlung[1].checked == false))
    {
       alert("Bitte eine Zahlungsart auswählen!");
       return false;
    }
  if(document.Bestellformular.ax_Lizenz.checked == false)
    {
       alert("Haben Sie schon den Lizenzvertrag gelesen?");
       document.Bestellformular.ax_Lizenz.focus();
       return false;
    }
}



function BearbeiteDownloadFormularCGI()
{
  if(document.Downloadformular.ab_Name.value == "")
    {
       alert("Bitte Ihren Namen eingeben!");
       document.Downloadformular.ab_Name.focus();
       return false;
    }
  if(document.Downloadformular.ad_Strasse.value == "")
    {
       alert("Bitte Ihre Anschrift eingeben!");
       document.Downloadformular.ad_Strasse.focus();
       return false;
    }
  if(document.Downloadformular.ae_Land.value == "")
    {
       alert("Bitte Ihr Land eingeben!");
       document.Downloadformular.ae_Land.focus();
       return false;
    }
  if(document.Downloadformular.af_PLZ.value == "")
    {
       alert("Bitte Ihre Postleitzahl eingeben!");
       document.Downloadformular.af_PLZ.focus();
       return false;
    }
  if(document.Downloadformular.ag_Ort.value == "")
    {
       alert("Bitte Ihren Ort eingeben!");
       document.Downloadformular.ag_Ort.focus();
       return false;
    }
  if(document.Downloadformular.ah_Telefon.value == "")
    {
       alert("Bitte Ihre Telefonnummer eingeben!");
       document.Downloadformular.ah_Telefon.focus();
       return false;
    }
  if(document.Downloadformular.ax_Lizenz.checked == false)
    {
       alert("Haben Sie schon den Lizenzvertrag gelesen?");
       document.Downloadformular.ax_Lizenz.focus();
       return false;
    }
}

function BearbeiteDownloadFormularCGIEnglish()
{
  if(document.Downloadformular.ab_Name.value == "")
    {
       alert("Please fill in your Name!");
       document.Downloadformular.ab_Name.focus();
       return false;
    }
  if(document.Downloadformular.ad_Strasse.value == "")
    {
       alert("Please fill in your adress!");
       document.Downloadformular.ad_Strasse.focus();
       return false;
    }
  if(document.Downloadformular.ae_Land.value == "")
    {
       alert("Please fill in your country!");
       document.Downloadformular.ae_Land.focus();
       return false;
    }
  if(document.Downloadformular.af_PLZ.value == "")
    {
       alert("Please fill in your zip code!");
       document.Downloadformular.af_PLZ.focus();
       return false;
    }
  if(document.Downloadformular.ag_Ort.value == "")
    {
       alert("Please fill in your city!");
       document.Downloadformular.ag_Ort.focus();
       return false;
    }
  if(document.Downloadformular.ah_Telefon.value == "")
    {
       alert("Please fill in your phone number!");
       document.Downloadformular.ah_Telefon.focus();
       return false;
    }
  if(document.Downloadformular.ax_Lizenz.checked == false)
    {
       alert("Please confirm that you may only use this download version for testing purposes!");
       document.Downloadformular.ax_Lizenz.focus();
       return false;
    }
}


function shot01()
{
    Fenster1= window.open("shot01.html","Diagnose","width=390,height=400");
}

function shot02()
{
    Fenster2= window.open("shot02.html","Medikamententabelle","width=425,height=290");
}

function shot03()
{
    Fenster3= window.open("shot03.html","Krankenblatt_drucken","width=440,height=400");
}

function shot04()
{
    Fenster4= window.open("shot04.html","Rechnungen_bearbeiten","width=510,height=450");
}


function GanzesFrameset()
{
    if( parseInt(navigator.appVersion.substring(0,1)) >= 4 )
    {
        if(top.frames.length == 0)
        {
            top.location.href="http://www.vetset.de";
        }
    }
}

function FremderFrame()
{
    if(top.frames.length > 0) top.location.href=self.location;
}

/*
function aufruf(selObj)
{
        self.name=selectWert(selObj);
        self.location.href="wertueb1a.htm";
}

function selectWert(sObj)
{
        return sObj.options[sObj.selectedIndex].value;
}
*/