function LoadWindow(URL) {
  var w = screen.availWidth||screen.width;
  var h = screen.availHeight||screen.height;
  WinVar = window.open(URL,'NewWin','location=yes,menubar=yes,toolbar=yes,titlebar=yes,resizable=yes,scrollbars=yes');
};
function PrintWindow(URL) {
  var w = 760;
  var h = 600;
  WinVar = window.open(URL,'PrintWin','location=yes,menubar=yes,toolbar=yes,titlebar=yes,resizable=yes,scrollbars=yes,top=50,width='+w+',height='+h);
};

function winStat(Status) {
    if (Status) {
        window.status = StatusOpen + Status;
    } else {
        window.status = DefaultStatusMessage;
    };
    return true;
}

function ImgOver(imgName) {
    imgOver = eval(imgName + "OVER.src");
    document [imgName].src = imgOver;
}

function ImgOut(imgName) {
    imgOff = eval(imgName + "OUT.src");
    document [imgName].src = imgOff;
}

function DelayImgOut(imgName) {
    window.setTimeout("ImgOut('" + imgName + "')",200,'Javascript');
}

var windowWidth = 0;
// Determine Browser Type
// Netscape
var ns4=(document.layers)? true:false;
var ns6=(document.getElementById)? true:false;
// Internet Explorer
var ie4=(document.all)? true:false;
var ie5=false;
if(ie4){
    if((navigator.userAgent.indexOf('MSIE 5')> 0)||(navigator.userAgent.indexOf('MSIE 6')> 0)){ ie5=true; }
    ns6=false; ns4=false;
}
// Mac Compatible
var No3 = (parseInt(navigator.appVersion) > 3) ? 1:0;
if (navigator.userAgent == "Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)") { No3 = 0; }

function GetWindowWidth() {
//Returns the Inner Width of the current window
    var iwidth;
    if(ie4)iwidth      = self.document.body.clientWidth;                           //Internet Explorer 4+
    if(ns4)iwidth      = self.innerWidth;                                          //NetScape 4+
    if(ns6)iwidth      = self.outerWidth;                                          //NetScape 6+
    return iwidth;
};

function GetWindowHeight() {
//Returns the Inner Height of the current window
    var iheight;
    if(ie4)iheight     = self.document.body.clientHeight;                          //Internet Explorer 4+
    if(ns4)iheight     = self.innerHeight;                                         //NetScape 4+
    if(ns6)iheight     = self.outerHeight;                                         //NetScape 6+
    return iheight;
};

function parseURLString() {
//Returns Hash of passed URL parameters
    var pairs=unescape(location.search.substring(1).replace(/\+/g," ")).split('&');
    for (var i=0;i<pairs.length;i++){ var pair = pairs[i].split('='); this[pair[0]]=pair[1]; }
}

function getWidth(id) {
// Returns the width of the layer (id)
    var el=document.getElementById(id).offsetWidth;
    if(!el) { el = document.getElementById(id).style.height; };
    return el;
}

function getHeight(id) {
// Returns the height of the layer (id)
    var el = document.getElementById(id).offsetHeight;
    if(!el) { el = document.getElementById(id).style.height; };
    return el;
}

function PositionHoverDiv() {
    windowWidth = getWidth('MAIN_WINDOW_TABLE');
    windowWidth = GetWindowWidth();
    if (windowWidth) {
      document.getElementById('LIGHT_AIRCRAFT_HOVER').style.top   = 132;
      document.getElementById('LIGHT_AIRCRAFT_HOVER').style.left  = (windowWidth/2) + 148;
      document.getElementById('MEDIUM_AIRCRAFT_HOVER').style.top  = 132;
      document.getElementById('MEDIUM_AIRCRAFT_HOVER').style.left = (windowWidth/2) + 203;
      document.getElementById('HEAVY_AIRCRAFT_HOVER').style.top   = 132;
      document.getElementById('HEAVY_AIRCRAFT_HOVER').style.left  = (windowWidth/2) + 256;
    };
}

var HideTimer; clearTimeout(HideTimer);
function ShowAircraft(airType) {
    clearTimeout(HideTimer);
    if (!windowWidth) { return; };
    if(airType=='light') {
        document.getElementById('MEDIUM_AIRCRAFT_HOVER').style.visibility = 'hidden';
        document.getElementById('HEAVY_AIRCRAFT_HOVER').style.visibility  = 'hidden';
        document.getElementById('LIGHT_AIRCRAFT_HOVER').style.visibility  = 'visible';
    } else if(airType=='medium') {
        document.getElementById('LIGHT_AIRCRAFT_HOVER').style.visibility  = 'hidden';
        document.getElementById('HEAVY_AIRCRAFT_HOVER').style.visibility  = 'hidden';
        document.getElementById('MEDIUM_AIRCRAFT_HOVER').style.visibility = 'visible';
    } else if(airType=='heavy') {
        document.getElementById('LIGHT_AIRCRAFT_HOVER').style.visibility  = 'hidden';
        document.getElementById('MEDIUM_AIRCRAFT_HOVER').style.visibility = 'hidden';
        document.getElementById('HEAVY_AIRCRAFT_HOVER').style.visibility  = 'visible';
    } else {
        document.getElementById('LIGHT_AIRCRAFT_HOVER').style.visibility  = 'hidden';
        document.getElementById('MEDIUM_AIRCRAFT_HOVER').style.visibility = 'hidden';
        document.getElementById('HEAVY_AIRCRAFT_HOVER').style.visibility  = 'hidden';
    };
}

window.onresize = PositionHoverDiv; PositionHoverDiv();
