﻿var LocationOther = Class.create({
    initialize: function(ddlLocations, txtOther) {
        this.dropDownList = $(ddlLocations);
        this.otherTextBox = $(txtOther);

        this.dropDownList.observe('change', this.SelectedIndexChanged.bindAsEventListener(this));
    },
    SelectedIndexChanged: function(event) {
        if (parseInt(this.dropDownList.selectedIndex, 10) == parseInt(this.dropDownList.length, 10) - 1) {
            this.otherTextBox.style.display = 'block';
        } else {
            this.otherTextBox.style.display = 'none';
        }
    }
});