// JAVA SCRIPTING for Web2000 Pages
// (c) 1999-2004 WIS Wiesinger/Schenk & Partner, München
//
//DEFAULT FUNCTIONS SET+GET VARS
//
function setvar(topwin,pagewin) {
  if (this.topwin==null || this.topwin==false) {this.topwin='';}
  if (this.pagewin==null || this.pagewin==false) {this.pagewin='';}
  if (topwin!='') {this.topwin=topwin;}
  if (pagewin!='') {this.pagewin=pagewin;}
  //this.pagewinmark='';
}
function setvarmark(pagewinmark) {
  if (this.pagewinmark==null || this.pagewinmark==false) {this.pagewinmark='';}
  if (pagewinmark!='') {this.pagewinmark=pagewinmark;}
}
function setvarref(win,pagerefopener,pagerefdomain,pagereflink) {
if (win==null || win=='' || win==false) {win=window;}
  //with (win) {
  if (this.pagerefopener==null || this.pagerefopener==false) {this.pagerefopener='';}
  if (this.pagerefdomain==null || this.pagerefdomain==false) {this.pagerefdomain='';}
  if (this.pagereflink==null || this.pagereflink==false) {this.pagereflink='';}

  if (pagerefopener!='') {this.pagerefopener=pagerefopener;}
  if (pagerefdomain!='') {this.pagerefdomain=pagerefdomain;}
  if (pagereflink!='') {this.pagereflink=pagereflink;}
  //}
}

function settimeid(timeid) {
this.timeid=timeid;
}
function setguest(gallname,gname,gsurname,gtitel,gcompany,gemail,gphone) {
 win='';
// if (win=='' || win==null || win==false) {win=top.opener;}
 if (win=='' || win==null || win==false) {win=top;}
 if (win=='' || win==null || win==false) {win=window;}
// if (top.refopener!=null && top.refopener!='' ) {win=top.refopener;}
 if (win.name!="Web") {win=window;}
  if (gallname.indexOf(',')!=-1) {  //name,vorname,anrede
    gtitel=gallname.substr(gallname.lastIndexOf(',')+1)
    gallname=gallname.substr(0,gallname.lastIndexOf(','))
    gsurname=gallname.substr(gallname.lastIndexOf(',')+1)
    gallname=gallname.substr(0,gallname.lastIndexOf(','))
    gname=gallname; gallname=''
  }
 var guest=gallname+";"+gname+";"+gsurname+";"+gtitel+";"+gcompany+";"+gemail+";"+gphone;
 guestold=top.GetCookie('Guest',win);
 if (guest != guestold) {top.SetCookie('Guest',guest,win);}
}
function getguest(gallname,gname,gsurname,gtitel,gcompany,gemail,gphone) {
 win='';
// if (win=='' || win==null || win==false) {win=top.opener;}
 if (win=='' || win==null || win==false) {win=top;}
 if (win=='' || win==null || win==false) {win=window;}
// if (top.refopener!=null && top.refopener!='' ) {win=top.refopener;}
 if (win.name!="Web") {win=window;}
 guest=top.GetCookie('Guest',win);
 if (guest==null || guest==false) {guest='';}
 if (guest !='') {
//   if (gname==null || gname=='') {gname=theForm.KontaktName}
//   if (gsurname==null || gsurname=='') {gsurname=theForm.KontaktVorname}
//   if (gtitel==null || gtitel=='') {gtitel=theForm.KontaktAnrede}

   b=0; e=0; x=''
   //b=0;e=guest.indexOf(";",b+1);
   //x=guest.slice(b,e);
   e=guest;
   x= e.substr(0,e.indexOf(';')); e=e.substr(e.indexOf(';')+1);
   if(x.substr(0,1)==';') {x=x.substr(1) }
//       gallname.value=x
   if (x!='') {
     if (x.indexOf(',')!=-1) {  //name,vorname,anrede
       gtitel.value=x.substr(x.lastIndexOf(',')+1)
       x=x.substr(0,x.lastIndexOf(','))
       gsurname.value=x.substr(x.lastIndexOf(',')+1)
       x=x.substr(0,x.lastIndexOf(','))
       gname.value=x;
     } else {
       gallname.value=x
     }
   }
   x= e.substr(0,e.indexOf(';')); e=e.substr(e.indexOf(';')+1); if (x!='') {gname.value=x}
   x= e.substr(0,e.indexOf(';')); e=e.substr(e.indexOf(';')+1); if (x!='') {gsurname.value=x}
   x= e.substr(0,e.indexOf(';')); e=e.substr(e.indexOf(';')+1);
     if (x!='') {
       if (gtitel.type=='Text') {
         gtitel.value=x
       } else {
         for(i=0;i<gtitel.options.length;i++) {
           if (x=gtitel.options[i].value) { gtitel.selectedIndex = i;i=gtitel.options.length+1}
         }
       }
     }
   x= e.substr(0,e.indexOf(';')); e=e.substr(e.indexOf(';')+1); if (x!='') {gcompany.value=x}
   x= e.substr(0,e.indexOf(';')); e=e.substr(e.indexOf(';')+1); if (x!='') {gemail.value=x}
   x= e.substr(0,e.indexOf(';')); e=e.substr(e.indexOf(';')+1); if (x!='') {gphone.value=x}
   //b=e+1;e=guest.indexOf(";",e+1); x=guest.slice(b,e); if (x!='') {gname.value=x}
   //b=e+1;e=guest.indexOf(";",e+1); x=guest.slice(b,e); if (x!='') {gsurname.value=x}
   //b=e+1;e=guest.indexOf(";",e+1); x=guest.slice(b,e); if (x!='') {gtitel.value=x}
   //b=e+1;e=guest.indexOf(";",e+1); gcompany.value=guest.slice(b,e);
   //b=e+1;e=guest.indexOf(";",e+1); gemail.value=guest.slice(b,e);
   //b=e+1;e=guest.indexOf(";",e+1); gphone.value=guest.slice(b);
 }
}
function getguestname(gallname) {
window.onError=null;
 win='';
// if (win=='' || win==null || win==false) {win=top.opener;}
 if (win=='' || win==null || win==false) {win=top;}
 if (win=='' || win==null || win==false) {win=window;}
 if (win.name!="Web") {win=window;}
 guest=top.GetCookie('Guest',win);
 gallname='';
 if (guest==null || guest==false) {guest='';}
 if (guest !='') {
   var b=0;
   var e=0;
   b=0;e=guest.indexOf(";",b+1);
   var gallname=guest.slice(b,e);
 }
 return (gallname);
}

// JAVA SCRIPTING for Web2000 Pages
// (c) 1999,2000 WIS Wiesinger/Schenk & Partner, München

//CONTACT PAGES SET VARS
//
function setfform(formname) {
    with (this) {
    fformname=formname;
    }
}
function getfform(a) {
//  with (this) {
    switch (a) {
    case 'formname':
        formname = fformname;
        return formname;
        break;
    default:
    }
//  }
}
function setformvars(theForm,opt) {
  if (opt==null) {opt=''}
  //PREDEF RESET VARS
  if (opt=='') {opt='RESET' }

  if (top.formvars==null) {top.formvars=''}
  if (opt.indexOf('RESET')!=-1 || opt=='') {top.formvars=''}

  if (theForm.elements!=null) {
    a='';a1='';n='';v='';i=0;i1=0
    for(i=0;i<theForm.length;++i) {
      a1='';n='';v=''
      if (theForm.elements[i].type=='radio_') {
        if (n!=theForm.elements[i].name) {
          n=theForm.elements[i].name; v=theForm.elements[i].value
          a1=a1+theForm.elements[i].name+'='+theForm.elements[i].value
        }
/*
        if (theForm.elements[i].length==null || theForm.elements[i].length==1) {
          a1=a1+theForm.elements[i].name+'='+theForm.elements[i].value
        } else {
          n=theForm.elements[i].name
          a1=a1+theForm.elements[i].name+'='
          for(i1=0;i1<theForm[n].length;++i1) {
            if (theForm[n][i1].checked==true) {
             a1=a1+ theForm[n][i1].value
            }
          }
          i1=i1-1
          i=i+i1
        }
*/

      } else if (theForm.elements[i].type=='select-one') {
        n=theForm.elements[i].name; v=''
        a1=a1+theForm.elements[i].name+'='

        if (theForm[n].selectedIndex >= 0) {
          v=theForm[n].options[theForm[n].selectedIndex].value
          a1=a1+ theForm[n].options[theForm[n].selectedIndex].value
        }

      } else if (theForm.elements[i].type=='checkbox') {
        n=theForm.elements[i].name; v=''
        a1=a1+theForm.elements[i].name+'='
        if (theForm.elements[i].checked==true) {
          v=theForm.elements[i].value
          a1=a1+theForm.elements[i].value
        }

      } else if (theForm.elements[i].type=='radio') {
        n=theForm.elements[i].name; v=''
        //a1=a1+theForm.elements[i].name+'='
        if (a.indexOf(theForm.elements[i].name)==-1) {
          if (i!=0 || a.indexOf('&'+theForm.elements[i].name)==-1) {a=a+"&"+n+'='}
          else if (i!=0 || a.indexOf(theForm.elements[i].name)==-1) {a=a+n+'='}
        }
        if (theForm.elements[i].checked==true) {
          //a1=a1+theForm.elements[i].name+'='
          v=theForm.elements[i].value
          //a1=a1+theForm.elements[i].value
          a=a+v
        } else {
        }
        a1=''; n=''; v='';  //nichts mehr anhängen

      } else {
        n=theForm.elements[i].name; v=theForm.elements[i].value
        a1=a1+theForm.elements[i].name+'='+theForm.elements[i].value
      }
      if (opt.indexOf('RESET')!=-1) {
        if (n+v!='') {
          if (i!=0 || n!=theForm.elements[0].name) {a=a+"&"}
          a=a+ n+'='+v
        }
      } else if (opt.indexOf('REPLACE')!=-1) {
      } else if (opt.indexOf('URL')!=-1) {
        v=escape(v)
        if (i!=0 || n!=theForm.elements[0].name) {a=a+"&"}
        a=a+ n+'='+v
      } else {
        if (a1!='') {
          //if (i+1<theForm.length) {a1=a1+"&"}
          //a=a+a1
          if (i!=0 || n!=theForm.elements[0].name) {a=a+"&"}
          a=a+ a1
        }
      }
      a1=''; n=''; v='';

    }
    if (opt.indexOf('RET')!=-1) {
      return (a)
    } else {
      top.formvars=a;
    }
    a=''
  }
}
//    a=getformvars('CertClass')
//    alert(a)
//    return(false)
function getformvars(field) {
  if (field==null) {field=''}
  a='';a1=''
  if (field!='') {
    if (top.formvars!=null) {
      a=top.formvars
      if (a.indexOf(field+'=')!=-1) {
        a1=a.substring(a.indexOf(field+'='))
        if (a1.indexOf('&')!=-1) { a1=a1.substring(0,a1.indexOf('&')) }
        if (a1.indexOf('=')!=-1) { a1=a1.substring(a1.indexOf('=')+1) }
        if (a1==null) {a1=''}
        return (a1)
      } else {
        //a1='NoData '+field
        return (a1)
      }
    } else {
      //a1='NoData'
      return (a1)
    }
  } else {
    return (a1)
  }
}
function setformvars2fo(win,field,val,opt) {
  if (win==null) {win=window}
  if (field==null) {field=''}
  if (val==null) {val=''}
  if (opt==null) {opt=''}
  if (opt.indexOf('ALL')!=-1 || field=='') {field='ALL'}
  if (opt.indexOf('VAR')!=-1 || field=='') {field='VAR'}
  theForm=''; theForm0=''
//  alert(top.WebTop.document.name)
  if (top.WebTop.document!=null) {
    if (top.WebTop.document.forms[0]!=null) { theForm0=top.WebTop.document.forms[0] }
  }
  if (win.document.forms[0]!=null) { theForm=win.document.forms[0] }
//alert(field+":"+val+":"+opt)
  if (field!='') {
      a=''
      if (field=='ALL' || opt.indexOf('ALL')!=-1 || val=='ALL') {
        a='';i=0;i1=0
        if (theForm!='' && theForm0!='') {
          for(i=0;i<theForm.length;++i) {
            field=theForm.elements[i].name
            if (field.indexOf('head')==-1 && field.indexOf('AUTO')==-1) {
              if (theForm.elements[field]!=null && theForm0.elements[field]!=null) {
                theForm0[field].value = theForm[field].value //.elements
              }
            }
          }
        }
      } else if (field=='VAR' || opt.indexOf('VAR')!=-1 || val=='VAR') {
        a='';i=0;i1=0
        if (theForm!='' && theForm0!='') {
          for(i=0;i<theForm.length;++i) {
            field=theForm.elements[i].name
            if (field.indexOf('WFo')==-1 && field.indexOf('head')==-1 && field.indexOf('BT')==-1&& field.indexOf('AUTO')==-1) {
              if (theForm.elements[field]!=null) {
                // && theForm0.elements[field]!=null

                theForm0.TEMP1.value=''
                with (win) { if (self["v_"+field]!=null) {theForm0.TEMP1.value=self["v_"+field] } }
                // if (theForm0.TEMP1.value==null || theForm0.TEMP1.value=='undefined') { theForm0.TEMP1.value='' }
                if (theForm0.TEMP1.value!=null) {
                  theForm[field].value = theForm0.TEMP1.value
                  if (theForm0.elements[field]!=null) { theForm0[field].value = theForm0.TEMP1.value }
                }
    /*
                a=''
                with (win) { if (self["v_"+field]!=null) {a=self["v_"+field] } }
                // if (a==null || a=='undefined') { a='' }
                if (a!=null) {
                    //while (a.indexOf('&#252;')!=-1) { a=a.replace('&#252;','ü') }
                    //while (a.indexOf('&#168;')!=-1) { a=a.replace('&#168;','ue') }
                  theForm[field].value = a.value
                  if (theForm0.elements[field]!=null) { theForm0[field].value = a }
                }
    */
              }
            }
          }
        }
      } else {
        if (val!='') {
          a=val
        } else {
          if (theForm!='') {
            if (theForm.elements[field]!=null) { a=theForm[field].value }
          }
        }
        if (theForm0!='') {
          if (theForm0.elements[field]!=null) { theForm0[field].value = a }
        }
      }
      if (opt.indexOf('RESET')!=-1) {
        if (theForm0!='') { top.setformvars(theForm0) }
      }

  }
}

