0){if($telerik.quirksMode){i+=(f.css("border-left-style")!="none"?parseInt(f.css("border-left-width"),10):0)+(f.css("border-right-style")!="none"?parseInt(f.css("border-right-width"),10):0)+(parseInt(f.css("padding-left"),10)||0)+(parseInt(f.css("padding-right"),10)||0);
}if($telerik.isIE9Mode||parseFloat(f.css("font-size"))>12){i+=3;
}f[0].style.width=Math.ceil(i)+"px";
}else{if(h<3){setTimeout(function(){b.RadMenu._adjustListWidth(g,h);
},0);
}}};
b.RadMenu._getViewPortSize=function(){var g=$telerik.getViewPortSize();
var f=document.compatMode!="CSS1Compat";
if($telerik.isFirefox&&f){g.height+=document.body.scrollTop;
}return g;
};
b.RadMenu._updateChildrenPositionClass=function(g){var h=function(i){a(i).children(".rmItem").filter(function(){return(this._item&&this._item.get_visible());
}).removeClass("rmFirst rmLast").filter(":first").addClass("rmFirst").end().filter(":last").addClass("rmLast");
};
if(!g){return;
}var f=g.get_childListElement();
if(!f){return;
}if(a(f).is(".rmMultiColumn")){a(f).find("> .rmGroupColumn > ul").each(function(){h(this);
});
}else{h(f);
}};
b.RadMenu._removeChildListCorners=function(f){a(f.get_childListElement()).find(".rmTopRight, .rmBottomLeft, .rmBottomRight, .rmTopFix, .rmBottomFix").remove();
f._roundedCornersRendered=false;
f._shadowsRendered=false;
};
b.RadMenu._removeScrollWrapContainer=function(f){if(f._slide){var g=a(f._getScrollWrapElement()).appendTo(f._slide.get_element())[0];
if(g){a(f.get_element()).find(".rmScrollWrapContainer").remove();
f._slide.set_animatedElement(g);
}f._roundedCornersRendered=false;
f._shadowsRendered=false;
}};
b.RadMenu._renderCornerElements=function(j,g){var k=a(j._getScrollWrapElement()),f='<{0} class="rmTopRight">{0}><{0} class="rmBottomLeft">{0}><{0} class="rmBottomRight">{0}><{0} class="rmTopFix">{0}><{0} class="rmBottomFix">{0}>',h=(j.get_hasContentTemplate&&j.get_hasContentTemplate()),m="span",i="li";
if(g){f='<{0} class="rmTopRight rmTopShadowRight">{0}><{0} class="rmBottomLeft rmBottomShadowLeft">{0}><{0} class="rmBottomRight rmBottomShadowRight">{0}>';
}if(h){f=String.format(f,m);
a(j._getContentTemplateContainer()).prepend(f);
}else{f=String.format(f,i);
if(k.length){var l=a(j.get_element()).find(".rmScrollWrapContainer");
if(!l.length){l=a('').append(k).appendTo(j._getAnimationContainer());
j._animatedElement=l[0];
j._slide.set_animatedElement(j._getAnimatedElement());
}l.prepend(f);
}else{a(j.get_childListElement()).prepend(f);
}}};
b.RadMenu._ensureCorners=function(g,f){if($telerik.isIE6||$telerik.quirksMode){if(g.get_enableRoundedCorners()||g.get_enableShadows()){setTimeout(function(){var i=a(f._slide.get_element()).children(".rmScrollWrapContainer"),h=f.get_childListElement(),k=0,j=0;
if(!i.length){i=a(h);
h.style.cssText=h.style.cssText;
k=i.innerWidth()-4;
j=i.innerHeight();
}else{var l=a(f._getScrollWrapElement());
k=l.innerWidth();
j=l.innerHeight()+4;
}a(i).children(".rmTopRight").height(j);
a(i).children(".rmTopFix, .rmBottomFix").width(k);
a(i).children(".rmBottomRight, .rmBottomLeft").add(h).add(i).each(function(){this.style.cssText=this.style.cssText;
});
a(i).children(".rmBottomShadowLeft").width(i.innerWidth()-4);
},0);
}}};
b.RadMenu._preloadItemImages=function(h){var g=["imageUrl","hoveredImageUrl","expandedImageUrl","disabledImageUrl","clickedImageUrl","selectedImageUrl"];
var f=function(m){for(var j=0;
j0&&f.get_expandDirection()==b.ExpandDirection.Left){this._item.focusFirstChild(d);
return;
}var i=this._item.get_parent(),k=null;
if(i.get_groupSettings){k=i.get_groupSettings();
}if(k&&k.get_expandDirection()==b.ExpandDirection.Right){i._transferFocus(d);
return;
}var h=this._owner.get_openedItem();
if(h){h.focusPreviousItem(d);
}},_onKeyboardRight:function(d){var j=this._item._getParentFlow();
if(j==b.ItemFlow.Horizontal){this._item.focusNextItem(d);
return;
}var g=this._item.get_items(),f=this._item.get_groupSettings();
if(g.get_count()>0&&f.get_expandDirection()==b.ExpandDirection.Right){this._item.focusFirstChild(d);
return;
}var i=this._item.get_parent(),k=null;
if(i.get_groupSettings){k=i.get_groupSettings();
}if(k&&k.get_expandDirection()==b.ExpandDirection.Left){i._transferFocus();
return;
}var h=this._owner.get_openedItem();
if(h){h.focusNextItem(d);
}},_onKeyboardEsc:function(d){var g=this._item.get_parent(),f=this._owner;
if(g==f){this._item._setFocused(false,d);
}else{g._close(d);
g._transferFocus(d);
}}};
})($telerik.$,Telerik.Web.UI);
(function(a,c,d){var b=Sys.Serialization.JavaScriptSerializer;
c.RadMenu.prototype.get_hierarchyModel=function(){var f=this.get_odataClientSettings();
f.ExpandMode=c.MenuItemExpandMode.WebService;
var e=this.get_dataBindings();
if(e){e[e.length-1].ExpandMode=c.MenuItemExpandMode.ClientSide;
}f.DataBindings=e;
return c.RadODataDataSource.Binder.Hierarhical.Model(f);
},c.RadMenu.prototype._initializeODataSourceBinder=function(){var e=this;
setTimeout(function(){var h=e.get_odataClientSettings().ODataSourceID,g=$find(h);
if(!g){var i=String.format("DataSource with id {0} was not found on the page",h);
alert(i);
return;
}e._hierarhicalBinder=new c.RadODataDataSource.Binder.Hierarhical(g,e);
e._hierarhicalBinder.initialize();
var f=a.raiseCancellableControlEvent(e,"menuPopulating",{});
if(!f){e._onDataNeeded();
}},1);
};
c.RadMenu.prototype._onDataNeeded=function(h){var f=h!=d?1+h.get_level():0,e=h!=d?h.get_key():"null";
var g={level:f,key:e,events:{requesting:function(i){if(h){var j=new Telerik.Web.UI.WebServiceLoaderEventArgs(h);
this._onItemLoadingStarted(this,j);
}},success:function(i){var j=h||this,k=new Telerik.Web.UI.WebServiceLoaderSuccessEventArgs(i,j);
this._onItemLoadingSuccess(this,k);
},fail:function(i){var j=h||this,k=new Telerik.Web.UI.WebServiceLoaderErrorEventArgs(i.get_message(),j);
this._onItemLoadingError(this,k);
}}};
this._hierarhicalBinder.fetch(g);
};
c.RadMenu.prototype.get_webServiceSettings=function(){return this._webServiceSettings;
};
c.RadMenu.prototype.set_webServiceSettings=function(f){var e=b.deserialize(f);
if(e.ODataSettings){this._webServiceSettings=new c.NavigationControlODataSettings(e);
}else{this._webServiceSettings=new c.WebServiceSettings(e);
}};
c.RadMenu.prototype._initializeWebServiceLoader=function(){var e=this.get_webServiceSettings();
if(e.get_isOData()){this._webServiceLoader=new c.NavigationControlODataLoader(this.get_webServiceSettings(),function(f){if(f.length>0){return c.MenuItemExpandMode.WebService;
}else{return c.MenuItemExpandMode.ClientSide;
}});
}else{this._webServiceLoader=new c.WebServiceLoader(this.get_webServiceSettings());
}this._webServiceLoader.add_loadingStarted(Function.createDelegate(this,this._onItemLoadingStarted));
this._webServiceLoader.add_loadingSuccess(Function.createDelegate(this,this._onItemLoadingSuccess));
this._webServiceLoader.add_loadingError(Function.createDelegate(this,this._onItemLoadingError));
};
c.RadMenu.prototype._loadChildrenFromWebService=function(e){if(!this._webServiceLoader){this._initializeWebServiceLoader();
}var i={},g=new c.RadMenuItemPopulatingEventArgs(e,i);
this._raiseEvent("itemPopulating",g);
if(g.get_cancel()){return;
}var f={Text:e.get_text(),Value:e.get_value(),ExpandMode:e.get_expandMode()};
if(e.get_attributes().get_count()>0){f.Attributes=e.get_attributes()._data;
}var h={item:f,context:i};
if(this.get_webServiceSettings().get_isWcf()){h.context=this._webServiceLoader._serializeDictionaryAsKeyValuePairs(h.context);
if(h.item.Attributes){h.item.Attributes=this._webServiceLoader._serializeDictionaryAsKeyValuePairs(h.item.Attributes);
}}else{if(this.get_odataClientSettings()){this._onDataNeeded(e);
return;
}}this._webServiceLoader.loadData(h,e);
};
c.RadMenu.prototype._onItemLoadingStarted=function(g,e){var f=e.get_context();
f._onChildrenLoading();
};
c.RadMenu.prototype._onItemLoadingSuccess=function(o,h){var n=h.get_data(),m=h.get_context(),f=m.get_items(),p=this.get_webServiceSettings().get_isWcf();
for(j=0;
j0){k=1;
}j.push({ExpandMode:k,Key:h[this._dataFieldID],NavigateUrl:h[this._dataNavigateUrlField],ParentID:h[this._dataFieldParentID],Text:h[this._dataTextField],Value:h[this._dataValueField]});
}var e={_data:j,_context:n,get_data:function(){return this._data;
},get_context:function(){return this._context;
}};
this._onItemLoadingSuccess(this,e);
};
})($telerik.$,Telerik.Web.UI);
(function(a,b,c){b.RadMenu.prototype._initializeScroller=function(){if(!this._childControlsCreated){return null;
}var g=this._getScrollWrapElement(),d=this.get_childListElement();
if(g&&d){var f=null;
if(this._scroller){f=this._scroller.get_currentPosition();
this._scroller.dispose();
}this._scroller=new b.MenuItemScroller(this,this.get_childListElement(),this._flow);
d.style.display="block";
var e=this._flow==b.ItemFlow.Horizontal;
if(e){b.RadMenu._adjustListWidth(this);
}else{b.RadMenu._adjustChildrenWidth(this);
if(this.get_rightToLeft()&&$telerik.isIE&&d.firstChild){d.style.width=d.firstChild.offsetWidth+"px";
d.parentNode.style.width=d.offsetWidth+"px";
}}this._scroller.initialize();
this._scroller.updateState();
if(f!==null){this._scroller.set_currentPosition(f);
}if(this.get_rightToLeft()&&e){d.style.cssFloat="left";
this._scroller.scrollToMaxPosition();
}this._setHorizontalArrowSize(e);
}};
b.RadMenu.prototype._getScrollableParent=function(e){var d=this._extractItemFromDomElement(e);
if(!d&&this._scroller){d=this;
}return d;
};
b.RadMenu.prototype._changeScrollSpeed=function(g,f){var d=this._getScrollableParent(g),e=d._scroller;
if(!e){return;
}e.changeScrollSpeed(f);
};
b.RadMenu.prototype._startScroll=function(i,d){var g=this._getScrollableParent(i),h=g._scroller;
if(!h){return;
}var e=1,f=g.get_openedItem();
if(d==b.ArrowPosition.Top||d==b.ArrowPosition.Left){e=-1;
}if(f){f.close();
}h.startScroll(b.ScrollerSpeed.Slow,e);
};
b.RadMenu.prototype._stopScroll=function(f){var d=this._getScrollableParent(f),e=d._scroller;
if(!e){return;
}e.stopScroll();
};
b.RadMenu.prototype._onItemMousewheel=function(f){var h=f.originalEvent,d=h.wheelDelta?h.wheelDelta:-h.detail,k=b.ScrollerSpeed.MousewheelDefault,g=this._getScrollableParent(f.target),i=g&&g.get_parent?g.get_parent():null,j=i?i._scroller:null;
if(!j){return;
}j.scrollRelative(d>0?-k:k);
f.preventDefault();
};
b.RadMenu.prototype._onArrowMouseDown=function(d){this._changeScrollSpeed(d,b.ScrollerSpeed.Fast);
};
b.RadMenu.prototype._onArrowMouseUp=function(d){this._changeScrollSpeed(d,b.ScrollerSpeed.Slow);
};
b.RadMenu.prototype._onArrowMouseOver=function(e,d){this._startScroll(e,b.ArrowPosition[d]);
};
b.RadMenu.prototype._onArrowMouseOut=function(d){this._stopScroll(d);
};
})($telerik.$,Telerik.Web.UI);
(function(a,b,q){var m=a.proxy,j="rmLeftArrow",k="rmRightArrow",l="rmTopArrow",d="rmBottomArrow",f="rmLeftArrowDisabled",g="rmRightArrowDisabled",h="rmTopArrowDisabled",e="rmBottomArrowDisabled",i="rmItem",p="touchstart",n="touchend",o="touchmove",c=".";
b.MenuItemScroller=function(t,r,s){this._owner=t;
this._menu=this._owner.get_menu?this._owner.get_menu():this._owner;
this._leftArrowCssClass=j;
this._rightArrowCssClass=k;
this._topArrowCssClass=l;
this._bottomArrowCssClass=d;
this._leftArrowDisabledCssClass=f;
this._rightArrowDisabledCssClass=g;
this._topArrowDisabledCssClass=h;
this._bottomArrowDisabledCssClass=e;
this._arrowsZIndex=2;
this._scroller=null;
this._childListElement=r;
this._scrollElement=null;
this._orientation=null;
this._minScrollPosition=null;
this._itemFlow=s;
this._scrollerPositionChangedDelegate=null;
this._decArrow=null;
this._incArrow=null;
this._rtl=b.RadMenu._requiresRightToLeft(r);
this._isUsedOnTouchDevices=$telerik.isTouchDevice;
this._initialTouchLocation=0;
this._previousScrollLocation=0;
this._touchScrollInAction=false;
this._timeOut=null;
};
b.MenuItemScroller.prototype={initialize:function(){b.RadMenu.ExtendWithView(this._menu,this,"ExtendScrollerWithView");
this._childListElement.style.position="relative";
this._scrollElement=this._childListElement.parentNode;
this._orientation=b.ScrollerOrientation.Horizontal;
if(this._itemFlow==b.ItemFlow.Vertical){this._orientation=b.ScrollerOrientation.Vertical;
}this._scroller=new b.Scroller(this._childListElement,this._scrollElement,this._orientation);
if(this._isUsedOnTouchDevices){var r=a(this._childListElement);
r.on(p,c+i,m(this._mobileScrollHandlerStart,this));
r.on(o,c+i,m(this._mobileScrollHandler,this));
r.on(n,c+i,m(this._mobileScrollHandlerStop,this));
this._scroller._onTick=a.proxy(this._onTick,this);
}this._scroller.initialize();
this._createArrows();
this._scroller.resetState();
this._scrollerPositionChangedDelegate=Function.createDelegate(this,this._onScrollerPositionChanged);
this._scroller.add_positionChanged(this._scrollerPositionChangedDelegate);
},dispose:function(){if(this._isUsedOnTouchDevices){var r=a(this._childListElement);
r.off(p,c+i,this._mobileScrollHandlerStart);
r.off(o,c+i,this._mobileScrollHandler);
r.off(n,c+i,this._mobileScrollHandlerStop);
}if(this._scroller){this._scroller.dispose();
this._scroller=null;
var s=a(this._decArrow).add(a(this._incArrow));
if($telerik.isIE){s.unbind(".menuScroller");
}s.remove();
}this._scrollerPositionChangedDelegate=null;
this._childListElement=null;
this._scrollElement=null;
},updateState:function(){this._updateScrollingLimits();
this._updateArrows();
},resetState:function(){this._scroller.resetState();
},startScroll:function(s,r){this._scroller.startScroll(s,r);
},changeScrollSpeed:function(r){this._scroller.changeScrollSpeed(r);
},stopScroll:function(){this._scroller.stopScroll();
},scrollToMaxPosition:function(){this._scroller.scrollToMaxPosition();
},scrollRelative:function(r){this.set_currentPosition(this.get_currentPosition()+r);
},get_currentPosition:function(){return this._scroller._currentPosition;
},set_currentPosition:function(r){this._scroller._scrollTo(Math.max(Math.min(this._scroller._maxPosition,r),this._scroller._minPosition));
},_onTick:function(){var s=this._scroller,r=s._currentPosition+(s._direction*s._speed);
r=Math.max(r,s._minPosition);
r=Math.min(r,s._maxPosition);
this._previousScrollLocation=r;
s._scrollTo(r);
if(r==s._minPosition||r==s._maxPosition){s.stopScroll();
}},_createArrows:function(){var r=this._arrowsZIndex;
this._decArrow=this._createArrowDomElement(r);
this._incArrow=this._createArrowDomElement(r);
if(this._orientation==b.ScrollerOrientation.Vertical){this._decArrow.style.left="0px";
this._decArrow.style.top="0px";
this._incArrow.style.left="0px";
this._incArrow.style.bottom="0px";
}else{this._decArrow.style.top="0px";
this._decArrow.style.left="-1px";
this._incArrow.style.top="0px";
this._incArrow.style.right="-1px";
}},_updateArrows:function(){var s=this._scroller.isAtMinPosition(),r=this._scroller.isAtMaxPosition();
if(s){this._decArrow.disabled="disabled";
this._setElementCssClass(this._decArrow,this._getDecArrowCssClass(false));
}else{this._decArrow.disabled="";
this._setElementCssClass(this._decArrow,this._getDecArrowCssClass(true));
}if(r){this._incArrow.disabled="disabled";
this._setElementCssClass(this._incArrow,this._getIncArrowCssClass(false));
}else{this._incArrow.disabled="";
this._setElementCssClass(this._incArrow,this._getIncArrowCssClass(true));
}},_updateScrollingLimits:function(){var u=0,t=0,r=a(this._childListElement),s=a(this._scrollElement);
if(this._orientation==b.ScrollerOrientation.Vertical){t=r.height()-s.height();
}else{t=r.width()-s.width();
}if(this._rtl&&$telerik.isIE8){u=-t;
t=0;
}this._scroller.setScrollingLimits(u,t);
},_getDecArrowCssClass:function(r){if(this._orientation==b.ScrollerOrientation.Vertical){return r?this._topArrowCssClass:this._topArrowDisabledCssClass;
}else{return r?this._leftArrowCssClass:this._leftArrowDisabledCssClass;
}},_getIncArrowCssClass:function(r){if(this._orientation==b.ScrollerOrientation.Vertical){return r?this._bottomArrowCssClass:this._bottomArrowDisabledCssClass;
}else{return r?this._rightArrowCssClass:this._rightArrowDisabledCssClass;
}},_onScrollerPositionChanged:function(s,r){this._updateArrows();
},_mobileScrollHandler:function(t){var r=this._orientation!=Telerik.Web.UI.ScrollerOrientation.Vertical?$telerik.getTouchEventLocation(t).x:$telerik.getTouchEventLocation(t).y,s,u,v=this._owner.get_openedItem();
t.preventDefault();
t.stopPropagation();
if(this._initialTouchLocation===0){this._initialTouchLocation=r;
if(v){v.close();
}}s=this._initialTouchLocation-r;
u=s+this._previousScrollLocation;
this.set_currentPosition(u);
clearTimeout(this._timeOut);
this._touchScrollInAction=true;
if(this._scroller.isAtMinPosition(u)||this._scroller.isAtMaxPosition(u)){this.stopScroll();
}else{this._lastDelta=s;
}},_mobileScrollHandlerStop:function(r){r.stopPropagation();
this._initialTouchLocation=0;
this._previousScrollLocation+=this._lastDelta;
this._touchScrollInAction=false;
},_mobileScrollHandlerStart:function(r){var s=this;
r.stopPropagation();
this._timeOut=setTimeout(function(){s._touchScrollInAction=false;
},90);
}};
b.MenuItemScroller.registerClass("Telerik.Web.UI.MenuItemScroller",null,Sys.IDisposable);
})($telerik.$,Telerik.Web.UI);
(function(a,b,c){a.registerEnum(b,"ItemFlow",{Vertical:0,Horizontal:1});
a.registerEnum(b,"ExpandDirection",{Auto:0,Up:1,Down:2,Left:3,Right:4});
a.registerEnum(b,"MenuRepeatDirection",{Vertical:0,Horizontal:1});
b.RadMenuItemGroupSettings=function(f,d){if(d){for(var e in d){this[e]=d[e];
}}for(var e in f){var g=this["set_"+e];
if(g){g.call(this,f[e]);
}}};
a.registerControlProperties(b.RadMenuItemGroupSettings,{flow:b.ItemFlow.Vertical,expandDirection:b.ExpandDirection.Auto,offsetX:0,offsetY:0,width:null,height:null,repeatDirection:b.MenuRepeatDirection.Vertical,repeatColumns:1});
b.RadMenuItemGroupSettings.registerClass("Telerik.Web.UI.RadMenuItemGroupSettings");
})($telerik.$,Telerik.Web.UI);