var _radInputBoxes = new Array();

function AddRADComboboxToCache(radComboBoxArg)
{
    _radInputBoxes.push(radComboBoxArg);
};

function SetFocusOfAllRADComboboxesToNoneExceptFor(radComboboxInputIdArg)
{
    for (var _i = 0; _i < _radInputBoxes.length; _i++)
    {
        if (_radInputBoxes[_i].InputID != radComboboxInputIdArg)
        {
            _radInputBoxes[_i].ComboboxHasFocus = false;
            _radInputBoxes[_i].HideDropDown();
            _radInputBoxes[_i].DropDownVisible = false;
        }
    }
};


function RadComboItem() { this.ComboBox = null; this.ClientID = null; this.Highlighted = false; this.Index = 0; this.Enabled = 1; this.Selected = 0; this.Text = ""; this.Value = null; this.O = new Array(); }; RadComboItem.prototype.Initialize = function(o) { for (var I in o) { this[I] = o[I]; } }; RadComboItem.prototype.A = function() { if (this.ComboBox.Items.length > 0) { var totalHeight = 0; for (var i = 0; i <= this.Index; i++) { var U = document.getElementById(this.ComboBox.Items[i].ClientID); if (U) { totalHeight += U.offsetHeight; } } document.getElementById(this.ComboBox.ClientID + "_\x44\x72opDown").scrollTop = totalHeight - document.getElementById(this.ComboBox.ClientID + "\137\x44\x72opDow\x6e").offsetHeight; } }; RadComboItem.prototype.Z = function() { if (this.ComboBox.Items.length > 0) { var totalHeight = 0; for (var i = 0; i < this.Index; i++) { var U = document.getElementById(this.ComboBox.Items[i].ClientID); if (U) { totalHeight += U.offsetHeight; } } var scrollTop = document.getElementById(this.ComboBox.ClientID + "\x5fDropD\x6f\x77n").scrollTop; if (scrollTop > totalHeight) { document.getElementById(this.ComboBox.ClientID + "_DropDown").scrollTop = totalHeight; } } }; RadComboItem.prototype.Highlight = function() { if (!this.Highlighted && this.Enabled) { this.ComboBox.UnHighlightAll(); if (!this.ComboBox.IsTemplated || this.ComboBox.HighlightTemplatedItems) { if (document.getElementById(this.ClientID)) { document.getElementById(this.ClientID).className = this.ComboBox.ItemCssClassHover; } } this.Highlighted = true; this.ComboBox.HighlightedItem = this; } }; RadComboItem.prototype.UnHighlight = function() { if (this.Highlighted && this.Enabled && document.getElementById(this.ClientID)) { document.getElementById(this.ClientID).className = this.ComboBox.ItemCssClass; this.Highlighted = false; this.ComboBox.HighlightedItem = null; } }; RadComboItem.prototype.Select = function() { this.ComboBox.SelectedItem = this; this.ComboBox.z(this); this.ComboBox.HideDropDown(); this.ComboBox.W(); }; function RadComboBox(w, V)
{
    var v = window[V]; if (v != null && !v.tagName) { v.T(); } if (window.tlrkComboBoxes == null) { window.tlrkComboBoxes = new Array(); } tlrkComboBoxes[V] = this; this.CurrentACPrefix = "";
    
    this.RetrievingACItems = false; this.Items = new Array(); this.t = false; this.ID = w; this.ClientID = V; this.S = V; this.DropDownID = V + "\x5f\x44ropDown";

    this.InputID = V + "\x5f\x49nput";
    this.ComboboxHasFocus = false;
    var _combobox = this;
    AddRADComboboxToCache(_combobox);
    var cInput = $(this.InputID);
    cInput.addEvent('blur', function(e)
    {
        _combobox.G(e);
        _combobox.ComboboxHasFocus = false; 
    });
    cInput.addEvent('focus', function()
    {
        var a = '';
        _combobox.ComboboxHasFocus = true;
        SetFocusOfAllRADComboboxesToNoneExceptFor(_combobox.InputID);
    }); 
    
    this.ImageID = V + "_Image"; this.DropDownPlaceholderID = V + "\x5fDropDo\x77\x6ePlac\x65\x68old\x65r"; this.MoreResultsBoxID = V + "\x5f\115\x6f\x72eResu\x6c\x74sBo\x78"; this.MoreResultsBoxImageID = V + "\137Mo\x72\x65Result\x73\x42oxIm\x61\147e"; this.MoreResultsBoxMessageID = V + "_\x4d\x6freResult\x73\x42oxM\x65\163sa\x67\145"; this.R = V + "_Header"; this.r = document.getElementById(this.InputID); this.Q = document.getElementById(this.ImageID); this.P = document.getElementById(this.DropDownPlaceholderID); this.N = document.getElementById(this.ClientID + "_text"); this.n = document.getElementById(this.ClientID + "\x5f\x76alue"); this.M = document.getElementById(this.ClientID + "_ind\x65\x78"); this.Enabled = true; this.DropDownVisible = false; this.LoadOnDemandUrl = null; this.PollTimeOut = 0; this.HighlightedItem = null; this.SelectedItem = null; this.ItemRequestTimeout = 300; this.EnableLoadOnDemand = false; this.AutoPostBack = false; this.ShowMoreResultsBox = false; this.OpenDropDownOnLoad = false; this.m = false; this.MarkFirstMatch = false; this.IsCaseSensitive = false; this.PostBackReference = null; this.LoadingMessage = "\x4coading\x2e\x2e."; this.ScrollDownImage = null; this.ScrollDownImageDisabled = null; this.L = null; this.RadComboBoxImagePosition = "Right"; this.ItemCssClass = null; this.ItemCssClassHover = null; this.ItemCssClassDisabled = null; this.ImageCssClass = null; this.ImageCssClassHover = null; this.InputCssClass = null; this.InputCssClassHover = null; this.LoadingMessageCssClass = "ComboBo\x78\x4coadin\x67\x4dess\x61ge"; this.AutoCompleteSeparator = null; this.OnClientSelectedIndexChanging = null; this.OnClientDropDownOpening = null; this.OnClientDropDownClosing = null; this.OnClientItemsRequesting = null; this.OnClientSelectedIndexChanged = null; this.OnClientItemsRequested = null; this.OnClientKeyPressing = null; this.Skin = "Classic"; this.HideTimeoutID = 0; this.l = 0; this.K = false; this.k = null; this.AllowCustomText = false; this.ExpandEffectString = null; this.HighlightTemplatedItems = false; this.CausesValidation = false; this.ClientDataString = null; this.J = false; this.H = -1; this.IsTemplated = false; var comboInstance = this; this.h = function() { comboInstance.HideOnClick(); }; if (document.attachEvent) { document.attachEvent("onclic\x6b", this.h); } else { document.addEventListener("click", this.h, false); } document.getElementById(this.InputID).onblur = function(e) { comboInstance.G(e); }; document.getElementById(this.InputID).setAttribute("aut\x6f\x63omplet\x65", "\x6f\x66f"); document.getElementById(this.DropDownPlaceholderID).onselectstart = function() { return false; };

    if (typeof (RadCallbackNamespace) != "undefin\x65\x64")
    {
        window.setTimeout(function() { comboInstance.g(document.getElementById(comboInstance.InputID)); }, 100);
    } 
    else
    {
        var F = false;
        window.addEvent('ondomready', function()
        {
            comboInstance.g(document.getElementById(comboInstance.InputID));
        });
        
        if (window.addEventListener)
        {
            F = true;
        }
//        else
//        {
//            if (!F)
//            {
//                this.g(document.getElementById(this.InputID));
//            }
//        }
    }

    if (window.attachEvent) { } else { } 
}; RadComboBox.prototype.T = function() { tlrkComboBoxes[this.ID] = null; this.Items = null; this.r = null; this.Q = null; this.P = null; this.N = null; this.n = null; this.M = null; this.L = null; this.OnClientSelectedIndexChanging = null; this.OnClientDropDownOpening = null; this.OnClientDropDownClosing = null; this.OnClientItemsRequesting = null; this.OnClientSelectedIndexChanged = null; this.OnClientItemsRequested = null; this.OnClientKeyPressing = null; var comboInstance = this; if (document.detachEvent) { document.detachEvent("onclick", this.h); } else { document.removeEventListener("\x63\x6c\x69ck", this.h, false); } if (window.removeEventListener) { window.removeEventListener("\x6coad", function() { comboInstance.g(document.getElementById(comboInstance.InputID)); }, false); } var input = document.getElementById(this.InputID); if (input != null) input.onblur = null; input = null; var f = document.getElementById(this.DropDownPlaceholderID); if (f != null) f.onselectstart = null; f = null; }; RadComboBox.prototype.Initialize = function(D, o) { this.d(D); this.C(o); this.B(); this.o0(); }; RadComboBox.prototype.d = function(D) { for (var I in D) { this[I] = D[I]; } }; RadComboBox.prototype.B = function() { this.ItemCssClass = "C\x6fmboB\x6f\x78Item\x5f" + this.Skin; this.ItemCssClassHover = "Com\x62\x6fBoxIte\x6d\x48ove\x72_" + this.Skin; this.ItemCssClassDisabled = "\x43omboBox\x49\x74emDis\x61\x62led\x5f" + this.Skin; this.ImageCssClass = "ComboBoxI\x6d\x61ge_" + this.Skin; this.ImageCssClassHover = "Comb\x6f\x42oxIma\x67\x65Hove\x72\137" + this.Skin; this.InputCssClass = "ComboB\x6f\x78Input\x5f" + this.Skin; this.InputCssClassHover = "\x43omboBo\x78\x49nputH\x6f\x76er\x5f" + this.Skin; this.LoadingMessageCssClass = "ComboBoxLoad\x69\156gM\x65\x73sag\x65\x5f" + this.Skin; }; RadComboBox.prototype.z = function(item) { if (item != null) { this.O0(item.Text); this.SetValue(item.Value); this.l0(item.Index); } else { this.SetText(""); this.SetValue(""); this.l0("-1"); } }; RadComboBox.prototype.W = function() { if (this.AutoPostBack) { if (this.CausesValidation) { if (typeof (WebForm_DoPostBackWithOptions) != "\x66unction" && !(typeof (Page_ClientValidate) != "function" || Page_ClientValidate())) { return; } } eval(this.PostBackReference); } }; RadComboBox.prototype.G = function(e) { var i0 = this.SelectedItem; var I0 = this.HighlightedItem; if (i0 != null && I0 != null && i0 != I0) { this.z(I0); this.o1(); } if (i0 != null && I0 == null && this.AllowCustomText) { this.SetText(this.GetText()); this.W(); } }; RadComboBox.prototype.O1 = function() { var l1 = document.getElementById(this.S); while (l1.tagName != "\106ORM") { l1 = l1.parentNode; } return l1; }; RadComboBox.prototype.i1 = function() { var f = document.getElementById(this.DropDownPlaceholderID); var I1 = f.getElementsByTagName("inp\x75t"); return I1.length > 0; }; RadComboBox.prototype.o2 = function() { if ((!document.readyState || document.readyState == "complet\x65") && (!this.K)) { var parentElement = document.body; if (this.i1()) { parentElement = this.O1(); } var f = document.getElementById(this.S).getElementsByTagName("\x44IV")[0]; f.parentNode.removeChild(f); f.style.marginLeft = "\x30"; var O2 = document.getElementById(this.DropDownPlaceholderID); if (O2) { O2.parentNode.removeChild(O2); } if (parentElement.firstChild) { parentElement.insertBefore(f, parentElement.firstChild); } else { parentElement.appendChild(f); } this.K = true; this.P = document.getElementById(this.DropDownPlaceholderID); } }; RadComboBox.prototype.HideOnClick = function() { var comboInstance = this; this.HideTimeoutID = window.setTimeout(function() { comboInstance.DoHideOnClick(); }, 5); }; RadComboBox.prototype.DoHideOnClick = function() { if (this.HideTimeoutID) { this.HideDropDown(); } }; RadComboBox.prototype.ClearHideTimeout = function() { this.HideTimeoutID = 0; }; RadComboBox.prototype.l2 = function(text) { var lastIndex = -1; for (var i = 0; i < this.AutoCompleteSeparator.length; i++) { var i2 = this.AutoCompleteSeparator.charAt(i); var I2 = text.lastIndexOf(i2); if (I2 > lastIndex) { lastIndex = I2; } } return lastIndex; }; RadComboBox.prototype.O0 = function(o3) { var O3 = -1; var l3 = this.GetText(); if (this.AutoCompleteSeparator != null) { O3 = this.l2(l3); } var i3 = l3.substring(0, O3 + 1) + o3; this.SetText(i3); }; RadComboBox.prototype.ClearSelection = function() { this.z(null); this.SelectedItem = null; this.I3 = null; }; RadComboBox.prototype.C = function(o) { for (var i = 0; i < o.length; i++) { var item = new RadComboItem(); item.ComboBox = this; item.Index = this.Items.length; item.Initialize(o[i]); this.Items[this.Items.length] = item; } }; RadComboBox.prototype.o0 = function()
{
    if (this.SelectedItem != null) { this.SelectedItem.Highlight(); } else { var l3 = this.GetText(); var o4 = this.FindItemByText(l3); if (o4 != null) { this.SelectedItem = o4; this.SelectedItem.Highlight(); } } this.t = true; if (this.SelectedItem == null && this.H == -1 && this.Items.length > 0) { this.SelectedItem = this.Items[0]; this.Items[0].Selected = true; this.SelectedItem.Highlight(); } var comboInstance = this; if (this.OpenDropDownOnLoad)
    {
        window.addEvent('ondomready', function()
        {
            comboInstance.ShowDropDown();
        });
    } 
}; 
    RadComboBox.prototype.O4 = function(o, l4) { if (!l4) { this.Items.length = 0; } this.HighlightedItem = null; this.SelectedItem = null; this.t = false; if (this.Items.length > 0) { if (this.Items[0].Text == document.getElementById(this.InputID).value) { this.SetValue(this.Items[0].Value); } else { this.SetValue(""); } this.k = this.GetText(); } this.C(o); }; RadComboBox.prototype.SetText = function(o3) { document.getElementById(this.InputID).value = o3; this.N.value = o3; }; RadComboBox.prototype.GetText = function() { return document.getElementById(this.InputID).value; }; RadComboBox.prototype.SetValue = function(value) { if (value || value == "") { this.n.value = value; } }; RadComboBox.prototype.GetValue = function() { return this.n.value; }; RadComboBox.prototype.l0 = function(index) { this.M.value = index; }; RadComboBox.prototype.i4 = function(el) { var parent = null; var I4 = []; var box; if (el.getBoundingClientRect) { box = el.getBoundingClientRect(); var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft; var x = box.left + scrollLeft - 2; var y = box.top + scrollTop - 2; return [x, y]; } else if (document.getBoxObjectFor) { box = document.getBoxObjectFor(el); I4 = [box.x - 2, box.y - 2]; } else { I4 = [el.offsetLeft, el.offsetTop]; parent = el.offsetParent; if (parent != el) { while (parent) { I4[0] += parent.offsetLeft; I4[1] += parent.offsetTop; parent = parent.offsetParent; } } } if (window.opera) { parent = el.offsetParent; while (parent && parent.tagName != "B\x4f\x44Y" && parent.tagName != "HTML") { I4[0] -= parent.scrollLeft; I4[1] -= parent.scrollTop; parent = parent.offsetParent; } } else { parent = el.parentNode; while (parent && parent.tagName != "\x42\x4fDY" && parent.tagName != "HTML") { I4[0] -= parent.scrollLeft; I4[1] -= parent.scrollTop; parent = parent.parentNode; } } return I4; }; RadComboBox.prototype.o5 = function(x, y)
{
    if (document.readyState && document.readyState != "\x63omplet\x65") { return; } var O5 = (navigator.userAgent.toLowerCase().indexOf("\x73\x61\x66ari") != -1); var l5 = window.opera; if (O5 || l5 || (!document.all)) { return; } if (this.L == null) { this.L = document.createElement("IFRA\x4d\105"); this.L.src = "javascrip\x74:\047\x27"; this.L.id = this.ClientID + "\x5f\117ver\x6c\x61y"; this.L.frameBorder = 0; this.L.style.position = "\x61bsolute"; this.L.style.visibility = "\x68idden"; window.document.body.appendChild(this.L); this.L.style.zIndex = this.P.style.zIndex - 1; } this.L.style.visibility = "\x68idden"; this.L.style.left = x; this.L.style.top = y; var i5 = this.P.offsetWidth; var I5 = this.P.offsetHeight;

    this.L.style.width = i5 + "\x70\x78";
    this.L.style.height = I5 + "\160\x78"; this.L.style.visibility = "visible";
}; RadComboBox.prototype.o6 = function() { var O5 = (navigator.userAgent.toLowerCase().indexOf("\163\x61fari") != -1); var l5 = window.opera; if (O5 || l5 || (!document.all)) { return; } if (this.L != null) { this.L.style.visibility = "hidde\x6e"; } }; RadComboBox.prototype.O6 = function() { for (var i = 0; i < tlrkComboBoxes.length; i++) { if ((typeof (tlrkComboBoxes[i]) != "\x66unc\x74\x69on") && (tlrkComboBoxes[i].ClientID != this.ClientID)) { tlrkComboBoxes[i].HideDropDown(); } } };RadComboBox.prototype.ShowDropDown = function()
{
    if (this.l6(this.OnClientDropDownOpening, this) == false) { return; } this.O6(); this.o2(); var i6; (this.RadComboBoxImagePosition == "Righ\x74") ? i6 = this.r : i6 = document.getElementById(this.ImageID); var position = this.i4(i6); var x = position[0]; var y = position[1] + i6.offsetHeight; var I6 = document.getElementById(this.S); o7 = I6.offsetWidth; if (this.ExpandEffectString != null && document.all) { this.P.style.filter = this.ExpandEffectString; this.P.filters[0].Apply(); this.P.filters[0].Play(); } this.P.style.position = "\x61bs\x6f\x6cute"; this.P.style.left = x + "px"; this.P.style.top = y + "\x70\x78";

    //this.P.style.width = o7 - 2 + "px";

    this.P.style.display = "\x62lock"; this.o5(x + "\x70x", y + "px"); if (this.HighlightedItem != null) { this.HighlightedItem.A(); } if (this.SelectedItem != null) { this.SelectedItem.A(); } this.ClearHideTimeout();

    this.DropDownVisible = true;
    try
    {
        //$(this.InputID).focus();
    }
    catch (e) { };

    if ((this.EnableLoadOnDemand) && (this.Items.length == 0)) { this.O7(true, null); }

    if (this.SelectedItem != null)
    {
        this.SelectedItem.Highlighted = false;
        this.SelectedItem.Highlight();
        this.SelectedItem.Z();
    }
}; 