function getformvars0(win,field,opt) {
  if (win==null) {win=window}
  if (field==null) {field=''}
  if (opt==null) {opt=''}
  if (opt=='ALL' || field=='') {field='ALL'}
  theForm0=top.WebTop.document.forms[0]
  theForm=win.document.forms[0]
  if (field!='') {
    a=''
    if (field=='ALL' || opt=='ALL') {
      a='';i=0;i1=0
      for(i=0;i<theForm.length;++i) {
        field=theForm.elements[i].name
        if (field.indexOf('head')==-1 && field.indexOf('AUTO')==-1) {
          if (theForm.elements[field]!=null && theForm0.elements[field]!=null) {
            theForm[field].value = theForm0[field].value  //.elements
          }
        }
      }
    } else {
      if (theForm0.elements[field]!=null) { a = theForm0[field].value }

      if (opt=='RET') {
        return (a)
      } else {
        if (theForm.elements[field]!=null) { theForm[field].value=a }
      }
    }
  }

}

function setfheadvar(headtitel,headdatetime,headip,headtyp,headan,headvon,headbetreff,headprio,headtermin) {
win=top;
//if (top.refopener!=null && top.refopener!='' ) {win=top.refopener;}
//    with (this) {
        win.fheadtitel = headtitel;
        win.fheaddatetime = headdatetime;
        win.fheadip = headip;
        win.fheadtyp = headtyp;
        win.fheadan = headan;
        win.fheadvon = headvon;
        win.fheadbetreff = headbetreff;
        win.fheadprio = headprio;
        win.fheadtermin = headtermin;
//    }
}
function getfheadvar(a) {
win=top;
//if (top.refopener!=null && top.refopener!='' ) {win=top.refopener;}
//  with (this) {
    switch (a) {
    case 'headtitel':
        headtitel = win.fheadtitel;
        return headtitel;
        break;
    case 'headdatetime':
        headdatetime = win.fheaddatetime;
        return headdatetime;
        break;
    case 'headip':
        headip = win.fheadip;
        return headip;
        break;
    case 'headtyp':
        headtyp = win.fheadtyp;
        return headtyp;
        break;
    case 'headan':
        headan = win.fheadan;
        return headan;
        break;
    case 'headvon':
        headvon = win.fheadvon;
        return headvon;
        break;
    case 'headbetreff':
        headbetreff = win.fheadbetreff;
        return headbetreff;
        break;
    case 'headprio':
        headprio = win.fheadprio;
        return headprio;
        break;
    case 'headtermin':
        headtermin = win.fheadtermin;
        return headtermin;
        break;
    default:
    }
//  }
}

function setfkontaktvar(KontaktName,KontaktFirma,KontaktEMail,KontaktTelefon,Info,Doc) {
win=top;
//if (top.refopener!=null && top.refopener!='' ) {win=top.refopener;}
//    with (this) {

        if (KontaktName.indexOf(',')!=-1) {  //name,vorname,anrede
          KontaktAnrede=KontaktName.substr(KontaktName.lastIndexOf(',')+1)
          KontaktName=KontaktName.substr(0,KontaktName.lastIndexOf(','))
          KontaktVorname=KontaktName.substr(KontaktName.lastIndexOf(',')+1)
          KontaktName=KontaktName.substr(0,KontaktName.lastIndexOf(','))
        } else {
          KontaktVorname='?'; KontaktAnrede='?'
        }
        if(KontaktName!='?') {win.fKontaktName = KontaktName;}
        if(KontaktVorname!='?') {win.fKontaktVorname = KontaktVorname;}
        if(KontaktAnrede!='?') {win.fKontaktAnrede = KontaktAnrede;}
        if(KontaktFirma!='?') {win.fKontaktFirma = KontaktFirma;}
        if(KontaktEMail!='?') {win.fKontaktEMail = KontaktEMail;}
        if(KontaktTelefon!='?') {win.fKontaktTelefon = KontaktTelefon;}
        if(Info!='?') {win.fInfo=Info;}
        if (Doc!=false || Doc!=null) {if(Doc!='?') {win.fDoc=Doc;}}
//    }
}
function getfkontaktvar(a) {
win=top;
//if (top.refopener!=null && top.refopener!='' ) {win=top.refopener;}
//  with (this) {
    switch (a) {
    case 'KontaktName':
        if (fKontaktName==null) {win.fKontaktName='';}
        KontaktName = win.fKontaktName;
        return KontaktName;
        break;
/*
    case 'KontaktVorname':
        if (fKontaktVorname==null) {win.fKontaktVorname='';}
        KontaktVorname = win.fKontaktVorname;
        return KontaktVorname;
        break;
    case 'KontaktAnrede':
        if (fKontaktAnrede==null) {win.fKontaktAnrede='';}
        KontaktAnrede = win.fKontaktAnrede;
        return KontaktAnrede;
        break;
*/
    case 'KontaktFirma':
        if (fKontaktFirma==null) {win.fKontaktFirma='';}
        KontaktFirma = win.fKontaktFirma;
        return KontaktFirma;
        break;
    case 'KontaktEMail':
        if (fKontaktEMail==null) {win.fKontaktEMail='';}
        KontaktEMail = win.fKontaktEMail;
        return KontaktEMail;
        break;
    case 'KontaktTelefon':
        if (fKontaktTelefon==null) {win.fKontaktTelefon='';}
        KontaktTelefon = win.fKontaktTelefon;
        return KontaktTelefon;
        break;
    case 'Info':
        if (fInfo==null) {win.fInfo='';}
        Info = win.fInfo;
        return Info;
        break;
    case 'Doc':
        if (fDoc==null) {win.fDoc='';}
        Doc = win.fDoc;
        return Doc;
        break;
    default:
    }
//  }
}

