=0&&g=0;
g--){var k=a(j.getItem(g).get_element()).position().top;
if(k=0){var f=function(n,i,m){return h;
};
this.highlightItem(f,true);
}};
b.RadComboBox.prototype.highlightFirstVisibleItem=function(){var l=a(this.get_dropDownElement()).find("div.rcbScroll");
var j=this.get_items();
var h=-1;
for(var g=0;
gl.scrollTop()){h=j.getItem(g).get_index();
break;
}}if(h>=0){var f=function(n,i,m){return h-1;
};
this.highlightItem(f,true);
}};
b.RadComboBox.prototype._needsItemCompletion=function(){var g=this._getInputSelectionRange();
var f=this._getSurroundingSeparatorIndices(g.start).before;
var h=f;
var i=this.get_text();
var j=i.substring(h,i.length);
if(this.findItemByText(j)===null){return false;
}return true;
};
b.RadComboBox.prototype._isCommandKey=function(f){for(var g in Telerik.Web.UI.Keys){if(g!="Numpad0"&&g!="Numpad9"&&g!="Zero"&&g!="Del"&&g!="Space"){if(f==Telerik.Web.UI.Keys[g]){return true;
}}}return false;
};
b.RadComboBox.prototype._onKeyUpIE=function(f){var g=f.keyCode||f.which;
if(!this._isCommandKey(g)&&!this.get_readOnly()){this._onChangeHelper(f);
}};
b.RadComboBox.prototype._onKeyDown=function(h){var j=h.keyCode||h.which,i,k,f=8;
if(($telerik.isIE||$telerik.isChrome)&&this.get_readOnly()&&j==f){h.preventDefault();
}if($telerik.isIE&&j!=b.Keys.Down&&j!=b.Keys.Up){this._updateFilterText=true;
}if(j==b.Keys.Escape){h.preventDefault();
}if(!this._fireEvents||this._ajaxRequest){return;
}this.raise_onClientKeyPressing(h);
this._lastKeyCode=j;
switch(j){case b.Keys.Left:case b.Keys.Righ:return;
case b.Keys.Escape:this._hideDropDown(h);
if($telerik.isFirefox){this._escKeyPressed=true;
}return;
case b.Keys.Enter:this._hideDropDown(h);
h.returnValue=true;
if(h.preventDefault){h.preventDefault();
}this._onEnterKey(h);
return;
case b.Keys.Down:h.returnValue=false;
if(h.altKey){this._toggleDropDown(h);
return;
}this.highlightNextItem(null);
if(h.preventDefault){h.preventDefault();
}return;
case b.Keys.Up:h.returnValue=false;
if(h.altKey){this._toggleDropDown(h);
return;
}this.highlightPreviousItem();
if(h.preventDefault){h.preventDefault();
}return;
case b.Keys.Home:h.returnValue=false;
if(h.altKey){this._toggleDropDown(h);
return;
}if(this.get_inputDomElement().readOnly){this.highlightFirstItem();
if(h.preventDefault){h.preventDefault();
}}return;
case b.Keys.End:h.returnValue=false;
if(h.altKey){this._toggleDropDown(h);
return;
}if(this.get_inputDomElement().readOnly){this.highlightLastItem();
if(h.preventDefault){h.preventDefault();
}}return;
case b.Keys.PageDown:h.returnValue=false;
if(h.altKey){this._toggleDropDown(h);
return;
}var l=a(this.get_dropDownElement()).find("div.rcbScroll");
l.scrollTop(l.scrollTop()+l.height());
this.highlightLastVisibleItem();
if(h.preventDefault){h.preventDefault();
}return;
case b.Keys.PageUp:h.returnValue=false;
if(h.altKey){this._toggleDropDown(h);
return;
}var l=a(this.get_dropDownElement()).find("div.rcbScroll");
l.scrollTop(l.scrollTop()-l.height());
this.highlightFirstVisibleItem();
if(h.preventDefault){h.preventDefault();
}return;
case b.Keys.Tab:this._hideDropDown(h);
this._raiseClientBlur(h);
this._selectItemOnBlur(h);
this._applyEmptyMessage();
this._focused=false;
return;
case b.Keys.Space:if(this.get_dropDownVisible()){i=this.get_highlightedItem();
if(this._checkBoxes&&i){if(h.preventDefault){h.preventDefault();
}this._performCheck(i,h);
}else{if(this._checkBoxes&&!i&&this._checkAllElement&&a(this._checkAllElement).hasClass(d)){a(this._checkAllElement).click();
}}}return;
}if(j>=b.Keys.Numpad0&&j<=b.Keys.Numpad9){j-=(b.Keys.Numpad0-b.Keys.Zero);
}k=String.fromCharCode(j);
if(k&&(!h.altKey)&&!(this.get_enableLoadOnDemand()||!this.get_readOnly())){if(this.get_readOnly()&&this._dropDown.isVisible()==false){this._inputDomElement.setAttribute("aria-live","polite");
}this.highlightNextItem(k);
if(this.get_readOnly()&&this._dropDown.isVisible()==false){var g=this;
setTimeout(function(){g._inputDomElement.setAttribute("aria-live","off");
},50);
}return;
}};
b.RadComboBox.prototype._onEnterKey=function(g){var i=this.findItemByText(this.get_text()),j=this.get_selectedItem(),h=this.get_highlightedItem();
if(!this._checkBoxes){if(this.get_allowCustomText()&&!this.get_markFirstMatch()&&!i){if(this.raise_selectedIndexChanging(null,g)===false){if(j){j.set_selected(false);
}if(h){h.unHighlight();
}this.set_selectedItem(null);
this.set_selectedIndex(null);
this.set_highlightedItem(null);
this.raise_selectedIndexChanged(null,g);
var f={Command:"Select",Index:-1};
this.postback(f);
}}else{this._performSelect(h,g);
}if(this.get_markFirstMatch()){var k=this.get_text().length;
this.selectText(k,k);
}}else{if(h&&!h.get_checked()){this._performCheck(h,g);
}}};
b.RadComboBox.prototype._onKeyPressCheckSelection=function(f){var i=this.get_inputDomElement(),l=this._getInputSelection(i),m=this.get_text(),j,h;
if(l.selectionStart!=l.selectionEnd&&this.get_highlightedItem()){if(!this.get_isCaseSensitive()){j=(i.value.charAt(l.selectionStart).toLowerCase()==String.fromCharCode(f.keyCode).toLowerCase());
}else{j=(i.value.charAt(l.selectionStart).toString()==String.fromCharCode(f.keyCode).toString());
}if(j){h=this.findFirstMatch(m.substring(0,l.selectionStart)+String.fromCharCode(f.keyCode).toString());
if(h&&h.get_text()===this.get_highlightedItem().get_text()){if(this.get_inputDomElement().setSelectionRange){this.get_inputDomElement().setSelectionRange(l.selectionStart+e,l.selectionEnd);
}else{var k=i.createTextRange();
k.moveStart("character",l.selectionStart+e);
try{k.select();
}catch(g){}}f.preventDefault();
}}}};
b.RadComboBox.prototype._onKeyPress=function(g){if(!this._fireEvents){return;
}var f=g.charCode||g.keyCode;
if(this._ajaxRequest){if(f===b.Keys.Enter){g.returnValue=false;
if(g.preventDefault){g.preventDefault();
}}return;
}var j=[b.Keys.PageUp,b.Keys.PageDown,b.Keys.End,b.Keys.Home,b.Keys.Insert,b.Keys.Delete];
for(var h=0;
h=0;
f--){if(h[f].get_enabled()&&!h[f].get_isSeparator()){return f;
}}return -1;
};
})();
(function(){var b=Telerik.Web.UI,a=Sys.Serialization.JavaScriptSerializer,c={0:"contains",1:"contains",2:"startswith"};
b.RadComboBox.prototype.get_itemData=function(){return this._itemData;
};
b.RadComboBox.prototype.get_webServiceSettings=function(){return this._webServiceSettings;
};
b.RadComboBox.prototype.set_webServiceSettings=function(e){var d=a.deserialize(e);
if(d.ODataSettings){this._webServiceSettings=new b.NavigationControlODataSettings(d);
}else{this._webServiceSettings=new b.WebServiceSettings(d);
}};
b.RadComboBox.prototype.get_enableItemCaching=function(){return this._enableItemCaching;
};
b.RadComboBox.prototype.set_enableItemCaching=function(d){this._enableItemCaching=d;
};
b.RadComboBox.prototype.get_moreResultsBoxElement=function(){var d=this._getChildElement("MoreResultsBox");
return d;
};
b.RadComboBox.prototype.get_moreResultsBoxMessageElement=function(){var d=this.get_moreResultsBoxElement();
var e=$telerik.getFirstChildByTagName(d,"span",0);
return e;
};
b.RadComboBox.prototype.clearCache=function(){this.lodHashTable={};
},b.RadComboBox.prototype.requestItems=function(g,d){if(this._disposed){return;
}var h={},f;
if(d){if((this._pendingAjaxRequestsCount>0)||this.get_endOfItems()){return;
}}else{this._filterText=g;
}this._ensureChildControls();
this._ajaxRequest=true;
this.set_appendItems(d);
h.Text=g;
h.NumberOfItems=0;
if(this.get_appendItems()){h.NumberOfItems=this.get_items().get_count();
}f=new b.RadComboBoxRequestCancelEventArgs(g,h);
this.raiseEvent("itemsRequesting",f);
if(f.get_cancel()){this._ajaxRequest=false;
return;
}if(this.get_highlightedItem()){this.get_highlightedItem().unHighlight();
}if(!this._loadingDiv){this._loadingDiv=document.createElement("li");
this._loadingDiv.className="rcbLoading";
this._loadingDiv.id=this.get_id()+"_LoadingDiv";
this._loadingDiv.innerHTML=this.get_loadingMessage();
if(!this.get_childListElement()){this._createChildListElement();
}this.get_childListElement().insertBefore(this._loadingDiv,this.get_childListElement().firstChild);
}g=encodeURIComponent(g);
this._callbackText=g;
this._pendingAjaxRequestsCount++;
var e=this.get_isUsingODataSource()||this.get_webServiceSettings().get_isOData();
if(this.get_webServiceSettings().get_method()||e){this._doLoadOnDemandFromWebService(g,h);
}else{if(this._clientDataSource){this._doLoadOnDemandFromClientDataSource(h);
}else{this._doLoadOnDemand(g,h);
}}};
b.RadComboBox.prototype._createChildListElement=function(){var d=document.createElement("ul");
d.className="rcbList";
this.get_childListElementWrapper().appendChild(d);
this._onDropDownClickDelegate=Function.createDelegate(this,this._onDropDownClick);
$telerik.addHandler(this.get_childListElement(),"click",this._onDropDownClickDelegate);
this._onDropDownHoverDelegate=Function.createDelegate(this,this._onDropDownHover);
$telerik.addHandler(this.get_childListElement(),"mouseover",this._onDropDownHoverDelegate);
this._cancelDelegate=Function.createDelegate(this,b.RadComboBox._cancelEvent);
$telerik.addHandler(this.get_childListElement(),"selectstart",this._cancelDelegate);
$telerik.addHandler(this.get_childListElement(),"dragstart",this._cancelDelegate);
this._onDropDownOutDelegate=Function.createDelegate(this,this._onDropDownOut);
$telerik.addHandler(this.get_childListElement(),"mouseout",this._onDropDownOutDelegate);
if($telerik.isIE8&&$telerik.standardsMode){d.style.position="absolute";
d.style.width="100%";
}if(this.get_enableAriaSupport()){this._applyChildListElementAttributes();
}return d;
};
b.RadComboBox.prototype._initializeVirtualScroll=function(){this._onDropDownScrollDelegate=Function.createDelegate(this,this._onDropDownScroll);
$telerik.addHandler(this.get_childListElementWrapper(),"scroll",this._onDropDownScrollDelegate);
};
b.RadComboBox.prototype._onDropDownScroll=function(f){if(!this._virtualScroll||this._ajaxRequest||this.get_endOfItems()){return;
}var d=this.get_childListElement(),g=$telerik.getFirstChildByTagName(d,"div",0);
if(g){var h=g.offsetHeight;
if(this.get_childListElementWrapper().scrollTop+h>=d.offsetHeight-h){this.requestItems(this._filterText,true);
}}};
b.RadComboBox.prototype._detachVirtualScrollEvents=function(){$telerik.removeHandler(this.get_childListElementWrapper(),"scroll",this._onDropDownScrollDelegate);
};
b.RadComboBox.prototype._initializeMoreResultsBox=function(){var d=this.get_moreResultsBoxElement();
this._onMoreResultsBoxClickDelegate=Function.createDelegate(this,this._onMoreResultsBoxClick);
$telerik.addHandler(d,"click",this._onMoreResultsBoxClickDelegate);
this._onMoreResultsBoxOverDelegate=Function.createDelegate(this,this._onMoreResultsBoxOver);
$telerik.addHandler(d,"mouseover",this._onMoreResultsBoxOverDelegate);
this._onMoreResultsBoxOutDelegate=Function.createDelegate(this,this._onMoreResultsBoxOut);
$telerik.addHandler(d,"mouseout",this._onMoreResultsBoxOutDelegate);
};
b.RadComboBox.prototype._onMoreResultsBoxClick=function(d){this.requestItems(this._filterText,true);
};
b.RadComboBox.prototype._onMoreResultsBoxOver=function(d){this.get_moreResultsBoxElement().style.cursor="pointer";
};
b.RadComboBox.prototype._onMoreResultsBoxOut=function(d){this.get_moreResultsBoxElement().style.cursor="default";
};
b.RadComboBox.prototype._detachMoreResultsBoxEvents=function(){var d=this.get_moreResultsBoxElement();
$telerik.removeHandler(d,"click",this._onMoreResultsBoxClickDelegate);
$telerik.removeHandler(d,"mouseover",this._onMoreResultsBoxOverDelegate);
$telerik.removeHandler(d,"mouseout",this._onMoreResultsBoxOutDelegate);
};
b.RadComboBox.prototype._initializeWebServiceLoader=function(){var d=this.get_webServiceSettings();
if(d.get_isOData()){this._webServiceLoader=new b.NavigationControlODataLoader(this.get_webServiceSettings());
}else{this._webServiceLoader=new b.WebServiceLoader(this.get_webServiceSettings());
}this._webServiceLoader.add_loadingSuccess(Function.createDelegate(this,this._onWebServiceResponse));
this._webServiceLoader.add_loadingError(Function.createDelegate(this,this._onWebServiceError));
};
b.RadComboBox.prototype._initializeODataSourceBinder=function(){var e=this.get_odataClientSettings().ODataSourceID,d=$find(e);
if(!d){var f=String.format("DataSource with id {0} was not found on the page",e);
alert(f);
}else{this._flatBinder=new b.RadODataDataSource.Binder.Flat(d,this);
this._flatBinder.initialize();
}};
b.RadComboBox.prototype._initializeClientDataSource=function(){if(this._clientDataSourceID){var d=$find(this._clientDataSourceID);
this._reinitializeClientDataSource(d);
}Sys.Application.remove_load(this._cdInitDelegate);
};
b.RadComboBox.prototype._reinitializeClientDataSource=function(d){this._clientDataSource=d;
};
b.RadComboBox.prototype._disposeODataSourceBinder=function(){if(this._flatBinder){this._flatBinder.dispose();
}};
b.RadComboBox.prototype._onDataNeeded=function(k){var l=this,e=l.get_items().get_count(),h=l.get_filter(),g=l.get_odataClientSettings().DataTextField,f=c[h],i=l._itemsPerRequest,d=l.get_appendItems(),j={events:{requesting:function(m){var n=m.get_options();
n.context={filterText:k,itemsCount:e,shouldAppendItem:d};
if(k){m.set_filterExpressions({field:g,operator:f,value:k});
}if(i!=-1){n.data.take=i;
}if(d){n.data.skip=e;
}},success:function(m,o,n){var p=m,q=p.length,r=n.shouldAppendItem?n.itemsCount+q:q,u=o,s=new b.WebServiceLoaderSuccessEventArgs(p,n.filterText);
l.set_endOfItems(r==u);
l._onWebServiceResponse(l,s);
if(l._showMoreResultsBox){var t=l._getShowMoreMessage(1,r,u);
l.set_showMoreMessage(t);
l._updateMoreResultsBox();
}},fail:function(m){var n=new b.WebServiceLoaderErrorEventArgs(m.get_message());
l._onWebServiceError(l,n);
}}};
l._flatBinder.fetch(j);
};
b.RadComboBox.prototype._getShowMoreMessage=function(d,e,f){return String.format("Items {0}-{1} out of {2}",d,e,f);
},b.RadComboBox.prototype.get_flatModel=function(){var d=this.get_odataClientSettings();
return b.RadODataDataSource.Binder.Flat.Model(d);
},b.RadComboBox.prototype._doLoadOnDemand=function(j,k){var g=0;
if(this.get_appendItems()){g=this.get_items().get_count();
}var f={Command:"LOD",Text:j,ClientState:this._clientState,Context:k,NumberOfItems:g};
var h=Function.createDelegate(this,this._onCallbackResponse);
var i=Function.createDelegate(this,this._onErrorReceived);
if(this.get_enableItemCaching()&&this.lodHashTable[j+"$"+g]!==undefined){this._onCallbackResponse(this.lodHashTable[j+"$"+g]);
}else{var e=new b.CallbackSettings({id:this._uniqueId,arguments:a.serialize(f),onCallbackSuccess:h,context:j,onCallbackError:i,isAsync:true});
var d=new b.CallbackLoader(e);
d.invokeCallbackMethod();
}};
b.RadComboBox.prototype._doLoadOnDemandFromWebService=function(g,h){if(!this._webServiceLoader){this._initializeWebServiceLoader();
}var e={context:h},f=this.get_webServiceSettings();
if(f.get_isOData()){e.isRootLevel=true;
}if(f.get_isWcf()){e.context=this._webServiceLoader._serializeDictionaryAsKeyValuePairs(e.context);
}var d=h.NumberOfItems;
if(this.get_enableItemCaching()&&this.lodHashTable[g+"$"+d]!==undefined){this._pendingAjaxRequestsCount--;
this._addNewItems(g,this.lodHashTable[g+"$"+d]);
}else{if(this.get_isUsingODataSource()){this._onDataNeeded(g);
}else{this._webServiceLoader.loadData(e,g);
}}};
b.RadComboBox.prototype._doLoadOnDemandFromClientDataSource=function(g){var e=this._clientDataSource,f=this;
if(this.get_enableItemCaching()){var d=this.lodHashTable[g.Text+"$"+g.NumberOfItems];
if(d!==undefined){this._pendingAjaxRequestsCount--;
this._addNewItems(g.Text,d);
return;
}}if(e.get_data().length===0){e.fetch(function(h){f._loadItemsFromClientDataSource(g);
});
}else{f._loadItemsFromClientDataSource(g);
}};
b.RadComboBox.prototype._loadItemsFromClientDataSource=function(l){this._pendingAjaxRequestsCount--;
var e=this._clientDataSource,g=this,j=this._itemsPerRequest,i=true,k;
if(l.Text){var f,d=Telerik.Web.UI.ClientDataSource.FilterOperator;
if(this.get_filter()==Telerik.Web.UI.RadComboBoxFilter.Contains){f=d.Contains;
}else{f=d.StartsWith;
}e.get_filterExpressions().clear();
e.get_filterExpressions().add([{fieldName:this._dataTextField,value:l.Text,operator:f}]);
}else{e.get_filterExpressions().clear();
}if(j!=-1){e.set_allowPaging(true);
e.set_pageSize(j);
var h=l.NumberOfItems/j;
e.set_currentPageIndex(h);
}e.fetch(function(){k=e.view();
i=(e._kendoDataSource.totalPages()==(h+1));
g.set_endOfItems(i);
g._addNewItems(l.Text,{Items:k,EndOfItems:i});
});
};
b.RadComboBox.prototype._onCallbackResponse=function(q){if(this._disposed){return;
}this._pendingAjaxRequestsCount--;
this.set_selectedItem(null);
this.set_highlightedItem(null);
var m=this._children.get_count();
var l=0;
var o=q.split("_$$_")[4];
var g=window.encodeURI(this._callbackText);
function p(u,i,t){return u.replace(new RegExp(i,"g"),t);
}g=p(g,"'",window.escape("'"));
g=p(g,"~",window.escape("~"));
o=p(o,"%7e",window.escape("~"));
if((this._pendingAjaxRequestsCount===0)&&(o!=g)){this.requestItems(this._callbackText,this.get_appendItems());
return;
}if(this.get_appendItems()){l=this.get_items().get_count();
}if(this.get_enableItemCaching()&&this.lodHashTable[o+"$"+l]===undefined){this.lodHashTable[o+"$"+l]=q;
}var r=q.split("_$$_");
var n;
if(r[0]=="[]"){n=null;
}else{n=eval(r[0]);
}if(r[3]=="True"){this.set_endOfItems(true);
}else{this.set_endOfItems(false);
}if(this.get_appendItems()&&this._itemData&&n){Array.addRange(this._itemData,n);
}else{this._itemData=n;
}if(this._loadingDiv){if(this._loadingDiv.parentNode){this._loadingDiv.parentNode.removeChild(this._loadingDiv);
}this._loadingDiv=null;
}var e=this.get_childListElement();
if(!e){e=this._createChildListElement();
}this._childControlsCreated=true;
var f=$telerik.getFirstChildByTagName(e,"div",0);
if(f){f.parentNode.removeChild(f);
}if(this.get_appendItems()){var s=document.createElement("ul");
s.innerHTML=r[1];
var d=$telerik.getChildrenByTagName(s,"li");
var k=d.length;
for(var h=0;
h=h)&&q){var g=k-h;
var m=new b.RadComboBoxItemDataBoundEventArgs(l,n[g]);
this.raiseEvent("itemDataBound",m);
}}this._restoreSelectionAfterRequest();
this._setUpDropDownAfterRequest(s,e,p);
};
b.RadComboBox.prototype._scrollToTheNextPortionOfItems=function(d){if(this.get_appendItems()&&(this.get_items().getItem(d+1))){this.get_items().getItem(d+1).scrollIntoView();
}};
b.RadComboBox.prototype._setUpDropDownAfterRequest=function(h,e,g){if(this._virtualScroll){this._setUpScroll(this.get_endOfItems(),e);
}this._scrollToTheNextPortionOfItems(g);
this._updateMoreResultsBox();
var d=$telerik.$(e);
if(!this._height&&!this._maxHeight&&!$telerik.isIE8){d.parents(".rcbScroll")[0].style.height="";
}this.raise_itemsRequested(h,null);
if(this.get_filter()==b.RadComboBoxFilter.None){this.highlightMatches();
}else{var f=this.get_highlightedItem();
this.highlightAllMatches(this._filterText);
if(f){f.highlight();
}}if(this.get_dropDownVisible()){this._skipDropDownPositioning=true;
if(this._slide){this._slide.updateSize();
}this._skipDropDownPositioning=null;
this._dropDown.reflow();
this._adjustChildListElementHeight();
}this._resizeDropDown();
if(this._maxHeight){this._scrollToTheNextPortionOfItems(g);
}this._ajaxRequest=false;
};
b.RadComboBox.prototype._updateMoreResultsBox=function(){if(this._showMoreResultsBox&&this.get_moreResultsBoxMessageElement()){this.get_moreResultsBoxMessageElement().innerHTML=this.get_showMoreMessage();
}},b.RadComboBox.prototype._setUpScroll=function(f,d){var e;
if(f){e=$telerik.getFirstChildByTagName(d,"div",0);
if(e){e.parentNode.removeChild(e);
}}else{e=document.createElement("div");
if(!this._height&&this._maxHeight){e.style.height=this._maxHeight+"px";
}else{e.style.height=this._height+"px";
}d.appendChild(e);
}};
b.RadComboBox.prototype._onErrorReceived=function(d,f){if(this._requestTimeoutID>0){window.clearTimeout(this._requestTimeoutID);
this._requestTimeoutID=0;
}var e=this._extractErrorMessage(d);
if(this.raise_itemsRequestFailed(f,e,null)){return;
}alert(e);
};
b.RadComboBox.prototype._onWebServiceError=function(f,e){var d=e.get_message(),g=e.get_context();
this._onErrorReceived(d,g);
};
b.RadComboBox.prototype._restoreSelectionAfterRequest=function(){var d=this.findItemByValue(this.get_value());
if(d&&d.get_enabled()&&(!d.get_isSeparator())){d.set_selected(true);
d.highlight();
this.set_selectedItem(d);
}};
})();
(function(){var a=Telerik.Web.UI;
a.RadComboBox.prototype.get_markFirstMatch=function(){return this._markFirstMatch;
};
a.RadComboBox.prototype.set_markFirstMatch=function(b){this._markFirstMatch=b;
this.repaint();
};
a.RadComboBox.prototype.findFirstMatch=function(f){if(!f){return null;
}var c=this.get_items(),d=c.get_count();
for(var b=0;
b0){i=c+this._callbackText.length+1;
b=j.length-i;
}}if(i&&b){this.selectText(i,b);
}};
a.RadComboBox.prototype.highlightFirstVisibleEnabledItem=function(){if(this.get_text().length>0){var d=this.get_visibleItems();
var e=d.length;
for(var c=0;
c=a.Keys.PageUp)&&(this._lastKeyCode<=a.Keys.Del)){return false;
}if((this._lastKeyCode>=a.Keys.F1)&&(this._lastKeyCode<=a.Keys.F12)){return false;
}if(this._lastKeyCode==a.Keys.Delete){return false;
}return true;
};
})();
(function(){var a=Telerik.Web.UI;
a.RadComboBox.prototype.get_selectedIndex=function(){var b=this.get_selectedItem();
if(b){return b.get_index();
}return this._selectedIndex;
};
a.RadComboBox.prototype.set_selectedIndex=function(b){this._selectedIndex=b;
};
a.RadComboBox.prototype.get_selectedItem=function(){if(!this._setSelectedItem){this._setSelectedItem=true;
this._setFirstSelectedItem();
}return this._selectedItem;
};
a.RadComboBox.prototype.set_selectedItem=function(b){this._selectedItem=b;
};
a.RadComboBox.prototype.clearSelection=function(){this.set_text("");
this.set_value("");
this.set_selectedItem(null);
var b=this.get_highlightedItem();
if(b){b.unHighlight();
}this._applyEmptyMessage();
};
a.RadComboBox.prototype._performSelect=function(d,c){if(d&&d!=this.get_selectedItem()&&!this.get_enableLoadOnDemand()){d._select(c);
return;
}if(d&&d==this.get_selectedItem()&&this.getLastWord(this.get_text())!=d.get_text()&&!this.get_readOnly()){this._appendTextAfterLastSeparator(d.get_text());
return;
}if(d&&d==this.get_selectedItem()){if(this.get_markFirstMatch()){if(d.get_text()!=this.get_text()||d.get_value()!=this.get_value()){d._select(c);
}}return;
}if(d&&this.get_originalText()!=d.get_text()){d._select(c);
return;
}if(d&&(!this.get_selectedItem()||this.get_selectedItem().get_value()!=d.get_value())){d._select(c);
return;
}if((this.get_allowCustomText()||this.get_enableLoadOnDemand())&&this._shouldPostbackOnChange()&&!this._checkBoxes){if(this.get_highlightedItem()){this.get_highlightedItem().unHighlight();
}if(this.raise_textChange(this,c)===true){return;
}var b={Command:"TextChanged"};
this.postback(b);
}};
a.RadComboBox.prototype._selectItemOnBlur=function(c){if(this.get_emptyMessage()&&(this.get_text()==this.get_emptyMessage())){return;
}var h,f=null;
if(this.get_markFirstMatch()===true&&this.get_filter()==a.RadComboBoxFilter.None&&this.get_allowCustomText()===false&&this.get_enableLoadOnDemand()===false&&this.get_emptyMessage()&&this.get_autoCompleteSeparator()){h=this.get_lastWord();
}if(this._checkBoxes){if(this.get_filter()!=a.RadComboBoxFilter.None){this.setAllItemsVisible(true);
}return;
}f=this._findItemToSelect(h);
if(f===null&&this._defaultItem!==null&&(this.get_text()===""||this.get_text()==this._defaultItem.get_text())){f=this._defaultItem;
}var d=!this.get_enableLoadOnDemand()&&!this.get_allowCustomText();
if(!f&&d&&(this.get_items().get_count()>0)){if(this.get_filter()!=a.RadComboBoxFilter.None){f=this.get_selectedItem();
if(!f){this.set_text("");
}else{this.set_text(f.get_text());
this.set_value(f.get_value());
}}else{if(this.get_markFirstMatch()&&!this.get_emptyMessage()){if(this.get_text()===""){this.set_text(this._originalText);
}this.highlightMatches();
this.selectText(0,0);
f=this.get_highlightedItem();
}}}if(this.get_filter()!=a.RadComboBoxFilter.None){this.setAllItemsVisible(true);
}if(!f){var g=this.get_selectedItem();
if(g&&!d){if(this.raise_selectedIndexChanging(null,c)===true){this.set_text(g.get_text());
return;
}g.set_selected(false);
this.set_selectedItem(null);
this.set_selectedIndex(null);
this.raise_selectedIndexChanged(null,c);
var b={Command:"Select",Index:-1};
this.postback(b);
return;
}if(g&&d){f=g;
}}this._performSelect(f,c);
};
})();
(function(){var a=$telerik.$;
var b=Telerik.Web.UI;
b.RadComboBox.prototype.get_selectElement=function(){return a(this.get_element()).find("select").get(0);
};
b.RadComboBox.prototype.get_selectElementText=function(){var c=this.get_selectElement();
var d="";
if(c.options.length&&c.selectedIndex>-1){d=c.options[c.selectedIndex].text;
}return d;
};
b.RadComboBox.prototype.get_selectedOption=function(){var c=this.get_selectElement();
if(c.options.length&&c.selectedIndex>-1){return c.options[c.selectedIndex];
}return null;
};
b.RadComboBox.prototype.get_simpleRendering=function(){if(!this._simpleRendering){this._simpleRendering=false;
}else{return this._simpleRendering;
}if(a(this.get_element()).find("select").length>0&&this.get_inputDomElement()===null){this._simpleRendering=true;
}return this._simpleRendering;
};
b.RadComboBox.prototype._initializeSelect=function(){var c=this;
a(this.get_selectElement()).bind("change",function(d){c._onSelectChange(d,c);
});
};
b.RadComboBox.prototype._onSelectChange=function(c,d){var f=c.target.options[c.target.selectedIndex];
d._ensureChildControls();
d._performSelect(f._item,c);
};
b.RadComboBox.prototype._disposeSelect=function(){a(this.get_selectElement()).unbind("change");
};
})();
(function(b,a){b.RadComboBoxDefaultItem=function(){b.RadComboBoxDefaultItem.initializeBase(this);
};
b.RadComboBoxDefaultItem.prototype={_select:function(d){if(!this.get_isEnabled()||this.get_isSeparator()){return;
}var c=this.get_comboBox();
var h=c.get_text(),f=c._getLastSeparatorIndex(h),i=h.substring(0,f+1)+this.get_text(),g=c.get_selectedItem();
if(g){g.set_selected(false);
}c.clearSelection();
c.get_inputDomElement().value=i;
c._element.value=this.get_value();
c.set_value(this.get_value());
this.set_selected(true);
this.highlight();
}};
b.RadComboBoxDefaultItem.registerClass("Telerik.Web.UI.RadComboBoxDefaultItem",b.RadComboBoxItem);
})(Telerik.Web.UI,$telerik.$);