RadComboBox.prototype.FindItemByText = function(o3) { for (var i = 0; i < this.Items.length; i++) { if (this.Items[i].Text.toLowerCase().contains(o3.toLowerCase())) { return this.Items[i]; } } return null; }; RadComboBox.prototype.FindItemByValue = function(l7) { for (var i = 0; i < this.Items.length; i++) { if (this.Items[i].Value == l7) { return this.Items[i]; } } return null; }; RadComboBox.prototype.HideDropDown = function() { if (this.DropDownVisible) { if (this.l6(this.OnClientDropDownClosing, this) == false) { return; } document.getElementById(this.DropDownPlaceholderID).style.display = "none"; this.o6(); this.DropDownVisible = false; } }; RadComboBox.prototype.ToggleDropDown = function() { (this.DropDownVisible) ? this.HideDropDown() : this.ShowDropDown(); }; RadComboBox.prototype.i7 = function(I7) { if (I7) { while (I7 != null) { if (I7.id && this.o8(I7.id)) { return I7; } I7 = I7.parentNode; } } return null; }; RadComboBox.prototype.o8 = function(O8) { for (var i = 0; i < this.Items.length; i++) { if (this.Items[i].ClientID == O8) { return true; } } return false; }; RadComboBox.prototype.l8 = function(item) { for (var i = 0; i < this.Items.length; i++) { if (this.Items[i].ClientID == item.id) { return this.Items[i]; } } return null; }; RadComboBox.prototype.i8 = function(I8) { I8.Highlight(); }; RadComboBox.prototype.o9 = function(I8) { I8.UnHighlight(); }; RadComboBox.prototype.o1 = function(eventArgs) { var O9 = this.HighlightedItem; if (O9 != null) { if (this.l6(this.OnClientSelectedIndexChanging, O9, eventArgs) == false) { return; } O9.Select(); this.l6(this.OnClientSelectedIndexChanged, O9, eventArgs); } this.HideDropDown(); }; RadComboBox.prototype.HandleClick = function(eventArgs) { this.o1(eventArgs); }; RadComboBox.prototype.l9 = function(index) { var i = index; var i9 = false; while (i < this.Items.length - 1) { i = i + 1; if (this.Items[i].Enabled) { i9 = true; break; } } if (i9) return i; return index; }; RadComboBox.prototype.I9 = function(index) { var i = index; var i9 = false; while (i > 0) { i = i - 1; if (this.Items[i].Enabled) { i9 = true; break; } } if (i9) return i; return index; }; RadComboBox.prototype.oa = function(comboInstance, eventArgs) { this.l6(this.OnClientKeyPressing, this, eventArgs); if (eventArgs.keyCode == 46) { if (!this.EnableLoadOnDemand && !this.AllowCustomText) { this.Oa(eventArgs); } } if (eventArgs.keyCode == 40) { if (eventArgs.altKey && (!this.DropDownVisible)) { this.ShowDropDown(); return; } var index = -1; if (this.HighlightedItem == null && this.Items.length > 0) { index = 0; } if (this.HighlightedItem != null) { index = this.l9(this.HighlightedItem.Index); } else { index = this.l9(0); } if (index >= 0 && this.Items.length > 0) { if (this.l6(this.OnClientSelectedIndexChanging, this.Items[index], eventArgs) == false) { return; } if (this.DropDownVisible) { if (document.getElementById(this.Items[index].ClientID).style.display == "none") { if (index == this.Items.length - 1) { eventArgs.keyCode = 38; } this.Items[index].Highlight(); this.oa(comboInstance, eventArgs); } else { this.Items[index].Highlight(); this.Items[index].A(); this.z(this.Items[index]); this.Oa(eventArgs); } } } return; } if (eventArgs.keyCode == 27 && this.DropDownVisible) { this.HideDropDown(); return; } if (eventArgs.keyCode == 38) { if (eventArgs.altKey && this.DropDownVisible) { this.HideDropDown(); return; } var index = -1; if (this.HighlightedItem != null) { index = this.I9(this.HighlightedItem.Index); } if (index >= 0) { if (this.l6(this.OnClientSelectedIndexChanging, this.Items[index], eventArgs) == false) { return; } if (this.DropDownVisible) { if (document.getElementById(this.Items[index].ClientID).style.display == "none") { if (index == 0) { eventArgs.keyCode = 40; } this.Items[index].Highlight(); this.oa(comboInstance, eventArgs); } else { this.Items[index].Z(); this.Items[index].Highlight(); this.z(this.Items[index]); this.Oa(eventArgs); } } } return; } if (eventArgs.keyCode == 9 && this.RetrievingACItems == true) { return; } if ((eventArgs.keyCode == 13 || eventArgs.keyCode == 9) && this.DropDownVisible && this.RetrievingACItems == false) { if (eventArgs.keyCode == 13) { this.Oa(eventArgs); } this.o1(); return; } if (eventArgs.keyCode == 9 && !this.DropDownVisible) { return; } if (eventArgs.keyCode == 35 || eventArgs.keyCode == 36 || eventArgs.keyCode == 37 || eventArgs.keyCode == 39) { return; } if (this.EnableLoadOnDemand && (!eventArgs.altKey) && (!eventArgs.ctrlKey) && (!(eventArgs.keyCode == 16))) { if (!this.DropDownVisible) { this.ShowDropDown(); } this.la(false, eventArgs.keyCode); return; } var ia = eventArgs.keyCode; if ((ia < 32) || (ia >= 33 && ia <= 46) || (ia >= 112 && ia <= 123)) { return; } var Ia = this; window.setTimeout(function() { Ia.ob(); }, 20); }; RadComboBox.prototype.Ob = function(eventArgs) { if (eventArgs.preventDefault) { if (eventArgs.keyCode == 13 || (eventArgs.keyCode == 32 && (!this.EnableLoadOnDemand))) { eventArgs.preventDefault(); } } }; RadComboBox.prototype.lb = function(s) { if (encodeURIComponent) { return encodeURIComponent(this.ib(s)); } if (escape) { return escape(this.ib(s)); } }; RadComboBox.prototype.ib = function(text) { if (typeof (text) != "n\x75mber") { return text.replace(/\x27/g, "\x26squote"); } }; RadComboBox.prototype.Ib = function(oc, text, keyCode) { if (!this.m) { this.m = true; var Oc = (text) ? text : document.getElementById(this.InputID).value; var lc = this.GetValue(); Oc = Oc.replace(/\x27/g, "&\x73quote"); var url = this.LoadOnDemandUrl + "\x26text=" + this.lb(Oc); url = url + "&comboValue=" + this.lb(lc); url = (oc) ? url + "&itemC\x6f\x75nt=" + this.Items.length : url; url = url + "\x26skin=" + this.lb(this.Skin); if (this.ClientDataString != null) { url += "&\x63lientDataSt\x72ing=" + this.lb(this.ClientDataString); } url = url + "\x26\164\x69\x6deSta\x6d\x70=" + encodeURIComponent((new Date()).getTime()); var xmlRequest = null; if (typeof (XMLHttpRequest) != "\x75ndefine\x64") { xmlRequest = new XMLHttpRequest(); } if (typeof (ActiveXObject) != "\x75\x6edefine\x64") { xmlRequest = new ActiveXObject("\x4dicrosoft\x2e\x58MLH\x54\x54P"); } xmlRequest.open("\x47ET", url, true); var ic = this; xmlRequest.onreadystatechange = function() { if (xmlRequest.readyState != 4) return; ic.Ic(xmlRequest.responseText, oc, Oc, keyCode, xmlRequest.status, url); }; xmlRequest.send(""); } }; RadComboBox.prototype.Ic = function(od, oc, Oc, keyCode, status, url) { if (status == 500) { alert("r.a.d\x2ecombobo\x78\x3a Se\x72\x76er\x20\x65rro\x72\040\x69n t\x68e It\x65msRequ\x65sted e\x76ent h\x61\156\x64ler, \x70ress\x20ok t\x6f vi\x65\167\x20the\x20resu\x6ct."); document.body.innerHTML = od; return; } if (status == 404) { alert("r.a.d.combo\x62\x6fx: \x4c\x6fad \x4f\x6e De\x6d\x61nd \x50\141\x67e not \x66\157u\x6e\144:\x20" + url); var Od = "r\x2e\x61.d.comb\x6f\x62ox: \x4c\157a\x64\x20On \x44\x65man\x64\040\x50\141g\x65\040n\x6ft fou\x6e\144:\x20" + url + "\x3c\x62r/>"; Od += "Pl\x65\x61se, tr\x79\x20usi\x6e\x67 Ex\x74\x65rna\x6c\x43al\x6c\x42a\x63\x6bPa\x67\145\x20\164o\x20map t\x6f the \x65xact \x6cocat\x69on o\x66 the\x20call\x62ackp\x61ge \x79ou a\x72e u\x73ing\x2e"; document.body.innerHTML = Od; return; } eval("\x76\x61r callB\x61\x63kDa\x74\x61 = " + od + ";"); if (this.ShowMoreResultsBox) { document.getElementById(this.MoreResultsBoxMessageID).innerHTML = callBackData.Message; } var ld = this.Items.length; this.O4(callBackData.Items, oc); if (oc) { document.getElementById(this.DropDownID).removeChild(document.getElementById(this.ClientID + "\x5fLoading\x44\x69v")); document.getElementById(this.DropDownID).innerHTML += callBackData.DropDownHtml; if (this.Items[ld + 1] != null) { this.Items[ld + 1].A(); } } else { document.getElementById(this.DropDownID).innerHTML = callBackData.DropDownHtml; } this.o5(this.P.style.left, this.P.style.top); this.l6(this.OnClientItemsRequested, this, Oc, oc); this.m = false; var oe = this.FindItemByText(this.GetText()); if (oe != null) { oe.Highlight(); oe.A(); } if (!keyCode) return; if (keyCode < 32 || (keyCode >= 33 && keyCode <= 46) || (keyCode >= 112 && keyCode <= 123)) { return; } this.ob(); }; RadComboBox.prototype.Oe = function(l3) { var O3 = -1; if (this.AutoCompleteSeparator != null) { O3 = this.l2(l3); } var le = l3.substring(O3 + 1, l3.length); return le; }; RadComboBox.prototype.ie = function(Ie, of) { if (!this.IsCaseSensitive) { return (Ie.toLowerCase() == of.toLowerCase()); } else { return (Ie == of); } }; RadComboBox.prototype.ob = function()
{
    if (!this.MarkFirstMatch) return; var l3 = this.GetText(); var le = this.Oe(l3); if (le.length == 0) { return; } for (var i = 0; i < this.Items.length; i++)
    {
        var Of = this.Items[i].Text; if (Of.length >= le.length)
        {
            var If = Of.substring(0, le.length); if (Of.toLowerCase().contains(le.toLowerCase()))
            {
                var O3 = -1; if (this.AutoCompleteSeparator != null) { O3 = this.l2(l3); } var i3 = l3.substring(0, O3 + 1) + Of; this.SetText(i3); this.SetValue(this.Items[i].Value); this.l0(this.Items[i].Index); if (this.l6(this.OnClientSelectedIndexChanging, this.Items[i], null) == false) { return; } this.Items[i].Highlight(); this.Items[i].A(); var og = O3 + le.length + 1; var Og = i3.length - og;
                if (this.ComboboxHasFocus)
                {
                    if (document.all)
                    {
                        var lg = document.getElementById(this.InputID).createTextRange();
                        lg.collapse(true);
                        lg.moveEnd("character", Og);
                        lg.moveStart("character", og);
                        lg.select();
                        /* #1669 fix of the movement of letters */
                        document.getElementById(this.InputID).scrollLeft = 0;
                    }

                    else
                    {
                        document.getElementById(this.InputID).setSelectionRange(og, og + Og);
                    }
                }
                return;
            }
            else
            {
                this.SetValue("");
                this.l0(-1);
                if (this.HighlightedItem != null)
                {
                    this.HighlightedItem.UnHighlight();
                }
            }
        }
    } this.SetValue(""); this.l0("-1"); if (!this.AllowCustomText) { var ig = l3.substring(0, l3.length - 1); if (this.k != null) { this.SetText(this.k); return; } this.SetText(ig); this.ob(); }
}; RadComboBox.prototype.la = function(l4, keyCode) { if (!this.m && (!document.getElementById(this.ClientID + "\x5f\x4coadingDi\x76"))) { var comboInstance = this; if (this.l) { window.clearTimeout(this.l); this.l = 0; } this.l = window.setTimeout(function() { comboInstance.O7(l4, keyCode); }, this.ItemRequestTimeout); } }; RadComboBox.prototype.O7 = function(l4, keyCode) { var Oc = document.getElementById(this.InputID).value; if (Oc == "") Oc = false; if (this.l6(this.OnClientItemsRequesting, this, Oc, l4) == false) { return; } if (!this.m) { } var comboInstance = this; window.setTimeout(function() { comboInstance.Ib(l4, Oc, keyCode); }, 20); }; RadComboBox.prototype.RequestItems = function(text, l4) { this.Ib(l4, text, null); }; RadComboBox.prototype.UnHighlightAll = function() { for (var i = 0; i < this.Items.length; i++) { if (this.Items[i].Highlighted) { this.Items[i].UnHighlight(); } } }; RadComboBox.prototype.Ig = function() { document.getElementById(this.InputID).className = this.InputCssClass; var oh = document.getElementById(this.ImageID); if (oh) { oh.className = this.ImageCssClass; } }; RadComboBox.prototype.Oh = function() { document.getElementById(this.InputID).className = this.InputCssClassHover; var oh = document.getElementById(this.ImageID); if (oh) { oh.className = this.ImageCssClassHover; } }; RadComboBox.prototype.lh = function() { document.getElementById(this.MoreResultsBoxImageID).style.cursor = "\144\145fau\x6c\x74"; document.getElementById(this.MoreResultsBoxImageID).src = this.ScrollDownImageDisabled; }; RadComboBox.prototype.ih = function() { document.getElementById(this.MoreResultsBoxImageID).style.cursor = "\x68\x61nd"; document.getElementById(this.MoreResultsBoxImageID).src = this.ScrollDownImage; }; RadComboBox.prototype.Ih = function()
{
    this.UnHighlightAll(); this.la(true, null);

    //$(this.InputID).focus(); 
    
    }; RadComboBox.prototype.oi = function(eventArgs) { if (eventArgs.stopPropagation) { eventArgs.stopPropagation(); } else { eventArgs.cancelBubble = true; } }; RadComboBox.prototype.Oa = function(eventArgs) { if (eventArgs.preventDefault) { eventArgs.preventDefault(); } else { eventArgs.returnValue = false; } }; RadComboBox.prototype.l6 = function(Oi, a, b, ii) { if (!Oi) return true; RadComboBoxGlobalFirstParam = a; RadComboBoxGlobalSecondParam = b; RadComboBoxGlobalThirdParam = ii; var s = Oi; s = s + "\050RadComboBo\x78GlobalF\x69\x72\x73\x74Par\x61\155"; s = s + "\x2cRad\x43\x6fmboB\x6f\x78Glo\x62\141l\x53\x65con\x64\x50ar\x61m"; s = s + "\x2c\x52adCombo\x42\x6fxGl\x6f\x62al\x54\x68ird\x50\x61ra\x6d"; s = s + ")\x3b"; return eval(s); }; RadComboBox.prototype.HandleEvent = function(eventName, eventArgs) { var I8; var srcElement = (document.all) ? eventArgs.srcElement : eventArgs.target; var item = this.i7(srcElement); if (item != null) { I8 = this.l8(item); } if (!this.Enabled) { return; } switch (eventName) { case "s\x68owdr\x6f\x70down": this.oi(eventArgs); this.ShowDropDown(); break; case "\x68\x69dedropd\x6f\x77n": this.oi(eventArgs); this.HideDropDown(); break; case "\x74oggledr\x6f\x70down": this.oi(eventArgs); this.ToggleDropDown(); break; case "mou\x73\x65over": if (I8 != null) this.i8(I8); break; case "mouseo\x75\x74": if (I8 != null) this.o9(I8); break; case "keypress": this.oa(this, eventArgs); break; case "\x6beydown": this.Ob(eventArgs); break; case "click": this.HandleClick(eventArgs); break; case "\x69nputcli\x63\x6b": this.oi(eventArgs); document.getElementById(this.InputID).select(); this.ShowDropDown(); break; case "inputimag\x65\x6fut": this.Ig(); break; case "inputimageh\x6f\x76er": this.Oh(); break; case "moreres\x75\x6ctsima\x67\x65cli\x63k": this.oi(eventArgs); this.Ih(); break; case "moreresu\x6c\x74sima\x67\x65hove\x72": this.ih(); break; case "mo\x72\x65results\x69\x6dageo\x75\164": this.lh(); break; } }; RadComboBox.prototype.Enable = function() { document.getElementById(this.S).disabled = false; this.Enabled = true; }; RadComboBox.prototype.Disable = function() { document.getElementById(this.S).disabled = true; this.Enabled = false; this.N.value = this.GetText(); }; RadComboBox.prototype.g = function(Ii)
{
    if (window.opera) return; if (document.compatMode && document.compatMode == "\103SS1Compa\x74")
    {
        var computedStyle = null;
        if (Ii.currentStyle)
        {
            computedStyle = Ii.currentStyle;
        }
        else if (document.defaultView && document.defaultView.getComputedStyle)
        {
            computedStyle = document.defaultView.getComputedStyle(Ii, null);
        }
        else
        {
            return;
        }
        var height = parseInt(computedStyle.height);
        var width = parseInt(computedStyle.width);
        var paddingTop = parseInt(computedStyle.paddingTop);
        var paddingBottom = parseInt(computedStyle.paddingBottom);
        var paddingLeft = parseInt(computedStyle.paddingLeft);
        var paddingRight = parseInt(computedStyle.paddingRight);
        var borderTop = parseInt(computedStyle.borderTopWidth);
        if (isNaN(borderTop)) { borderTop = 0; }
        var borderBottom = parseInt(computedStyle.borderBottomWidth);
        if (isNaN(borderBottom)) { borderBottom = 0; }
        var borderLeft = parseInt(computedStyle.borderLeftWidth);
        if (isNaN(borderLeft)) { borderLeft = 0; }
        var borderRight = parseInt(computedStyle.borderRightWidth);
        if (isNaN(borderRight)) { borderRight = 0; }
        if (!isNaN(height)) { Ii.style.height = height - paddingTop - paddingBottom - borderTop - borderBottom + "px"; }

        if (!isNaN(width))
        {
            Ii.style.width = width - paddingLeft - paddingRight - borderLeft - borderRight + "px";
        }
    }
}; function rcbDispatcher(V, eventName, eventArgs) { var comboInstance = null; try { comboInstance = window[V]; } catch (e) { } if (typeof (comboInstance) == "un\x64efined" || comboInstance == null) { return; } if (typeof (comboInstance.HandleEvent) != "\x75ndefi\x6e\x65d") { comboInstance.HandleEvent(eventName, eventArgs); } }; function rcbAppendStyleSheet(oj, Oj) { var lj = (navigator.appName == "Micro\x73\x6fft In\x74\x65rne\x74 Explo\x72\x65r") && ((navigator.userAgent.toLowerCase().indexOf("\x6dac") != -1) || (navigator.appVersion.toLowerCase().indexOf("mac") != -1)); var O5 = (navigator.userAgent.toLowerCase().indexOf("\x73afari") != -1); if (lj || O5) { document.write("<" + "link" + " rel=\x27\x73tyle\x73heet\047 type\x3d\x27te\x78\x74/cs\x73\047\x20href\x3d\047" + Oj + "\x27>"); } else { var ij = document.createElement("LIN\x4b"); ij.rel = "\x73tyleshee\x74"; ij.type = "\x74ext/css"; ij.href = Oj; document.getElementById(oj + "\x53\164yle\x53\x68eetH\x6f\x6cder").appendChild(ij); } };

