function ie(){
    //var ie = true;
    if(navigator.appName == "Microsoft Internet Explorer") {
        return true;
    } else return false;
}
ie()
function bookmark() {
    if(ie()){
        window.external.AddFavorite(window.location.href,this.document.title);
    }else{
        alert("Diese Funktionalität ist in Netscape Browsern derzeit noch nicht verfügbar!");
        return;
    }
}

function save() {
    //document.eintrag.save.value = 1;
    document.eintrag.action.value = "";
    document.eintrag.submit();
return
}

function auswahl(){
    hoehe  = 550;   // (screen.height/2.5-20);
    breite = 550;   // (screen.width/2);
    win    = window.open("_includes/list.asp","FG", 'toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,resizable=1,dependent=yes,focus=1,Width='+breite+',Height='+hoehe+',left='+(screen.width-(breite+15))+',top=0');
}
function Typenauswahl(){
    hoehe  = 550;   // (screen.height/2.5-20);
    breite = 550;   // (screen.width/2);
    win    = window.open("_includes/Typenlist.asp","TypenFG", 'toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,resizable=1,dependent=yes,focus=1,Width='+breite+',Height='+hoehe+',left='+(screen.width-(breite+15))+',top=0');
}
if(!ie()){document.eintrag.FG.value = "";}
function select(fg_name) {
    if(document.all){

   if(document.all.FG.innerHTML.length < 1){
       document.all.FG.innerHTML = fg_name + '<BR>';
       document.EditFormular.Branchen.value = fg_name + '<BR>';
   }else{
       content = document.all.FG.innerHTML;
       if(content.indexOf('<BR>'+fg_name+'<BR>')<0){
           document.all.FG.innerHTML = content + fg_name + '<BR>';
           document.EditFormular.Branchen.value = content + fg_name + '<BR>';
       }

        }
    }else{

     if(document.eintrag.FG.value.length < 1){
         document.eintrag.FG.value = fg_name + '<BR>';
         document.EditFormular.Branchen.value = fg_name + '<BR>';
     }else{
         content   = document.eintrag.Kategorie.value;
         contentFG = document.eintrag.FG.value;
         if(content.indexOf('<BR>'+fg_name+'<BR>')<0){
             document.eintrag.FG.value = contentFG + fg_name + '<BR>';
             document.EditFormular.Branchen.value = content + fg_name + '<BR>';
         }
     }
    }

return
}

function Typenselect(fg_name) {
    if(document.all){

     if(document.all.TypenFG.innerHTML.length < 1){
         document.all.TypenFG.innerHTML = fg_name + '<BR>';
         document.EditFormular.Typen.value = fg_name + '<BR>';
     }else{
         content = document.all.TypenFG.innerHTML;
         if(content.indexOf('<BR>'+fg_name+"<BR>")<0){
             document.all.TypenFG.innerHTML = content + fg_name + '<BR>';
             document.EditFormular.Typen.value = content + fg_name + '<BR>';
         }

        }
    }else{

    if(document.eintrag.TypenFG.value.length < 1){
        document.eintrag.TypenFG.value = fg_name + '<BR>';
        document.EditFormular.Typen.value = fg_name + '<BR>';
    }else{
        content   = document.EditFormular.Typen.value;
        contentFG = document.eintrag.TypenFG.value;
        if(content.indexOf('<BR>'+fg_name+"<BR>")<0){
            document.eintrag.TypenFG.value = contentFG + fg_name + '<BR>';
            document.EditFormular.Typen.value = content + fg_name + '<BR>';
        }
    }
    }

return
}

function close_Window() {
    i = ie();
    if(i){
    }else{
        //for(i=0; i<150; i++){
        opener.window.focus();
        alert();
        self.focus();
        if(document.eintrag.Kommentar.focus()){
        //}


        for(i=0; i<2; i++){
            setTimeout("close_Navi()",200);
        }
        }
        //setTimeout("close_Window()",1);

    }
return
}
function close_Navi() {
         window.close();
return
}
function del() {
    document.EditFormular.Branchen.value = "<BR>";
    if(document.all){
        document.all.FG.innerHTML = "<BR>";
    }else{
        document.eintrag.FG.value = "<BR>";
    }
return
}
function Typendel() {
    document.EditFormular.Typen.value = "<BR>";
    if(document.all){
        document.all.TypenFG.innerHTML = "<BR>";
    }else{
        document.eintrag.TypenFG.value = "<BR>";
    }
return
}
function Typenselect_del(fg_name) {
    if(document.all){         // IE Browser
        fg_name = fg_name+'<BR>';
        if(document.all.TypenFG.innerHTML.indexOf(fg_name) > -1){
            content = document.all.TypenFG.innerHTML;
            document.all.TypenFG.innerHTML = content.replace(fg_name,'');
            document.EditFormular.Typen.value = content.replace(fg_name,'');

        }
    }else{                    // Netscape
        FG_Name = fg_name+'<BR>';
        fg_name = fg_name+'<BR>';
        if(document.eintrag.TypenFG.value.indexOf(FG_Name)>-1){
            content   = document.EditFormular.Typen.value;
            contentFG = document.eintrag.TyypenFG.value;
            document.EditFormular.Typen.value = content.replace(fg_name,'');
            document.eintrag.TypenFG.value = contentFG.replace(FG_Name,'');
        }
    }
return
}

