/*-- scripts by t.s. */

/* Umwandlung der Umlaute */
         
var myString = "";    
    myPath = "./";
                                                                    
                                                                                             
function MyConvert(myInput) 
{                                                         
  for (var x = 0; x < myInput.length; x++) 
  {                          
    myString = myString + escape(myInput.substr(x,1));                       
    if(navigator.userAgent.indexOf("Mac")!= -1) 
    {         
	   /* apple */   
	   if (navigator.userAgent.indexOf("MSIE") == -1) 
	   {                 
	       MyReplace("%80", "&Auml;");                                                    
	       MyReplace("%8A", "&auml;");                                                    
	       MyReplace("%85", "&Ouml;");                                                    
	       MyReplace("%9A", "&ouml;");                                                    
	       MyReplace("%86", "&Uuml;");                                                    
	       MyReplace("%9F", "&uuml;");                                                    
	       MyReplace("%A7", "&szlig;");    
	   }  
	   else
	   {
			MyReplace("%C4", "&Auml;");                                                    
			MyReplace("%E4", "&auml;");                                                    
			MyReplace("%D6", "&Ouml;");                                                    
			MyReplace("%F6", "&ouml;");                                                    
			MyReplace("%DC", "&Uuml;");                                                    
			MyReplace("%FC", "&uuml;");                                                    
			MyReplace("%DF", "&szlig;"); 
	   }                                              
    }                                                                             
	else 
	{      
	/* alle anderen */                                                                  
	  MyReplace("%C4", "&Auml;");                                                    
	  MyReplace("%E4", "&auml;");                                                    
	  MyReplace("%D6", "&Ouml;");                                                    
	  MyReplace("%F6", "&ouml;");                                                    
	  MyReplace("%DC", "&Uuml;");                                                    
	  MyReplace("%FC", "&uuml;");                                                    
	  MyReplace("%DF", "&szlig;");                                                    
	}                                                                             
	myString = unescape(myString);                                                                           
  }                                                                                                                            
}                                                                                   
                                                                                             
function MyReplace(keyword, replacement) 
{                                                
  var found = 0                                                                       
  var new_str = "";                                                                   
  if(myString.indexOf(keyword) != -1) 
  {                                         
    for(var x = 0; x < myString.length; x++) 
	{                                 
      for(var y = 0; y < keyword.length; y++) 
	  {                                     
        if(myString.charAt(x + y) == keyword.charAt(y))
		{                       
          found += 1;	                                                            
        }                                                                       
      }                                                                          
      if(found == keyword.length) 
	  {                                                 
        new_str += myString.substring(0, x);                                    
        new_str += replacement;                                                    
        new_str += myString.substring((x + keyword.length), myString.length);
        myString = new_str;                                                     
        new_str = "";                                                              
        x += (replacement.length - 1);                                             
       }                                                                          
       found = 0;                                                                    
     }                                                                             
   }                                                                                
}   	
	
	
function suche1(Eingabe)
     {
     for (k=0; k<=(index.length-1); k++) 
     {
       for (i=0; i<=(index[k].length-1); i++)
       { 
            j=1; 
            while((j < Eingabe.length+1) && (asterix == 1))
            {
                 if (Eingabe.toLowerCase() == index[k][i].substring(0,j).toLowerCase())
                 { 
                    nix=1;
                    prozent=(100 * Eingabe.length)/index[k][i].length; 
                    prozent=parseInt(prozent);
                    parent.MyInhalt.document.write('<span class=\"hervorgehoben\">['+index[k][i]+'] '+prozent+'% </span><BR>'+info[k]+'<p>'); 
                 } 
                 j++;
            } 
       } 
     } 
    if (nix == 0) 
       parent.MyInhalt.document.write('<span class=\"text\">Leider kein Sucheintrag. Versuchen Sie es mal mit dem Anfangsbuchstaben! </span><BR><HR size=1>');
    }

