﻿
function validateAgree() {

    if (document.getElementById("AgreeCheckbox").checked) {

        document.getElementById("AgreeError").style.visibility = 'hidden';
        return true;

    } else {

        document.getElementById("AgreeError").style.visibility = 'visible';
        document.getElementById("AgreeError").focus();
        return false;

    }

}

function CompanyRoleChanged() {

    document.getElementById('ctl00_ctl00_MainContentPlaceHolder_MainContentPlaceHolder_ContactRegistration1_CompanyRoleTextBox').value = document.getElementById('00N30000002WTUy').value;

    if (document.getElementById('ctl00_ctl00_MainContentPlaceHolder_MainContentPlaceHolder_ContactRegistration1_CompanyRoleTextBox').value == '') {
        document.getElementById('ctl00_ctl00_MainContentPlaceHolder_MainContentPlaceHolder_ContactRegistration1_CompanyRoleTextBox').value = '';
    }
    else {
        document.getElementById('ctl00_ctl00_MainContentPlaceHolder_MainContentPlaceHolder_ContactRegistration1_CompanyRole2TextBox').value = document.getElementById('00N30000002WTVM').value;
    }

}


function clearDropdownList(ddlID) {

    //alert("clear hit");

    var ddl = document.getElementById(ddlID);
    while (ddl.hasChildNodes()) ddl.removeChild(ddl.childNodes[0]);

}

function setupSecondaryRoleDDL() {

    //alert("hit");

    clearDropdownList("00N30000002WTVM");

    primaryRole = document.getElementById('00N30000002WTUy').value

    switch (primaryRole) {

        case '':
            document.getElementById("00N30000002WTVM").style.visibility = 'hidden';
            break
        case 'Lender':

            document.getElementById("00N30000002WTVM").style.visibility = 'visible';

            var opt = document.createElement("option");
            opt.text = "Please Select an Option";
            opt.value = "";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "MLA or Bond Arranger";
            opt.value = "MLA or Bond Arranger";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Development Bank or ECA";
            opt.value = "Development Bank or ECA";
            document.getElementById("00N30000002WTVM").options.add(opt);

            break

        case 'Adviser':

            document.getElementById("00N30000002WTVM").style.visibility = 'visible';

            var opt = document.createElement("option");
            opt.text = "Please Select an Option";
            opt.value = "";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Financial";
            opt.value = "Financial";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Legal";
            opt.value = "Legal";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Management Consultancy";
            opt.value = "Management Consultancy";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Ratings Agency";
            opt.value = "Ratings Agency";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Technical";
            opt.value = "Technical";
            document.getElementById("00N30000002WTVM").options.add(opt);

            break

        case 'Sponsor':

            document.getElementById("00N30000002WTVM").style.visibility = 'visible';

            var opt = document.createElement("option");
            opt.text = "Please Select an Option";
            opt.value = "";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "EPC";
            opt.value = "EPC";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Equipment Manufacturer";
            opt.value = "Equipment Manufacturer";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Equity Provider";
            opt.value = "Equity Provider";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Oil &amp; Gas";
            opt.value = "Oil &amp; Gas";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Operating Contractor";
            opt.value = "Operating Contractor";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Other";
            opt.value = "Other";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Utility";
            opt.value = "Utility";
            document.getElementById("00N30000002WTVM").options.add(opt);

            break

        case 'Secondary Market Investor':

            document.getElementById("00N30000002WTVM").style.visibility = 'visible';

            var opt = document.createElement("option");
            opt.text = "Please Select an Option";
            opt.value = "";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Fund";
            opt.value = "Fund";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Institutional Investor";
            opt.value = "Institutional Investor";
            document.getElementById("00N30000002WTVM").options.add(opt);

            break

        case 'Insurance':

            document.getElementById("00N30000002WTVM").style.visibility = 'visible';

            var opt = document.createElement("option");
            opt.text = "Please Select an Option";
            opt.value = "";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Risk";
            opt.value = "Risk";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Monoline";
            opt.value = "Monoline";
            document.getElementById("00N30000002WTVM").options.add(opt);

            break

        case 'Other':

            document.getElementById("00N30000002WTVM").style.visibility = 'visible';

            var opt = document.createElement("option");
            opt.text = "Please Select an Option";
            opt.value = "";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "College or Student";
            opt.value = "College or Student";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Conference Organiser";
            opt.value = "Conference Organiser";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Government Agency";
            opt.value = "Government Agency";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Other Supplier";
            opt.value = "Other Supplier";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "PR Agency";
            opt.value = "PR Agency";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Recruitment Consultant";
            opt.value = "Recruitment Consultant";
            document.getElementById("00N30000002WTVM").options.add(opt);

            var opt = document.createElement("option");
            opt.text = "Advertising Angency";
            opt.value = "Advertising Angency";
            document.getElementById("00N30000002WTVM").options.add(opt);

            break

    }



}