");
document.write("");
document.write("");
} else {
document.write("");
document.write("");
document.write("");
document.write("");
}
var logNum = 100; //Change this to the number of planes you wish to keep at any one time.
var mapopen = 0;
var pdetected = 0;
var iconlnk;
var mapwin; //Hold our map window so we can communicate with it.
function OpenMap() {
mapwin = window.open("/?fid=12","mapWind", "status,height=600,width=800,resizable=1");
if (!mapwin) {
alert('Please allow popups')
return false;
} else {
return true;
mapwin.focus();
}
}
// About is open
var abopen = "";
// Array for the airline and type statistics
var acstats = new Array();
var alstats = new Array();
// Page loaded?
var pageloaded = 0;
// Get flights from this timestamp
var validfrom = 1283597043;
// Array with flight informations on the map
var fliInfoE = new Array(logNum);
var fliInfoW = new Array(logNum);
var fliIdent = new Array(logNum);
var flinorth = new Array(logNum);
var flieast = new Array(logNum);
var fliwest = new Array(logNum);
var fliPathE = new Array(logNum);
var fliPathW = new Array(logNum);
var fliTime = new Array(logNum);
// String Replacer method
var re = new RegExp(' ', 'gi') ;
// Timeout Handler for the chatfunction
var TO = "";
// Timeout for chat(send|receive) (milliseconds)
var refITV = 7000;
// Nickname for the chat
var nick = "";
// Unique ID created by acarsd server for this client
var clientid = "a0ee364f-17d1-4833-89d5-69f855627699";
// Chat is enabled/disabled
var inchat = 0;
// Messagecounter
var messages = 0;
// Compare function for the statistic output
function compareFunc(a1, a2) {
return a1[1] > a2[1] ? -1 :
a1[1] < a2[1] ? 1 :
a1[0] < a2[0] ? -1 :
a1[0] > a2[0] ? 1 : 0;
}
// Search the complete array
function arraySearch(str,arr) {
// Set base indicators
var max = arr.length-1;
// Start search
var i = 0; var s = "";
while (i<=max) {
s = arr[i]; if (str == s[0]) { return i; }
i++;
}
// Error
return -1;
}
// Insert new value into array or increment the counter
// for an already existing element
function statInsert(str,arr) {
// Search entry
var i = arraySearch(str,arr);
// Entry not found
if (i==-1) {
// Insert new entry
arr[arr.length] = new Array(str,1);
} else {
// Increment counter
var s = arr[i]; s[1]++;
}
}
// Show or hide chat window
function showChatWin(x) {
// Open close chat window
iF.OpenClose('chat',x);
// Chat is disabled or enabled
inchat = x;
// Disable the chat
if ((!x) && (TO.length)) {
clearTimeout(TO); TO = "";
} else if (x) {
sendchatmessage(0);
}
}
// Write coloured strings
function cstr(c) {
var W = parent.frames.ACARS.document;
// W.write("");
}
// Show message from admin
function adminmessage(msg) {
cstr(3); parent.frames.ACARS.document.write("Message from admin: ");
cstr(0); parent.frames.ACARS.document.writeln(msg+" ");
}
// Output flight informations based on the layernumber
function flightinfo(num) { alert(fliInfo[num]); }
// Flight is already on the map?
function is_flight_on_map(reg) {
var l = fliIdent.length;
for (var i=0;i=logNum)?-1:i;
}
}
// Nothing found
return -1;
}
// Update aircraft position on the map
function routeupdate(reg,pnorth,peast) {
// Plot flight on the Google Map
if (!mapopen) return;
var d = mapwin.document;
if (d==null) return;
// This flight is already on the map?
var mi = is_flight_on_map(reg);
// Flight is not on the map
if (mi == -1) return;
// Customize for around Greece area only, discards invalid position errors
if (pnorth > 31.0 && pnorth < 45.0 && peast > 14.0 && peast < 36.0) {
mapwin.LoadPlanes();
}
}
// Write error output
function wrerr(code,trash) {
// Make a shortcut
var W = parent.frames.ACARS.document;
cstr(7); W.writeln(code+" ");
cstr(6); W.writeln(trash+"
");
// Scroll Window
parent.frames.ACARS.scrollBy(-1,10000);
}
// Write ACARS output
function wrtac(mode,gst,reg,type,label,ldesc,bid,msgno,flightno,route,airline,msg,dt,manu,oreg,oflight,crc,cont,tstat,pnorth,psouth,peast,pwest,two,cards,card,channel,chname,distance,time,eastwest) {
// Page not loaded
if (!pageloaded) { return }
// Increment message counter
messages++;
// Set values for west and south
if (pwest > 0) {
peast = 0 - pwest;
}
if (psouth > 0) {
pnorth = 0 - psouth;
}
if (peast > 180) peast/=10; // very strange but found some, wrong decimal point position on peast
// Replace with correct \n within messagetext
//var message = msg.replace(re, '\n');
var message = msg;
// Make a shortcut
var W = parent.frames.ACARS.document;
if(message.indexOf("DFB*WOB") != -1) {
var len = (message.indexOf("N",39) - 3) - 38;
var altitude = message.substr(38,len).replace(/^\s*|\s*$/g,"");
} else if(message.indexOf("DFB*WXR") != -1) {
var getpos = (message.indexOf("M",22) + 4);
var len = (message.length - getpos) - 3;
var altitude = message.substr((message.indexOf("M",22) + 4),len).replace(/^\s*|\s*$/g,"");
} else if(message.indexOf(" W ") != -1) {
var start = message.indexOf(",") + 1;
var altitude = message.substr(start,message.indexOf(",", start + 1) - start).replace(/^\s*|\s*$/g,"");
} else if(message.indexOf("DFBCRZ") != -1) {
var start = message.lastIndexOf("-") + 5;
var altitude = message.substr(start, message.indexOf("07", start + 5) - start).replace(/^\s*|\s*$/g,"");
} else if(message.indexOf(",W ") != -1) {
var start = message.indexOf(",",11) + 1;
var altitude = message.substr(start, message.lastIndexOf(",") - start).replace(/^\s*|\s*$/g,"");
} else {
var altitude = "Unknown";
}
if(altitude>60000 || altitude.length>5 || altitude.length==0) altitude="Unknown";
// Checksum not verified
if (crc) {
cstr(4); W.writeln("Checksum not verified for the following message ");
} else {
// Update statistics
if (airline.length) { statInsert(airline,alstats); }
if (type.length) { statInsert(tstat,acstats); }
}
// Soundcard informations
if ((cards>1) || (two)) {
cstr(8); W.writeln("-= Soundcard No. "+(card+1)+" on Channel "+channel+" ["+chname+"] =- ");
}
// Write ACARS output
cstr(3); W.write("ACARS mode: "); cstr(2);
W.write(mode+" ");
if (gst.length) { cstr(1); W.write("["+gst+"] "); }
cstr(3); W.write("Aircraft reg: "); cstr(2);
W.write(reg+" ");
if (oreg.length) {
cstr(3); W.write("Org: ");
cstr(2); W.write(oreg+" ");
}
if (type.length) { cstr(1); W.write("["+type+"] "); }
W.writeln(" "); cstr(3); W.write("Message label: ");
cstr(2); W.write(label+" ");
if (ldesc.length) { cstr(1); W.write("["+ldesc+"] "); }
cstr(3); W.write("Block id: "); cstr(2);
W.write(bid+" "); cstr(3); W.write("Msg no: ");
cstr(2); W.writeln(msgno+" "); cstr(3);
W.write("Flight id: "); cstr(2); W.write(flightno+" ");
if (oflight.length) {
cstr(3); W.write("Org: ");
cstr(2); W.write(oflight+" ");
}
if (route.length) { cstr(1); W.write("["+route+"]"); }
if (airline.length) { cstr(1); W.write(" ["+airline+"]"); }
W.writeln(" ");
// Distance available
if (distance) {
cstr(3); W.write("Flight distance: "); cstr(2);
W.write("appr. "+distance+"km"); cstr(3);
W.write(" Flight time: "); cstr(2);
W.writeln("appr. "+time+" hours ");
}
//Altitude available
if(altitude != "Unknown") {
cstr(3); W.write("Flight altitude: "); cstr(2);
W.write(altitude+"ft ");
}
if (msg.length) {
cstr(3); W.writeln("Message content:- ");
cstr(2); W.writeln(message+" ");
}
// This entry was translated?
if ((oreg.length) || (oflight.length)) {
cstr(3); W.writeln(" ");
if (oreg.length) {
cstr(3); W.write("Original registration: ");
cstr(2); W.write(oreg+" ");
}
if (oflight.length) {
cstr(3); W.write("Original flightnumber: ");
cstr(2); W.write(oflight+" ");
}
W.writeln(" ");
}
if (pnorth) {
cstr(3); W.write("North: ");
cstr(2); W.write(pnorth+" ");
}
if (psouth) {
cstr(3); W.write("South: ");
cstr(2); W.write(psouth+" ");
}
if (peast) {
cstr(3); W.write("East: ");
cstr(2); W.write(peast+" ");
W.writeln(" ");
}
if (pwest) {
cstr(3); W.write("West: ");
cstr(2); W.write(pwest+" ");
W.writeln(" ");
}
cstr(0);
W.writeln("----------------------------------------------------------[ "+dt+" ]- ");
if (cont.length) {
cstr(5); W.writeln(cont+"
");
} else {
W.writeln(" ");
}
// Scroll Window
parent.frames.ACARS.scrollBy(-1,5000);
// Refresh content frame
if (messages >= 500) {
parent.frames.ACARS.document.close();
parent.frames.ACARS.document.location.href="/?fid=1";
messages = 0;
}
// Customize for around Greece area only, discards invalid position errors
if (pnorth > 31.0 && pnorth < 45.0 && peast > 14.0 && peast < 36.0) {
logPositions(reg,route,dt,flightno,airline,tstat,pnorth,psouth,peast,pwest,distance,time,eastwest,altitude);
}
// Iconsupport?
if (iF.icons) iF.fetch(reg,manu+" - "+type+" ["+reg+"]");
}
// Start ACARS fetch
function fetchData() {
// AJAX is enabled?
// if (AJACARS.avail) {
// AJACARS.vfrom = validfrom; AJACARS.clientid = clientid;
// return;
// }
// Page is ready?
if (pageloaded) {
// Get latest data from ACARS Server
document.getElementById("hframe").src="/?fid=2&cid="+clientid+"&uid="+validfrom;
// Update number of aircrafts giving position info, open the map to see them
// document.getElementById("onmap").innerHTML=pdetected;
}
}
function logPositions(reg,route,dt,flightno,airline,tstat,pnorth,psouth,peast,pwest,distance,time,eastwest,altitude) {
if (pnorth) {
// This flight is already on the map?
var mi = is_flight_on_map(reg);
var parrayid;
if(mi==-1) {
parrayid = pdetected;
} else {
parrayid = mi;
}
// Set flight informations
if(!route) {
route = "No Route Data";
}
fliInfoW[parrayid] = "Flight: "+flightno+" "+route+" Altitude: "+altitude+" ft Operator: "+airline+" Aircraft reg. and type: "+reg+" ["+tstat+"] Contacted: "+dt+" Position: N"+pnorth+", W"+pwest;
fliInfoE[parrayid] = "Flight: "+flightno+" "+route+" Altitude: "+altitude+" ft Operator: "+airline+" Aircraft reg. and type: "+reg+" ["+tstat+"] Contacted: "+dt+" Position: N"+pnorth+", E"+peast;
if(mi == -1 && fliPathE[parrayid] != "") {
fliPathE[parrayid] = "";
fliPathW[parrayid] = "";
}
fliIdent[parrayid] = reg;
fliwest[parrayid] = pwest;
flieast[parrayid] = peast;
flinorth[parrayid] = pnorth;
if(mi != -1) {
var oldPathE = fliPathE[parrayid];
var oldPathW = fliPathW[parrayid];
fliPathW[parrayid] = oldPathW + pnorth+","+pwest+"/";
fliPathE[parrayid] = oldPathE + pnorth+","+peast+"/";
} else if(mi == -1) {
fliPathW[parrayid] = pnorth+","+pwest+"/";
fliPathE[parrayid] = pnorth+","+peast+"/";
}
fliTime[parrayid] = Date();
if(mapopen == 1) {
mapwin.LoadPlanes();
if(mapwin.focusonchng == 1) {
mapwin.focus();
}
}
if (mi == -1) {
// Start from 0
pdetected++;
if (pdetected >= logNum) pdetected = 0;
}
} else {
if(mapopen == 1) {
//"silently" reload the window to check for any planes over the timelimit.
mapwin.LoadPlanes();
}
}
}
// Information about the current release
function aboutWin(x) {
// Show/Hide about frame
clearTimeout(abopen);
iF.OpenClose('about',x);
var d = document.getElementById("mainWindow");
if (x) abopen = setTimeout("aboutWin(0)",15000);
}
// Send chat message to the server
function sendchatmessage(x) {
// We need a unique id for cache reasons
var d = new Date(); var uid = d.getTime();
// User set the nickname?
var m = document.forms.comm.msg.value;
if ((x) && (m.substr(0,6)=="/NICK ")) {
nick = m.substr(6,m.length-6);
document.forms.comm.msg.value = "";
clearTimeout(TO);
document.forms.comm.msg.focus();
TO = setTimeout("sendchatmessage(0)",refITV);
alert("Your nickname was accepted");
return;
}
// Send/Receive message or just receive new messages
if (x) {
document.getElementById("chatc").src="/?fid=4&f="+uid+"&msg="+escape(m)+"&nick="+escape(nick);
document.forms.comm.msg.value = ""; clearTimeout(TO);
} else {
document.getElementById("chatc").src="/?fid=3&f="+uid;
}
// Set next timeout
document.forms.comm.msg.focus();
TO = setTimeout("sendchatmessage(0)",refITV);
}
// Keypress Handler
function kpHdlr(e) {
// Chat is enabled?
if (!inchat) { return }
// Check for RETURN keycode #13
if (document.all) {
if (event.keyCode==13) {
sendchatmessage(1);
}
} else if (e.which==13) {
sendchatmessage(1);
}
}
// Show/Hide search inputwindow
function searchDB(x,snd) {
// Send request
if (snd) {
// Get searchtype
var stype = (document.forms.dbsrch.stype[0].checked)?0:1;
// Send search request
document.getElementById("srch").src="/?fid=6&cid="+clientid+"&stype="+stype+"&srch="+escape(document.forms.dbsrch.sstring.value.toUpperCase())+"&uid="+validfrom;
// Close Window
iF.OpenClose('search',1); return;
}
// Show search input frame
iF.OpenClose('searchfunc',x);
}
// Show/Hide ANAD style Report Window
function requestReports(x,snd) {
// Send report request
if (snd) {
// Close Window and send request
requestReports(0,0);
document.getElementById("srch").src="/?fid=7&cid="+clientid+"&date="+escape(document.forms.grep.dstring.value)+"&uid="+validfrom;
return;
}
// Show search input frame
iF.OpenClose('getrep',x);
}
/* Modify servers databases */
function dbModify(x,snd) {
// Send request to the server
if (snd) {
// Get form
var f = document.forms.dbmod;
// Get operation
if (f.what[0].checked) {
var op = f.what[0].value;
} else if (f.what[1].checked) {
var op = f.what[1].value;
} else if (f.what[2].checked) {
var op = f.what[2].value;
} else if (f.what[3].checked) {
var op = f.what[3].value;
} else {
var op = f.what[4].value;
}
// Close Window and send request
iF.OpenClose('dbmodify',0);
document.getElementById("srch").src="/?fid=13&"+f.modpass.value+"&"+op+"&"+escape(f.key.value)+"^"+escape(f.value.value)+"&uid="+validfrom;
return;
}
// Show search input frame
iF.OpenClose('dbmodify',x);
}
/* Subscribe/unsubscribe for daily reports */
function dailyMailing(x,snd) {
// Send request to the server
if (snd) {
// Get form
var f = document.forms.mail;
// Get searchtype
if (f.type[0].checked) {
var rtype = "0";
} else if (f.type[1].checked) {
var rtype = "1";
} else {
var rtype = "2";
}
// Get operation
if (f.what[0].checked) {
var op = "1";
} else if (f.what[1].checked) {
var op = "2";
} else if (f.what[2].checked) {
var op = "3";
} else if (f.what[3].checked) {
var op = "4";
} else {
var op = "5";
}
// Close Window and send request
iF.OpenClose('dmailing',0);
document.getElementById("srch").src="/?fid=10&cid="+clientid+"&op="+op+"&type="+rtype+"&mail="+escape(f.email.value)+"&auth="+escape(f.auth.value)+"&uid="+validfrom;
return;
}
// Show search input frame
iF.OpenClose('dmailing',x);
}
// FleetList Browser
function getFleetList(x) {
// Request the fleetlist
if (x) {
// Get form content
var f = document.forms.fwin.alc.value;
if (f.length) {
// Send request to acarsd server
document.getElementById("srch").src="/?fid=14&cid="+clientid+"&alc="+escape(f.toUpperCase())+"&uid="+validfrom;
// Open result window
iF.OpenClose('search',x);
}
// Show search input frame
return;
}
// Show search input frame
iF.OpenClose('fleetwin',x);
}
// Show Web ACARS Help
function showHelp() {
// Load helpfile
document.getElementById("srch").src="/?fid=9&uid="+validfrom;
iF.OpenClose('search',1);
}
// Show daily new contacts
function newContacts(x) {
// Load list from the server
if (x) {
document.getElementById("srch").src="/?fid=11&uid="+validfrom;
// Reload newsticker to get latest values
NewsTicker.GetNews("/?fid=15",1);
}
// Open/Close Window
iF.OpenClose('search',x);
}
// Show airline statistics
function stats(arr,r0,r1) {
// Sort array
arr = arr.sort(compareFunc);
// Change header
var d = document.getElementById("srchbar");
d.innerHTML = r0 + " statistics";
// Open Output Window
iF.OpenClose('search',1);
var d = window.frames.srch.document;
d.open();
// Create header
if(location.hostname.indexOf("awmn") != -1 && location.hostname.indexOf("sv1lh") != -1) {
d.writeln("\n\n
");
// Close document
d.close();
}
// Remove all old contacts from the map // keep 1Hour history
function CleanMap() {
// Get current time
var d = new Date(); var t = d.getTime();
t-=3600000;
var l = fliIdent.length;
for (var i=0;iFirst Heard today: ");
//NewsTicker.GetNews("/?fid=15",1);
//-->
Here you can add (or update) entries within servers database.
May be you'll need a password to update entries. You'll get this from the serveradmin.
Results from acarsd server
Realtime web ACARS chat
Search in servers database
You can search aircraft registrations or flights. For your search you can use the following wildcard signs: * replaces every character (For example: LH*) ? replaces one character (For example: HA-LP?)
The search is limited to 20 seconds CPU time or 1000 hits