/* Suchfunction mit Und-Verknüpfung */ 	
	
    function suche2(Eingabe1, Eingabe2)
    {
	   Eingabe = Eingabe1;
	     for (k=0; k<=(index.length-1); k++) 
	     {
	       for (i=0; i<=(index[k].length-1); i++)
	       { 
	            j=1; 
	            while((j < Eingabe.length+1) && (asterix == 1))
	            {
	                 if (Eingabe.toLowerCase() == index[k][i].substring(0,j).toLowerCase())
	                 { 
	                   nix=1;
	                   prozent=(100 * Eingabe.length)/index[k][i].length; 
	                   prozent=parseInt(prozent);
					   /* erfolgreicher Wortstamm gefunden, suche nach Und-Verknuepfung */
					   wort1 = index[k][i];
					   prozent1 = prozent;
					   Eingabe = Eingabe2;
					   nix=0;
					   for (l=0; l<=(index[k].length-1); l++)
				       { 
				            j=1;
				            while((j < Eingabe.length+1) && (asterix == 1) && (l != i))
				            {
				                 if (Eingabe.toLowerCase() == index[k][l].substring(0,j).toLowerCase())
				                 { 
				                    nix=1;
				                    prozent=(100 * Eingabe.length)/index[k][l].length; 
				                    prozent=parseInt(prozent);
				                    parent-MyInhalt.document.write('<span class=\"hervorgehoben\">['+wort1+', '+index[k][l]+'] '+prozent1+'% / '+prozent+'% </span><br><span class=\"text\">'+info[k]+'<p>'); 
				                 } 
				                 j++;
				            } 
				       } 
					   /* ---- weiter ---*/
	                } 
	                j++;
	            } 
			  Eingabe = Eingabe1;
	       } 
	     } 
    if (nix == 0) 
       parent-MyInhalt.document.write('<span class=\"text\">Leider kein Sucheintrag. Versuchen Sie es mal mit dem Anfangsbuchstaben!</span> <BR>');
    }

/* Auswahl der Suchfunktion und Vorbereitung der Suche */
	
  function suche(Eingabe)
  {   
     nix=0; 
     asterix=0;
	 
     if (Eingabe.length >= 1)
        asterix=1;
		
     /* normale suche */
	 if ((asterix == 1) && (Eingabe.indexOf('/') == -1) && (Eingabe.indexOf('+') == -1))
	 {
	   suche1(Eingabe)
	 }   
	 
	 /* oder suche */
     if ((asterix == 1) && (Eingabe.indexOf('/') > 0) && (Eingabe.indexOf('+') == -1))
     { 
       Eingabe1=Eingabe.substring(0,Eingabe.indexOf('/')-1);
       Eingabe2=Eingabe.substring(Eingabe.indexOf('/')+1,Eingabe.length);
       suche1(Eingabe1);
       suche1(Eingabe2);  
     } 
	 
	 /* und suche */
	 if ((asterix == 1) && (Eingabe.indexOf('/') == -1) && (Eingabe.indexOf('+') > 0))
     { 
       Eingabe1=Eingabe.substring(0,Eingabe.indexOf('+')-1);
       Eingabe2=Eingabe.substring(Eingabe.indexOf('+')+1,Eingabe.length);
       suche2(Eingabe1, Eingabe2);  
     } 
   }
   
   
  function ausgabe(eingabe) 
  { 
     myString = '';
	 parent.MyInhalt.document.clear(); 
	 MyConvert(eingabe);
	 eingabe = myString;
	 document.MyForm.MySearch.value = eingabe;
     parent.MyInhalt.document.write('<HTML><HEAD><link rel="stylesheet" type="text/css" href=\"../styles/style1.css\"></HEAD><BODY><table width=\"100%\"><tr><td colspan=\"2\" class=\"ueberschrift1\">Ihr Suchergebnis</td></tr><tr><td valign=\"top\" width=\"130\"><img src=\"../gif/search1.gif\"></td><td span class=\"text\" width=\"100%\">Suche nach ['+document.MyForm.MySearch.value+'] lieferte das folgende Ergebnis:<P>'); 
	 suche(eingabe); 
     parent.MyInhalt.document.write("<span class=\"klein\"><hr>&#169 2000 entwickelt von <A HREF='http://www.el-zorro.de/' TARGET=_parent>EL-ZORRO</A> TEAM98</span></td></tr></table></BODY></HTML>"); 
     document.MyForm.MySearch.value = '';
	 parent.MyInhalt.document.close(); 
	 parent.tops.myStatus=3;
    } 
	
  function ausgabe2(eingabe) 
  { 
     myString = '';
	 myPath = '../';
	 parent.MyInhalt.document.clear(); 
	 MyConvert(eingabe);
	 eingabe = myString;
	 document.MyForm.MySearch.value = eingabe;
     parentMyInhalt.document.write('<HTML><HEAD><link rel="stylesheet" type="text/css" href=\"'+myPath+'styles/style1.css\"></HEAD><BODY><table width=\"100%\"><tr><td colspan=\"2\" class=\"ueberschrift1\">Verwandte Themen</td></tr><tr><td valign=\"top\" width=\"130\"><img src=\"'+myPath+'gif/search2.gif\"></td><td span class=\"text\" width=\"100%\">Suche nach ['+document.MyForm.MySearch.value+'] lieferte das folgende Ergebnis:<P>'); 
	 suche(eingabe); 
     parent.MyInhalt.document.write("<span class=\"klein\"><hr>&#169 2000 entwickelt von <A HREF='http://www.el-zorro.de/' TARGET=_parent>EL-ZORRO</A> TEAM98</span></td></tr></table></BODY></HTML>"); 
     document.MyForm.MySearch.value = '';
	 parent.MyInhalt.document.close(); 
	 parent.tops.myStatus=3;
    } 
 
   function surf(eingabe) 
   { 
     parent.location.href=eingabe; 
   }
      
   function MyFocus()
   {
	 if (parent.tops.myStatus != 3)
	   MyButton(5,0);
	   parent.MyInhalt.location.href = "../search/tips.htm"; 
   }

