﻿
function GetOptions() {
    var M = $('#ComprehensiveInsurance').is(':checked');
    var G = $('#ThirdParty').is(':checked');
    var H = $('#HomeInsurance').is(':checked');

    if (M === true && G === false && H === false) return MakifObj_1;
    if (M === true && G === false && H === true) return MakifObj_1;
    if (M === false && G === true && H === false) return NoMakifObj_1;
    if (M === false && G === false && H === true) return NoMakifObj_1;
    if (M === false && G === true && H === true) return NoMakifObj_1;

    return 'empty';
}

function CreateOptions() {
    var opt = eval(NoMakifObj);
    var optionSelect = "<option value='-1' >בחר סוג רכב</option>";

//    NoMakifObj_1 += optionSelect;
//    MakifObj_1 += optionSelect;

    $.each(opt, function (index, value) {       
        NoMakifObj_1 += '<option value="' + value.Value + '">' + value.Text + '</option>';
    });

   var opt = eval(MakifObj);
    $.each(opt, function (index, value) {
        MakifObj_1 += '<option value="' + value.Value + '">' + value.Text + '</option>'; 
    });


}

function RenderOptions() {
    var x = GetOptions();
    if (x != 'empty') {
        var ddloptions = x;
        var selectedval = getPrevSelected();      
        $(".manfuCar").show().html(ddloptions);
        if (Number(selectedval) > -1) {            
            $('select.manfuCar').val(selectedval);
        }         
        $.hyjack_select.update(".manfuCar");
    }
}

function getPrevSelected() {
    var selected = $('select.manfuCar :selected');
    if (selected.length > 0) {
        return selected.val()
    }
    return -1;
}

function AddWTCheckBox(checkBoxName) {
    CallWTFunctionWithMi('HomePage', 'CheckBox', 'Car_CheckBox', 'Select', null, checkBoxName);
}
