﻿function bindDropDownList(e, targetDropDownList) 
{
    var key = this.value;
    var allOptions = targetDropDownList.allOptions;
    var option;
    var newOption;
    targetDropDownList.options.length = 0;

    for (var i=0; i < allOptions.length; i++) 
    {
        option = allOptions[i];
        if (option.key == key) 
        {
            newOption = new Option(option.text, option.value);
            targetDropDownList.options.add(newOption);
        }
    }

}
function bindDropDownList2(e, targetDropDownList) {
    var key = this.value;
    var allOptions = targetDropDownList.allOptions;
    var option;
    var newOption;
    targetDropDownList.options.length = 0;

    for (var i = 0; i < allOptions.length; i++) {
        option = allOptions[i];
        if (option.key == key) {
            newOption = new Option(option.text, option.value);
            targetDropDownList.options.add(newOption);
        }
    }
    if (targetDropDownList.length > 0) {
        //alert(document.getElementById('PropList').selectedIndex);
        $.cookie('PropList_index', document.getElementById('PropList').selectedIndex, { expires: 1 });
        $.cookie('Locks_index', 0, { expires: 1 });

        $('#rangedate1').val("");
        $('#rangedate2').val("");
        $get('BigCalendar').action = document.getElementById('uri').value;
        $get('BigCalendar').submit();
    }
}
function bindDropDownList3(value, targetDropDownList) {
    var key = value;
    var allOptions = targetDropDownList.allOptions;
    var option;
    var newOption;
    targetDropDownList.options.length = 0;

    for (var i = 0; i < allOptions.length; i++) {
        option = allOptions[i];
        if (option.key == key) {
            newOption = new Option(option.text, option.value);
            targetDropDownList.options.add(newOption);
        }
    }
    //alert(key);

}
