function CallMailSender(URL,breite,hoehe)
{
  var links = (screen.width-breite)/2;
  var oben  = (screen.height-hoehe)/2;

  document.sform.method = "post";
  document.sform.target = "RYGOL-SAKRET";
  document.sform.action = URL;
  window.open("" ,"RYGOL-SAKRET","Width=" + breite + "Height=" + breite + ",left=" + links + ",top=" + oben + 
                         ",resizable=no,menubar=no,toolbar=no,scrollbars=yes,dependent=yes");
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------

function ChangeSearchType(i)
{
  switch (i)
  { 
    case 1: document.sform.artbez.checked=true;
            document.sform.kurzbez.checked=false;
            break
    case 2: document.sform.artbez.checked=false;
            document.sform.kurzbez.checked=true;
            break
  }
  
  document.sform.method = "post";
  document.sform.target = "_self";
  document.sform.action = "produktsuche.php";
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function Sakret(Seite)
{
  document.sform.umi.value=1;
  if (document.sform.lmi) document.sform.lmi.value=1;
  document.sform.method = "post";
  document.sform.target = "_self";
  document.sform.action = Seite+".php";
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function FindProduct()
{
 i=0;
 if ((document.sform.artbez) && (document.sform.artbez.checked)) i=1;
 if ((document.sform.kurzbez) && (document.sform.kurzbez.checked)) i=2;
 ChangeSearchType(i);
}

//---------------------------------------------------------------------------------------------  

function NextProduct(phpseite,umi, umip, umib)
{
  document.sform.method = "post";
  document.sform.target = "_self";

  switch (umi)
  { case umip: if (document.sform.page) document.sform.page.value = "0";
               if (document.sform.lmi) document.sform.lmi.value = 0;
               break;
    case umib: if (document.sform.page) document.sform.page.value = "8";  
               if (document.sform.lmi) document.sform.lmi.value = 1;
               break;
  }

  document.sform.umi.value = umi;
  document.sform.action = phpseite;
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function NextApplication(umi, umip, umiv, umih)
{
  document.sform.method = "post";
  document.sform.target = "_self";

  switch (umi)
  { case umip: if (document.sform.antw1) document.sform.antw1.value = 0;
               break;
    case umiv: if (document.sform.antw1) document.sform.antw1.value = 0;
               break;
    case umih: if (document.sform.antw1) document.sform.antw1.value = 0;  
               break;
  }
  if (document.sform.structure) document.sform.structure.value = 0;
  if (document.sform.lmi) document.sform.lmi.value = 0;
  if (document.sform.banwid) document.sform.banwid.value = 0;

  document.sform.umi.value = umi;
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function NextSearch(umi, umip, umib)
{
  document.sform.method = "post";
  document.sform.target = "_self";

  switch (umi)
  { case umip: break;
    case umib: break;
  }
//  if (document.sform.lmi) document.sform.lmi.value = 0;

  document.sform.umi.value = umi;
  document.sform.action = 'search.php';
  document.sform.submit();
}
                                  
//---------------------------------------------------------------------------------------------  
                                  
function CallSelfWdvsSysteme(page)
{
  document.sform.page.value = page;
  document.sform.method = "post";
  document.sform.target = "_self";
  document.sform.action = "wdvssysteme.php";
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function CallSelfProdukte(phpseite,page)
{
  document.sform.page.value = page;
  document.sform.method = "post";
  document.sform.target = "_self";
  document.sform.action = phpseite;
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function CallSelf()
{
 window.location.reload();       // geht im firefox nicht ???  
}

//---------------------------------------------------------------------------------------------  

function FindNextAnswer(fr)
{
  document.sform.method = "post";
  document.sform.target = "_self";
  document.sform.mfr.value=fr;
  document.sform.action = "anwendungen.php";
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function show_structure()
{
  document.sform.structure.value = 1;
  document.sform.method = "post";
  document.sform.target = "_self";
  document.sform.action = "anwendungen.php";
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function SetHL(id,anz)
{
   for (i=1; i<=anz; i++)
   { idname="td"+i;
     if (document.getElementById(idname)) 
     { docid=document.getElementById(idname);
       if ((i==id) || (document.sform.lmi.value==i)) docid.className ="lmenu_hilite";
                                                else docid.className ="lmenu_option";
     }                                           
   }
}

//---------------------------------------------------------------------------------------------  

function SetO(id)
{
  idname="td"+id;
  docid=document.getElementById(idname);
  if (document.sform.lmi.value!=id) docid.className ="lmenu_option";
}

//---------------------------------------------------------------------------------------------  

function CallPG(phpseite,page,id)
{
  document.sform.lmi.value = id;
  CallSelfProdukte(phpseite,page);
}


//---------------------------------------------------------------------------------------------  

function FindNA(id)
{
  document.sform.lmi.value = id;
  FindNextAnswer(0);
}

//---------------------------------------------------------------------------------------------  

function CallPage(ns,page)
{
  document.sform.action = ns;
  document.sform.lmi.value = page;
  document.sform.umi.value = page;
  document.sform.method = "post";
  document.sform.target = "_self";
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function show_apdata()
{
  alert('Hier fehlen noch Daten !');
}

//---------------------------------------------------------------------------------------------  

function ViewI(m1,m2,us)
{ 
  Seite="seite.php?EbeneM1="+m1+"&EbeneM2="+m2+"&ITyp="+us; 
  Optionen = 'height=500, width=650, left=100, top=100, resizable=yes, scrollbars=yes, menubar=1'; 
  ////screenX=50, screenY=50, toolbar=0,location=0,directories=0,status=0,menubar=0,
  neues_Fenster = window.open(Seite,'',Optionen);
}

//---------------------------------------------------------------------------------------------  

function NachrichtSenden(afaus)
{ if (
      (document.sform.vorname.value=='')||
      (document.sform.nachname.value=='')||
//      (document.sform.firma.value=='')||
      (document.sform.strasse.value=='')||
      (document.sform.staat.value=='')||  
      (document.sform.plzm.value=='')||           
      (document.sform.ort.value=='')||
      (document.sform.telefon.value=='')||
//      (document.sform.email.value=='')||
      (document.sform.nachricht.value=='')
     ) //NBW('Achtung','Bitte alle Felder ausfüllen.'); else 
     alert(afaus); else
  {    
   Seite="inc/cmail.php";
   Seite=Seite+"?sid="+document.sform.sid.value
   Seite=Seite+"&vorname="+document.sform.vorname.value; 
   Seite=Seite+"&nachname="+document.sform.nachname.value; 
   Seite=Seite+"&firma="+document.sform.firma.value;
   Seite=Seite+"&strasse="+document.sform.strasse.value;
   Seite=Seite+"&staat="+document.sform.staat.value;  
   Seite=Seite+"&plz="+document.sform.plzm.value;           
   Seite=Seite+"&ort="+document.sform.ort.value;
   Seite=Seite+"&tel="+document.sform.telefon.value;
   Seite=Seite+"&email="+document.sform.email.value;
   nachricht=document.sform.nachricht.value;
   while (nachricht.indexOf("\n")>-1) nachricht=nachricht.replace("\n","@@@");
   Seite=Seite+"&nachricht="+nachricht;
   Optionen = 'height=320, width=320, left=100, top=100, resizable=yes, scrollbars=yes'; 
   nF = window.open(Seite,'',Optionen);
  }
}

//---------------------------------------------------------------------------------------------  

function CallService()
{
  document.sform.method = "post";
  document.sform.target = "_self";
  document.sform.action = "service.php";
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function FindAB(anwid,id)
{
  if (id>0) document.sform.lmi.value = id;
  document.sform.banwid.value = anwid;
  document.sform.method = "post";
  document.sform.target = "_self";
  document.sform.action = "anwendungen.php";
  document.sform.submit();
}

//---------------------------------------------------------------------------------------------  

function PView(PTyp,lfdnr)
{ 
  Seite="pview.php?ptyp="+PTyp+"&nr="+lfdnr; 
  Optionen = 'height=700, width=650, left=100, top=100, resizable=yes, scrollbars=yes, menubar=1'; 
  ////screenX=50, screenY=50, toolbar=0,location=0,directories=0,status=0,menubar=0,
  neues_Fenster = window.open(Seite,'',Optionen);
}

//---------------------------------------------------------------------------------------------  

function bw_on()
{
  document.getElementById("bw").style.display = "inline";
//   document.getElementById("bw").style.visibility = "visible";
  document.body.style.cursor = "wait";
}

//---------------------------------------------------------------------------------------------  

function bw_off()
{
  document.getElementById("bw").style.display = "none";
//  document.getElementById("bw").style.visibility = "hidden";
  document.body.style.cursor = "default";
}

//---------------------------------------------------------------------------------------------  

function act3_off()
{
  if (document.getElementById("act3")) document.getElementById("act3").style.display = "none";
}

//---------------------------------------------------------------------------------------------  

function shop()
{ 
  Seite="http://www.sakret.de/shop"; 
  Optionen = 'scrollbars=yes, menubar=yes, toolbar=yes, status=yes, resizable=yes, top=0px, left=0px'; 
  neues_Fenster = window.open(Seite,'sakwin',Optionen);
}

//---------------------------------------------------------------------------------------------  

function NachOben()
{
 while(document.body.scrollTop > 0) window.scrollBy(0,-100);
}
//---------------------------------------------------------------------------------------------  

function ViewP(PId)
{ 
  //alert(PId);
  Seite="pview.php?Produkt="+PId+"&sid="+document.sform.sid.value; 
  Optionen = 'height=500, width=500, resizable=yes, scrollbars=yes'; 
  neues_Fenster = window.open(Seite,'',Optionen);
}

function ViewP_Sak(PId)
{ 
  //alert(PId);
  Seite="pview_sak.php?Produkt="+PId+"&sid="+document.sform.sid.value; 
  Optionen = 'height=500, width=500, resizable=yes, scrollbars=yes'; 
  neues_Fenster = window.open(Seite,'',Optionen);
}