//Cookie Verarbeitung
function setXID(win,cname,opt,opt1,opt2) {
  if (win=='' || win==null || win==false) {win=window;}
  if (cname==null) {cname='WIS'} // cookie name
  cname=cname.toUpperCase()
  if (opt==null) {opt=''}        // values cookie oder commands for kind of cookie
  if (opt1==null) {opt1=''}      // commands for kind of cookie
  if (opt2==null) {opt2=''}      // commands for set var: V=top.var, F=Form (only form 0),RET=return, MSG=Message with cookie value, +D=add Date to cookie; multiplie can be used seperate with space
  theForm='';
  if (win.document!=null) {
    if (win.document.forms[0]!=null) { theForm=win.document.forms[0] }
  }
  i=''; i1=''; i2=''; cval='';
  opt1=opt1.toUpperCase();opt2=opt2.toUpperCase();
  i1=self.location;i1=i1.toString();i1=i1.toUpperCase();
  i2=top.location;i2=i2.toString();i2=i2.toUpperCase();
  if ( (i1.indexOf(cname+'=')!=-1 && i1.indexOf('NEW')!=-1) || (i2.indexOf(cname+'=')!=-1 && i2.indexOf('NEW')!=-1)) { opt1=opt1+' NEW' }
  if ( (i1.indexOf(cname+'=')!=-1 && i1.indexOf('SET')!=-1) || (i2.indexOf(cname+'=')!=-1 && i2.indexOf('SET')!=-1)) { opt1=opt1+' SET' }
  if ( (i1.indexOf(cname+'=')!=-1 && i1.indexOf('DEL')!=-1) || (i2.indexOf(cname+'=')!=-1 && i2.indexOf('DEL')!=-1)) { opt1=opt1+' DEL' }
  i1=''; i2='';
  if (  opt1.indexOf('NEW')==-1 && opt.indexOf('NEW')==-1 ) {i=GetCookie(cname,top) }                  // set NEW Cookie, ignorie previus cookie value
  if (  opt1.indexOf('SET')!=-1 || opt.indexOf('SET')!=-1 ) {i=''}                                     // SET the Cookie value - ignore other values i.e. in url
  if ( (opt1.indexOf('DEL')!=-1 || opt.indexOf('DEL')!=-1 ) && i!='') {i=''; DeleteCookie(cname,top)}  // DELete cookie
  //if (  opt1=='PRESET') {i=''}                                               // PRESET value (=DEFAULT), used if no value in url is availibly
  //if (  opt1=='READ') {i=''}                                                 // only READ value for cookie
  if (i==null) {i=''}
  if (i.indexOf('PID=')!=-1) { i=i.substr(i.indexOf('PID=')) } //Suchen PID
  if (i.indexOf('&')!=-1) { i=i.substr(0,i.indexOf('&')) } //Abschneiden Search Werte
  if (i.indexOf('#')!=-1) { i=i.substr(0,i.indexOf('#')) } //Abschneiden Hash Werte

  if (i!=null && i!='') {
    cval=i; i1=i;
  } else {
    //i = opt
    i=''
    if (theForm!='') { if (i.indexOf('PID=')==-1) { i=theForm.headmessageid.value  } }
    if ( top[cname]!=null) { if (i.indexOf('PID=')==-1) { i= top[cname]  } }
    //if (i.indexOf(cname+'=')==-1) { i=self.location;i=i.toString() }
    if (i.indexOf(cname+'=')==-1) { i=top.location;i=i.toString() }
    if (i.indexOf(cname+'=')!=-1) {
      cval=i.substr(i.indexOf(cname+'=')+4)
      if (cval.indexOf('&')!=-1) { cval=cval.substr(0,cval.indexOf('&')) } //Abschneiden Search Werte
      if (cval.indexOf('#')!=-1) { cval=cval.substr(0,cval.indexOf('#')) } //Abschneiden Hash Werte
      if (cval.indexOf(';')!=-1) { cval=cval.substr(0,cval.indexOf(';')) }
    }
  }
  if ( opt1=='SET' && opt!='' ) {cval=opt;} //;i=opt
  if ( opt1=='PRESET' && opt!='' && cvald=='') {cval=opt;} //;i=opt

  i=i1
  if (cval=='DEL') {
    DeleteCookie(cname,top)
    cval=''
  } else if (cval=='READ' || opt1.indexOf('READ')!=-1 || opt.indexOf('READ')!=-1 ) {
    //  || opt1=='NEW' || opt=='NEW'
  } else {
    if (cval!='') {
      if (opt2.indexOf('+D')!=-1 && cval.indexOf(.20)==-1) {
        if (cval.indexOf(',')!=-1) {
          cval=cval.substr(0,cval.indexOf(','))        //Abschneiden Datumswerte
        }
        cval=cval+', '+GetDate('D')
      }
      if (i.indexOf(cval)==-1) { SetCookie(cname,cval,top) }
    } else {
      //i1=GetCookie(cname) //,top)
      if (i==null || i=='') {
        if (cval!='') { SetCookie(cname,cval,top) }
      }
    }
  }
  if (GetCookie(cname,top)==cval && cval!='') {
    if (opt2.indexOf('FORM')!=-1 && theForm!='') { theForm.headmessageid.value= cname+'='+cval+';' }
    if (opt2.indexOf('VAR')!=-1)                { top[cname]=cname+'='+cval+';' }
    if (opt2.indexOf('RET')!=-1)                { return (cname+'='+cval+';') }
    if (opt2.indexOf('MSG')!=-1)                { alert ('Das Cookie mit dem Namen: '+cname+' \nhat den folgenden Wert: \n'+cval+'') }
  } else {
    if (opt2.indexOf('FORM')!=-1 && theForm!='') { theForm.headmessageid.value= cname+'='+cval+';NoCookie' }
    if (opt2.indexOf('VAR')!=-1)                { top[cname]=cname+'='+cval+';NoCookie' }
    if (opt2.indexOf('RET')!=-1)                { return (cname+'='+cval+';NoCookie') }
    if (opt2.indexOf('MSG')!=-1)                { alert ('Das Cookie mit dem Namen: '+cname+' \nhat keinen Wert gesetzt'+cval+'') }
  }
  //if (GetCookie(cname,top)!='') { alert(top['cname']+":"+GetCookie(cname,top)) }
}
//PartnerID lesen/setzen
function setPID(win,opt,opt1,opt2) {
  if (win=='' || win==null || win==false) {win=window;}
  if (opt==null) {opt=''}; if (opt1==null) {opt1=''}; if (opt2==null) {opt2=''}
  ret=setXID(win,'PID',opt,opt1,opt2)
  if (opt2.indexOf('RET')!=-1) { return (ret) }
}

function pagegettitel(win,opt) {
  if (win=='' || win==null || win==false) {win=top.opener;}
  if (win==null || win==false) {win=window;}
  i=true
  titel=''
  window.onError=null;
  window.onError="i=false";
//  if (win.location.hostname!=self.location.hostname) {
//    if (win.location.protocol=='https:' && self.location.protocol=='https:') { i=false }
//  }
//else { win=window[win];}

  s=top.location; s=s.toString();
  if (s.indexOf('!OPTITEL=')!=-1) {
    s=s.substr(s.indexOf('!OPTITEL=')+9)
    if (s.indexOf('?')!=-1) { s.substr(0,s.indexOf('?')!=-1) }
    if (s.indexOf('?')!=-1) { s.substr(0,s.indexOf('#')!=-1) }
    while (s.indexOf('%20')!=-1) {
      s=s.replace('%20',' ')
    }
    titel=s;
    i=false
  }
  if (i==true) {
    if (titel=='') {
      s=win.frames[1].document.title;
      if (win.frames[1].length>0) {
        s=win.frames[1].frames[1].document.title;
        if (win.frames[1].frames[1].length>0) {s=win.frames[1].frames[1].frames[1].document.title;}
       }
      if (s.lastIndexOf('Wiesinger/Schenk')!=-1 )
        {spos=s.lastIndexOf('Wiesinger/Schenk')+17;
         s=s.substring(spos,s.length);}
      if (s.indexOf('- ')!=-1 )
        {spos=s.indexOf('- ')+2;
         s=s.substring(spos,s.length);}
      titel=s;
    }
    if (opt!=null && opt!=false) {
      if (opt=='+MARK' && win.pagewinmark!=null && win.pagewinmark!=false) {titel=titel+": "+win.pagewinmark;}
    }
  }
  return (titel);
}

//DEFAULT FUNCTIONS PAGE
//
function pageload(win) {
win.pageload('');
}
function pageback() {
  self.back();
  //return (true);
}
function pageforward() {
  self.forward();
//  return (true);
}
function pagerefresh(win) {
  if (win=='' || win==null || win==false) { win=window;}
  self.open(win.location);
//  return (true);
}
function pageprint() {
 self.print();
}
function pagemail() {
}
function pagesubmit(theForm) {
}
function pagelink(theForm,url,target,options,veruser) {
  win=window;
  window.onError = null;
  topener=''; topenername=''
  //topener=top.opener
  //topenername=top.opener.name
  if (target == '') {target=self.name;}
  if (url != '' && url != self.location )
  // && target != self.name)
  {
    // RENAME/CLOSE WINDOW IF WEBSEARCH IS SINGLE WINDOW
    if (topener==null || topener==false || topenername!=target) {
      if (top.name!=window.name) {
        if (window.name=='WebSearch') {window.name='Web'}
        if (window.name=='WebHelp') {window.name='Web'}
      }
    } else {
      if (window.name=='WebSearch' && target.lastIndexOf(window.name)==-1 && top.opener.name!='Web') {options = 'Close'}
      if (window.name=='WebHelp' && target.lastIndexOf(window.name)==-1 && top.opener.name!='Web') {options = 'Close'}
    }
    // window.onError = pagelink2(url,target); //ERROR IN IE
    l=window.location;
    l=l.toString();
    //if (url.lastIndexOf('index.html')==-1 && url.lastIndexOf('index.htm')!=-1)
      //{ if (l.lastIndexOf('mailer.wis')!=-1)
      //  {url=url;}
      //else if (url.lastIndexOf('index.htm?')!=-1 || url.lastIndexOf('index.htm?')!=-1)
      //  {url=url+"l";}
      //}
    //if (target != self.name)
    //  {window.blur();}
    if (options == '' || options == 'Close') {
      win=window.open(url,target);
    } else {
      win=window.open(url,target,options);
    }
  }
  if (url != '' && url == self.location && target == self.name) { self.refresh();}
/*
  if (url.indexOf('wis.de')!=-1 ) {
    window.onError=null;
    msg='Willkommen zu: '+win.document.title
    self.status=msg;
    win.defaultStatus=msg;
    win.onfocus="parent.DisplayMSG(this,window.status)";
  }
*/
  win.focus()

  if (options == 'Close') {window.close();}
}
function pagelinksub(theForm,url,target,options,veruser,suburl,subtarget,timer) {
  pagelink(theForm,url,target,options,veruser);
  //pagelink(theForm,suburl,subtarget,options,veruser);
  if (suburl!='') {
    //if (subtarget != 'Web' && subtarget != target || url.lastIndexOf('index.htm')==-1)
    //{_top.WebTop.pageResetImage();}
    if (timer=='') {timer='15000';}
    i=top.timeid;
    i=clearTimeout(i);
    i=setTimeout("top.pagelink('','"+suburl+"','"+subtarget+"','','')",timer);
  }
}
function pagelink2(url,target) {
  //.htm wird zu .html
  url=url+'l';
  window.open(url,target);
}
function forwardlink(win,url,target,timer) {
if (win=='' || win==null || win==false) { win=window;}
var language="";
var i=0;
var msg='';
  //win.defaultStatus=msg;
  //win.onfocus="parent.DisplayMSG(this,window.status)";
  if (timer=='')
    {timer='15000';}
  i=top.timeid;
  i=clearTimeout(i);
  i=setTimeout("top.pagelink('','"+url+"','"+target+"','','')",timer);
  //top.settimeid(i);
}

//DEFAULT FUNCTIONS PARENT PAGE
//
function parentpageback(win) {
 if (win=='' || win==null || win==false) {
   win=self.top.pagewin;
   if (win.closed) {win=self.top.pagewin.parent;}
   }
 if (win.closed) {win=self.parent;}
 url=win.location;
 win.back();
 if (url==win.location) {win.parent.back();}
  //self.parent.back();
  //if (url==self.parent.location) {self.parent.back();}
  //self.history.go(-1);
  //url=self.history.previous;
  //self.history.go(i);
}
function parentpageforward(win) {
 if (win=='' || win==null || win==false) {
   win=self.top.pagewin;
   if (win.closed) {win=self.top.pagewin.parent;}
   }
 if (win.closed) {win=self.parent;}
 url=win.location;
 win.forward();
 if (url==win.location) {win.parent.forward();}
  //self.parent.forward();
  //self.history.go(-1);
  //url=self.history.next;
  //self.history.go(i);
}

