// -- MODIFICATIONS MADE BY BYRGIUS TECHNOLOGIES ---------------------------------------------------------------
//
// Developer:   Byrgius Technologies
// Files:       airport.js, airport.html
// URL:         http://www.byrgius.com/
// Version:     1.00 (iFrame Version)
// Last Mod:    07/02/2004
//
// ModDate__ModUser_______ModDescription________________________________________________________________________
//

// -- USAGE INSTRUCTIONS ---------------------------------------------------------------------------------------
//

// -- Configurable Environment Variables -----------------------------------------------------------------------

// server path to calendar
var popAirPath          = '/TEMPLATES/popAirport/';
var popAirHtmlFile      = 'airport.html';

// is the form field a SELECT
var INPUT_SELECT        = false;

// calendar object array
var airports            = [];

// -- create calendar object -----------------------------------------------------------------------------------
function airport(obj_target) {
    // assigning methods
    this.LoadAirport    = air_load_frame;
    this.CheckVal       = check_field_val;

    // validate input parameters
    if (!obj_target)
        return air_error("Error calling the calendar: no target control specified");
    if (obj_target.value == null)
        return air_error("Error calling the calendar: parameter specified is not valid target control");

    this.target         = obj_target;
    this.is_Select      = INPUT_SELECT;
    this.pox_x          = 0;
    this.pox_y          = 0;

    // register in global collections
    this.id             = airports.length;
    airports[this.id]  = this;
}

// -- load calendar iFrame layer -------------------------------------------------------------------------------
function air_load_frame(str_val) {
    if (this.frame_name) {
        var obj_airFrame = document.getElementById(this.frame_name);
        obj_airFrame.src = (
            popAirPath + popAirHtmlFile + '?airport=' + str_val + '&id=' + this.id
            + '&fName=' + this.frame_name + '&pos_x=' + this.pos_x + '&pos_y=' + this.pos_y
        );
    } else {
        if (!this.pos_x) { this.pos_x = 200; };
        if (!this.pos_y) { this.pos_y = 200; };
        var obj_airWindow = window.open(
            popAirPath + popAirHtmlFile + '?airport=' + str_val + '&id=' + this.id + '&pos_x='
            + this.pos_x + '&pos_y=' + this.pos_y, 'Airport','width=200,height=200,status=no,resizable=no,top='
            + this.pos_x + ',left=' + this.pos_y + ',dependent=yes,alwaysRaised=yes'
        );
        obj_airWindow.opener = window;
        obj_airWindow.focus();
    };
}

// -- field value check ----------------------------------------------------------------------------------------
function check_field_val(str_val) {
    if (str_val) {
        return str_val;
    } else {
        return '';
    };
}

// -- END OF APPLICATION ---------------------------------------------------------------------------------------
