oboutGrid.prototype.initRecordSelection=function(){this.selectPreviouslySelectedRecords();this.populateSelectedRecordsFromContainer()};oboutGrid.prototype.selectRecordByClick=function(b,a){if(this.getElementIndex(a)==this.RecordInEditMode)return;if(!b)b=window.event;if(this.AllowMultiRecordSelection==true)var f=b.ctrlKey;else var f=false;if(this.AllowMultiRecordSelection==true)var g=b.shiftKey;else var g=false;if(g==true){this.selectMultipleRecords(a);return}var e=false,c=null,d=this.getRecordSelectionIndex(a);if(d==-1){(this.AllowMultiRecordSelection==false||this.AllowMultiRecordSelection==true&&f==false)&&this.restorePreviousSelectedRecord();c=this.markRecordAsSelected(a,false,true,e)}else if(this.AllowMultiRecordSelection==false||this.AllowMultiRecordSelection==true&&f==true)this.markRecordAsUnSelected(a,d);else{this.restorePreviousSelectedRecord();c=this.markRecordAsSelected(a,false,true,e)}this.LastSelectedRecord=a;this.updateSelectedRecordsContainer();this.handleOnSelectEvent(c,true)};oboutGrid.prototype.getRecordSelectionIndex=function(b){for(var a=0;a<this.SelectedRecordsCollection.length;a++)if(this.SelectedRecordsCollection[a].Record==b)return a;return-1};oboutGrid.prototype.restorePreviousSelectedRecord=function(){for(var a=0;a<this.SelectedRecordsCollection.length;a++){(this.EnableRecordHover==true||this.AllowKeyNavigation==true)&&this.clearHoverEffect(this.SelectedRecordsCollection[a].Record);this.SelectedRecordsCollection[a].Record.className=this.SelectedRecordsCollection[a].PreviousClassName;if(this.AllowKeyNavigation==true&&this.LastHighlightedRecord!=null&&this.getElementIndex(this.SelectedRecordsCollection[a].Record)==this.getElementIndex(this.LastHighlightedRecord)){var b=this.LastHighlightedRecord;this.LastHighlightedRecord=null;this.manageHoverEffects(b,true)}}this.SelectedRecordsCollection.splice(0,this.SelectedRecordsCollection.length);this.PageSelectedRecords.splice(0,this.PageSelectedRecords.length);this.SelectedRecords=[]};oboutGrid.prototype.markRecordAsSelected=function(a,d,f,e,c){if(d==true){var g=this.getRecordSelectionIndex(a);g!=-1&&this.markRecordAsUnSelected(a,g)}if(c==null)c=false;if(a.className!=this.CSSRecordSelected||d==true){this.SelectedRecordsCollection.push(new OboutGridSelectedRecord(a,a.className,f,this));var b={};b=this.getRecordValuesByRecord(a,c);b.ob_bIsPageSelectedRecord=true;b.ob_bIsNewSelectedRecord=f;this.PageSelectedRecords.push(b);(this.EnableRecordHover==true||this.AllowKeyNavigation==true)&&this.restoreRecordStateBeforeHover(a);a.className=this.CSSRecordSelected;if(this.OnClientSelect!=null&&e)this.handleOnSelectEvent(b,true);else{if(this.NewSelectedRecords==null)this.NewSelectedRecords=[];this.NewSelectedRecords.push(b)}(this.EnableRecordHover==true||this.AllowKeyNavigation==true&&this.LastHighlightedRecord!=null&&this.getElementIndex(a)==this.getElementIndex(this.LastHighlightedRecord))&&this.updateLastHighlightedRecordInfo(a)}if(e==false)return b};oboutGrid.prototype.markRecordAsUnSelected=function(b,a){if(a==null)a=this.getRecordSelectionIndex(b);if(a!=-1){(this.EnableRecordHover==true||this.AllowKeyNavigation==true)&&this.restoreRecordStateBeforeHover(b);b.className=this.SelectedRecordsCollection[a].PreviousClassName;this.SelectedRecordsCollection.splice(a,1);this.PageSelectedRecords.splice(a,1);(this.EnableRecordHover==true||this.AllowKeyNavigation==true&&this.LastHighlightedRecord!=null&&this.getElementIndex(b)==this.getElementIndex(this.LastHighlightedRecord))&&this.updateLastHighlightedRecordInfo(b)}};oboutGrid.prototype.handleOnSelectEvent=function(a,b){if(this.OnClientSelect!=null&&a!=null){if(b==true)a=new Array(a);this.raiseClientEvent(this.OnClientSelect,a);this.NewSelectedRecords=null}if(this.AutoPostBackOnSelect==true)if(typeof __doPostBack=="function")__doPostBack(this.ElementsClientIds.PostbackElementID,"");else if(this.ElementsClientIds.PostbackElementID)document.getElementById(this.ElementsClientIds.PostbackElementID).click();else document.forms[0].submit()};oboutGrid.prototype.selectMultipleRecords=function(f){var e=this.getBodyTableBody(),a=false,c=false;if(this.LastSelectedRecord==null)a=true;for(var d=0;d<e.childNodes.length;d++){var b=e.childNodes[d];if(this.LastSelectedRecord!=null)if(b==this.LastSelectedRecord)if(a==true)c=true;else a=true;if(b==f)if(a==true)c=true;else a=true;if(a)this.isBodyRecord(b)&&this.getElementIndex(b)!=this.RecordInEditMode&&this.markRecordAsSelected(b,true,true,false);else this.markRecordAsUnSelected(b,this.getRecordSelectionIndex(b));if(c==true)a=false}this.updateSelectedRecordsContainer();this.handleOnSelectEvent(this.NewSelectedRecords)};oboutGrid.prototype.showSelectionArea=function(b,f){var e=this;this.PreviousMouseMoveEventHandler=document.onmousemove;this.PreviousMouseUpEventHandler=document.onmouseup;this.PreviousOnSelectStartEventHandler=document.onselectstart;var c=this.GridBodyContainer.scrollLeft,d=b.offsetTop,a=document.createElement("DIV");a.style.position="absolute";a.className=this.CSSSelectionArea;a.style.left=c+"px";a.style.top=d+"px";a.style.display="none";this.SelectionArea=this.GridBodyContainer.appendChild(a);this.SelectionArea.style.filter="alpha(style=0, opacity=50)";try{this.SelectionArea.style.MozOpacity=.5;this.SelectionArea.style.opacity=.5}catch(g){}this.DraggingSelectionStarted=false;this.DraggingSelectionInitialRecord=b;this.DraggingSelectionInitialLeft=c;this.DraggingSelectionInitialTop=d;this.DraggingSelectionIsOverBody=true;this.DraggingSelectionGridBodyLeft=this.getLeft(this.GridBodyContainer);this.DraggingSelectionGridBodyTop=this.getTop(this.GridBodyContainer);document.onselectstart=function(){return false};document.onmousemove=function(a){e.updateSelectionArea(a)};document.onmouseup=function(a){e.closeSelectionArea(a);return false};f==false&&this.restorePreviousSelectedRecord();this.SelectionStartRecord=b};oboutGrid.prototype.updateSelectionArea=function(e){if(this.isIE)if(window.event.button==0){this.closeSelectionArea(e);return}this.DraggingSelectionStarted=true;this.DraggingSelectionInProgress=true;var d=this.getMouseCoords(e),f=d[0]-this.DraggingSelectionGridBodyLeft,b=d[1]-this.DraggingSelectionGridBodyTop,c=null;if(b>=this.DraggingSelectionInitialTop){if(this.SelectionArea.style.top!=this.DraggingSelectionInitialTop+"px")c=this.DraggingSelectionInitialTop;selectionAreaHeight=b-this.DraggingSelectionInitialTop;if(selectionAreaHeight>this.GridBodyContainer.firstChild.offsetHeight-this.DraggingSelectionInitialTop)selectionAreaHeight=this.GridBodyContainer.firstChild.offsetHeight-this.DraggingSelectionInitialTop-2}else{if(this.SelectionArea.style.top!=d[1]+"px")c=b>0?b:0;selectionAreaHeight=this.DraggingSelectionInitialTop-b+this.DraggingSelectionInitialRecord.offsetHeight;if(selectionAreaHeight>this.DraggingSelectionInitialTop+this.DraggingSelectionInitialRecord.offsetHeight)selectionAreaHeight=this.DraggingSelectionInitialTop+this.DraggingSelectionInitialRecord.offsetHeight-2}var a=f-this.DraggingSelectionInitialLeft;if(a>this.GridBodyContainer.clientWidth)a=this.GridBodyContainer.clientWidth-2;if(c!=null)this.SelectionArea.style.top=c+"px";if(a<0)a=0;if(selectionAreaHeight<0)selectionAreaHeight=0;this.SelectionArea.style.width=a+"px";this.SelectionArea.style.height=selectionAreaHeight+"px";this.SelectionArea.style.display=""};oboutGrid.prototype.closeSelectionArea=function(g){var a=this.getMouseCoords(g),h=a[0]-this.DraggingSelectionGridBodyLeft,f=a[1]-this.DraggingSelectionGridBodyTop,b=this.DraggingSelectionGridBodyLeft+this.GridBodyContainer.scrollLeft,c=this.DraggingSelectionGridBodyTop+this.GridBodyContainer.scrollTop,d=a[0]>=b&&a[0]<=b+this.GridBodyContainer.clientWidth,e=a[1]>=c&&a[1]<=c+this.GridBodyContainer.clientHeight;this.DraggingSelectionStarted==true&&d&&e&&this.selectRecordsFromArea(f);this.GridBodyContainer.removeChild(this.SelectionArea);this.SelectionArea=null;document.onselectstart=this.PreviousOnSelectStartEventHandler;document.onmouseup=this.PreviousMouseUpEventHandler;if(this.PreviousMouseMoveEventHandler!=null&&this.PreviousMouseMoveEventHandler.toString()!=document.onmousemove.toString())document.onmousemove=this.PreviousMouseMoveEventHandler;else document.onmousemove=null;this.PreviousMouseMoveEventHandler=null;this.DraggingSelectionInProgress=false;this.SelectionZoneStartRecordTop=null;this.SelectionStartRecord=null;this.DraggingSelectionInitialRecord=null;this.DraggingSelectionInitialLeft=null;this.DraggingSelectionInitialTop=null;this.DraggingSelectionGridBodyLeft=null;this.DraggingSelectionGridBodyTop=null};oboutGrid.prototype.selectRecordsFromArea=function(c){var b="DESC";if(c<this.DraggingSelectionInitialTop)b="ASC";var a=this.DraggingSelectionInitialRecord;do{this.isBodyRecord(a)&&this.getElementIndex(a)!=this.RecordInEditMode&&this.markRecordAsSelected(a,true,true,false);if(b=="DESC")a=a.nextSibling;else a=a.previousSibling;if(a!=null)iRecordTop=a.offsetTop}while(a!=null&&(iRecordTop<=c&&b=="DESC"||iRecordTop+a.offsetHeight>c&&b=="ASC"));this.updateSelectedRecordsContainer();this.handleOnSelectEvent(this.NewSelectedRecords)};oboutGrid.prototype.updateSelectedRecordsContainer=function(){this.updateSelectedRecords();for(var c="",b="",e,a=0;a<this.SelectedRecords.length;a++){if(c!="")c+=this.ArrayElementsSeparatorEncoded;b="";for(var d in this.SelectedRecords[a])if(d!="ob_bIsPageSelectedRecord"&&d!="ob_bIsNewSelectedRecord"){if(b!="")b+=this.CommandVariableSeparatorEncoded;b+=this.urlEncode(d)+this.CommandNameValueSeparatorEncoded+this.urlEncode(this.xmlCdataDecode(this.SelectedRecords[a][d]))}else e=this.SelectedRecords[a].ob_bIsPageSelectedRecord;c+=b+this.ObjectPropertiesSeparatorEncoded+this.SelectedRecords[a].ob_bIsNewSelectedRecord}this.SelectedRecordsContainer.value=c};oboutGrid.prototype.populateSelectedRecordsFromContainer=function(){this.SelectedRecords=[];var e=this.urlDecode(this.SelectedRecordsContainer.value);if(e!="")for(var f=e.split(this.ArrayElementsSeparator),b=0;b<f.length;b++){for(var a={},i=f[b].split(this.ObjectPropertiesSeparator),g=i[0].split(this.CommandVariableSeparator),c=0;c<g.length;c++){var h=g[c].split(this.CommandNameValueSeparator);a[h[0]]=h[1].replace(/\r\n/g," ")}for(var d=0;d<this.PageSelectedRecords.length;d++)if(this.compareSelectedRecords(this.PageSelectedRecords[d],a)==true)a.ob_bIsPageSelectedRecord=true;this.SelectedRecords.push(a)}this.updateSelectedRecordsContainer()};oboutGrid.prototype.selectPreviouslySelectedRecords=function(){if(this.GridBodyContainer==null)return;this.PageSelectedRecords=[];this.SelectedRecordsCollection=[];if(this.SelectedRecordsIndexesContainer==null||this.SelectedRecordsIndexesContainer.value=="")return;for(var b=this.SelectedRecordsIndexesContainer.value.split(","),a=0;a<b.length;a++)this.markRecordAsSelected(this.getBodyRow(b[a]),true,false,false,true)};oboutGrid.prototype.updateSelectedRecords=function(){for(var a=0;a<this.SelectedRecords.length;a++){var b=this.SelectedRecords[a];if(b.ob_bIsPageSelectedRecord==true){this.SelectedRecords.splice(a,1);a--}}for(var a=0;a<this.PageSelectedRecords.length;a++)this.SelectedRecords.push(this.PageSelectedRecords[a])};oboutGrid.prototype.compareSelectedRecords=function(b,c){for(var a in b)if(a!="ob_bIsPageSelectedRecord"&&a!="ob_bIsNewSelectedRecord")if(b[a]!=c[a])return false;return true};oboutGrid.prototype.getElementIndex=function(a){if(a.parentNode!=null)for(var b=0;b<a.parentNode.childNodes.length;b++)if(a.parentNode.childNodes[b]==a){return b;break}return-1};oboutGrid.prototype.selectRecord=function(c,b){var a=this.getBodyRow(c);if(a){b==true&&this.restorePreviousSelectedRecord();this.markRecordAsSelected(a,null,null,true);this.updateSelectedRecordsContainer()}};oboutGrid.prototype.deselectRecord=function(b){var a=this.getBodyRow(b);if(a){this.markRecordAsUnSelected(a);this.updateSelectedRecordsContainer()}};oboutGrid.prototype.selectRecordFromKeyboard=function(c){if(this.LastHighlightedRecord!=null){var b=this.getElementIndex(this.LastHighlightedRecord);if(b!=-1){var a=true;if(this.AllowMultiRecordSelection==true&&c)a=false;if(a==true||this.LastHighlightedRecord.className!=this.CSSRecordSelected)this.selectRecord(b,a);else this.deselectRecord(b)}}};oboutGrid.prototype.selectRecordsAfterCancelingMultiRecordActions=function(){for(var a=0;a<this.SelectedRecordsCollection.length;a++)for(var e=this.getRecordValuesByRecord(this.SelectedRecordsCollection[a].Record),h=this.getBody().childNodes.length,d=0;d<h;d++){var c=false,b=this.getBody().childNodes[d];if(this.isBodyRecord(b)){c=true;var g=this.getRecordValuesByRecord(b);for(var f in e)if(e[f]!=g[f]){c=false;break}}if(c){this.SelectedRecordsCollection[a].Record=b;break}}};try{if(Sys)Sys.Application&&Sys.Application.notifyScriptLoaded()}catch(ex){};