function RADHandleOnLoad(comboBox)
{
//    alert(comboBox.InputID);
//    
//    comboBox.ComboboxHasFocus = false;
//    var cInput = document.getElementById(comboBox.InputID);
//    cInput.onblur = function(e) { comboBox.G(e); comboBox.ComboboxHasFocus = false; };
//    cInput.onfocus = function() { comboBox.ComboboxHasFocus = true; }; 
};

function RADHandleAutoCompleteRequestStart(comboBox, text, more)
{
    RedrawDropdownList(comboBox);
    if (more == true)
    {
        if (comboBox.DropDownVisible == true)
        {
            comboBox.HideDropDown();
        }
        return false;
    }
    if (text == false)
    {
        if (comboBox.DropDownVisible == true)
        {
            comboBox.HideDropDown();
        }
        return false;
    }
    else
    {
        ValidateACInputForAlpha(document.getElementById(comboBox.InputID));
        text = document.getElementById(comboBox.InputID).value.trim();
        if (text.length >= GetMinAutoCompleteLength())
        {
            if (PrefixIsCashed(comboBox, text) == true)
            {
                FilterItemsForPrefix(comboBox, text);
                RedrawDropdownList(comboBox);
                HighlightItemForPrefix(comboBox, text);
                if (comboBox.DropDownVisible == false)
                {
                    comboBox.ShowDropDown();
                }
                return false;
            }
            comboBox.RetrievingACItems = true;
            if (comboBox.DropDownVisible == true)
            {
                comboBox.HideDropDown();
            }
            for (YT_count = 0; YT_count < comboBox.Items.length; YT_count++)
            {
                comboBox.Items[YT_count] = null;
            }
            comboBox.Items.length = 0;
            return ValidateBrowserOnline();
        }
        else
        {
            if (comboBox.DropDownVisible == true)
            {
                comboBox.HideDropDown();
            }
            return false;
        }
    }
};
                

