﻿function getHelp(filename) {
    url = 'images/form7480_' + filename + '.gif';
    popUp(url,400,500);
}

function popUp(URL,WinWidth,WinHeight) {
    width = WinWidth;
    height = WinHeight;
    day = new Date();
    id = day.getTime();
    if (width == undefined)
        width = 700;
    if (height == undefined)
        height = 270;
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + width + ",height=" + height + ",left = 340,top = 352');");
}

function refreshParent() {
    opener.location.reload();
    window.close();
}

function EditAccount() {
    popUp('pvtpopup.aspx?section=editaccount', 700, 320);
}
function EditLogins() {
    popUp('pvtpopup.aspx?section=editlogins', 700, 250);
}
function EditAirport(facId) {
    popUp('pvtpopup.aspx?section=editfacility&facid=' + facId, 700, 320);
}
function EditContact(contactId, facId) {
    popUp('pvtpopup.aspx?section=editcontact&contactid=' + contactId + '&facid=' + facId);
}
function EditRunway(runwayId) {
    popUp('pvtpopup.aspx?section=editrunway&runwayid=' + runwayId);
}
function EditHelipad(helipadId) {
    popUp('pvtpopup.aspx?section=edithelipad&helipadid=' + helipadId);
}

function AddContact(facId) {
    popUp('pvtpopup.aspx?section=addcontact&facId=' + facId);
}

function AddHelipad(facId) {
    popUp('pvtpopup.aspx?section=addhelipad&facid=' + facId);
}

function AddRunway(facId) {
    popUp('../pvtpopup.aspx?section=addrunway&facid=' + facId);
}


function showHideAccountType(element) {
    if (element == 'showHidePersonal') {
        document.getElementById('showHideOrgainzation').style.display = 'none';
        document.getElementById('showHidePersonal').style.display = 'block';

    } else {
        document.getElementById('showHideOrgainzation').style.display = 'block';
        document.getElementById('showHidePersonal').style.display = 'none';
    }
    document.getElementById('addressInformation').style.display = 'block';
    document.getElementById('continueButton').style.display = 'block';
    
}

function CheckOrganization(oSrc, args) {
    var x = false;
    if (document.getElementById('ctl00_ContentPlaceHolder1_ctl00_rdoOrganizational').checked) {
        ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_ctl00_fvFirst'), false);
        ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_ctl00_fvLast'), false);
        ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_ctl00_fvPrefix'), false);
        ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_ctl00_fvOrganization'), true);    

    } else {
        ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_ctl00_fvFirst'), true);
        ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_ctl00_fvLast'), true);
        ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_ctl00_fvPrefix'), true);
        ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_ctl00_fvOrganization'), false);
    }
} 

function CheckCheckboxes(oSrc, args) {
    var flag = '';
    
    for (var x = 1; x <= 13; x++) 
    {
        var tempId = 'ctl00_ContentPlaceHolder1_ctl00_CheckBox' + x;
        if (document.getElementById(tempId).checked == false)
            flag = '1';
    }

    if (flag == '1') {
        args.IsValid = false;
    } else {
        args.IsValid = true;
    }
}




