﻿// JScript File
function JobFunctionOther(frm, otherText) {
    var txtJobOther;
    var dllFunction;
    for (var i = 0; i < frm.length; i++) {
        e = frm.elements[i];
        if (e.name != null && e.name.indexOf('txtOtherJob') != -1) {
            txtJobOther = e;
        }

        if (e.name != null && e.name.indexOf('ddlJobFunction') != -1) {
            ddlFunction = e;
        }

    }

    if (ddlFunction.options[ddlFunction.selectedIndex].text != otherText) {
        txtJobOther.style.visibility = "hidden";
    }
    else {
        txtJobOther.style.visibility = "visible";
    }
}

function openPasswordBox() {
    var URL = "/Users/PasswordRequirements.aspx";
    var windowHeader = "Password Requirements";
    var features = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=350";
    newOpenWindow = window.open(URL, 'test', 'width=400,height=350');
    if (newOpenWindow.opener == null) {
        newOpenWindow.opener = self;
    }
    newOpenWindow.focus();
    return (false);
}

function EnableContactMethod(checkBoxId, checkBoxListId, numOfItems) {
    var checkBox = document.getElementById(checkBoxId);

    if (null == checkBox)
        return;

    var i = 0;
    var chkItem = null;
    for (i = 0; i < numOfItems; i++) {
        chkItem = document.getElementById(checkBoxListId + '_' + i);
        if (null == chkItem)
            continue;

        chkItem.disabled = (!checkBox.checked);
    }
}
function AboutMVI(frm, otherText) {
    var txtOthers;
    var dllAbout;
    for (var i = 0; i < frm.length; i++) {
        e = frm.elements[i];
        if (e.name != null && e.name.indexOf('txtOthers') != -1) {
            txtOthers = e;
        }

        if (e.name != null && e.name.indexOf('ddlAbout') != -1) {
            ddlAbout = e;
        }

    }

    if (ddlAbout.options[ddlAbout.selectedIndex].text != otherText) {
        txtOthers.style.visibility = "hidden";
    }
    else {
        txtOthers.style.visibility = "visible";
    }
}
function TypeBussiness(frm, otherText) {
    var txtBussiness;
    var ddlType;
    for (var i = 0; i < frm.length; i++) {

        e = frm.elements[i];
        if (e.name != null && e.name.indexOf('txtBussiness') != -1) {
            txtBussiness = e;
        }

        if (e.name != null && e.name.indexOf('ddlType') != -1) {
            ddlType = e;
        }

    }

    if (ddlType.options[ddlType.selectedIndex].text != otherText) {
        txtBussiness.style.visibility = "hidden";
    }
    else {
        txtBussiness.style.visibility = "visible";
    }
}


function Check(frm) {
    var chb3;
    var txtOther;

    for (var i = 0; i < frm.length; i++) {
        e = frm.elements[i];

        if (e.name != null && e.name.indexOf('chb3') != -1) {
            chb3 = e;
        }
        if (e.name != null && e.name.indexOf('txtOther') != -1) {
            txtOther = e;
        }
    }

    if (chb3.checked) {
        txtOther.style.visibility = "visible";
    }
    else {
        txtOther.style.visibility = "hidden";
    }

} 