function RADHandleAutoCompleteRequestEnd(comboBox, text, more)
{
    comboBox.RetrievingACItems = false;

    var currentComboValue = document.getElementById(comboBox.InputID).value;

    if (currentComboValue.length < 3) { return false; }
    if (currentComboValue.length >= text.length)
    {
        if (currentComboValue.substring(0, text.length) != text)
        {
            return false;
        }
    }

    if (comboBox.Items.length <= 0)
    {
        if (comboBox.DropDownVisible == true) { comboBox.HideDropDown(); }
        if (typeof (ShowAutoCompleteNoResultsMessage) != 'undefined')
        {
            ShowAutoCompleteNoResultsMessage(text);
            if (typeof (AnalyticsLogSearchNoACLocations) != 'undefined')
            {
                AnalyticsLogSearchNoACLocations(text);
            }
        }
        comboBox.CurrentACPrefix = ""; 
        return false;
    }
    
    comboBox.CurrentACPrefix = text;


    FilterItemsForPrefix(comboBox, text);
    HighlightItemForPrefix(comboBox, text);
    if (comboBox.DropDownVisible == false && comboBox.ComboboxHasFocus)
    {
        comboBox.ShowDropDown();
    }
    if (!comboBox.ComboboxHasFocus)
    {
        comboBox.HideDropDown();
        setTimeout("RADHandleAutoCompleteRequestCloseDDL(" + comboBox.ClientID + ")", 150);
    }
    
    var isScrolling = RedrawDropdownList(comboBox);

    var itemsMaxLen = 20;
    for (var _i = 0; _i < comboBox.Items.length; _i++)
    {
        if (itemsMaxLen < comboBox.Items[_i].Text.length)
        {
            itemsMaxLen = comboBox.Items[_i].Text.length;
        }
    }
    if (isScrolling)
    {
        itemsMaxLen = itemsMaxLen * 6.5;
    }
    else
    {
        itemsMaxLen = itemsMaxLen * 6.4;
    }

    var ddlBlock = $(comboBox.ClientID + "\x5f\117ver\x6c\x61y");
    if ($defined(ddlBlock))
    {
        ddlBlock.setStyle('width', (itemsMaxLen + 2) + 'px');
    }
    var ddlWrapperControl = $(comboBox.DropDownPlaceholderID);
    ddlWrapperControl.setStyle('width', itemsMaxLen + 'px');
    var ddlControl = $(comboBox.DropDownID);
    ddlControl.setStyle('width', itemsMaxLen + 'px');

    var ddItemWidth = (itemsMaxLen - 6) + 'px'; 
    if (isScrolling)
    {
        ddItemWidth = (itemsMaxLen - 23) + 'px';
    }
    var ddlControls = ddlControl.getElements('div[class=ComboBoxItem_Outlook]');
    for (var _i = 0; _i < ddlControls.length; _i++)
    {
        ddlControls[_i].setStyle('width', ddItemWidth);
    }
    
    if (typeof (YT_ACRequestEnd) != "undefined")
    {
        window.setTimeout("YT_ACRequestEnd(" + comboBox.ClientID + ")", 100);
    }
};

