
// plz.js Copyright (c)2003 Siebert Industrieelektronik GmbH.

function ShowPartner(button, language)
{
  var PLZ = document.PLZsuchen.PLZ.value;

  if (PLZpruef(PLZ, language))
  	{

    // Vertreter D/O: PLZ 01-19, 99
	if ((PLZ >= 1000 && PLZ <= 4999) || (PLZ >= 6000 && PLZ <= 19999) || (PLZ >= 99000 && PLZ <= 99999))
        {
		read("adresses/d_o.htm");
        document.all.anschrift.innerHTML=source;
		}
     else
    	{
     
	 	// Vertreter D/N: PLZ 20-29, 30-31, 37-39
     	if ((PLZ >= 20000 && PLZ <= 31999) || (PLZ >= 37000 && PLZ <= 39999))
         	{
			read("adresses/d_n.htm");
          	document.all.anschrift.innerHTML=source;
			}
       	else
      		{
      	
			// Vertreter D/W: PLZ 32-33, 40-49, 50-53, 57-59
       		if ((PLZ >= 32000 && PLZ <= 33999) || (PLZ >= 40000 && PLZ <= 42999) || (PLZ >= 44000 && PLZ <= 53999) || (PLZ >= 57000 && PLZ <= 59999))
          		{
				read("adresses/d_w.htm");
          		document.all.anschrift.innerHTML=source;
				}
        	else
        		{
		  
		  		// Vertreter D/M: 34-36, 54-56, 60-69
          		if ((PLZ >= 34000 && PLZ <= 36999) || (PLZ >= 54000 && PLZ <= 56999) || (PLZ >= 60000 && PLZ <= 61999) || (PLZ >= 63000 && PLZ <= 69999))
         			{
					read("adresses/d_m.htm");
          			document.all.anschrift.innerHTML=source;
					}
           		else
          			{
 		  	
					// Vertreter D/SW: 70-79, 88-89
            		if ((PLZ >= 70000 && PLZ <= 79999) || (PLZ >= 88000 && PLZ <= 89699))
         				{
						read("adresses/d_sw.htm");
          				document.all.anschrift.innerHTML=source;
						}
             		else
            			{
			  
			  			// Vertreter D/S: 80-87, 90-987
              			if ((PLZ >= 80000 && PLZ <= 87799) || (PLZ >= 90000 && PLZ <= 98799))
         					{
							read("adresses/d_s.htm");
          					document.all.anschrift.innerHTML=source;
							}
               			else
         					{
							read("adresses/d_fault.htm");
          					document.all.anschrift.innerHTML=source;
							}
             			}
          			}
        		}
      		}
		}

	document.PLZsuchen.PLZ.focus();
  	}

  	if (button == 1)
  		{
		return;
		}
	else
		
		return false;
		
}

function PLZpruef(language)


	{
  	var PLZ = document.PLZsuchen.PLZ.value;
	if (isNaN(PLZ))
  		{
      	switch(language) 
			{
 			case "d":
			alert ("Die Postleitzahl darf nur aus Zahlen bestehen !");
			break;
 			case "e":
			alert ("Postcode only with numbers  !");
			break;
			}
    	document.PLZsuchen.PLZ.focus();
    	return false;
		}

  	if (PLZ == ""|| PLZ == 0 || PLZ.length < 5)
  		{
      	switch(language) 
			{
 			case "d":
      		alert ("Sie m&uuml;ssen die Postleitzahl 5-stellig eingeben !");
			break;
 			case "e":
      		alert ("5-digit postcode required !");
			break;
			}
		document.PLZsuchen.PLZ.focus();
    	return false;
		}
  		  
    return true;
	}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

var source = "";
function read(file)
{

   document.fileopener.setFile(window.location.href,file);
   source = document.fileopener.getFile();
   //return source;
}

function ShowInt(adresse)
	{
	read("international/"+adresse);
    document.all.anschrift.innerHTML=source;
	}


