﻿/* scripts-isrv.js                                                            */
/* 280805                                                                     */
/*          dj 130603 frmLeft => fb ms mz ns op                               */
/* created: dj 171203                                                         */
/* update:                                                                    */
/*                appName   appVersion  userAgent    CodeName                 */
/* Firebird061 =  Netscape  5.0         Firebird061  Mozilla                  */
/* Mozilla14   =  Netscape  5.0         ./.          Mozilla                  */ 
/* Netscape701 =  Netscape  5.0         Netscape701  Mozilla                  */
/* Netscape621 =  Netscape  5.0         Netscape621  Mozilla                  */
/* Netscape47  =  Netscape  4.7         Mozilla47    Mozilla                  */
/* Netscape451 =  Netscape  4.51        Mozilla451   Mozilla                  */
/* Opera703    =  Opera     7.03        Opera703     Mozilla                  */
/* MSIE60      =  Micro...  4.0         MSIE60       Mozilla                  */   
/* */
/* ****************************************************************************/
<!-- vor alten Browsern verstecken
/* for all */
ns = (navigator.appName == "Netscape");

var uAgent = navigator.userAgent;
var aName  = navigator.appName;
var aVers  = parseFloat(navigator.appVersion);
var uAl    = uAgent.length;
var rVers  = /([0-9]..)/;
var client = "xx";
if (uAgent.indexOf("Firebird") >= 0) 
   client = "fb" + uAgent.substr(uAgent.indexOf("Firebird"),uAl);
if (uAgent.indexOf("MSIE")     >= 0) 
   client = "ms" + uAgent.substr(uAgent.indexOf("MSIE"),uAl);
if (uAgent.indexOf("Netscape") >= 0) 
   client = "ns" + uAgent.substr(uAgent.indexOf("Netscape"),uAl);
if (uAgent.indexOf("Opera")    >= 0) 
   client = "op" + uAgent.substr(uAgent.indexOf("Opera"),uAl);
vs = rVers.exec(client);
vs = (RegExp.$1);
if (client.slice(0,2) == "fb") client = "ns";
if (client.slice(0,2) == "ms") client = "ms";
if (client.slice(0,2) == "ns") client = "ns";
if (client.slice(0,2) == "op") client = "op";
if (ns && aVers == "4.7")      client = "ns4";
if (ns && aVers == "4.51")     client = "ns4";
if (client == "xx")            client = "ns";

window.onerror=null;
var newWin0=null;  // nur opera         
var newWin1=null;  // globale hilfe     
var newWin2=null;  // context hilfe     
var newWin3=null;  // context hilfe    
var newWin4=null;  // Bilder anzeigen 

framelen = parent.frames.length;

setwait = "scrollbars=no,resizable=no,height=250,width=250,top=300,left=300";
set600  = "scrollbars=yes,resizable=yes,height=500,width=410,top=160,left=600";
set768  = "scrollbars=yes,resizable=yes,height=525,width=420,top=160,left=590";
set1024 = "scrollbars=yes,resizable=yes,height=725,width=450,top=180,left=820";
if (screen.height >= 600) features = set600;
if (screen.height >= 768) features = set768;
if (screen.height >= 1024)features = set1024;