function parentpageprint(win) {
 if (win=='' || win==null || win==false) {
   url=self.top.pagewin;
   url.print();
 } else {
   if (win.closed) {
     self.print();
   } else {
     win.print();
   }
 }
}
function parentpagefind(win) {
 if (navigator.appName=='Netscape') {
   if (win=='' || win==null || win==false) {
     url=self.top.pagewin;
     url.find();
   } else {
     if (win.closed) {
       self.find();
     } else {
       win.find();
     }
   }
 } else {
   alert('Die Suchfunktion kann bisher nicht unterstützt werden,\rverwenden Sie stattdessen die Funktion Suchen oder STRG-F.');
 }
}
function parentpagebookmark(win) {
 if (navigator.appName=='Netscape') {
   if (win=='' || win==null || win==false) {
     url=self.top.pagewin;
     url.focus();
     xwin=url;xloc=url.location;xtit=url.document.title
     //alert('Die Seite "'+url.document.title+'" wurde markiert,\rverwenden Sie jetzt die entsprechende Funktion Lesezeichen oder STRG-D.');
       //self.top.pagewin.focus()
       //alert(self.top.pagewin.name)
       //alert('Die Seite "'+self.top.pagewin.document.title+'" wurde markiert,\rverwenden Sie jetzt die entsprechende Funktion Lesezeichen oder STRG-D.');
   } else {
     if (win.closed) {
       self.focus();
       xwin=self;xloc=self.location;xtit=self.document.title
       //alert('Die Seite "'+self.document.title+'" wurde markiert,\rverwenden Sie jetzt die entsprechende Funktion Lesezeichen oder STRG-D.');
     } else {
       win.focus();
       xwin=win;xloc=win.location;xtit=win.document.title
       //alert('Die Seite "'+win.document.title+'" wurde markiert,\rverwenden Sie jetzt die entsprechende Funktion Lesezeichen oder STRG-D.');
     }
   }
   //x=window.open(xloc,'Bookmark','status=yes,scrollbars=no,resizable=no,width=1,height=1');
   x.focus();
   x.blur();
   alert('Die Seite "'+xtit+'" wurde markiert,\rverwenden Sie jetzt die entsprechende Funktion Lesezeichen oder STRG-D.');
   //x=window.open(xloc,'Bookmark','status=yes,scrollbars=no,resizable=yes,width=670,height=20');
   //x.focus();
   //document.open();
   //document.writeln("Die Seite<br>");
   //document.writeln(xtit+"<br>");
   //document.writeln("wurde markiert. verwenden Sie jetzt die entsprechende Funktion Lesezeichen oder STRG-D.<br>");
   //document.close() ;
 } else {
   if (win=='' || win==null || win==false) {
     url=self.top.pagewin;
     window.external.AddFavorite(url.location,url.document.title)
   } else {
     if (win.closed) {
       window.external.AddFavorite(self.location,self.document.title)
     } else {
       window.external.AddFavorite(win.location,win.document.title)
     }
   }
 }
}

function pageloadmark(win) {
if (win=='' || win==null || win==false) {win=window;}
hash='';
with (win) {
  if (hash=='' && self.top.location.hash>"" ) {
    hash=top.location.hash;
    top.setvarmark(hash.substring(1))
    self.location=self.location+hash;
//  } else if (top.WebPage.location.hash!="" ) {
//    hash=top.WebPage.location.hash;
  }
  if (hash=='' && top.document.frames.length >= 1) {
    if ( top.document.frames[1].location.hash!="" ) {
      hash=top.document.frames[1].location.hash;
      top.setvarmark(hash.substring(1))
      self.location=self.location+hash;
    }
  }
  if (hash=='' && parent.location.hash!="" ) {
    hash=parent.location.hash;
    top.setvarmark(hash.substring(1))
    self.location=self.location+hash;
  }
}
}

function pagegotomark(win,mark) {
  if (win=='' || win==null || win==false) { win=window;}
  var url=win.location;
  var urlhash=win.location.hash;
  var urlsearch=win.location.search;
  url=url.toString();
  if (url.lastIndexOf('.htm')!=-1)
   {ipos=url.lastIndexOf('.htm')+4;
    url=url.substr(0,ipos);}
  var gotourl=url+'#'+mark;
  if (urlhash=='') {gotourl=gotourl+urlsearch;}
  if (mark.toUpperCase()=="TOP") {
    win.scroll(0,0);
    setvarmark('');
  } else if (mark.toUpperCase()=="END") {
    win.scroll(0,99999);
    var i=win.document.anchors.length;
    if (i>=0){setvarmark(win.document.anchors[i-1].name);} else {setvarmark('');}
  } else if (mark.toUpperCase()=="MID") {
    win.scroll(0,win.outerHeight/2);
  } else if (mark.toUpperCase()=="END1") {
    win.scroll(0,win.pageYOffset+win.innerHeight);
  } else if (mark.toUpperCase()=="PREV") {
    win.scroll(0,win.pageYOffset-win.innerHeight);
  } else if (mark.toUpperCase()=="FORW") {
    win.scroll(0,win.pageYOffset+win.innerHeight+1);
  } else if (mark.toUpperCase()=="NEXT") {
    marklast=this.pagewinmark;
    for (i=1; i<=win.document.anchors.length;i++) {
      if (i<win.document.anchors.length) {
        var a=win.document.anchors[i].name;
        if (marklast=='') {
          i=1;
          if (win.document.anchors[i].name=="Top") {i=i+1;}
          setvarmark(win.document.anchors[i].name);
          gotourl=url+'#'+win.document.anchors[i].name;
           if (urlhash=='') {gotourl=gotourl+urlsearch;}
          if (win.document.anchors[i].name!='End') {
            //window.open(gotourl,win.name);
            win.location= gotourl;}
          i=win.document.anchors.length+2;
        } else if (marklast==a) {
          if (i+1<win.document.anchors.length) {
            i=i+1;
            setvarmark(win.document.anchors[i].name);
            gotourl=url+'#'+win.document.anchors[i].name;
              if (urlhash=='') {gotourl=gotourl+urlsearch;}
            if (win.document.anchors[i].name!='End') {
              //window.open(gotourl,win.name);
              win.location= gotourl;}
            i=win.document.anchors.length+2;
          }
        } else {
        }
      } else {
      }
    }
  } else if (mark.toUpperCase()=="BACK") {
    marklast=this.pagewinmark;
    for (i=0; i<=win.document.anchors.length+1;i++) {
      if (i<win.document.anchors.length) {
        var a=win.document.anchors[i].name;
        if (marklast=='') {
          i=1;
          setvarmark(win.document.anchors[i].name);
          gotourl=url+'#'+win.document.anchors[i].name;
           if (urlhash=='') {gotourl=gotourl+urlsearch;}
          i=win.document.anchors.length+2;
          //window.open(gotourl,win.name);
          win.location= gotourl;
        } else if (marklast==a) {
          if (i-1>0) {
            i=i-1;
              setvarmark(win.document.anchors[i].name);
              gotourl=url+'#'+win.document.anchors[i].name;
                     if (urlhash=='') {gotourl=gotourl+urlsearch;}
              i=win.document.anchors.length+2;
              //window.open(gotourl,win.name);
              win.location= gotourl;
          }
        } else {
        }
      }
    }
  } else {
    window.open(gotourl,win.name);
  }
}
// win für aktuelles fenster, oder über target angabe definiertes
// aufruf href="javascript:top.pagegotomark(this,'End');" target='WebInfoPageTextLauf'
// this = paramter für win, wenn target angegeben ist this=target


