function Searchsong()
 {
   var laenge, Eingabe, pfad, song, fehler, songnr, zfill, songna, dummy, memsong;
   
   Eingabe=window.document.form1.Songnr.value;
   zfill = "XXXXXXXXXXXXXXXXXXXXXX";
   fehler = 2;
   laenge=Eingabe.length;
   if (laenge > 7)
    { 
      FEHLER = 3;
    }
  if (laenge < 7)
    { 
      FEHLER = 3;
    }

  var zeichen=Eingabe.substring(3,4);
  if (zeichen != "-")
   {
    fehler = 3;
   }
   var zfind = " ";
       songnr = " ";
   for (a=0; a<anzahl; a++)
   {
    songnr=db[a]+zfill;
    songnr=songnr.substring(0,7);
    songna=db[a]+"    ";
    dummy = songna.replace(/.wav/gi," ");
    songna = dummy;
 
    if (songnr == "") {songnr=zfill;}
    if (Eingabe==songnr)
     { zfind ='X';
       fehler = 1;
       break;
     }
   }
  if (zfind=="X")
    {
      song=db[a];
      play_sound (song);
      fenster1(songna);
    }
   else
    {
     if (fehler == 2) {fenster2(Eingabe)}
     if (fehler == 3) {fenster3()}
     } 
 }

function otto()
{

}

 
function fenster3()
 {
  var win4;
   text01 = "SINGESONG-Song-Clip-Bibliothek";
   text02 = "ZUM REINHÖREN";
   text03 = "Leider entspricht Ihre Eingabe nicht dem geforderten Eingabe-Format.";
   text04 = "Die Song-Nummer muss sechsstellig und";
   text05 = "in der Mitte unterbrochen von einem Bindestrich sein. Zum Beispiel so:";
   text06 = "001-101";
   text07 = "Ein anderes Format nimmt die Suchmaschine leider nicht an.";
   text08 = "Versuchen Sie es bitte nochmals...";

   win4=window.open("","Hallo","width=450,height=320,resizable=yes");

   win4.document.open("text/html");
 
 
   win4.document.font="Chalk";
   win4.document.color="#FFFFFF";
   win4.document.bgColor="#FF6600";
   win4.document.fgColor="#FFFFFF";

   win4.document.write("<H2><BLINK><CENTER>");
   win4.document.write(text01);
   win4.document.write("<BR>");
   win4.document.write(text02);
   win4.document.write("<BR>");
   win4.document.write("</CENTER></BLINK></H2>");

    win4.document.write("<H4><CENTER>");
   win4.document.write("<font color='#000000'>");
   win4.document.write(text03);
   win4.document.write("<BR>");
   win4.document.write(text04);
   win4.document.write("<BR>");
   win4.document.write(text05);
   win4.document.write("</H4>");  

 
   win4.document.write("<H2><CENTER>");
   win4.document.write(text06);
   win4.document.write("</H2>");  
 
   win4.document.write("<H4><CENTER>");
   win4.document.write(text07);
   win4.document.write("</H4>");  

   win4.document.write("<H4><CENTER>");
   win4.document.write(text08);
   win4.document.write("</H4>");  

 }



function fenster1(songna)
 {
  var win;

   text01 = "SINGESONG-Song-Clip-Bibliothek";
   text02 = "ZUM REINHÖREN";
   text03 = "Ihre Song-Nummern-Eingabe war erfolgreich.";
   text04 = "Der Song mit der Nummer";
   text05 = "&SONG&";
   text06 = "ist hinterlegt.";
  
   win4=window.open("","Hallo","width=450,height=250,resizable=yes");

   win4.document.open("text/html");
 
 
   win4.document.font="Chalk";
   win4.document.color="#FFFFFF";
   win4.document.bgColor="#008000";
   win4.document.fgColor="#FFFFFF";


   win4.document.write("<H2><BLINK><CENTER>");
   win4.document.write(text01);
   win4.document.write("<BR>");
   win4.document.write(text02);
   win4.document.write("<BR>");
   win4.document.write("</CENTER></BLINK></H2>");

   win4.document.write("<H4><CENTER>");
   win4.document.write("<font color='#000000'>");
   win4.document.write(text03);
   win4.document.write("<BR>");
   win4.document.write(text04);
   win4.document.write("</H4>");  

   win4.document.write("<H2><CENTER>");
   win4.document.write(songna);
   win4.document.write("</H2>");  
  
 
   win4.document.write("<H4><CENTER>");
   win4.document.write(text06);
   win4.document.write("</H4>");  
  
 }
function play_sound (filename)
{
  location.href= filename;
}

function fenster2(songna)
 {
  var win;
   text01 = "SINGESONG-Song-Clip-Bibliothek";
   text02 = "ZUM REINHÖREN";
   text03 = "Ihre Song-Nummern-Eingabe war leider NICHT erfolgreich.";
   text04 = "Der Song mit der Nummer";
   text05 = "&SONg";
   text06 = "ist leider noch nicht hinterlegt.";
   text07 = "Im SINGESONG ist er natürlich trotzdem jederzeit spielbereit.";
   text08 = "Vielleicht gibt es noch eine andere Version von dem Song,";
   text09 = "die eventuell hinterlegt ist?";
   text10 = "Wenn Sie wollen schicken Sie uns ein 'Hinterlegungswunsch'-email.";
   text11 = "Die am meisten gewünschten Songs werden am ehesten hinterlegt";
    
   win4=window.open("","Hallo","width=450,height=400,resizable=yes");
   win4.document.open("text/html");
  
   win4.document.font="Chalk";
   win4.document.color="#FFFFFF";
   win4.document.bgColor="#FF6600";
   win4.document.fgColor="#FFFFFF";

   win4.document.write("<H2><BLINK><CENTER>");
   win4.document.write(text01);
   win4.document.write("<BR>");
   win4.document.write(text02);
   win4.document.write("<BR>");
   win4.document.write("</CENTER></BLINK></H2>");

   win4.document.write("<H4><CENTER>");
   win4.document.write("<font color='#000000'>");
   win4.document.write(text03);
   win4.document.write("<BR>");
   win4.document.write(text04);
   win4.document.write("</H4>");  

 
   win4.document.write("<H2><CENTER>");
   win4.document.write(songna);
   win4.document.write("</H2>");  
 
   win4.document.write("<H4><CENTER>");
   win4.document.write(text06);
   win4.document.write("<BR>");
   win4.document.write(text07);
   win4.document.write("<BR>");
   win4.document.write(text08);
   win4.document.write("<BR>");
   win4.document.write(text09);
   win4.document.write("<BR>");
   win4.document.write(text10);
   win4.document.write("<BR>");
   win4.document.write(text11);
   win4.document.write("</H4>");  
  
 }