var GHOST="";
/* fin */
/* **************************************************************** LeftFrame */
function frmLeft(FORM0,IA)
{
 if (client == "ms")
 {
  parent.frames.location.target="_top";
  if (FORM0 == "lang")   parent.frames.location.replace("../index.html.S");
  if (FORM0 == "isrv")   parent.frames.location.replace("login_frm.S");
  if (FORM0 == "stat")   parent.frames[2].location.href="stat_main.S";
  if (FORM0 == "iwahl")
  {
   xben = parent.frames[2].document.forms[0].BEN_NR.value;
   xpas = parent.frames[2].document.forms[0].PASSWD.value;  
   TASK = "../login.C"
         + "?BENUTZER=" + xben 
         + "&PASSWORD=" + xpas 
         + "&FUNC=logged"  
         + "&DUM1=";
   parent.frames[2].location.href=TASK;  
  }
 }

 if (client == "ns" || client == "ns4")
 {
  parent.frames.location.target="_top";
  if (FORM0 == "lang")   parent.frames.location.replace("../index.html.S");
  if (FORM0 == "isrv")   parent.frames.location.replace("login_frm.S");
  if (FORM0 == "stat")   parent.frames.location.replace("stat_frm.S");
  if (FORM0 == "iwahl")
  {
   xben = parent.frames[2].document.forms[0].BEN_NR.value;
   xpas = parent.frames[2].document.forms[0].PASSWD.value;  
   TASK = "../login.C"
         + "?BENUTZER=" + xben 
         + "&PASSWORD=" + xpas 
         + "&FUNC=logged"  
         + "&DUM1=";
   parent.frames[2].location.href=TASK;  
  }
 }

 if (client == "op")
 {
  if (newWin0 && !newWin0.closed) newWin0.close();
  if (FORM0 == "lang")   newWin0 = window.open("../index.html.S", "newWin0");
  if (FORM0 == "isrv")   newWin0 = window.open("login_frm.S", "newWin0");
  if (FORM0 == "stat")   newWin0 = window.open("stat_frm.S", "newWin0");
  if (FORM0 == "iwahl")
  {
   xben = parent.frames[2].document.forms[0].BEN_NR.value;
   xpas = parent.frames[2].document.forms[0].PASSWD.value;  
   TASK = "../login.C"
         + "?BENUTZER=" + xben 
         + "&PASSWORD=" + xpas 
         + "&FUNC=logged"  
         + "&DUM1=";
   parent.frames[2].location.href=TASK;  
  }
 }
}
/* ************************************************************ end LeftFrame */

/* ***************************************************************** TopFrame */
/* ********************** stop */
function stFrm2(LANG)
{
  window.stop();
}
/* end stop */
/* ********************* print */

function prFrm2(LANG)
{
 parent.frames[2].focus();
 parent.print();
}
/* end print */
/* ********************* reset */
function rsFrm2(LANG)
{
 formlen = parent.frames[2].document.forms.length;
 if (formlen <= 0) window.open("../nothing.html.S", "nothing", setwait);
 else parent.frames[2].document.forms[0].reset();
}
/* end reset */
/* ************** back history */
function bwFrm2() { parent.frames[2].history.back(); }
/* end back history */
/* ************** forw. history*/
function fwFrm2() { parent.frames[2].history.forward(); }
/* end forw.history */
/* **************** select all */
function slAll2(LANG)
{
 formlen = parent.frames[2].document.forms.length;
 if (formlen <= 0) window.open("../nothing.html.S", "nothing", setwait);
 else
 {
  FORM0 = parent.frames[2].document.forms[0].name;
  if (FORM0 == "icomm" || FORM0 == "medkl" || FORM0 == "vorml")
  {
   ellen = parent.frames[2].document.forms[0].elements.length;
   for(var i = 2; i < ellen; i++)
   {
    parent.frames[2].document.forms[0].elements[i].checked = 1;
   }
  }
  else window.open("../nothing.html.S", "nothing", setwait);
 }
}
/* end select all */
/* **************** remark all */
function rsMark2(LANG)
{
 formlen = parent.frames[2].document.forms.length;
 if   (formlen <= 0) window.open("../nothing.html.S", "nothing", setwait);
 else
 {
  FORM0 = parent.frames[2].document.forms[0].name;
  if (FORM0 == "icomm" || FORM0 == "medkl" || FORM0 == "vorml")
  {
   parent.frames[2].document.forms[0].reset();
  }
  else window.open("../nothing.html.S", "nothing", setwait);
 }
}
/* end remark all */
/* ************************************************************* end TopFrame */