//DOCOMENT AUTOMAT. FUNKTIONS
//
function parentpageshow(win,page,suburl,reftitel) {
 if (win=='' || win==null || win==false) { win=window;}
 if (page==null) { page='';}
 if (suburl==null) { suburl='';}
 if (reftitel==null) { reftitel='';}
 page=page.toLowerCase();

if (page!='') {
 pagehost='';
 var url=win.location;
 url=url.toString();
 if (url.lastIndexOf('/_')!=-1) {
   url=url.substr(0,url.lastIndexOf('/_')-4);
 } else {
   url=win.location.protocol+'//'+win.location.hostname
   //url='/';
 }
 pagehost=url;
 if (pagehost.indexOf('ssl.wis.de')!=-1) {
   pagehost='http://www.wis.de'
   //if (page.indexOf('kontakt')!=-1 || page.indexOf('abbo')!=-1) {
   //  pagehost='https://ssl.wis.de'
   //} else {
   //}
 }

 url=win.location; url=url.toString();
 pagedomain='wis';
 pageurl='';
 pageurl2='';
 pagewinname='Web';
 pagewinopt='';
 pagelang='';
  //language=top.GetCookie('Language');
  //if (language==null) {language='';}
  //if (language=='' &&  navigator.language=="de" || language=='' && navigator.language=="DE") { language='German'}
  language='';language=getlanguage();

  if (language=='German') {
    pagelang='_german/';
  } else {
    pagelang='_german/';
  }

  //if ( page.indexOf('')!=-1 || page.indexOf('')!=-1 ) {page='' }
  if ( page.indexOf('news')!=-1 || page.indexOf('aktuell')!=-1 ) {page='news' }
  if ( page.indexOf('proj')!=-1 ) {page='proj' }
  if ( page.indexOf('prod')!=-1 ) {
    if ( page.indexOf('infopage')!=-1 ) { page='produkt_infopage' }
    else if ( page.indexOf('cert')!=-1 ) {
      if ( page.indexOf('search')!=-1 ) { page='search_cert' }
      else if ( page.indexOf('shop')!=-1 ) { page='produkt_cert_shop' }
      else { page='produkt_inet_certs' }
    }
    else if ( page.indexOf('shop')!=-1 ) {
      if ( page.indexOf('sofw')!=-1 ) { page='produkt_sofw_shop' }
      else if ( page.indexOf('cert')!=-1 ) { page='produkt_cert_shop' }
      else if ( page.indexOf('inet')!=-1 ) { page='produkt_inet_shop' }
      else { page='produkt_shop' }
    } else {
      page='prod'
    }
  }
  if ( page.indexOf('search')!=-1 || page.indexOf('suche')!=-1 ) {
    if ( page.indexOf('word')!=-1 || page.indexOf('begriff')!=-1 ) { page='search_word' }
    else if ( page.indexOf('index')!=-1 ) { page='search_index' }
    else if ( page.indexOf('explore')!=-1 ) { page='search_explore' }
    else if ( page.indexOf('adress')!=-1 || page.indexOf('addres')!=-1) { page='search_adress' }
    else if ( page.indexOf('cert')!=-1 ) { page='search_cert' }
    else {
      page='search'
    }
  }
  if ( page.indexOf('kontakt')!=-1 || page.indexOf('contact')!=-1) {
    if ( page.indexOf('info')!=-1 ) {page='kontakt_info' }
    else if ( page.indexOf('filedownload')!=-1 ) {page='kontakt_filedownload' }
    else if ( page.indexOf('docdownload')!=-1 ) {page='kontakt_docdownload' }
    else if ( page.indexOf('download')!=-1 ) {page='kontakt_docdownload' }
    else if ( page.indexOf('wecker')!=-1 || page.indexOf('timer')!=-1) {page='kontakt_wecker' }
    else if ( page.indexOf('spezial')!=-1 ) {page='kontakt_spezial' }
    else if ( page.indexOf('_')==-1 ) {
      page='kontakt'
    } else {
    }
  }
  if ( page.indexOf('docdownload')!=-1 ) {page='kontakt_docdownload' }
  if ( page.indexOf('filedownload')!=-1 ) {page='kontakt_filedownload' }
  if (page.indexOf('_')==-1) {
    if ( page.indexOf('chat')!=-1 || page.indexOf('servicechat')!=-1) {page='chat' }
    if ( page.indexOf('help_impressum')!=-1 || page.indexOf('hilfe')!=-1) {page='help_impressum' }
    if ( page.indexOf('help')!=-1 || page.indexOf('hilfe')!=-1) {page='help' }
    if ( page.indexOf('info')!=-1 ) {page='info' }
    if ( page.indexOf('impress')!=-1 ) {page='impress' }
  }

  //Übergabe Titel
    if (reftitel=='') {
      s=''  ; wint=top.window
      if (wint.frames[1]!=null) {
        if (wint.frames[1].length>0) {  s=wint.frames[1].document.title; }
        if (wint.frames[1].frames[1].length>0) { s=wint.frames[1].frames[1].document.title; }
        if (wint.frames[1].frames[1].length>0) { s=wint.frames[1].frames[1].frames[1].document.title; }
      }
    } else {
      s=reftitel
    }
    if (s.lastIndexOf('Wiesinger/Schenk')!=-1 )
      {spos=s.lastIndexOf('Wiesinger/Schenk')+17;
       s=s.substring(spos,s.length);}
    if (s.indexOf('- ')!=-1 )
      {spos=s.indexOf('- ')+2;
       s=s.substring(spos,s.length);}
    while (s.indexOf(' ')!=-1) {
      s=s.replace(' ','%20')
    }
    reftitel=s;
    //if (reftitel!='') { reftitel=reftitel+'!OPTITEL='+reftitel; }
    reftitel='#!OPTITEL='+reftitel;
// reftitel=''

 switch(page) {

 case 'home':
     pagedomain='wis';
     //pagelang='';
     pageurl='index.htm';
     pagewinname=top.name;//'Web';
   if (pagehost.indexOf('mailer.wis.de')!=-1) {
     pagehost='https://mailer.wis.de'
     pagedomain='wis';
   } else if (pagehost.indexOf('ssl.wis.de')!=-1) {
     pagehost='https://ssl.wis.de'
     pagedomain='shop';
     pageurl='';
   } else if (pagehost.indexOf('wis.de')!=-1) {

   } else if (pagehost.indexOf('pages.wsx.de')!=-1) {
     pagehost='http://pages.wsx.de'
     pagedomain='user';
     pageurl='';
   } else if (pagehost.indexOf('chat.wsx.de')!=-1) {
     pagehost='http://chat.wsx.de'
     pagedomain='';
     pageurl='';
   } else {
     pagedomain='wis';
     //pagelang='';
     pageurl='index.htm';
     pagewinname=top.name;//'Web';
   }
   break;

 case 'wis':
   pagedomain='wis';
   //pagelang='';
   pageurl='index.htm';
   pagewinname=top.name;//'Web';
   break;

 case 'news':
 // || 'aktuell' || 'aktuelles':
   pageurl='news/newpfrm.htm';
   //if (suburl!='' && suburl.indexOf('.htm')==-1) {pageurl2='?'+suburl;}
   pagewinname='WebPage';
   pagewinopt='';//scrollbars=yes,resizable=yes';
   break;
 case 'abbo_register':
   pagehost='https://mailer.wis.de'
   pageurl='public/webkont.htm';
   //pageurl2='?news/abbo/page000t.htm#List';
   pageurl2='?public/servpg/webkabbo.htm';
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=530';
   break;
 case 'abbo_storno':
   pagehost='https://mailer.wis.de'
   pageurl='public/webkont.htm';
   pageurl2='?public/servpg/webkasto.htm';
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=530';
   break;

 case 'service':
   pageurl='service/svcpfrm.htm';
   pagewinname='WebPage';
   pagewinopt='';//scrollbars=yes,resizable=yes';
   break;

 case 'proj':
 // || 'projekt' || 'project':
   pageurl='projekte/prjpfrm.htm';
   pagewinname='WebPage';
   pagewinopt='';//scrollbars=yes,resizable=yes';
   break;

 case 'prod':
 // || 'produkt' || 'product':
   pageurl='produkte/prdpfrm.htm';
   pagewinname='WebPage';
   pagewinopt='';//scrollbars=yes,resizable=yes';
   break;

 case 'produkt_infopage':
   pageurl='produkte/prdinfop.htm';
   pageurl2='?public/kontpg/webkdown.htm';
   pagewinname='WebProduktPageInfo';
   pagewinopt='status=yes,scrollbars=no,resizable=no,top=10,left=10,width=440,height=335';
   break;
 case 'produkt_inet_certs':
 // || 'product_inet_certs' || 'inet_certs' || 'certs':
   pageurl='produkte/prdpfrm.htm';
   pageurl2='?internet/page0070.htm';
   pagewinname='WebPage';
   pagewinopt='';
   break;
 case 'produkt_shop':
 // || 'product_shop' || 'shop' || 'webshop':
   pagehost='https://ssl.wis.de'
   //pagedomain='wis';
   //pageurl='produkte/Shop/index.htm';
   pagedomain='';pagelang='';
   pageurl='shop'
   pagewinname='WebShop';
   //pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=0,width=800,height=600';
   pagewinopt='menubar=yes,personalbar=yes,toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=no,width=800,height=600,top=10,left='+(((screen.width-800)/2))+""
   break;
 case 'produkt_sofw_shop':
 // || 'product_softw_shop' || 'softw_shop':
   pagehost='https://ssl.wis.de'
   //pagedomain='wis';
   //pageurl='produkte/Shop/index.htm?Software#Softline';
   pagedomain='';pagelang='';
   pageurl='soft'
   pagewinname='WebShop';
   //pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=0,width=800,height=600';
   pagewinopt='menubar=yes,personalbar=yes,toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=no,width=800,height=600,top=10,left='+(((screen.width-800)/2))+""
   break;
 case 'produkt_cert_shop':
 // || 'product_cert_shop' || 'cert_shop' || 'certshop':
   pagehost='https://ssl.wis.de'
   //pagedomain='wis';
   //pageurl='produkte/Shop/index.htm?Zertifikate#GlobalSign';
   pagedomain='';pagelang='';
   pageurl='certs'
   pagewinname='WebShop';
   //pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=0,width=800,height=600';
   pagewinopt='menubar=yes,personalbar=yes,toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=no,width=800,height=600,top=10,left='+(((screen.width-800)/2))+""
   break;
 case 'produkt_inet_shop':
 // || 'product_inet_shop' || 'inet_shop' || 'inetshop':
   pagehost='https://ssl.wis.de'
   //pagedomain='wis'
   //pageurl='produkte/Shop/index.htm?Internet#Netdiscounter';
   pagedomain='';pagelang='';
   pageurl='inet'
   pagewinname='WebShop';
   //pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=0,width=800,height=600';
   pagewinopt='menubar=yes,personalbar=yes,toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=no,width=800,height=600,top=10,left='+(((screen.width-800)/2))+""
   break;

 case 'search_cert':
   //'product_cert_search':
   pagehost='https://ssl.wis.de'
   pagedomain='';pagelang=''; // !! sonst wis und _german
   pageurl='certs/request/index.htm?services.cfm?id=1413967734&reset=yes&language=de';
   pagewinname='WebShop';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=0,width=800,height=600';
   break;

 case 'search':
 // || 'suche' || 'suchen':
   pageurl='search/index.htm';
   //if (suburl!='' && suburl.indexOf('.htm')==-1) {pageurl2='?'+suburl;suburl=''}
   pagewinname='WebSearch';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,width=670,height=590';
   break;
 case 'search_word':
 // || 'suche_begriff':
   pageurl='search/index.htm';
   pageurl2='?search/srcword.htm';
   pagewinname='WebSearch';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,width=670,height=590';
   break;
 case 'search_index':
 //|| 'suche_index':
   pageurl='search/index.htm';
   pageurl2='?search/srcindx.htm';
   pagewinname='WebSearch';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,width=670,height=590';
   break;
 case 'search_explore':
 // || 'suche_explorer':
   pageurl='search/index.htm';
   pageurl2='?search/srcxplr.htm';
   pagewinname='WebSearch';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,width=670,height=590';
   break;
 case 'search_engine':
 // || 'suche_maschiene':
   pageurl='search/index.htm';
   pageurl2='?search/srcengn.htm';
   pagewinname='WebSearch';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,width=670,height=590';
   break;
 case 'search_adress':
 //|| 'suche_adresse':
   pageurl='search/index.htm';
   pageurl2='?search/srcword.htm';
   pagewinname='WebSearch';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,width=670,height=590';
   break;

 case 'help':
 // || 'hilfe':
   pageurl='public/webhelp.htm';
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;

 case 'info':
 //|| 'information':
   pageurl='info/infpfrm.htm';
   pagewinname='WebPage';
   pagewinopt='';//scrollbars=yes,resizable=yes';
   break;

 case 'impress':
 //|| 'impressum':
   pageurl='public/webimpr.htm';
   pagewinname='WebPage';
   pagewinopt='';//scrollbars=yes,resizable=yes';
   break;
 case 'help_impressum':
   pageurl='public/webhelp.htm';
   pageurl2='?public/webimpr.htm'
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;

 case 'kontakt':
 // || 'contact':
   pagehost='https://mailer.wis.de'
   pageurl='public/webkont.htm';
   if (reftitel!='') { pageurl=pageurl+reftitel; }
   //if (suburl!='' && suburl.indexOf('.htm')==-1) {pageurl='?'+suburl;suburl=''}
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;
case 'kontakt_info':
 //|| 'contact_info':
   pagehost='https://mailer.wis.de'
   pageurl='public/webkont.htm';
   if (reftitel!='') { pageurl=pageurl+reftitel; }
   pageurl2='?public/kontpg/webkinfo.htm';
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;
 case 'kontakt_telap':
 //|| 'contact_info':
   pagehost='https://mailer.wis.de'
   pageurl='public/webkont.htm';
   if (reftitel!='') { pageurl=pageurl+reftitel; }
   pageurl2='?info/infopg/wisp03t.htm';
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;
 case 'kontakt_weg':
 //|| 'contact_info':
   pagehost='https://mailer.wis.de'
   pageurl='public/webkont.htm';
   if (reftitel!='') { pageurl=pageurl+reftitel; }
   pageurl2='?info/infopg/wisp09t.htm';
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;
 case 'kontakt_docdownload':
 // || 'contact_docdownload':
   pagehost='https://mailer.wis.de'
   pageurl='public/webkont.htm';
   if (reftitel!='') { pageurl=pageurl+reftitel; }
   if (suburl=='' || suburl==null || suburl==false) { suburl='';} else {suburl='#'+suburl;}
   //pageurl2='?public/kontpg/webkdoc.htm'+suburl;
   pageurl2='?public/servpg/webkdoc.htm'+suburl;
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;
 case 'kontakt_filedownload':
 // || 'contact_docdownload':
   pagehost='https://mailer.wis.de'
   //if (url.indexOf('ssl.wis.de')!=-1) { pagehost='https://ssl.wis.de' }
   pageurl='public/webkont.htm';
   if (reftitel!='') { pageurl=pageurl+reftitel; }
   if (suburl=='' || suburl==null || suburl==false) { suburl='';} else {suburl='#'+suburl;}
   //pageurl2='?public/kontpg/webkdoc.htm'+suburl;
   pageurl2='?public/servpg/webkfile.htm'+suburl;
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;
 case 'kontakt_wecker':
 // || 'contact_timer' || 'wecker' || 'timer':
   pagehost='https://mailer.wis.de'
   pageurl='public/webkont.htm';
   if (reftitel!='') { pageurl=pageurl+reftitel; }
   pageurl2='?public/servpg/webmterm.htm';
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;
 case 'kontakt_spezial':
 // || 'contact_special' || 'spezial' || 'special':
   pagehost='https://mailer.wis.de'
   pageurl='public/webkont.htm';
   if (reftitel!='') { pageurl=pageurl+reftitel; }
   pageurl2='?public/kontpg/webkspez.htm';
   pagewinname='WebHelp';
   pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
   break;

 case 'wsx':
   pagehost='http://wsx.de';
   pagedomain='wsx';
   //pagelang='';
   pageurl='index.htm';
   pagewinname=top.name;//'Web';
   break;

 case 'chat':
 // || 'sevicechat':
   //pageurl='../../wsx/chat/index.htm';
   //pageurl='../../wsx/chat/chat.htm';
   if (url.hostname!=null && url.hostname!=false){
        pagehost='http://wsx.de';
           pagedomain='wsx';
   } else {
        pagehost='http://chat.wsx.de';
   }
   pagelang='';
   pageurl='chat/chat.htm';
   pagewinname='Chat';
   pagewinopt='status=yes,scrollbars=yes,resizable=no,top=10,left=10,width=694,height=600';
   break;

 default:
   break;
 }

 if (pageurl>'') {
   if (pageurl.lastIndexOf('index.htm')!=-1) {
     if (pageurl.indexOf('mailer.wis')!=0) {
       pageurl=pageurl+pageurl2;
     } else {
       pageurl=pageurl+"l"+pageurl2;
     }
   } else {
     pageurl=pageurl+pageurl2;
   }
   r='';
   if (win=='return') { r='return';win=''; }
   if (win=='' || win==null || win==false) {
     win=self.top.pagewin;
     if (win.closed) {win=self.top.pagewin.parent;}
   }
   if (win.closed) {win=self.parent;}
//   var url=win.location;
//   url=url.toString();

   if (pagedomain!='') {pagedomain=pagedomain+'/'}
   if (pagedomain.substring(0,1)!='/') { pagedomain='/'+pagedomain }
   if (url.hostname!=null && url.hostname!=false) {
     url=pagehost+pagedomain;  //+'/'
   } else if (url.hostname!=pagehost) {
     url=pagehost+pagedomain;   //+'/'
   } else {
     if (url.lastIndexOf('/_')!=-1) {
       //ipos=url.lastIndexOf('/_')+1;
       //url=url.substr(0,ipos);
       ipos=url.lastIndexOf('/_')-4;
       url=url.substr(0,ipos)+pagedomain;
     } else {
       url='/'+ pagedomain;
     }
   }
   search='';
//alert(url+pagelang+pageurl+search)
   if (suburl!=null && suburl!=null && suburl!=false) {   if (suburl>"") { search="?"+suburl;} }
   if (pagewinopt!=''){
     win=window.open(url+pagelang+pageurl+search,pagewinname,pagewinopt);
   } else {
     win=window.open(url+pagelang+pageurl+search,pagewinname);
   }
/*
   if (url.indexOf('wis.de')!=-1 ) {
     window.onError=null;
     msg='Willkommen zu: '+win.document.title
     self.status=msg;
     win.defaultStatus=msg;
     win.onfocus="parent.DisplayMSG(this,window.status)";
   }
*/
   win.focus()
   if (r=='return') { return (win) }
   //return (true);
 }
}
}
function parentpageshowsub(win,page,suburl,subtarget,timer) {
 if (page>'') {
   if (suburl.indexOf('/public')>0) {
     ipos=suburl.indexOf('/public')+1;
     suburl=suburl.substr(ipos);
   }
   parentpageshow(win,page,suburl);
 }
}
function parentpageshowext(page,ext,link,linkopt) {
 top.shopname=ext;
switch(ext) {
 case ' ':
   var url='';
   return url;
   break;

 default:
   break;
 }
}

