﻿Type.registerNamespace('Mbccs.WebControls'); Mbccs.WebControls.PersistentScrollPosition = function(element) { Mbccs.WebControls.PersistentScrollPosition.initializeBase(this, [element]); this._scrollDelegate = null; this._endRequestDelegate = null; this._storage = null;}
Mbccs.WebControls.PersistentScrollPosition.prototype = { _getScrollPosition : function() { var el = this.get_element(); if (el) { return { x: el.scrollLeft || 0, y: el.scrollTop || 0
};}
}, get_storage : function() { return this._storage;}, set_storage : function(value) { this._storage = value;}, initialize : function() { Mbccs.WebControls.PersistentScrollPosition.callBaseMethod(this, 'initialize'); this._scrollDelegate = Function.createDelegate(this, this._onScroll); this._endRequestDelegate = Function.createDelegate(this, this._onEndRequest); var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(this._endRequestDelegate); $addHandler(this.get_element(), 'scroll', this._scrollDelegate);}, dispose : function() { Mbccs.WebControls.PersistentScrollPosition.callBaseMethod(this, 'dispose'); var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.remove_endRequest(this._endRequestDelegate); delete this._endRequestDelegate; delete this._scrollDelegate;}, _onScroll : function(e) { this._storage.value = Sys.Serialization.JavaScriptSerializer.serialize(this._getScrollPosition());}, _onEndRequest : function(sender, args) { var o = null; if(this._storage.value !== '')
o = Sys.Serialization.JavaScriptSerializer.deserialize(this._storage.value); if (o) { var el = this.get_element(); el.scrollLeft = o.x; el.scrollTop = o.y; this._storage.value = '';}
}
}
Mbccs.WebControls.PersistentScrollPosition.registerClass('Mbccs.WebControls.PersistentScrollPosition', Sys.UI.Behavior); if(typeof(Sys) !== 'undefined')
Sys.Application.notifyScriptLoaded(); 
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();