/* **************************************************************** MainFrame */
function smFrm2(LANG,FUNC)
{
 formlen = parent.frames[2].document.forms.length;
 if (formlen <= 0) window.open("../nothing.html.S", "nothing", setwait);
 else
 {
  FORM0 = parent.frames[2].document.forms[0].name;

  /* ************************************************************************ */
  if (FORM0 == "login")
  {
   done = 0;
   if ((parent.frames[2].document.forms[0].BENUTZER.value != "") &&
      (parent.frames[2].document.forms[0].PASSWORD.value != "")) 
   {
    TASK = "../login.C";
    parent.frames[2].document.forms[0].action=TASK;
    parent.frames[2].document.forms[0].submit();       
    parent.frames[2].document.forms[0].reset();  
   }
   else window.open("../nothing.html.S", "nothing", setwait);
  }
  /* ************************************************************************ */
  if (FORM0 == "isrv")
  {
   done = 0;
   ellen = parent.frames[2].document.forms[0].elements.length;
   i=0;
   for (var i = 0; i < ellen; i++)
   {
    if (parent.frames[2].document.forms[0].elements[i].checked &&
       parent.frames[2].document.forms[0].elements[i].name == "FUNC")
    {
     /* ******************************************* IS: An-Abmeldung anmelden */
     if (parent.frames[2].document.forms[0].elements[i].value == "isan") 
     {
      done = done + 1;
      TASK = "ianab.C";
      parent.frames[2].document.forms[0].action=TASK;
     }
     /* ******************************************* IS: An-Abmeldung abmelden */
     if (parent.frames[2].document.forms[0].elements[i].value == "isab") 
     {
      done = done + 1;
      TASK = "ianab.C";
      parent.frames[2].document.forms[0].action=TASK;
     }
     /* ************************** IS: Kommunikationswege und Anfragen listen */
     if (parent.frames[2].document.forms[0].elements[i].value == "icomml") 
     {
      done = done + 1;
      TASK = "icomm.C";
      parent.frames[2].document.forms[0].action=TASK;
     }
     /* ********************************** IS: Neuerwerbungs-Service eingeben */  
     if (parent.frames[2].document.forms[0].elements[i].value == "iwishl") 
     {
      done = done + 1;
      TASK = "iwish.C";
      parent.frames[2].document.forms[0].action=TASK;
     }
     /* ************************************ IS: Meine Mitteiluungen anzeigen */   
     if (parent.frames[2].document.forms[0].elements[i].value == "ilistl") 
     {
      done = done + 1;
      TASK = "ilist.C";
      parent.frames[2].document.forms[0].action=TASK;
     }
     /* *********************************** IS: Info-Wunsch listen (Personal) */
     if (parent.frames[2].document.forms[0].elements[i].value == "persl") 
     {
      done = done + 1;
      TASK = "perslb.C";
      parent.frames[2].document.forms[0].action=TASK;  
     }
    }
   }
   if (done == 0) window.open("../nothing.html.S", "nothing", setwait);
   else
   {
    parent.frames[2].document.forms[0].submit();
    parent.frames[2].document.forms[0].reset();
   }
  }
  /* ******************* IS: Kommunikationswege und Anfragen speichern */
  if (FORM0 == "icomm") 
  {
   done = 0;    
   if (parent.frames[2].document.forms[0].BEN_NR.value != "")
   {
    done = done + 1;
/*
    if ((parent.frames[2].document.forms[0].NEWSLETT[0].checked ||
         parent.frames[2].document.forms[0].VORBEING[0].checked ||
         parent.frames[2].document.forms[0].REMIND[0].checked   ||
         parent.frames[2].document.forms[0].CLAIM[0].checked )  &&
        (parent.frames[2].document.forms[0].MAIL_ADR.value == ""))  done = 0; 
*/
    if ((parent.frames[2].document.forms[0].NEWSLETT[0].checked ||
         parent.frames[2].document.forms[0].VORBEING[0].checked ||
         parent.frames[2].document.forms[0].REMIND[0].checked    )  &&
        (parent.frames[2].document.forms[0].MAIL_ADR.value == ""))  done = 0; 

/*
    if ((parent.frames[2].document.forms[0].VORBEING[1].checked ||
        parent.frames[2].document.forms[0].REMIND[1].checked || 
        parent.frames[2].document.forms[0].CLAIM[1].checked ) &&
        parent.frames[2].document.forms[0].MOBPHONE.value == "")  done = 0;
*/
    if ((parent.frames[2].document.forms[0].VORBEING[1].checked ) &&
        parent.frames[2].document.forms[0].MOBPHONE.value == "")  done = 0;

    if (parent.frames[2].document.forms[0].MOBPHONE.value != "")
    { 
     mobin = parent.frames[2].document.forms[0].MOBPHONE.value.match(/[0-9]/g);
     parent.frames[2].document.forms[0].MOBPHONE.value = mobin.join("");  
    }  
   }  
   if (done == 0) window.open("../nothing.html.S", "nothing", setwait);
   else  
   {
    TASK = "icomm.C";
    parent.frames[2].document.forms[0].action=TASK;
    parent.frames[2].document.forms[0].submit();

    TASK = "../icomm.C"
         + "?BEN_NR="
         + parent.frames[2].document.forms[0].BEN_NR.value 
         + "&PASSWD=" 
         + parent.frames[2].document.forms[0].PASSWD.value 
         + "&FUNC=icomml"  
         + "&DUM1=YES";
    setTimeout ("parent.frames[2].location.href=TASK",1000);  
   }
  }
  /* ************************************ IS: Neuerwerbungs-Service speichern */ 
  if (FORM0 == "iwish") 
  {
   if (parent.frames[2].document.forms[0].QUERYCMT.value != "")
      parent.frames[2].document.forms[0].submit();
   else window.open("../nothing.html.S", "nothing", setwait);
  }
  /* ************************************************************************ */
  if (FORM0 == "stat")
  {
   done = 0;
   if (parent.frames[2].document.forms[0].elements[1].checked)
   {
    done = 1;
    TASK = "../statistik.C";
    parent.frames[2].document.forms[0].action=TASK;
    parent.frames[2].document.forms[0].submit();
   }
   if (parent.frames[2].document.forms[0].elements[2].checked)
   {
    done = 1;
    TASK = "../statistik.C";
    parent.frames[2].document.forms[0].action=TASK;
    parent.frames[2].document.forms[0].submit();
   }
   if (done == 0) window.open("../nothing.html.S", "nothing", setwait);
  }
  /* ************************************************************************ */
  if (FORM0 == "stti"  || FORM0 == "sttu")
  {
   i = 0; 
   done = 0;
   ellen = parent.frames[2].document.forms[0].elements.length;
   for (var i = 0; i < ellen; i++)
   {
    if (parent.frames[2].document.forms[0].elements[i].checked) done=1;
   }
   if   (done == 0) window.open("../nothing.html.S", "nothing", setwait);
   else parent.frames[2].document.forms[0].submit();  
  }
  /* ************************************************************************ */
  /* ********************************** IS: Info-Wunsch bearbeiten (Personal) */
  if (FORM0 == "persl")
  {
   done = 0;
   ellen = parent.frames[2].document.forms[0].elements.length;
   i=0;
   for (var i = 0; i < ellen; i++)
   {
    if (parent.frames[2].document.forms[0].elements[i].checked &&
       parent.frames[2].document.forms[0].elements[i].name == "INDEX")
    {
     done = done + 1;
     TASK = "perslb.C";
     parent.frames[2].document.forms[0].action=TASK;
    }
   }
   if (done == 0) window.open("../nothing.html.S", "nothing", setwait);
   else parent.frames[2].document.forms[0].submit();
  } 

  /* *********************************** IS: Info-Wunsch speichern (Personal) */
  if (FORM0 == "persb")
  {
   i = 1;
   done = 0;
   ellen = parent.frames[2].document.forms[0].elements.length;
   for (var i = 1; i < ellen; i++)
   {
    if (parent.frames[2].document.forms[0].elements[i].value != "")
    {
     if (parent.frames[2].document.forms[0].elements[i].name == "FLD1") done = 1;
     if (parent.frames[2].document.forms[0].elements[i].name == "FLD2") done = 1;
     if (parent.frames[2].document.forms[0].elements[i].name == "FLD3") done = 1;
     if (parent.frames[2].document.forms[0].elements[i].name == "FLD4") done = 1;
     if (parent.frames[2].document.forms[0].elements[i].name == "FLD5") done = 1;
     if (parent.frames[2].document.forms[0].elements[i].name == "FLD6") done = 1;
     if (parent.frames[2].document.forms[0].elements[i].name == "FLD7") done = 1;
     if (parent.frames[2].document.forms[0].elements[i].name == "FLD8") done = 1;
     if (parent.frames[2].document.forms[0].elements[i].name == "FLD9") done = 1;
     if (parent.frames[2].document.forms[0].elements[i].name == "REMOVE") done =1;
    }
   }
   if (done == 0) window.open("../nothing.html.S", "nothing", setwait);
   else
   {
    TASK = "perslb.C";
    parent.frames[2].document.forms[0].action=TASK;
    parent.frames[2].document.forms[0].FUNC.value="perss";
    parent.frames[2].document.forms[0].submit(); 
   }
  } 
 }
}
/* ************************************************** update for the personal */
function upDate2(LANG,FUNC)
{
 TASK = "perslb.C"
      + "?LANG=" + LANG
      + "&FUNC=" + FUNC
      + "&BEN_NR="
      + parent.frames[2].document.forms[0].BEN_NR.value 
      + "&PASSWD=" 
      + parent.frames[2].document.forms[0].PASSWD.value ;  
 parent.frames[2].location.href=TASK;  
}
/* *********************************************** end update for the personal */
/* ************************************************************* end MainFrame */