function parentpagekontaktsub1(win,suburl,subtarget,timer) {
  if (win=='' || win==null || win==false) { win=window;}
  parentpagekontakt('');
  //  i=parentpagekontakt('return');
  //if (i.closed) {
    if (timer=='')
     {timer='15000';}
    i=top.timeid;
    i=clearTimeout(i);
    i=setTimeout("top.pagelink('','"+suburl+"','"+subtarget+"','','')",timer);
    //top.settimeid(i);
  //} else {
  //  pagelink(i,suburl,subtarget,'','');
  //}
}

//MAIL LDAP FUNCTIONS
//
function parentpagemail(win,to,cc,bcc,subject) {
  if (win=='' || win==null || win==false) { win=top;}
  //win=top;
  if (subject=='') {
    s=win.frames[1].document.title;
    if (win.frames[1].length>0) {
      s=win.frames[1].frames[1].document.title;
      if (win.frames[1].frames[1].length>0) {s=win.frames[1].frames[1].frames[1].document.title;}
     }
    if (s.lastIndexOf('Wiesinger/Schenk')!=-1 )
      {spos=s.lastIndexOf('Wiesinger/Schenk')+17;
       s=s.substring(spos,s.length);}
    if (s.indexOf('- ')!=-1 )
      {spos=s.indexOf('- ')+2;
       s=s.substring(spos,s.length);}
    subject="Ihre Webseite "+s;
    }
  if (to=='') {to="webmaster@wis.de";}
  if (cc!='') {cc="cc="+cc+"&";}
  if (bcc!='') {bcc="bcc="+bcc+"&";}
  self.location="mailto:"+to+"?"+cc+bcc+"Subject="+subject;
  //return (true);
}

function parentpageldap(win,page,subject) {
  if (win=='' || win==null || win==false) { win=top;}
  if (page==null) { page='';}
  if (subject==null) { subject='';}
  url=''
  if (page=='') {
    alert('Kein LDAP-Server definiert, Suche nicht moeglich.')
  } else {
    if (subject=='') {
      subject=prompt('Suche auf LDAP-Server '+page+' nach Zertifikat(en)\nGeben Sie den Allgmeinen Namen (Name der Person, des Server, ..) an:',subject)
    }
    if (subject!='' && subject!=null && subject!=false) {
      pagewinopt='status=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=600,height=590';
      pagewinname=page
      if (page='GLOBALSIGN') {
        url='ldap://ldap.globalsign.net/dc=globalsign,dc=net??sub?(cn=*'+subject+'*)'
      }
      if (url!='') {
        win=window.open(url,pagewinname,pagewinopt);
      }
    }
  }
  //return (false);
}

//LOGIN FUNCTIONS
//
function login_forwardlink(win) {
if (win=='' || win==null || win==false) { win=window;}
var language="";
var i=0;
var msg='';
 //language=top.GetCookie('Language');
 //if (language==null || language==false) {language='';}
 //if (language=='' &&  navigator.language=="de" || language=='' && navigator.language=="DE") { language='German'}
 language='';language=getlanguage();
 if (language=='') {
    language='German';timer='30000';
    msg="Bitte waehlen Sie Ihre Sprache / Please select your language";
    i=setTimeout("parent.login_pagelink('','','German',false)",'30000');
    top.settimeid(i);
  } else {
    win.document.forms[0].SelectSetCookie.checked='true';
    var timer=3000;
    if (language=='German')
      { msg="Sie werden auf die deutschen Seiten weitergeleitet";
        if (parent.WebTop.document.images.length>=0) {        parent.WebTop.pageLoadImage(parent.WebTop,'GERM',parent.WebTop.load_germ);}
        i=setTimeout("parent.login_pagelink('','','German',false)",timer);

        //parent.login_pagelink('','','German',false)
        top.settimeid(i);
      } else {
        msg="You are linked to the English sites";
        if (parent.WebTop.document.images.length>=0) {        parent.WebTop.pageLoadImage(parent.WebTop,'ENGL',parent.WebTop.load_engl);}
        //i=setTimeout("parent.login_pagelink('','','English',false)",timer);
        top.settimeid(i);
      }
  }
  self.status=msg;
  win.defaultStatus=msg;
  win.onfocus="parent.DisplayMSG(this,window.status)";
  //i=setTimeout("top.login_pagelink('',language,false)",timer);
}

function login_pagelink(win,theForm,command,cookie,LoginID,LoginDateTime,LoginName,LoginIP) {
t=top.timeid;
t=clearTimeout(t);

var i = "";
var url="";
  var url0=window.location;
  url0=url0.toString();
  if (url0.lastIndexOf('/_')!=-1)
   {ipos=url0.lastIndexOf('/_')+1;
    url0=url0.substr(0,ipos);}
   else
    {url0='';}

// Startseite Sprache
if (command == 'German') {
  language=command;
  i="Deutsche Seiten werden aufgerufen";
  window.status=i;
  if (cookie=='1')
    { i=i+" - Cookie wird gesetzt";
      top.SetCookie('Language',language);
      window.status=i;
    }
    msg="Willkommen auf den deutschen Seiten";
    self.status=msg;
    win.defaultStatus=msg;

  //url= url0+'_german/'
  url='';
  //window.open(url0+'_german/webpfrm.htm','WebPage');
  //i=setTimeout("pagelink('',"+url0+"'_german/webpfrm.htm','WebPage','','')",0)
  i=setTimeout("pagelink('',"+url0+"'_german/index.htm','Web','','')",0)
  top.settimeid(i);
  }
if (command == 'English') {
  language=command;
  i="English sites started";
  window.status=i;
  if (cookie=='1')
    { i=i+" - set Cookie";
      window.status=i;
      top.SetCookie('Language',language);
      msg="Welcome to englich pages";
      self.status=msg;
      win.defaultStatus=msg;
    }
  url=url0+'_english/';
  if (confirm("We are sorry, the english sites not availible at this moment! \rShould we link you to the german sites?"))
    { url=url0+'_german/';
      msg="Willkommen auf den deutschen Seiten";
      self.status=msg;
          url='';
          i=setTimeout("pagelink('',"+url0+"'_german/index.htm','Web','','')",0)
          top.settimeid(i);
      win.defaultStatus=msg;
    } else {
      url='';
    }
  }

// Loginseite
if (command == 'LoginStart_German') {
  login=top.GetCookie('Login');
  url='';
  var useraccount='';
  if (LoginID!=null && LoginID!=false) {
    useraccount=LoginID;
  } else {
    useraccount=prompt('Bitte geben Sie Ihre Zugangskennung ein:','')
  }
  if (useraccount) {
    if (useraccount=='') {
      command = 'LoginClose_German';
    } else {
      url='';
      if (cookie=='1') {
        if (top.GetCookie('Login') =='')
          { top.SetCookie('Login','Auto'); }
      } else {
        if (cookie!='-') {
          if (login != '') { top.SetCookie('Login',''); }
        }
      }
      //Login Submit
      //top.
        loginlink(win,theForm,command,cookie,useraccount)
    }
  }
}
if (command == 'LoginClose_German') {
  login=top.GetCookie('Login');
  if (cookie!='1')
    { top.SetCookie('Login',''); }
  url="";
  //window.open('../index.html','Web');
  //url='../';
  //self.back();
  //t=setTimeout("pagelink('','../index.html','Web','','')",'0');
  //top.settimeid(i);
  self.reload(true);
  }

// Weiterleitung
if (url != '') {
  window.status=i;
  url=url+'index.htm';
  target=top.name;
  //'Web';
  if (navigator.appName=='Netscape') {
    window.onError = pagelink2(url,target); }
  l=window.location;
  l=l.toString();
  if (url.lastIndexOf('index.html')==-1 && url.lastIndexOf('index.htm')!=-1)
    {if (l.lastIndexOf('mailer.wis')!=-1)
      {url=url;}
    else
      {url=url+"l";}
    }
  if (win=='') {
    window.self.open(url,target);
  } else {
    if (navigator.appName=='Netscape') {
      window.onError = Null; }
    target=win;
    window.open(url,target);
    //if (target!=self.name) {self.close();}
    }
  }
}