function select_del(fg_name) {
    if(document.all){         // IE Browser
        fg_name = fg_name+'<BR>';
        if(document.all.FG.innerHTML.indexOf('<BR>'+fg_name) > -1){
            content = document.all.FG.innerHTML;
            document.all.FG.innerHTML = content.replace(fg_name,'');
            document.EditFormular.Branchen.value = content.replace(fg_name,'');

        }
    }else{                    // Netscape
        FG_Name = fg_name+'<BR>';
        fg_name = fg_name+'<BR>';
        if(document.eintrag.FG.value.indexOf('<BR>'+FG_Name)>-1){
            content   = document.EditFormular.Branchen.value;
            contentFG = document.eintrag.FG.value;
            document.EditFormular.Branchen.value = content.replace(fg_name,'');
            document.eintrag.FG.value = contentFG.replace(FG_Name,'');
        }
    }
return
}
//-------------------------------------------------------------------------------------------

function Pauswahl(){
    hoehe  = 550;   // (screen.height/2.5-20);
    breite = 550;   // (screen.width/2);
    win    = window.open("_includes/Plist.asp","PFG", 'toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,resizable=1,dependent=yes,focus=1,Width='+breite+',Height='+hoehe+',left='+(screen.width-(breite+15))+',top=0');
}



function Pdel() {
    document.EditFormular.Produkte.value = "<BR>";
    if(document.all){
        document.all.PFG.innerHTML = "<BR>";
    }else{
        document.eintrag.FG.value = "<BR>";
    }
return
}
function Pselect_del(fg_name) {
    if(document.all){         // IE Browser
        fg_name = fg_name+'<BR>';
        if(document.all.PFG.innerHTML.indexOf(fg_name) > -1){
            content = document.all.PFG.innerHTML;
            document.all.PFG.innerHTML = content.replace(fg_name,'');
            document.EditFormular.Produkte.value = content.replace(fg_name,'');

        }
    }else{                    // Netscape
        FG_Name = fg_name+'<BR>';
        fg_name = fg_name+'<BR>';
        if(document.eintrag.PFG.value.indexOf('<BR>'+FG_Name)>-1){
            content   = document.EditFormular.Produkte.value;
            contentFG = document.eintrag.PFG.value;
            document.EditFormular.Produkte.value = content.replace(fg_name,'');
            document.eintrag.PFG.value = contentFG.replace(FG_Name,'');
        }
    }
return
}

function Pselect(fg_name) {
    if(document.all){

  if(document.all.PFG.innerHTML.length < 1){
      document.all.PFG.innerHTML = fg_name + '<BR>';
      document.EditFormular.Produkte.value = fg_name + '<BR>';
  }else{
      content = document.all.PFG.innerHTML;
      if(content.indexOf('<BR>'+fg_name+'<BR>')<0){
          document.all.PFG.innerHTML = content + fg_name + '<BR>';
          document.EditFormular.Produkte.value = content + fg_name + '<BR>';
      }

  }
    }else{
   if(document.eintrag.PFG.value.length < 1){
       document.eintrag.PFG.value = fg_name +'<BR>';
       document.EditFormular.Produkte.value = fg_name + '<BR>';
   }else{
       content   = document.EditFormular.Produkte.value;
       contentFG = document.eintrag.PFG.value;
       if(content.indexOf('<BR>'+fg_name+'<BR>')<0){
           document.eintrag.PFG.value = contentFG + fg_name +'<BR>';
           document.EditFormular.Produkte.value = content + fg_name + '<BR>';
       }
   }
    }

return
}









function count() {
    alen = document.eintrag.Kommentar.value.length
    tmparr0 = document.eintrag.Kommentar.value.split("\"");
    tmparr1 = document.eintrag.Kommentar.value.split("\n");
    alen += ( ( tmparr0.length-1) *5)+((tmparr1.length-1)*2);
    if( alen > 255){
        Text = '&nbsp;..max. Zeichen-<br>&nbsp;anzahl<br>&nbsp;überschritten!</span>';
        i    = true;
    }
    if( alen == 255){
        Text = '&nbsp;..max. Zeichen-<br>&nbsp;anzahl erreicht!</span>';
        i    = false;
    }
    if( alen < 255){
        Text = '&nbsp;' + alen + '&nbsp;v. max. 255';
        i    = false;
    }
    if(document.all){
        document.all.counter.innerHTML = Text;
        if(i == true){
            document.all.counter.style.color = "#FF0000";
        }else{
            document.all.counter.style.color = "#8F8F8F";
        }
    }
return
}
function parscount(str,mlen) {
    tmparr = str.split("\"");
    alen = str.length+( ( (tmparr.length)-1) *5);
    if(alen > mlen){
        alert("Die maximale Länge dieses Feldes ist bereits überschritten worden!\n\nBitte kürzen Sie dieses Feld, da ansonsten der Eintrag autom. auf "+mlen+" Zeichen gekürzt wird!");
    }
return
}
function all_count() {
 if(document.eintrag.Kommentar.value.length > 255){
   br = confirm("Die Anzahl der Zeichen darf 255 nicht überschreiten?\n\nWollen Sie den Eintrag automatisch kürzen lassen?\nUm den Kommentareintrag auf 255 Zeichen zu kürzen, drücken Sie OK!");
   if(br == true) {
       document.eintrag.Kommentar.value = document.eintrag.Kommentar.value.slice(0,255);
       count();
   }else{
       document.eintrag.Kommentar.focus();
       document.eintrag.Kommentar.value = document.eintrag.Kommentar.value;

   }
 }

return
}


