function showIntPilot(Typ,Kennz,Plan,Ton,Loop)
  {
  BrowserTest()
  Pfad = 'http://www.netzpiloten.de/airport/'+Typ+'/'+Kennz+'/'+Plan+'.htm?pilotenmethode='+pilotenmethode+'&sound='+Ton+'&loop='+Loop;
   PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=yes");          

   if (PilotWindow.frames.length == 0) {
     PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=yes");
   }
   else {
    PilotWindow.location.href = Pfad;
     PilotWindow.focus();
   }
  }

function TakeOff(Typ,Kennz,Plan,Ton,Loop)
  {
  BrowserTest()
  Pfad = 'http://www.netzpiloten.de/airport/'+Typ+'/'+Kennz+'/'+Plan+'.htm?pilotenmethode='+pilotenmethode+'&sound='+Ton+'&loop='+Loop;
   PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=yes");          

   if (PilotWindow.frames.length == 0) {
     PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=yes");
   }
   else {
    PilotWindow.location.href = Pfad;
     PilotWindow.focus();
   }
  }

function WMTakeOff(Typ,Kennz,Plan,Ton,Loop)
  {
  BrowserTest()
  Pfad = 'http://www.netzpiloten.de/airport/'+Typ+'/'+Kennz+'/'+Plan+'&pilotenmethode='+pilotenmethode+'&sound='+Ton+'&loop='+Loop;
   PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=yes");          

   if (PilotWindow.frames.length == 0) {
     PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=yes");
   }
   else {
    PilotWindow.location.href = Pfad;
     PilotWindow.focus();
   }
  }

function showIntDaytime(Kennz)
  {
  BrowserTest();
  if(Kennz == 'USA_WEST')
    {
    Pfad = 'http://www.netzpiloten.de/us_routen/dynamopilot.htm?pilottime=800&pilotenmethode='+pilotenmethode;
    }
  if((Kennz == 'USA_EAST') || (Kennz == 'USA'))
    {
    Pfad = 'http://www.netzpiloten.de/us_routen/dynamopilot.htm?pilottime=700&pilotenmethode='+pilotenmethode;
    }
   else if (Kennz == 'E')
     {
    Pfad = 'http://www.netzpiloten.de/airport/np/E/dynamopilot.htm?pilottime=0&pilotenmethode='+pilotenmethode;
     }
  //Pfad = 'http://www.netzpiloten.de/routen/dynamopilot.htm?pilot='+Kennz+'_UHRZEITPILOT';
   PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=yes");          

   if (PilotWindow.frames.length == 0) {
     PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=yes");
   }
   else {
     PilotWindow.location.href = Pfad;
     PilotWindow.focus();
   }

  }

function showIntWMPilot(Typ,Kennz,Plan){
	BrowserTest();
  	Pfad = 'http://www.netzpiloten.de/routen/'+Typ+'/'+Kennz+'/'+Plan+'&pilotenmethode='+pilotenmethode;
  	PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");          

   if (PilotWindow.frames.length == 0) {
     PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");
   }
   else {
     PilotWindow.location.href = Pfad;
     PilotWindow.focus();
   }
};


//Die neue Uhrzeitfunktion

function showDaytime(){
	BrowserTest();
  	Pfad = 'http://www.netzpiloten.de/airport/np/D/dynamopilot.htm?pilotenmethode='+pilotenmethode;
  	PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");          
   if (PilotWindow.frames.length == 0)
    {
     PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");
     PilotWindow.focus();
   }
   else {
     PilotWindow.location.href = Pfad;
     PilotWindow.focus();
   }
  }



function showPrivate(UserID,Number){
	BrowserTest();
  	Pfad = 'http://www.netzpiloten.de/de/mypilot/privat/pilot.htm?pilotenmethode='+pilotenmethode+'&UserID='+UserID+'&Pilot='+Number;
  	PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");          

   if (PilotWindow.frames.length == 0) {
     PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");
     PilotWindow.focus();
   }
   else {
     PilotWindow.location.href = Pfad;
     PilotWindow.focus();
   }
};

function showHelp(file) {
	helppath = "http://www.netzpiloten.de/" + file;
	HelpWindow = window.open(helppath,"Hilfe","toolbar=no,location=no,status=no,scrollbars=yes,width=330,innerWidth=330,height=400,innerheight=400,screenX=30,screenY=20,resizable=yes");
	HelpWindow.focus();
};

function BrowserTest()
	{
	var name = navigator.appName;
	var vers = navigator.appVersion;
	var codename = navigator.userAgent;
	var macintosh = /Mac/; 
	vers = vers.substring(0,1); // or 0,4  could return 4.5 instead of just 4
	if (vers >= 4) {
		if (name == "Microsoft Internet Explorer") {
			if (macintosh.exec(codename) == "Mac")
			{ 
			pilotenmethode=1;
			return pilotenmethode;
			}
			else
			{ 
			pilotenmethode=2;
			return pilotenmethode;
			}

		}
		else if (name == "Netscape"){
			if (macintosh.exec(codename) == "Mac")
			{ 
			pilotenmethode=3;
			return pilotenmethode;
			}
			else
			{ 
			pilotenmethode=4;
			return pilotenmethode;
			}
		}
	}
	else {
		pilotenmethode=0;
		return pilotenmethode;
		}
	};
	
function windowOpen(pfad,windowname,width,height) {
	eigenschaften = 'toolbar=no,location=no,status=no,scrollbars=no,width='+width+',innerWidth='+width+',height='+height+',innerheight='+height+',resizable=yes';
     OpenedWindow = window.open(pfad,windowname,eigenschaften);
     OpenedWindow.focus();
}
		
function showPilot(Plan){
	BrowserTest();
  	Pfad = 'http://www.netzpiloten.de/routen/'+Plan+'.htm?pilotenmethode='+pilotenmethode;
  	PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");          

   if (PilotWindow.frames.length == 0) {
     PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");
     PilotWindow.focus();
   }
   else {
     PilotWindow.location.href = Pfad;
     PilotWindow.focus();
   }
};
		
function showWMPilot(Plan){
	BrowserTest();
  	Pfad = 'http://www.netzpiloten.de/routen/'+Plan+'&pilotenmethode='+pilotenmethode;
  	PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");          

   if (PilotWindow.frames.length == 0) {
     PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");
   }
   else {
     PilotWindow.location.href = Pfad;
     PilotWindow.focus();
   }
};



function showMyPilot(Plan)
  {
	BrowserTest();
	Pfad = 'http://www.netzpiloten.de/routen/'+Plan+'.htm?pilotenmethode='+pilotenmethode;
	PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");          
	if (PilotWindow.frames.length == 0) {
		PilotWindow = window.open( Pfad,"Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=no");
	}
	else {
		PilotWindow.location.href = Pfad;
		PilotWindow.focus();
	}
}

function FlyOff(Typ,Kennz,Plan)
  {
  BrowserTest()
   PilotWindow = window.open("","Autopilot","toolbar=no,location=no,status=no,scrollbars=no,width=660,innerWidth=660,height=140,innerheight=140,screenX=30,screenY=20,resizable=yes");          
   document.forms[0].submit();
     PilotWindow.focus();
   }

function showWebmilesLogin(pid, typ, land, pilot) {
    CheckInWin = window.open("http://www.netzpiloten.de/de/webmiles/start.htm"
    	+"?pid="+pid+"&typ="+typ+"&land="+land+"&pilot="+pilot,
    	"CheckIn","menubar=yes,toolbar=no,location=no,status=yes,scrollbars=no,width=440,innerWidth=430,height=320,innerheight=310,resizable=yes");
}