//FUNCTIONS CONFIG
function config_pagelink(win,theForm,command,cookie) {
if (win=='' || win==null || win==false) { win=window;}
var i = "";
var url="";
// Startseite Sprache
  if (command == 'Config_Language') {
    if (cookie=='1') {
      //if (top.GetCookie('Language') =='') {
        language='English';
        language=theForm.SelectLanguage.options[theForm.SelectLanguage.selectedIndex].value;
        if (language=='' && (navigator.language=="de" || navigator.language=="DE")) { language='German';}
        top.SetCookie('Language',language);
      //}
    } else {
      if (cookie!='-') {
        //top.SetCookie('Language','expires="Jan 01, 2000"');
        top.SetCookie('Language','');
      }
    }
  }

// Loginseite
  if (command == 'Config_LoginStart') {
    if (cookie=='1' || cookie=='true') {
      //if (top.GetCookie('Login') =='') {
        top.SetCookie('Login','Auto',win);
      //}
    } else {
      if (cookie!='-') {
        if (login != '') { top.SetCookie('Login',''); }
      }
    }
  }
}

//FUNCTIONS FORM AND MAIL
//Default Hidden Forms
function WebFormMessage(win,mtyp,mtitel,man,man1,mvon,mbetreff,mprio,mtermin,mcom,mmsg) {
if (win=='' || win==null || win==false) { win=window;}
    ftyp='';
    if (mtyp=='' || mtyp==null || mtyp==false) { mtyp='';}
    if (mtitel=='' || mtitel==null || mtitel==false) { mtitel='';}
    if (man=='' || man==null || man==false) { man='';}
    if (man1=='' || man1==null || man1==false) { man1='';}
    if (mvon=='' || mvon==null || mvon==false) { mvon='';}
    if (mbetreff=='' || mbetreff==null || mbetreff==false) { mbetreff='';}
    if (mprio=='' || mprio==null || mprio==false) { mprio='1';}
    if (mtermin=='' || mtermin==null || mtermin==false) { mtermin='';}
    if (mcom=='' || mcom==null || mcom==false) { mcom='';}
    if (mmsg=='' || mmsg==null || mmsg==false) { mmsg='';}

    if (mbetreff!='') {
        if (mtyp=='EMail') {
                ftyp='';
                if (man!='') {man='$$AN '+man;}
                if (man1!='') {man=man+', '+man1;}
        } else if (mtyp=='Fax') {
                ftyp='Fax';
                if (man!='') {man='$$NUMMERNLISTE '+man;}
                if (man1!='') {man='$$NUMMERNLISTE '+man1;}
        } else if (mtyp=='TMail') {
                ftyp='TMail';
                if (man!='') {man='$$NUMMERNLISTE '+man;}
                if (man1!='') {man='$$NUMMERNLISTE '+man1;}
        } else if (mtyp=='SMS') {
                ftyp='SMS';
                if (man!='') {man='$$AN '+man;}
                if (man1!='') {man=man+', '+man1;}
        }
        //if (mvon!='') {mvon='$$VON '+mvon;}
        //if (mbetreff!='') {mbetreff='$$BTR '+mbetreff;}
        //if (mprio!='') {mprio='$$PRI '+mprio;}
        //if (mtermin!='') {mtermin='$$TRM '+mtermin;}
        if (mcom!='') { mcom='$$'+mcom+'$$';}

        with (win.document) {
        open();
        write("<form action='https://mailer.wis.de' method='POST' enctype='multipart/form-data' name='WEBFORMNachrichtX'>");
        // onsubmit='return pagesubmit(this)'");
        write("<input type='hidden' name='WEBFORMNachrichtX'"+ftyp+" value='WEBFORMNachrichtX'>");
        write("<input type='hidden' name='headmsgtyp' value='"+mtyp+"'>");
        write("<input type='hidden' name='headtitel' value='"+mtitel+"'>");
        write("<input type='hidden' name='headdatetime' value='##date## ##time##'>");
        write("<input type='hidden' name='headip' value='##distantip##'>");
        write("<input type='hidden' name='headtyp' value='$$'"+mtyp+"'>");
        write("<input type='hidden' name='headan' value='"+man+"'>");
        write("<input type='hidden' name='headan1' value='"+man1+"'>");
        write("<input type='hidden' name='headvon' value='"+mvon+"'>");
        write("<input type='hidden' name='headbetreff' value='"+mbetreff+"'>");
        write("<input type='hidden' name='headprio' value='"+mprio+"'>");
        write("<input type='hidden' name='headtermin' value='"+mtermin+"'>");
        write("<input type='hidden' name='headcommand' value='"+mcom+"'>");
        write("<input type='hidden' name='message' value='"+mmsg+"'>");
        write("</form>");
        close();
        forms[0].submit();
        clear();
        }
        //return (true);
    } else {
        //return (false);
    }
}

function WebMailAdress(win,to,cc,bcc,subject,body) {
  if (win=='' || win==null || win==false) { win=window;}
  if (subject=='') {
    //subject=win.document.titel;
  }
  if (to=='') {
    to="webmaster@wis.de";
  } else {
    if (to.lastIndexOf('@')==-1) {to=to+'@wis.de';}
  }
  if (cc!='') {
    if (cc.lastIndexOf('@')==-1) {cc=cc+'@wis.de';}
    cc="cc="+cc+"&";
  }
  if (bcc!='') {
    if (bcc.lastIndexOf('@')==-1) {bcc=bcc+'@wis.de';}
    bcc="bcc="+bcc+"&";
  }
  //win.open("mailto:"+to+"?"+cc+bcc+"Subject="+subject);
  win.location="mailto:"+to+"?"+cc+bcc+"Subject="+subject;
}

function parentpagemail() {
  if (win=='' || win==null || win==false) { win=top;}
  //win=top;
  //if (win=='' || win==null || win==false) { win=window;}
  if (subject=='') {
    s=win.frames[1].document.title;
    if (win.frames[1].length>0) {
      s=win.frames[1].frames[1].document.title;
      if (win.frames[1].frames[1].length>0) {s=win.frames[1].frames[1].frames[1].document.title;}
     }
    if (s.lastIndexOf('Wiesinger/Schenk')!=-1 )
      {spos=s.lastIndexOf('Wiesinger/Schenk')+17;
       s=s.substring(spos,s.length);}
    if (s.indexOf('- ')!=-1 )
      {spos=s.indexOf('- ')+2;
       s=s.substring(spos,s.length);}
    subject="Ihre Webseite "+s;
    }
  if (to=='') {
    to="webmaster@wis.de";
  } else {
    if (to.lastIndexOf('@')==-1) {to=to+'@wis.de';}
  }
  if (cc!='') {
    if (cc.lastIndexOf('@')==-1) {cc=cc+'@wis.de';}
    cc="cc="+cc+"&";
  }
  if (bcc!='') {
    if (bcc.lastIndexOf('@')==-1) {bcc=bcc+'@wis.de';}
    bcc="bcc="+bcc+"&";
  }
  self.location="mailto:"+to+"?"+cc+bcc+"Subject="+subject;
}

//FUNCTIONS SHOW ELEMENTS
function PageShowHideLayers() { //v2.0
  var i, visStr, args, theObj;
  args = PageShowHideLayers.arguments; //eval(args[i])
  i=''
  if (self.aktlayer!='' && self.aktlayer!=null) { i=self.aktlayer }
  if (args[2]!='' && args[2]!=null) { i=args[2] }
  if (i!='') { PageShowHideLayers1(i,'hide','66','') }
  if (args[3]!=null) {
    PageShowHideLayers2(args[0],args[1],args[2],args[3])
  } else {
    PageShowHideLayers1(args[0],args[1],args[2])
  }
  self.aktlayer=args[0]
}
function PageShowHideLayers1() { //v2.0
  var i, visStr, args, theObj;
  args = PageShowHideLayers1.arguments; //eval(args[i])
  for (i=0; i<(args.length-2); i+=3) { //with arg triples (objname,visStr,'')
    visStr   = args[i+1];

    if (navigator.appName == 'Netscape' && document.layers != null ) {
      theObj = document.layers[args[i]];
      if (theObj) {
        if (visStr == 'chgstatus') {
          if (theObj.visibility=='show' ) visStr = 'hide';
          if (theObj.visibility=='hide' || theObj.visibility=='inherit') visStr = 'show';
          //if (theObj.visibility=='visible') visStr = 'hidden';
          //if (theObj.visibility=='hidden' || theObj.visibility=='inherit') visStr = 'visible';
        }
        //theObj.resizeBy(250,100)
        //theObj.position = 'absolute';
        theObj.position = 'relative';
        theObj.visibility = visStr;
        theObj.bgColor='#FFFFFF';
      }
    } else if (document.all != null) { //IE
      theObj = document.all[args[i]];
      if (theObj) {
        if (visStr == 'show') visStr = 'visible'; //convert vals
        if (visStr == 'hide' || theObj.visibility=='inherit') visStr = 'hidden';
        if (visStr == 'chgstatus') {
          if (theObj.style.visibility=='visible') visStr = 'hidden';
          if (theObj.style.visibility=='hidden' || theObj.visibility=='inherit') visStr = 'visible';
        }
        //theObj.style.height='100px'
        //theObj.style.resizeBy(250,100)
        theObj.style.position = 'absolute';
        theObj.style.visibility = visStr;
        theObj.bgColor='#FFFFFF';
      }
  } }
}
function PageShowHideLayers2() { //v2.0
  var i, visStr, args, theObj;
  args = PageShowHideLayers2.arguments; //eval(args[i])
//  for (i=0; i<(args.length-2); i+=3) { //with arg triples (objname,visStr,'')
  for (i=0; i<(args.length-3); i+=4) { //with arg triples (objname,visStr,'')
    visStr   = args[i+1];
    if (navigator.appName == 'Netscape' && document.layers != null ) {
      theObj = document.layers[args[i]];
      if (theObj) {
        if (visStr == 'chgstatus') {
          if (theObj.visibility=='show' ) visStr = 'hide';
          if (theObj.visibility=='hide' || theObj.visibility=='inherit') visStr = 'show';
          //if (theObj.visibility=='visible') visStr = 'hidden';
          //if (theObj.visibility=='hidden' || theObj.visibility=='inherit') visStr = 'visible';
        }
        //theObj.resizeBy(250,100)
        //theObj.position = 'absolute';
        theObj.position = 'relative';
        theObj.visibility = visStr;
        theObj.bgColor='#FFFFFF';
        if (visStr=='show') {
          url=theObj.src; if (url==null) {url=''}; url=url.toString();
          urln=args[i+3]; if (urln==null) {urln=''}; urln=urln.toString();
          if (urln!='' && (url.indexOf('txblank.htm')==-1 || url.indexOf(urln)==-1)) {
            theObj.src=urln
          }
        }
      }
    } else if (document.all != null) { //IE
      theObj = document.all[args[i]];
      if (theObj) {
        if (visStr == 'show') visStr = 'visible'; //convert vals
        if (visStr == 'hide' || theObj.visibility=='inherit') visStr = 'hidden';
        if (visStr == 'chgstatus') {
          if (theObj.style.visibility=='visible') visStr = 'hidden';
          if (theObj.style.visibility=='hidden' || theObj.visibility=='inherit') visStr = 'visible';
        }
        //theObj.style.height='100px'
        //theObj.style.resizeBy(250,100)
        theObj.style.position = 'absolute';
        theObj.style.visibility = visStr;
        theObj.bgColor='#FFFFFF';
        if (visStr=='visible') {
          url=document.all[args[i]+'Frm'].src; if (url==null) {url=''}; url=url.toString();
          urln=args[i+3]; if (urln==null) {urln=''}; urln=urln.toString();
          if (urln!='' && (url.indexOf('txblank.htm')==-1 || url.indexOf(urln)==-1)) {
            document.all[args[i]+'Frm'].src=urln
          }
        }
      }
  } }
}