function RADHandleAutoCompleteRequestOpenDDL(comboBox)
{
    var comboBoxInput = document.getElementById(comboBox.InputID);
    if (comboBoxInput.value.length >= GetMinAutoCompleteLength() && comboBox.RetrievingACItems == false)
    {
        RedrawDropdownList(comboBox);
    } 
    else
    {
        return false;
    }
    if (comboBox.Items.length <= 0)
    {
        return false;
    }
    if (typeof (YT_ACDropdownOpening) != "undefined")
    {
        eval("YT_ACDropdownOpening(" + comboBox.ClientID + ")");
    }
    if (typeof (YT_Flights_ACDropdownOpening) != 'undefined')
    {
        if (!YT_Flights_ACDropdownOpening(eval(comboBox.ClientID)))
        {
            return false;
        }
    }
    if (!comboBox.ComboboxHasFocus)
    {
        return false;
    }
};
function RADHandleAutoCompleteRequestCloseDDL(comboBox) { if (typeof (YT_ACDropdownClosing) != 'undefined') { YT_ACDropdownClosing(eval(comboBox.ClientID)); } if (typeof (YT_Flights_ACDropdownClosing) != 'undefined') { YT_Flights_ACDropdownClosing(eval(comboBox.ClientID)); } }; 

function RedrawDropdownList(comboBox)
{
    var visibleItemsCount = 0;

    for (i = 0; i < comboBox.Items.length; i++)
    {
        if (document.getElementById(comboBox.Items[i].ClientID).style.display == "block")
        {
            visibleItemsCount = visibleItemsCount + 1;
        }
    }
    var ddl = document.getElementById(comboBox.DropDownID);
    var ddlBlock = document.getElementById(comboBox.ClientID + "\x5f\117ver\x6c\x61y");

    if (visibleItemsCount > 15)
    {
        ddl.style.height = "300px";
        if (ddlBlock != null)
        {
            ddlBlock.style.height = "300px";
        }
        ddl.style.overflow = "auto";
        if (ddlBlock != null)
        {
            ddlBlock.style.overflow = "hidden";
        }
        return true;
    }
    else
    {
        ddl.style.height = ""; ddl.style.overflow = "auto";
        if (ddlBlock != null)
        {
            ddlBlock.style.height = comboBox.P.offsetHeight + "\160\x78";
        }
    }
    ddl.scrollTop = 0;
    return false;
    //    var inputWidth = document.getElementById(comboBox.InputID).style.width;
    //    ddl.style.width = parseFloat(inputWidth.substring(0, inputWidth.indexOf('px'))) + 5 + 'px';
};

