﻿// Assurland vie form javascript ressources

/////////////////
// Page 1
/////////////////

// UI element's ID(s) page 1
var vie_ddlCurrentCarrierId;
var vie_ddlInstallmentId;
var vie_ddlRecurrentPaymentAmountId;
var vie_rowCurrentCarrierId;
var vie_rowInstallmentId;
var vie_rowRecurrentPaymentAmountId;

function vie_updateCurrentCarrierExist(value)
{
    if(value == "1")
    {
        showRow(vie_rowCurrentCarrierId);
    }
    else
    {
        hideRow(vie_rowCurrentCarrierId);
        dropDownList_clearError(vie_ddlCurrentCarrierId);
    }
}
function vie_updateOtherPayments(value)
{
    if(value == "1")
    {
        showRow(vie_rowInstallmentId);
        showRow(vie_rowRecurrentPaymentAmountId);
    }
    else
    {
        hideRow(vie_rowInstallmentId);
        dropDownList_clearError(vie_ddlInstallmentId);
        hideRow(vie_rowRecurrentPaymentAmountId);
        dropDownList_clearError(vie_ddlRecurrentPaymentAmountId);
    }
}

/////////////////
// Page 2
/////////////////

// UI element's ID(s) page 1
var vie_rblContrGuaranteeCodeId;

function vie_selectContrGuaranteeCode(value) {

   var radioGroup = document.getElementsByName(vie_rblContrGuaranteeCodeId);
   var tr;

    for (var i = 0; i < radioGroup.length; i++){
        tr = radioGroup[i].parentNode.parentNode;       
        tr.className = '';
        if (radioGroup[i].value==value){
            radioGroup[i].checked=true;
            tr.className = 'al_selected';
        }
    }
}