//FUNCTIONS CALLING
function DisplayMSG(win,msg) {
  window.onerror = null;
  if (msg == "") {
    //msg = "Warte auf Auswahl / wait for selection";
    msg='Willkommen zu: '+win.document.title
  }
  win.status=msg;
  return (true);
}

function getlanguage() {
   language=top.GetCookie('Language');
   if (language==null || language==false) {language='';}
   if (language=='')  {
     language.toLowerCase()
     language='german';

     if (navigator.language=="de" || language=='' && navigator.language=="ge") { language='german';}
     }
   return (language);
}

function GetDate(ret,opt) {
  if (ret == null || ret=='') {ret=''}
  if (opt == null || opt=='') {opt=''}
  x = new Date();
  wd=new String(x.getDay());
  dy=new String(x.getDate());           if (dy.length==1) {dy="0"+dy;}
  mo=new String(x.getMonth()+1);        if (mo.length==1) {mo="0"+mo;}
  if (navigator.appName=='Netscape') {
    y=new String(x.getYear()+1900);
  } else {
    y=new String(x.getYear());
  }
  d=dy+"."+mo+"."+y;
  t=new String(x.getHours());           if (t.length==1) {t="0"+t;}
  m=new String(x.getMinutes());         if (m.length==1) {m="0"+m;}
  s=new String(x.getSeconds());         if (s.length==1) {s="0"+s;}
  t=t+":"+m+":"+s;
  x=''
  if (ret=='D') {   x= d;}
  if (ret=='T') {   x= t;}
  if (ret=='DT') {  x= d+'-'+t;}
  if (ret=='D1') {  x= d.substr(0,2)+d.substr(3,2)+d.substr(6,4);}
  if (ret=='DT1') { x= d.substr(0,2)+d.substr(3,2)+d.substr(6,4)+'-'+t.substr(0,2)+t.substr(3,2)+t.substr(6,2);}
  if (ret=='D2') {  x= d.substr(6,4)+d.substr(3,2)+d.substr(0,2);}
  if (ret=='DT2') { x= d.substr(6,4)+d.substr(3,2)+d.substr(0,2)+'-'+t;}
  if (ret=='T2') {  x= t.substr(0,2)+t.substr(3,2);}
  if (ret=='DT3') { x= d.substr(0,2)+d.substr(3,2)+d.substr(6,4)+'-'+t.substr(0,2)+t.substr(3,2); }
  if (ret=='WD') {  x= GetDate4('WD',wd)}
  if (ret=='WD1') {  x= wd}
  if (ret=='WD2') { x= GetDate4('WD2',wd)}
  if (ret=='MO') {  x= mo;}
  if (ret=='MO1') {  x= GetDate4('MO1',mo)}
  if (ret=='MO2') {  x= GetDate4('MO2',mo)}
  if (ret=='MD') {  x= dy;}
  if (ret=='Y') {  x= y;}
  return x
}
function GetDate4(ret,opt) {
  if (ret == null || ret=='') {ret=''}
  if (opt == null) {opt='1'}
  x='';
  if (ret=='D') {
    opt=opt.toString()
    if (opt.length==1) {opt="0"+opt;}
    x=opt
  }
  if (ret=='WD') {   //0-7,0=7
    weekday   = new Array("So","Mo","Di","Mi","Do","Fr","Sa","So");
    x=weekday[parseInt(opt)]
  }
  if (ret=='WD2') {  //0-7,0=7
    weekday   = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag");
    x=weekday[parseInt(opt)]
  }
  if (ret=='MO') {
    opt=opt.toString()
    if (opt.length==1) {opt="0"+opt;}
    x=opt
  }
  if (ret=='MO1') {  //0;1-12
    month     = new Array("","Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez");
    x=month[parseInt(opt)]
  }
  if (ret=='MO2') {  //0;1-12
    month     = new Array("","Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
    x=month[parseInt(opt)]
  }
  return x
}

function SetCookie1(name,value,win) {
  expires= new Date();expires.setTime(60*60*24*30*12*31*1000);
  path='';
  domain='';
  secure='';
  SetCookie(name,value,win,path,domain,secure,expires);
}
function SetCookie(name,value,win) {
//,path,domain,secure,expires) {
  if (win=='' || win==null || win==false) { win=window;}
  if (win=='') { win=self.window;}
  //if (value.indexOf("expires=")<0) { value=value+"?expires='31-Dez-2002'";}
  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  //var expires = (argc > 2) ? argv[2] : null;
  var path = (argc > 3) ? argv[3] : null;
  var domain = (argc > 4) ? argv[4] : null;
  var secure = (argc > 5) ? argv[5] : false;
  var expires = (argc > 6) ? argv[6] : null;
  //if (domain == null) {domain = ".wis.de";}
  //secure =  true;
  exp=new Date();
  if (value=='' || value == null || value == false) {
    exp.setTime(exp.getTime-1);
    var cval = "" //"wird gelöscht" //"-";
    win.document.cookie = name +"="+cval+";expires=" + exp.toGMTString;
  } else {
    if (expires=='' || expires == null || expires == false) {
      //exp.setYear(exp.getYear()+1901);
      //expires="Dec 31, 2002";
      //expires= new Date();expires.setTime((60*60*24*30*12*1)*(exp.getYear()+1901));
      //expires= new Date();expires.setTime( exp )  // 1 Jahr
      m=exp.getMonth()+1; if (m==1) {m='Jan'};if (m==2) {m='Feb'};if (m==3) {m='Mar'};if (m==4) {m='Apr'};if (m==5) {m='Mai'};if (m==6) {m='Jun'};if (m==7) {m='Jul'};if (m==8) {m='Aug'};if (m==9) {m='Sep'};if (m==10) {m='Oct'};if (m==11) {m='Nov'};if (m==12) {m='Dec'};
      expires= m+" "+exp.getDate()+", "+(exp.getYear()+1901)  // 1 Jahr
    }
    exp=new Date(expires);
    exp.toGMTString();
  //  win.document.cookie = name + "=" + escape(value) +
  //    ((expires == null) ? "" : ("; expires=" + exp)) +
  //    ((path == null) ? "" : ("; path=" + path)) +
  //    ((domain == null) ? "" : ("; domain=" + domain)) +
  //    ((secure == true) ? "; secure" : "");
    c=name + "=" + escape(value)
    if (expires != null) { c=c+ ""; expires="" + exp }
    if (path != null) { c=c+ ""; path="" + path }
    if (domain != null) { c=c+ ""; domain="" + domain }
    if (secure != null) { c=c+ ""; secure="" + secure }
    win.document.cookie = c
  }
  window.focus();
}
function GetCookie(name,win) {
  if (win=='' || win==null || win==false) { win=window;}
  if (win=='') { win=self.window;}
  var arg = name + "=";
  var alen = arg.length;
  var clen = win.document.cookie.length;
  var i = 0;
  var value= ""
  while (i < clen)
  { var j = i +alen;
    if (win.document.cookie.substring(i, j) == arg)
       value=GetCookieVal (win,j);
       //if (value=='-') { value=''};
       return value;
    i = win.document.cookie.indexOf(" ", i) +1;
    if (i == 0) break;
  }
  return null;
}
function GetCookieVal(win,offset) {
//,win)
// if (win=='' || win==null || win==false) { win=window;}
  var endstr = win.document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = win.document.cookie.length;
  return unescape(win.document.cookie.substring(offset, endstr));
}

function DeleteCookie(name,win) {
  if (win=='' || win==null || win==false) { win=window;}
  if (win=='') { win=self.window;}
  var exp = new Date();
  exp.setTime(exp.getTime-1);
  var cval = GetCookie(name,win);
  cval="" //"wird gelöscht" // "-"
  win.document.cookie = name +"="+cval+";expires=" + exp.toGMTString;
}

function GetHost(ip) {
  host=''
  if (ip=='') {ip='##distantip##';}
  if (ip.substring(0,7)=='195.185') {
    host='http://bohost.wis.de'
  } else {
    host='http://wsx.de'
  }
  return host;
}
function GetSecureHost(url,win,com) {
  if (com=='' || com==null || com==false) { com='';}
  if (win=='' || win==null || win==false) { win=window;}
  //if (url=='' || url==null || url==false) { url=win.location;}
  if (url=='' || url==null || url==false) { url=self.location;}
    url=url.toString();
    if (url.indexOf('https://')==-1 ) {
        //if (win.location.hostname=='mailer.wis.de') {
        if (url.indexOf('mailer.wis.de')!=-1 ) {
          url='https://'+url.substring(7);
        }// else if (win.location.hostname=='bohost.wis.de') {
        else if (url.indexOf('bohost.wis.de')!=-1 ) {
          //com="-";
        } else {
          //com="-";
         }
        if (com=='-') {
        } else if (com=='') {
          return url;
        } else if (com=='RELOAD') {
          win.location=url;
          return url;
        } else if (com=='RELOADIFNOT') {
          url2=win.location
          url2=url2.toString();
          if (url!=url2) {
            win.location=url;
          }
          return url;
        }
    }
}
function GetSSLDataInfo(win) {
 if (win=='' || win==null || win==false) {win=window;}
    x=self.location.protocol;x=x.toLowerCase();
    x1=win.document.forms[0].action;x1=x1.toLowerCase();
    txt=''
    if (x1.indexOf('https:')!=-1 && x=='https:') {
        txt=txt+"<img src='https://"+self.location.hostname+"/wis/include/ssltslok.gif' border=0 hspace=2 vspace=0 align=left>"
        txt=txt+'Ihre Angaben werden verschl&uuml;sselt gesendet, SSL-Protokoll zum Server f&uuml;r Formular und Seite besteht. ';
//    }
//    if (x1.indexOf('https:')!=-1 && x!='https:') {
//        txt=txt+"<img src='"+self.location.protocol+"://"+self.location.hostname+"/wis/include/ssltslok.gif' border=0 hspace=2 vspace=0 align=left>"
//        txt=txt+'Ihre Angaben werden verschl&uuml;sselt gesendet, SSL-Protokoll zum Server f&uuml;r Formular besteht. ';
    } else if (x=='https:') {
        txt=txt+"<img src='https://"+self.location.hostname+"/wis/include/ssltslok.gif' border=0 hspace=2 vspace=0 align=left>"
        txt=txt+'Ihre Angaben werden verschl&uuml;sselt gesendet, SSL-Protokoll zum Server f&uuml;r Seite besteht. ';
    } else if (x1.indexOf('https:')!=-1) {
        txt=txt+"<img src='http://"+self.location.hostname+"/wis/include/ssltslno.gif' border=0 hspace=2 vspace=0 align=left>"
        txt=txt+'Ihre Angaben werden ggf. unverschl&uuml;sselt gesendet - SSL-Protokoll zum Server wird erst zum Senden der Daten aufgebaut! ';
    } else {
        txt=txt+"<img src='http://"+self.location.hostname+"/wis/include/ssltslno.gif' border=0 hspace=2 vspace=0 align=left>"
        txt=txt+'Ihre Angaben werden unverschl&uuml;sselt gesendet - SSL-Protokoll zum Server nicht aktiv! ';
    }
    return txt;
}