function PrefixIsCashed(comboBox, text) { if (comboBox.CurrentACPrefix.length == 0) { return false; } if (text.substring(0, comboBox.CurrentACPrefix.length).toLowerCase() == comboBox.CurrentACPrefix.toLowerCase()) { return true; } else { return false; } }; function HighlightItemForPrefix(comboBox, text) { var i; for (i = 0; i < comboBox.Items.length; i++) { if (comboBox.Items[i].Text.toLowerCase().contains(text.toLowerCase())) { comboBox.Items[i].Highlight(); return; } } }; function FilterItemsForPrefix(comboBox, text) { var i; var someIsVisible = false; for (i = 0; i < comboBox.Items.length; i++) { if (comboBox.Items[i].Text.toLowerCase().contains(text.toLowerCase())) { document.getElementById(comboBox.Items[i].ClientID).style.display = "block"; someIsVisible = true; } else { document.getElementById(comboBox.Items[i].ClientID).style.display = "none"; } } if (someIsVisible == false) { if (text.length > 0) { var pref = text.substring(0, text.length - 1); if (pref.length >= GetMinAutoCompleteLength()) { document.getElementById(comboBox.InputID).value = pref; FilterItemsForPrefix(comboBox, text.substring(0, text.length - 1)); } } } }; function RadComboBoxHandleWindowOnResize() { for (var l5 in tlrkComboBoxes) { if (typeof (tlrkComboBoxes[l5]) != "funct\x69\x6fn") { if (tlrkComboBoxes[l5].DropDownVisible == true) { tlrkComboBoxes[l5].HideDropDown(); tlrkComboBoxes[l5].ShowDropDown(); } } } }; function ValidateAlpha(inputStr) { for (i = 0; i < inputStr.length; i++) { if (!IsValidACCharacter(inputStr.substring(i, i + 1))) { return false; } } return true; };
function ValidateACInputForAlpha(inputEl) { var newValue = ''; var inputStr = inputEl.value; for (i = 0; i < inputStr.length; i++) { if (IsValidACCharacter(inputStr.substring(i, i + 1))) { newValue += inputStr.substring(i, i + 1); } } inputEl.value = newValue; };

function IsValidACCharacter(str)
{
    var euml = String.fromCharCode(192);
    var yuml = String.fromCharCode(255);

    if (((str >= "a") && (str <= "z")) || ((str >= "A") && (str <= "Z")) ||
    (str == " ") || (str == "/") || (str == "-") || (str == "_") || (str == "'") ||
    (str == "\"") || (str == ",") || (str == "(") || (str == ")" || (str == ".") ||
    ((str >= euml) && (str <= yuml))
    ))
    {
        return true;
    }
    return false;
};
    