/* -----bildwechsel----- */
   
var
   
  Button1a = new Image();
  Button1a.src = "../gif/home1.gif";  
  Button1b = new Image();
  Button1b.src = "../gif/home2.gif"; 

  Button2a = new Image();
  Button2a.src = "../gif/kontakt1.gif";  
  Button2b = new Image();
  Button2b.src = "../gif/kontakt2.gif"; 

  Button3a = new Image();
  Button3a.src = "../gif/impress1.gif";  
  Button3b = new Image();
  Button3b.src = "../gif/impress2.gif"; 
  
  Button4a = new Image();
  Button4a.src = "../gif/druck1.gif";  
  Button4b = new Image();
  Button4b.src = "../gif/druck2.gif"; 
  
  Button5a = new Image();
  Button5a.src = "../gif/suche1.gif";  
  Button5b = new Image();
  Button5b.src = "../gif/suche2.gif"; 
  

  MyButtonNorm = new Array();
    MyButtonNorm[0]=Button1a.src;
    MyButtonNorm[1]=Button2a.src;
    MyButtonNorm[2]=Button3a.src;
	MyButtonNorm[3]=Button4a.src;
	MyButtonNorm[4]=Button5a.src;
	  
   MyButtonHigh = new Array()
    MyButtonHigh[0]=Button1b.src;
    MyButtonHigh[1]=Button2b.src;
    MyButtonHigh[2]=Button3b.src;
	MyButtonHigh[3]=Button4b.src;
	MyButtonHigh[4]=Button5b.src;
	
  max=5;

  function MyButton(IndexNr,Bildnr)
  { 
    if (parseInt(navigator.appVersion) > 3)
    {
      myinfo = 1;
      for(i = 1; i <= max; i++) 
      { 
        if(i != IndexNr) 
		{
          document.images[i].src = MyButtonNorm[i-1];  
		}   
        else 
          document.images[i].src = MyButtonHigh[i-1];
      }
	  parent.tops.myStatus = IndexNr;
	  parent.tops.MyLeer();
    }
  }

  function MyLeer()
  { 
    if (parseInt(navigator.appVersion) > 3)
    {
      for(i = 1; i <= max; i++) 
      { 
         document.images[i].src = MyButtonNorm[i-1];      
      }
    }
  }   
   
/* PrintVersion */

function MyPrintVersion()
{
  winName="Print";
  myUrl = parent.MyInhalt.location.href;
  winName=winName+String(Math.floor(Math.random()*1000));
  window.open(myUrl, winName, "scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=no,width=660,height=400");
}
/*-- ende --*/