/* *************************************************************** global help */
function opWin1(LANG)
{
 if (newWin1 && !newWin1.closed) newWin1.close();
 file   = "../" + LANG.concat("/help_main.html.S");
 newWin1=window.open(file, "newWin1", features);
}
/* *********************************************************** end global help */

/* *********************************************************** individual help */
function opWin2(IA)                                      /* standard formulare */
{
 if (newWin2 && !newWin2.closed) newWin2.close();
 TASK = "#" + IA;
 if (parent.frames[2].document.forms[0].LANG.value == "cz")
    file="../cz/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "da")
    file="../da/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "de")
    file="../de/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "en")
     file="../en/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "fr")
    file="../fr/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "nl")
    file="../nl/help2_main.html.S" + TASK;
 newWin2=window.open(file, "newWin2", features);
}
/* ******************************************************* end individual help */

/* *********************************************************** individual help */
function opWin3(IA)                                     /* ergebniss formulare */
{
 if (newWin2 && !newWin2.closed) newWin2.close();
 TASK = "#" + IA;
 if (parent.frames[2].document.forms[0].LANG.value == "cz")
    file="cz/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "da")
    file="da/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "de")
    file="de/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "en")
    file="en/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "fr")
    file="fr/help2_main.html.S" + TASK;
 if (parent.frames[2].document.forms[0].LANG.value == "nl")
    file="nl/help2_main.html.S" + TASK;
 newWin2=window.open(file, "newWin2", features);
}
/* ******************************************************* end individual help */
/* **************************************************************** no history */
function noHist(FUNC)
{
 i = 0;
 done = 0;
 file1 = "/isrv/" + parent.frames[2].document.forms[0].LANG.value + "/index_frm.html.S";
 file2 = "/isrv/index.html.S";
 if (FUNC == "s1")
 {
  if (parent.frames[2].document.forms.length > 0)
  {
   parent.frames[2].document.forms[0].reset();
  }
 }

 if (FUNC == "s2")
 {
  if (parent.frames[2].document.forms.length > 0)
  {
   ellen = parent.frames[2].document.forms[0].elements.length;
   for (var i = 1; i < ellen; i++)
   {
    if (parent.frames[2].document.forms[0].elements[i].checked) done = done + 1;
   }

   if (done == 0)  parent.frames.close();  
  }
  else  parent.frames.close();
 }
}

function what(key)
{
 if(client == "ms" && window.event.keyCode == 17) parent.frames.close();
 if(client != "ms" && key.which == 17) parent.frames.close();
}

/* ************************************************************ end no history */

/* ************************************************************** close window */
function clWin()
{
 if (newWin0 && !newWin0.closed) newWin0.close();
 if (newWin1 && !newWin1.closed) newWin1.close();
 if (newWin2 && !newWin2.closed) newWin2.close();
 if (newWin3 && !newWin3.closed) newWin3.close();
 if (newWin4 && !newWin4.closed) newWin4.close();
}
/* ********************************************************** end close window */

// -->
