function ULS_inplview(){if (ULS_inplview.caller){ULS_inplview.caller.ULSTeamName = "Windows SharePoint Services 4";ULS_inplview.caller.ULSFileName = "inplview.js";}}
function SwapNode(a,b){ULS_inplview();return a.parentNode.replaceChild(b,a)}function GetAncestor(a,b){ULS_inplview();while(a!=null&&a.tagName!=b)a=a.parentNode;return a}function CountDictionary(b){ULS_inplview();var a=0,c;for(c in b)a++;return a}function EncodeQueryStringAsHash(a){ULS_inplview();return a.replace(/-/g,"--").replace(/&/g,"-")}function DecodeHashAsQueryString(a){ULS_inplview();return a.replace(/-/g,"&").replace(/&&/g,"-")}function SetUrlHash(a){ULS_inplview();window.location.hash=a}function CLVP(a){ULS_inplview();this.ctx=a;this.tab=null;this.pagingTab=null;this.tBody=null;this.wpq=null;this.inplUrl=null;this.trEmpty=null;this.rootFolder=null;this.rootFolderGuid=null;this.rgpag=null;this.wpid=null;this.isEditing=false;this.dsrc=null;this.isInserting=false;this.strGroupName=null;this.strGroupCache=null;this.bRequestOutstanding=false;this.isEcbInfo=false;this.queueEcbInfo=[];this.fnEcbCallback=null;a.clvp=this}CLVP.prototype.Init=CLVPInit;function CLVPInit(){ULS_inplview();var e=this.ctx.listBaseType==1,c;if(this.ctx.listTemplate=="109"){this.ctx.clvp=null;return}c=this.ctx.listName+"-"+this.ctx.view;var a=GetElementsByName(c);if(a.length==0&&e){c="onetidDoclibViewTbl0";a=GetElementsByName(c)}var b=null;if(a.length==0&&!e)a=GetElementsByName("onetidDoclibViewTbl0");if(a.length==0)a=GetElementsByName("onetidDoclibViewTbl"+this.ctx.ctxId);if(a.length==1){this.tab=a[0];b=this.FindWebPartDiv(this.tab)}else{var d;for(d=0;d<a.length;d++){var g=a[d];b=g;while(b!=null&&b.tagName!="DIV")b=b.parentNode;if(b!=null){var f=b.getAttribute("WebPartID");if(f!=null&&this.ctx.view.indexOf(f.toUpperCase())==1){this.tab=g;break}}}}if(b==null||this.tab==null)return;this.wpq=b.id;this.pagingTab=document.getElementById("bottomPagingCell"+this.wpq.substr(7));this.tab.clvp=this;if(this.tab.className=="ms-emptyView"){var h=GetAncestor(this.tab,"TR");this.trEmpty=h.nextSibling}if(typeof this.ctx.isJsGrid!="undefined"&&this.ctx.isJsGrid){this.isEditing=true;this.SwitchToEdit()}this.rootFolder=GetUrlKeyValue("RootFolder");if(this.rootFolder.length==0)this.rootFolder=null}CLVP.prototype.RestoreNavigation=CLVPRestoreNavigation;function CLVPRestoreNavigation(){ULS_inplview();var a=window.location.hash,c=this.InplViewUrl(),b=this.RefreshCurrent(true);b=b.substr(c.length+1);if(a.indexOf("InplviewHash=")==1){a=DecodeHashAsQueryString(a);var d=a.substr(14,38);if(d!=this.ctx.view)return;a=a.substr(52);var e="?"+a;SubmitFormPost(e)}}CLVP.prototype.FindWebPartDiv=CLVPFindWebPartDiv;function CLVPFindWebPartDiv(b){ULS_inplview();var a=b;while(a!=null&&a.tagName!="DIV")a=a.parentNode;return a}CLVP.prototype.SyncPagingTables=CLVPSyncPagingTables;function CLVPSyncPagingTables(){ULS_inplview();var c=this.pagingTab,a=document.getElementById("topPagingCell"+this.wpq.substr(7));if(c==null){if(a!=null)a.style.display="none";return}if(a!=null){a.style.display="";if(GetInnerText(a)!=GetInnerText(c))a.innerHTML=c.innerHTML;var e=a.getElementsByTagName("A"),d=c.getElementsByTagName("A"),b=0;for(b=0;b<d.length;b++)e[b].onclick=d[b].onclick}}CLVP.prototype.ResetPaging=CLVPResetPaging;function CLVPResetPaging(b){ULS_inplview();var o=this,m=this.pagingTab,c=b.first,d=b.last,h=b.count,a=[],g=false,l=document.getElementById("FilterIFrame"+this.ctx.ctxId);if(b.rootFolder!=null)this.rootFolder=b.rootFolder;if(l!=null)l.setAttribute("FilterLink",b.filterLink);a.push("<table><tr>");if(c.length==0&&d.length==0)c="1";if(c.length>0){c=1*c;d=1*c+h-1}if(d.length>0){d=1*d;c=1*d-h+1}if(c>1){a.push('<td><a href="javascript:" onclick=\'javascript:SubmitFormPost("f?');a.push(b.prev);a.push("&PageLastRow=");a.push(c-1);a.push("\")'>");a.push(b.prevImg);a.push("</a></td>");g=true}if(h>0)a.push('<td class="ms-paging" nowrap="nowrap">'+c+"\u00a0-\u00a0"+d+"</td>");if(b.next.length>0){a.push('<td><a href="javascript:" onclick=\'javascript:SubmitFormPost("f?');a.push(b.next);a.push("&PageFirstRow=");a.push(d+1);a.push("\")'>");a.push(b.nextImg);a.push("</a></td>");g=true}a.push("</tr></table>");var j=a.join("");if(m!=null)m.innerHTML=j;else if(g){var n="bottomPagingCell"+this.wpq.substr(7),e=[];e.push("<table width='100%' class='ms-bottompaging'><tr><td class='ms-vb' align='center' id='");e.push(n);e.push("'>");e.push(j);e.push("</td></tr></table>");var f=GetAncestor(this.tab,"TABLE");if(f!=null)f=f.parentNode;if(f!=null){var i=document.createElement("DIV");i.innerHTML=e.join("");var k=i.getElementsByTagName("TABLE")[0];i.removeChild(k);f.appendChild(k);this.pagingTab=document.getElementById(n)}}this.RehookPaging()}CLVP.prototype.RehookPaging=CLVPRehookPaging;function CLVPRehookPaging(){ULS_inplview();if(typeof this.ctx.noAJAX!="undefined"&&this.ctx.noAJAX)return;var tab=this.pagingTab;if(tab==null){this.SyncPagingTables();return}var lnks=tab.getElementsByTagName("A"),i;for(i=0;i<lnks.length;i++){var lnk=lnks[i],str=""+lnk.onclick;str=str.substr(str.indexOf('"')+1);str=str.substr(0,str.indexOf('"'));if(this.tBody!=null)str+="&IsGroupRender=TRUE";var clvp=this;if(this.tBody!=null)eval('var tBodyId="'+this.tBody.id+'";');else eval("var tBodyId=null");eval('var strHref="'+str+'";');UpdateOnClick(lnk,clvp,strHref,tBodyId)}if(this.tBody==null)this.SyncPagingTables();function UpdateOnClick(d,c,b,a){ULS_inplview();d.onclick=function(){ULS_inplview();c.RefreshPaging(b,a);return false}}}CLVP.prototype.FilterString=CLVPFilterString;function CLVPFilterString(){ULS_inplview();if(this.rgpaging==null)return null;var a,d,b=[],c=true;for(a in this.rgpaging)if(a.indexOf("Filter")==0||a.indexOf("Sort")==0){if(c)c=false;else b.push("&");b.push(a);b.push("=");b.push(this.rgpaging[a])}return b.join("")}CLVP.prototype.RefreshPaging=CLVPRefreshPaging;function CLVPRefreshPaging(c,a,b){ULS_inplview();if(a!=null)this.tBody=document.getElementById(a);var d=this.isEditing?"JsGrid":null;return this.RefreshPagingEx(c,true,d,b)}CLVP.prototype.RefreshPagingEx=CLVPRefreshPagingEx;function CLVPRefreshPagingEx(e,q,p,t){ULS_inplview();var s=GetUrlKeyValue("PageFirstRow",false,e)=="1";if(s)e=RemoveOnlyPagingArgs(e);var v=new CUrl(e),h=v.query;if(h.length>0)h=h.substr(1);var i=h.split("&"),f,a=[];if(p!=null)a.push("&Cmd="+p);else if(this.isEditing)a.push("&Cmd=JsGrid");if(q||this.rgpaging=="undefined"||this.rgpaging==null){this.rgpaging=[];for(f=0;f<i.length;f++){var c=i[f].split("=");if(c[0]=="List"||c[0]=="View"||c[0]=="JsGrid"||c[0]=="ID"){delete c;continue}if(c.length>1)this.rgpaging[c[0]]=c[1];delete c;a.push("&");a.push(i[f])}}else{var d;for(d in this.rgpaging){if(d=="List"||d=="View"||d=="ID")continue;a.push("&");a.push(d);a.push("=");a.push(this.rgpaging[d])}}var n=document.getElementById("GroupByWebPartID"+this.ctx.ctxId);if(n!=null)a.push("&WebPartID="+n.getAttribute("webPartID"));if(this.strGroupName!=null){var j=GroupStringFromGroupName(this.strGroupName);if(j!=null)a.push("&DrillDown=1&GroupString="+j)}var k=new CUrl(this.InplViewUrl()),u=k.path,g=k.query;if(g.length>0)g=g.substr(1);var r=a.join("");delete a;var b=u+"?"+ReconcileQstringFilters(g,r);if(GetUrlKeyValue("SortField",true,b).length==0){var l=GetUrlKeyValue("SortField",true,window.location.href);if(l.length>0)b=SetUrlKeyValue("SortField",l,false,b);var m=GetUrlKeyValue("SortDir",true,window.location.href);if(m.length>0)b=SetUrlKeyValue("SortDir",m,false,b)}var o=GetUrlKeyValue("RootFolder",true,e);if(o.length>0&&GetUrlKeyValue("RootFolder",true,b).length==0)b=SetUrlKeyValue("RootFolder",o,false,b);if(t)return b;this.RefreshCore(b)}CLVP.prototype.ResetSelection=CLVPResetSelection;function CLVPResetSelection(){ULS_inplview();var a=this.ctx,f=true;this.CUIItemInfo=null;if(CountSelectedItems(a)>0){var h=a.dictSel;a.dictSel=[];a.CurrentSelectedItems=0;var g=window.location.href;if(g.indexOf("Filter")==-1&&g.indexOf("Sort")==-1){var e=this.tab;if(e){var d=e.rows,k=function(b){ULS_inplview();var a=b.getAttribute("iid");return a&&h[a]!=null},c=GetLastSelectableRowIdx(e,k);if(d&&c>0){var b;for(b=0;b<c;b++){var j=d[b],i=j.getAttribute("iid");if(i&&h[i]!=null)ToggleItemRowSelection2(a,j,true,false)}f=false;ToggleItemRowSelection2(a,d[c],true,true)}}}}UpdateSelectAllCbx(a,true);if(f)RefreshCommandUI()}CLVP.prototype.WebPartId=CLVPWebPartId;function CLVPWebPartId(){ULS_inplview();if(this.wpid==null){if(this.tab!=null){var a=this.tab;a=GetAncestor(a,"DIV");if(a!=null){if(a.getAttribute("WebPartID2")!=null){this.wpid=a.getAttribute("WebPartID2");return this.wpid}if(a.getAttribute("WebPartID")!=null){this.wpid=a.getAttribute("WebPartID");return this.wpid}}}this.wpid=this.ctx.view.toLowerCase().substring(1,this.ctx.view.length-2)}return this.wpid}CLVP.prototype.RefreshCore=CLVPRefreshCore;function CLVPRefreshCore(strUrl){ULS_inplview();MenuHtc_hide();var notificationId=addNotification(SP.Res.genericLoading,true,null,null),req;if(window.XMLHttpRequest)req=new XMLHttpRequest;else req=new ActiveXObject("Microsoft.XMLHTTP");var additionalPostData=null;if(typeof this.ctx.overrideSelectCommand=="undefined")req.open("GET",strUrl,true);else{req.open("POST",strUrl,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");additionalPostData="OverrideSelectCommand="+this.ctx.overrideSelectCommand}var clvp=this;clvp.focusInfo=null;clvp.bRequestOutstanding=true;if(focusAcc!=null&&focusAcc.focusInCLVPTab!=null)clvp.focusInfo=focusAcc;var strHash="InplviewHash="+this.ctx.view+this.InplViewUrlTrim(strUrl);strHash=EncodeQueryStringAsHash(strHash);if(strHash.indexOf("?")>=0)debugger;req.onreadystatechange=function(){ULS_inplview();if(req.readyState==4){removeNotification(notificationId);try{req.onreadystatechange=null}catch(e){}clvp.bRequestOutstanding=false;var strInner=req.responseText;if(req.status==601){alert(req.responseText);return}if(clvp.isEcbInfo){clvp.CacheEcbInfo(strInner);clvp.isEcbInfo=false;clvp.strGroupName=null;if(clvp.queueEcbInfo.length>0)while(clvp.EnsureEcbInfo(null,null,clvp.queueEcbInfo.shift())!=null&&clvp.queueEcbInfo.length>0);return}if(clvp.isValidating){eval(strInner);var ve=clvp.qvalidate.shift();if(validated.length==0)ve.callback({isValid:true,dataValue:null,normalizedLocValue:ve.newval,hasLocValue:true,hasDataValue:true});else if(validated.length==1){var v=validated[0];ve.callback({isValid:true,dataValue:v.data,normalizedLocValue:v.localized,hasLocValue:true,hasDataValue:true})}else{var rgd=[],rgl=[],j;for(j=0;j<validated.length;j++){var v2=validated[j];rgd.push(v2.data);rgl.push(v2.localized)}ve.callback({isValid:true,dataValue:rgd.join(";#"),normalizedLocValue:rgl.join("; "),hasLocValue:true,hasDataValue:true})}if(clvp.qvalidate.length==0)clvp.isValidating=false;else{ve=clvp.qvalidate[0];clvp.RefreshCore(ve.strCmd)}return}if(clvp.isEditing){clvp.SwitchToGrid(strInner);return}if(clvp.grid!=null){clvp.CommitChanges();clvp.grid.Dispose();clvp.grid=null}if(clvp.tBody==null){SetUrlHash(strHash);var fnHideListViewRows=window.HideListViewRows;window.HideListViewRows=Noop}var div=document.createElement("DIV"),tid=clvp.tab.id;if(clvp.tab.tagName=="DIV")tid=clvp.tab.tabid;var pid=clvp.pagingTab!=null?clvp.pagingTab.id:null;div.style.visibility="hidden";div.innerHTML=strInner;var oldFilterIfrm=document.getElementById("FilterIframe"+clvp.ctx.ctxId),newIfrms=div.getElementsByTagName("IFRAME"),idx,newFilterIfrm=null;for(idx=0;idx<newIfrms.length;idx++)if(newIfrms[idx].id=="FilterIframe"+clvp.ctx.ctxId){newFilterIfrm=newIfrms[idx];break}if(oldFilterIfrm!=null&&newFilterIfrm!=null){var td=oldFilterIfrm.parentNode;td.removeChild(oldFilterIfrm);td.appendChild(newFilterIfrm)}document.body.appendChild(div);eval("ctx"+clvp.ctx.ctxId+".clvp=clvp;");var rgscripts=ExpColGroupScripts(strInner),ppid="previewpanetable"+clvp.ctx.ctxId,ppold=document.getElementById(ppid);if(ppold!=null)ppold.id="";clvp.tab.id="";var hid=document.getElementById("hidRootFolder");if(hid!=null){clvp.rootFolder=hid.value;if(hid.value.indexOf("?")>=0)debugger}var hidFolderGuid=document.getElementById("hidRootFolderGuid");if(hidFolderGuid!=null)clvp.rootFolderGuid=hidFolderGuid.value;var tabs=GetElementsByName(tid);if(tabs.length==0)if(tid=="onetidDoclibViewTbl0")tabs=GetElementsByName(clvp.ctx.listName+"-"+clvp.ctx.view);else tabs=GetElementsByName("onetidDoclibViewTbl0");var tabNew=null,pagNew=document.getElementById("bottomPagingCell"),trNew=null;if(tabs.length==1)tabNew=tabs[0];else{var i;for(i=0;i<tabs.length;i++){tabNew=tabs[i];var divNew=clvp.FindWebPartDiv(tabNew);if(divNew==div)break}if(i==tabs.length)tabNew=null}if(tabNew==null){SwapNode(clvp.tab,div);div.style.visibility="visible";return}if(tabNew.className=="ms-emptyView"){trNew=GetAncestor(tabNew,"TR");trNew=trNew.nextSibling}var groupRender=false;if(clvp.tBody!=null){groupRender=true;if(clvp.tBody.getAttribute("isLoaded")!=null){clvp.tBody.setAttribute("isLoaded","true");clvp.tab.id=tid;if(!clvp.tab.onmouseover)clvp.tab.onmouseover=clvp.ctx.TableMouseoverHandler;if(clvp.ctx.SelectAllCbx&&!clvp.ctx.SelectAllCbx.onfocus)clvp.ctx.SelectAllCbx.onfocus=clvp.ctx.TableCbxFocusHandler;if(!clvp.ctx.StateInitDone)ctxInitItemState(clvp.ctx);var objChildren=clvp.tBody.childNodes;for(var i=objChildren.length-1;i>=0;i--){var objToRemove=objChildren.item(i);if(objToRemove.tagName=="TR"&&ItemIsSelectable(objToRemove))clvp.ctx.TotalListItems--;clvp.tBody.removeChild(objToRemove)}var selectableNodes=0,tBodyArray=tabNew.getElementsByTagName("TBODY");if(tBodyArray.length>=1){objChildren=tBodyArray[0].childNodes;var node=null;for(var i=objChildren.length-1;i>=1;i--){var objToInsert=objChildren.item(i);if(objToInsert.tagName=="TR"&&ItemIsSelectable(objToInsert)){selectableNodes++;clvp.ctx.TotalListItems++}node=clvp.tBody.insertBefore(objToInsert,node)}if(pagNew!=null){var pagingTable=GetAncestor(pagNew,"TABLE"),curPagTab=clvp.tBody.nextSibling;if(curPagTab==null||curPagTab.tagName!="TBODY"||curPagTab.id!=clvp.tBody.id+"page"||curPagTab.firstChild==null||curPagTab.firstChild.tagName!="TR"){curPagTab=document.createElement("TBODY");curPagTab.id=clvp.tBody.id+"page";curPagTab=clvp.tBody.parentNode.insertBefore(curPagTab,clvp.tBody.nextSibling);var tr=document.createElement("TR");tr=curPagTab.appendChild(tr)}var trNode=curPagTab.firstChild;if(trNode.firstChild!=null)trNode.removeChild(trNode.firstChild);pagNew.colSpan=100;pagNew.id=pagNew.id+clvp.wpq.substr(7)+clvp.tBody.id;pagNew=trNode.appendChild(pagNew)}clvp.tBody.setAttribute("selectableRows",selectableNodes);UpdateCtxLastSelectableRow(clvp.ctx,clvp.tab)}clvp.InvalidateEcbInfo();clvp.ResetSelection()}}if(!groupRender){g_ExpGroupNeedsState=false;g_ExpGroupTable=[];SwapNode(clvp.tab,tabNew);if(clvp.tab.clvp!=null)clvp.tab.clvp=null;delete clvp.tab;clvp.tab=tabNew;clvp.tab.id=tid;clvp.tab.clvp=clvp;if(clvp.pagingTab!=null&&pagNew!=null)SwapNode(clvp.pagingTab,pagNew);else if(clvp.pagingTab!=null&&pagNew==null){var tabC=GetAncestor(clvp.pagingTab,"TABLE");tabC.parentNode.removeChild(tabC);clvp.pagingTab=null}else if(clvp.pagingTab==null&&pagNew!=null){var tabPaging=GetAncestor(pagNew,"TABLE"),tabParent=GetAncestor(tabNew,"TABLE");tabPaging.parentNode.removeChild(tabPaging);tabParent.parentNode.appendChild(tabPaging);pagNew=document.getElementById("bottomPagingCell");pid="bottomPagingCell"+clvp.wpq.substr(7)}if(clvp.pagingTab!=null)delete clvp.pagingTab;clvp.pagingTab=pagNew;if(clvp.pagingTab!=null&&pid!=null)clvp.pagingTab.id=pid;if(clvp.trEmpty==null&&trNew!=null){var tb=GetAncestor(clvp.tab,"TBODY");trNew.parentNode.removeChild(trNew);tb.appendChild(trNew);clvp.trEmpty=trNew}else if(clvp.trEmpty!=null&&trNew==null){clvp.trEmpty.parentNode.removeChild(clvp.trEmpty);clvp.trEmpty=null}if(clvp.fRestore){clvp.fRestore=false;RemoveCssClassFromElement(clvp.tab,"s4-hide-tr")}}document.body.removeChild(div);if(!groupRender){clvp.RehookPaging();var strScript=rgscripts.join("");if(strScript.length>0)eval(strScript);if(typeof ExpGroupOnPageLoad!="undefined")ExpGroupOnPageLoad(typeof clvp.ctx.isXslView!="undefined"&&clvp.ctx.isXslView?"true":null)}else if(pagNew!=null){var tab=clvp.pagingTab;clvp.pagingTab=pagNew;clvp.RehookPaging();clvp.pagingTab=tab}if(typeof ProcessImn!="undefined"){imnCount=0;bIMNOnloadAttached=false;ProcessImn()}if(!groupRender){clvp.ResetSelection();window.HideListViewRows=fnHideListViewRows}else{clvp.tBody=null;g_ExpGroupInProgress=false;if(g_ExpGroupQueue.length>0)ExpGroupFetchData(g_ExpGroupQueue.shift(),typeof clvp.ctx.isXslView!="undefined"&&clvp.ctx.isXslView?"true":null)}if(!g_ExpGroupInProgress&&clvp.queueEcbInfo.length>0)clvp.EnsureEcbInfo(null,null,clvp.queueEcbInfo.shift());if(clvp!=null&&clvp.focusInfo!=null)if(clvp.focusInfo.focusInCLVPTab!=null&&clvp.focusInfo.focusInCLVPTab==true){var focusTabl=clvp.tab,focusBack=null;if(focusTabl!=null&&clvp.focusInfo.tagName!=null&&clvp.focusInfo.id!=null){var focusArray=focusTabl.getElementsByTagName(clvp.focusInfo.tagName);for(var i=0;i<focusArray.length;i++)if(focusArray[i].id==clvp.focusInfo.id){focusBack=focusArray[i];break}}if(focusBack!=null&&focusBack.tagName!="A"){var anchorList=focusBack.getElementsByTagName("A"),anchorListLen=anchorList.length;if(anchorListLen>0)focusBack=anchorList[anchorListLen-1]}if(focusBack!=null)if(focusBack.setActive!=null)focusBack.setActive();else if(focusBack.focus!=null)focusBack.focus();focusAcc=null}}if(typeof CLVPRefreshed!="undefined")CLVPRefreshed()};req.send(additionalPostData)}CLVP.prototype.GetSaveLocation=CLVPGetSaveLocation;function CLVPGetSaveLocation(a){ULS_inplview();return a}CLVP.prototype.RefreshCurrent=CLVPRefreshCurrent;function CLVPRefreshCurrent(){ULS_inplview();if(this.ctx.isCalendarView){var a=SP.UI.ApplicationPages.CalendarInstanceRepository.lookupInstance(this.ctx.ctxId);if(a)a.refreshItems()}else{var b=document.URL;STSNavigate(b)}}CLVP.prototype.RefreshEcbInfo=CLVPRefreshEcbInfo;function CLVPRefreshEcbInfo(b){ULS_inplview();var a=document.URL;a=FixUrlFromClvp2(this,a,false);this.isEcbInfo=true;this.strGroupName=b;var c=this;this.RefreshPagingEx(a,false,"EcbView")}CLVP.prototype.CacheEcbInfo=CLVPCacheEcbInfo;function CLVPCacheEcbInfo(j){ULS_inplview();var f=document.createElement("DIV");f.innerHTML=j;f.style.display="none";var h=f.getElementsByTagName("TABLE"),a,d,b=null;if(this.strGroupName!=null)var k="ecbtab_ctx"+this.ctx.ctxId,b=document.getElementById(k);for(d=0;d<h.length;d++){a=h[d];if(a.id==this.tab.id){if(b==null)a.id="ecbtab_ctx"+this.ctx.ctxId;else a.id="ecbtab_ctx"+this.ctx.ctxId+"_"+this.strGroupName;if(a.rows.length>0&&a.rows[0].className=="ms-viewheadertr")a.deleteRow(0);a.style.display="none";if(this.tab!=null)this.tab.appendChild(a);var c;if(b==null)c=[];else c=b.dict;var i=a.getElementsByTagName("DIV"),e;for(e=0;e<i.length;e++){var g=i[e];if(g.id!="")c[g.id]=g}if(b==null)a.dict=c;if(this.strGroupName!=null)this.CacheGroupName(this.strGroupName);break}}if(this.fnEcbCallback!=null&&this.queueEcbInfo.length==0){this.fnEcbCallback(a);this.fnEcbCallback=null}}CLVP.prototype.EnsureEcbInfo=CLVPEnsureEcbInfo;function CLVPEnsureEcbInfo(b,d,a){ULS_inplview();var e="ecbtab_ctx"+this.ctx.ctxId,c=document.getElementById(e);if(c&&a!=null)if(!this.IsInGroupCache(a))c=null;if(c!=null){if(b&&this.NoOutstandingECBRequests())b(d);return c}if(b!=null&&this.fnEcbCallback==null)this.fnEcbCallback=function(){ULS_inplview();b(d)};if(this.isEcbInfo||this.bRequestOutstanding){if(!this.isEcbInfo||a!=null&&a!=this.strGroupName)this.EnqueueEcbInfoRequest(a);return null}this.RefreshEcbInfo(a);return null}CLVP.prototype.InvalidateEcbInfo=CLVPInvalidateEcbInfo;function CLVPInvalidateEcbInfo(){ULS_inplview();var b="ecbtab_ctx"+this.ctx.ctxId,a=document.getElementById(b);if(a!=null){this.tab.removeChild(a);this.DeleteGroupNameCache()}}CLVP.prototype.GetEcbInfo=CLVPGetEcbInfo;function CLVPGetEcbInfo(b){ULS_inplview();var a=this.EnsureEcbInfo();if(a!=null)if(a.dict!=null)return a.dict[b];return null}CLVP.prototype.SwitchToEdit=CLVPSwitchToEdit;function CLVPSwitchToEdit(){ULS_inplview();var a=document.URL;a=FixUrlFromClvp2(this,a,false);this.RefreshPagingEx(a,false,"JsGrid")}CLVP.prototype.EnsureChangeContext=CLVPEnsureChangeContext;function CLVPEnsureChangeContext(){ULS_inplview();if(this.cctx==null)this.cctx=new SP.ClientContext(null)}CLVP.prototype.CollectChange=CLVPCollectChange;function CLVPCollectChange(e){ULS_inplview();this.EnsureChangeContext();var d=e.recordKey,l=this.tc.GetCachedRecord(d),j=1*l.GetDataValue("FSObjType"),a=null;if(d==null||d=="0"){a=this.pendingItems[d];if(a==null){var k=new SP.ListItemCreationInformation;k.set_folderUrl(this.rootFolder);a=this.cctx.get_web().get_lists().getById(this.ctx.listName).addItem(k);a.retrieve("ID");this.isInserting=true}d=0}else{if(j==1)a=this.cctx.get_web().get_lists().getById(this.ctx.listName).getItemById(d);else a=this.cctx.get_web().get_lists().getById(this.ctx.listName).getItemById(d);a.set_objectVersion(""+l.GetDataValue("owshiddenversion"))}var n=e.oldProp,b=e.newProp,g;if(e.propType.ID=="SPUrl"){var i=n.data,f=i!=null?i.indexOf(", "):0,c=i,h="";if(f>0){c=i.substr(0,f);h=i.substr(f+2)}if(b.HasLocalizedValue())h=b.localized;if(b.HasDataValue()){c=b.data;if(c!=null){f=c.indexOf(", ");if(f>0){h=c.substr(f+2);c=c.substr(0,f)}}}g=c+", "+h;b.localized=h}else if(e.propType.ID=="SPUser")if(b.HasDataValue())g=b.data;else return;else g=b.localized;if(j==1&&e.fieldKey=="Title"){var m=this.ctx.listBaseType==1;a.set_item("FileLeafRef",g);if(!m)a.set_item("Title",g)}else a.set_item(e.fieldKey,g);this.changePending=true;this.pendingItems[d]=a}CLVP.prototype.DeleteItemCore=CLVPDeleteItemCore;function CLVPDeleteItemCore(d,h,b){ULS_inplview();if(b)throw"";var j=this.ctx.listBaseType==1;this.EnsureChangeContext();var a=null;if(typeof this.rgehs=="undefined")this.rgehs=[];var c,f;if(!b){c=new SP.ExceptionHandlingScope(this.cctx);this.rgehs.push(c);f=c.startScope()}this.cctx.get_pendingRequest().set_navigateWhenServerRedirect(true);var e=this.cctx.get_web().get_lists().getById(this.ctx.listName);if(this.ctx.ExternalDataList)a=e.getItemById(d.toString());else if(h==1)a=e.getItemById(parseInt(d));else a=e.getItemById(parseInt(d));if(!b&&j){a.retrieve("FileLeafRef");c.itmContext=a}var i=this.ctx.RecycleBinEnabled&&!this.ctx.ExternalDataList;if(i)a.recycle();else a.deleteObject();if(b){var k=this,l=SP.Res.processingRequest,g=addNotification(l,true);this.cctx.executeQuery(function(){ULS_inplview();k.RefreshCurrent();removeNotification(g)},function(b,a){ULS_inplview();alert(a.get_message());removeNotification(g)})}else{this.changePending=true;f.dispose()}}CLVP.prototype.CheckoutItem=CLVPCheckoutItem;function CLVPCheckoutItem(f,d){ULS_inplview();this.EnsureChangeContext();if(typeof this.rgehs=="undefined")this.rgehs=[];var a,c,b=null;if(d!=0)return;a=new SP.ExceptionHandlingScope(this.cctx);this.rgehs.push(a);c=a.startScope();b=this.cctx.get_web().get_lists().getById(this.ctx.listName).getItemById(f);b.retrieve("FileLeafRef");a.itmContext=b;var e=b.get_file();e.checkOut();c.dispose();this.changePending=true}CLVP.prototype.DiscardCheckoutItem=CLVPDiscardCheckoutItem;function CLVPDiscardCheckoutItem(e,g){ULS_inplview();this.EnsureChangeContext();if(typeof this.rgehs=="undefined")this.rgehs=[];var b=null,a,f;if(g!=0)return;a=new SP.ExceptionHandlingScope(this.cctx);this.rgehs.push(a);f=a.startScope();b=this.cctx.get_web().get_lists().getById(this.ctx.listName).getItemById(e);b.retrieve("FileLeafRef");a.itmContext=b;var h=b.get_file(),c=this.GetEcbInfo(e);if(c!=null&&c.getAttribute("COut")=="1")try{var i=this.ctx.HttpRoot+c.getAttribute("Url"),d=StsOpenEnsureEx("SharePoint.OpenDocuments.3");if(d!=null)d.DiscardLocalCheckout(i)}catch(j){}else h.undoCheckOut();this.changePending=true;f.dispose()}CLVP.prototype.CheckinItem=CLVPCheckinItem;function CLVPCheckinItem(g,j,a){ULS_inplview();this.EnsureChangeContext();if(typeof this.rgehs=="undefined")this.rgehs=[];var c=null,b,h;if(j!=0)return;b=new SP.ExceptionHandlingScope(this.cctx);this.rgehs.push(b);h=b.startScope();c=this.cctx.get_web().get_lists().getById(this.ctx.listName).getItemById(g);c.retrieve("FileLeafRef");b.itmContext=c;var f=c.get_file(),e=this.GetEcbInfo(g);if(e!=null&&e.getAttribute("COut")=="1")try{var i=this.ctx.HttpRoot+e.getAttribute("Url"),d=StsOpenEnsureEx("SharePoint.OpenDocuments.3");if(d!=null)if(a.kco)d.CheckinDocument(i,a.cit,a.cmt,true);else d.CheckinDocument(i,a.cit,a.cmt)}catch(k){}else{f.checkIn(a.cmt,a.cit);if(a.kco)f.checkOut();this.changePending=true}h.dispose()}CLVP.prototype.CommitChanges=CLVPCommitChanges;function CLVPCommitChanges(){ULS_inplview();var a=this,d=false;if(this.cctx!=null&&this.changePending){var c;for(c in this.pendingItems){var e=this.pendingItems[c];if(c>0||this.isInserting){e.update();e.retrieve("owshiddenversion")}}var b;if(a._isDelete){b=SP.Res.processingRequest;a._isDelete=false}else b=SP.Res.sending;var f=addNotification(b,true);this.cctx.executeQuery(function(){ULS_inplview();a.OnChangeCommitted();removeNotification(f);if(a.isInserting){a.isInserting=false;var c=null,d=[],g=a.dsrc.recordFactory;for(var b in a.pendingItems)if(!a.SetItemVersionInGrid(b)){var e=a.pendingItems[b];c=e.get_item("ID");rec=g.MakeRecord({ID:c},{ID:c});rec.AddFieldValue("owshiddenversion",{hasData:true,data:1});d.push(rec)}a.pendingItems=[];if(a.callbackOnCreate!=null)a.callbackOnCreate(d);a.callbackOnCreate=null}else{for(var b in a.pendingItems)a.SetItemVersionInGrid(b);a.pendingItems=[]}if(!a.isEditing)a.RefreshCurrent();if(typeof a.rgehs!="undefined")a.ShowErrorDialog()});d=true}this.changePending=false;return d}CLVP.prototype.ManageCopies=CLVPManageCopies;function CLVPManageCopies(itemId,fsobjtype){ULS_inplview();if(fsobjtype!=0)return;var ecb=this.GetEcbInfo(itemId);if(ecb!=null&&ecb.getAttribute("Url")!=null){var url=this.ctx.HttpRoot+"/_layouts"+"/managecopies.aspx?ItemUrl="+ecb.getAttribute("Url")+"&Source="+GetSource();eval("var ctxT=ctx"+this.ctx.ctxId+";");if(ctxT!=null&&ctxT.clvp!=null){var clvp=ctxT.clvp,urlT=FixUrlFromClvp(clvp,url);if(FV4UI()){clvp.ShowPopup(urlT);return}}STSNavigate(url)}}CLVP.prototype.ShowErrorDialog=CLVPShowErrorDialog;function CLVPShowErrorDialog(){ULS_inplview();var f,a=[],d=false;for(f in this.rgehs){var b=this.rgehs[f];if(b.get_hasException()){if(!d){d=true;a.push(SP.Res.dlgTitleError);a.push("<ul>")}var h=b.get_errorMessage();a.push('<li class="s4-dlg-err-li">');if(typeof b.itmContext!="undefined")try{a.push(b.itmContext.get_item("FileLeafRef"));a.push(": ")}catch(i){}a.push(h);a.push("</li>")}}if(d){a.push("</ul><div id='dlgDivButton'><button class='ms-ButtonHeightWidth' onclick='DismissErrDlg(this)'>");a.push(SP.Res.okButtonCaption);a.push("</button></div>")}var e=a.join("");if(e.length>0){var c=document.createElement("DIV");c.className="s4-dlg-err";c.innerHTML=e;var g={html:c,title:this.dlgTitle,height:326},j=new SP.UI.ModalDialog.showModalDialog(g)}this.rgehs=[]}CLVP.prototype.SetItemVersionInGrid=CLVPSetItemVersionInGrid;function CLVPSetItemVersionInGrid(a){ULS_inplview();if(a>0){var b=this.pendingItems[a],d=b.get_objectVersion(),c=this.tc.GetCachedRecord(a);c.AddFieldValue("owshiddenversion",{hasData:true,data:d});return true}return false}CLVP.prototype.OnChangeCommitted=CLVPOnChangeCommitted;function CLVPOnChangeCommitted(){ULS_inplview();if(this.callbackOnCommit!=null){var a=this.callbackOnCommit;this.callbackOnCommit=null;a();delete a}}CLVP.prototype.RememberColumnWidth=CLVPRememberColumnWidth;function CLVPRememberColumnWidth(){ULS_inplview();var a=this.tab,f=a!=null&&a.tagName=="TABLE";if(!f){a=document.getElementById(a.id+"_leftpane");a=a.getElementsByTagName("TABLE")[0]}var d=a.getElementsByTagName("TH"),c=[],b=1;for(;b<d.length;b++){var e=d[b],g=e.parentNode;if(!f||g.className!=null&&g.className.indexOf("ms-viewheadertr")>=0)c.push(e.offsetWidth)}this.rgdxcol=c}function GetColumnMenuHandler(a){ULS_inplview();return function(c,d,b){ULS_inplview();a.ShowColumnMenu(c,d,b)}}function GetCollectChangeHandler(a){ULS_inplview();return function(b){ULS_inplview();a.CollectChange(b)}}function GetCommitChangeHandler(a){ULS_inplview();return function(b){ULS_inplview();a.CommitChanges(b)}}function GetGridKeydownHandler(a){ULS_inplview();return function(b){ULS_inplview();a.GridKeydown(b)}}function GetItemCreator(a){ULS_inplview();return function(c,b){ULS_inplview();a.CreateItems(c,b)}}CLVP.prototype.CreateItems=CLVPCreateItems;function CLVPCreateItems(e,d){ULS_inplview();var g=this;this.EnsureChangeContext();if(this.cctx!=null){var b=new SP.ListItemCreationInformation;b.set_folderUrl(this.rootFolder);var f=this.cctx.get_web().get_lists().getById(this.ctx.listName),a;for(a=0;a<e;a++){var c=f.addItem(b);c.retrieve("ID");this.pendingItems[0-a]=c}this.changePending=true;this.isInserting=true;this.callbackOnCreate=d;this.CommitChanges()}}CLVP.prototype.GridKeydown=CLVPGridKeydown;function CLVPGridKeydown(g){ULS_inplview();var j=g.keyCode;if(j==Sys.UI.Key.del){var f=this.grid,c=f.GetSelectedRowRanges();if(c!=null&&c.length>0){var d;for(d=0;d<c.length;d++){var b=c[d],a;for(a=0;b.keys!=null&&a<b.keys.length;a++){var e=b.keys[a];if(e==0){b.keys.splice(a,1);continue}var i=this.tc.GetCachedRecord(e),h=1*i.GetDataValue("FSObjType");this.DeleteItemCore(e,h,false)}f.DeleteRecords(b.keys)}this.CommitChanges()}g.stopPropagation();return true}return false}CLVP.prototype.SwitchToGrid=CLVPSwitchToGrid;function CLVPSwitchToGrid(str){ULS_inplview();eval(str);var draw=res.dsrc;this.mpFld2Col=res.mpFld2Col;this.ResetPaging(res.pinfo);this.RememberColumnWidth();res=null;var iframe=document.getElementById("FilterIframe"+this.ctx.ctxId);if(iframe!=null)iframe=iframe.cloneNode(false);if(this.grid!=null){this.CommitChanges();this.grid.Dispose();this.gridParam.fnExpandColumnMenu=null;delete this.grid;this.grid=null;if(this.dsrc!=null)delete this.dsrc;this.dsrc=null}var crow=draw["LocalizedTable"]!=null?draw["LocalizedTable"].length:0,height=this.tab.offsetHeight+(this.tab.tagName=="DIV"?0:16)+"px";if(crow>0)height=crow*23+30+"px";var div=document.createElement("DIV");if(this.tab.tabid!=null)div.tabid=this.tab.tabid;else{div.tabid=this.tab.id;this.tabRead=this.tab}if(iframe!=null)div.appendChild(iframe);div.id="grid"+this.ctx.ctxId;div.style.width=this.tab.offsetWidth+"px";if(height!=null)div.style.height=height;div.clvp=this;if(this.ctx.isJsGrid){var tr=GetAncestor(this.tab,"TR");if(tr.nextSibling!=null)tr.nextSibling.style.display="none"}this.tab.parentNode.replaceChild(div,this.tab);var jgrid=new SP.JsGrid.JsGridControl(div,false);RegisterFieldTypeForEdit();var dsrc=new SP.JsGrid.StaticDataSource(draw);draw=null;this.dsrc=dsrc;dsrc=null;var clvp=this,jsGridParams=new SP.JsGrid.JsGridControl.Parameters;jsGridParams.fnExpandColumnMenu=GetColumnMenuHandler(clvp);if(this.ctx.listBaseType!=1){jsGridParams.fnCreateNewRecords=GetItemCreator(clvp);jsGridParams.tableViewParams.bNewRowEnabled=true}this.dsrc.InitJsGridParams(jsGridParams);var customFieldInfo=this.dsrc.GetAdditionalParams().CustomFieldInfo,cols=jsGridParams.tableViewParams.columns.GetColumnArray(),gfMap=jsGridParams.tableViewParams.gridFieldMap,i=0,_this=this;for(;true;){var col=cols[i];if(col==null)break;var fld=gfMap[col.columnKey],propType=fld.GetPropType();if(propType!=null)propType.clvp=this;if(propType.ID=="SPIcon"&&fld.key!="Attachments")col.fnOnCellContentsClicked=HandleJsGridCellContentClick;if(propType.ID=="SPChoice"){var ptNew=new SPChoice,temp=function(propType){ULS_inplview();var str="SPChoice_ "+fld.key;eval(customFieldInfo[fld.key]);ptNew.ID=str;ptNew.GetItems=function(){ULS_inplview();var b=[];for(var a in choice)b.push(SP.JsGrid.Property.MakeProperty(choice[a].value,choice[a].localString,true,true,propType));return b};ptNew.LocalizedToData=function(b){ULS_inplview();for(var a in choice)if(choice[a].localString==b)return choice[a].value;return null};ptNew.DataToLocalized=function(b){ULS_inplview();for(var a in choice)if(choice[a].value==b)return choice[a].localized;return null}}(ptNew);SP.JsGrid.PropertyType.RegisterNewDerivedCustomPropType(ptNew,"SPChoice");fld.SetSingleValuePropType(ptNew)}if(this.rgdxcol!=null)col.width=this.rgdxcol[i];i++}jgrid.Init(jsGridParams);this.tc=jsGridParams.tableCache;this.grid=jgrid;this.gridParam=jsGridParams;div.style.height="auto";var tabGrid=document.getElementById(div.id+"_leftpane_mainTable");if(tabGrid!=null)var dt=tabGrid.parentNode;jgrid.AttachEvent(SP.JsGrid.EventType.OnRowFocusChanged,GetCommitChangeHandler(clvp));jgrid.AttachEvent(SP.JsGrid.EventType.OnPropertyChanged,GetCollectChangeHandler(clvp));$addHandler(div,"keydown",GetGridKeydownHandler(clvp));if(this.tab.clvp!=null)this.tab.clvp=null;this.tab=null;this.tab=div;this.pendingItems=[]}var _v_rgflterAttr=["SortDisable","FilterDisable","Filterable","name","CtxNum","DisplayName","FieldType","ResultType","SortScript","SortFields"];CLVP.prototype.ShowColumnMenu=CLVPShowColumnMenu;function CLVPShowColumnMenu(k,r,l){ULS_inplview();var h=this.tabRead.rows[0],d,a,f,e,i,c,g,j=this.mpFld2Col[k.toLowerCase()];if(j==null)j=k;for(a=0;a<h.cells.length;a++){d=h.cells[a];e=d.getElementsByTagName("TABLE");if(e.length==0)e=d.getElementsByTagName("DIV");if(e.length>0){f=e[0];i=f.getAttribute("name");if(i==j)break;f=null}}g=document.getElementById(this.tab.id+"_leftpane");if(g!=null){g=g.getElementsByTagName("TABLE")[0];h=g.rows[0];for(a=0;a<h.cells.length;a++){d=h.cells[a];i=d.getAttribute("thColumnKey");if(i==k){c=d;break}}}var m=false;if(f!=null&&c!=null)for(a=0;a<_v_rgflterAttr.length;a++){var n=_v_rgflterAttr[a],p=f.getAttribute(n);if(p!=null)m=true;c.setAttribute(n,p)}filterTable=c;filterImageCell=c;ctxFilter=this.ctx;fnOnFilterMouseOut=l;if(c!=null&&m){var q=getFilterQueryParam().split("&"),b=c.getAttribute("SortFields");if(b!=null){if(b.indexOf("?")>0)b=b.substr(b.indexOf("?")+1);b="f?"+b;for(a=1;a<q.length;a++){var o=q[a].split("=");b=SetUrlKeyValue(o[0],o[1],true,b)}c.setAttribute("SortFields",b.substr(2))}CreateFilterMenu(null)}else{alert("no menu");l()}}CLVP.prototype.InplViewUrl=CLVPInplViewUrl;function CLVPInplViewUrl(){ULS_inplview();if(this.inplUrl!=null)return this.inplUrl;var a=[],b=escapeUrlForCallback(this.ctx.HttpRoot);a.push(b);if(b[b.length-1]!="/")a.push("/");a.push("_layouts/inplview.aspx?List=");a.push(this.ctx.listName);if(this.ctx.view!=null){a.push("&View=");a.push(this.ctx.view)}a.push("&ViewCount=");a.push(this.ctx.ctxId);a.push("&ListViewPageUrl=");var c=new CUrl(document.URL);a.push(escapeProperlyCore(c.path,true));if(typeof this.ctx.isXslView!="undefined"&&this.ctx.isXslView)a.push("&IsXslView=TRUE");if(typeof this.ctx.overrideSelectCommand!="undefined")a.push("&HasOverrideSelectCommand=TRUE");if(typeof this.ctx.overrideScope!="undefined")a.push("&OverrideScope="+this.ctx.overrideScope);if(typeof this.ctx.overrideFilterQstring!="undefined"){a.push("&");a.push(this.ctx.overrideFilterQstring)}this.inplUrl=a.join("");delete a;return this.inplUrl}CLVP.prototype.InplViewUrlTrim=CLVPInplViewUrlTrim;function CLVPInplViewUrlTrim(a){ULS_inplview();var b="";if(a)if(typeof this.ctx.overrideFilterQstring!="undefined")b=a.substr(this.InplViewUrl().length-this.ctx.overrideFilterQstring.length);else b=a.substr(this.InplViewUrl().length+1);return b}CLVP.prototype.ShowPopup=CLVPShowPopup;function CLVPShowPopup(a){ULS_inplview();MenuHtc_hide();if(typeof this.fnOnCommitPopup!="undefined"&&this.fnOnCommitPopup!=null)OpenPopUpPage(a,this.fnOnCommitPopup);else OpenPopUpPage(a,RefreshPage);return false}CLVP.prototype.ValidateField=CLVPValidateField;function CLVPValidateField(e,d,a,b){ULS_inplview();var c=this.FieldCommand("FldValidate",e,d,a,b),f={callback:a,newval:b,strCmd:c};if(this.qvalidate==null)this.qvalidate=[];this.qvalidate.push(f);if(!this.isValidating){this.isValidating=true;this.RefreshCore(c)}}CLVP.prototype.FieldCommand=CLVPFieldCommand;function CLVPFieldCommand(j,h,e,m,f){ULS_inplview();var a=[];a.push(this.InplViewUrl());a.push("&Cmd=");a.push(j);a.push("&Field=");a.push(e);a.push("&FieldValue=");var b=h.GetProp(e),d,n=this.gridParam.tableViewParams.columns.GetColumnByKey(e),k=jsGridParams.tableViewParams.gridFieldMap[e],l=b==null?k.GetPropType():b.propType;if(f!=null)if(l.ID=="SPUser"){var g=f.split(";"),c;for(c=0;c<g.length;c++){if(c>0)a.push(";%23");a.push("-1;%23");a.push(g[c])}}else a.push(f);else if(b!=null&&b.HasDataValue()){d=b.GetData();if(b.propType.ID=="SPUser")d=d.substr(0,d.indexOf(";#"));a.push(d)}else if(b!=null&&b.HasLocalizedValue()){if(b.propType.ID=="SPUser")a.push("-1;%23");a.push(b.GetLocalized())}var i=a.join("");return i}CLVP.prototype.IsInGroupCache=CLVPIsInGroupCache;function CLVPIsInGroupCache(a){ULS_inplview();if(this.strGroupCache==null)return false;return this.strGroupCache.indexOf(a+"$")!=-1}CLVP.prototype.CacheGroupName=CLVPCacheGroupName;function CLVPCacheGroupName(a){ULS_inplview();if(this.strGroupCache==null)this.strGroupCache=a+"$";else this.strGroupCache=this.strGroupCache+a+"$"}CLVP.prototype.DeleteGroupNameCache=CLVPDeleteGroupNameCache;function CLVPDeleteGroupNameCache(){ULS_inplview();if(this.strGroupCache==null)return;var b=0,a;a=this.strGroupCache.indexOf("$",b);while(a!=-1){var d=this.strGroupCache.substring(b,a),e="ecbtab_ctx"+this.ctx.ctxId+"_"+d,c=document.getElementById(e);if(c)this.tab.removeChild(c);b=a+1;a=this.strGroupCache.indexOf("$",b)}this.strGroupCache=null}CLVP.prototype.EnqueueEcbInfoRequest=CLVPEnqueueEcbInfoRequest;function CLVPEnqueueEcbInfoRequest(b){ULS_inplview();var a;for(a=0;a<this.queueEcbInfo.length;a++)if(this.queueEcbInfo[a]==b)return;this.queueEcbInfo.push(b)}CLVP.prototype.NoOutstandingECBRequests=CLVPNoOutstandingECBRequests;function CLVPNoOutstandingECBRequests(){ULS_inplview();if(this.isEcbInfo)return false;if(this.queueEcbInfo.length>0)return false;return true}function SetFocusBack(d){ULS_inplview();if(d==0||focusAcc!=null&&focusAcc.focusInCLVPTab!=null&&focusAcc.focusInCLVPTab!=true){var a=null;if(focusAcc!=null&&focusAcc.elem!=null)a=focusAcc.elem;if(a!=null&&a.tagName!="A"){var c=a.getElementsByTagName("A"),b=c.length;if(b>0)a=c[b-1]}if(a!=null)if(a.setActive!=null)a.setActive();else if(a.focus!=null)a.focus();focusAcc=null}}SPBoolean=function(){ULS_inplview();};SPBoolean.prototype={ID:"SPBoolean",BeginValidateNormalizeConvert:function(d,e,a){ULS_inplview();return {isValid:true,dataValue:null,normalizedLocValue:a,hasLocValue:true,hasDataValue:false}},FromDynamicUpdate:function(a){ULS_inplview();return {dataValue:!!a,locValue:!!a}},GetBool:function(a){ULS_inplview();var b=a.HasLocalizedValue()?a.GetLocalized():a.HasDataValue()?a.GetData():null;return !!(1*b)}};SPNumber=function(){ULS_inplview();};SPNumber.prototype={ID:"SPNumber",BeginValidateNormalizeConvert:function(d,e,a){ULS_inplview();return {isValid:true,dataValue:null,normalizedLocValue:a,hasLocValue:true,hasDataValue:false}},FromDynamicUpdate:function(a){ULS_inplview();return {dataValue:a,locValue:a}}};SPChoice=function(){ULS_inplview();};SPChoice.prototype={ID:"SPChoice",BeginValidateNormalizeConvert:function(d,e,a){ULS_inplview();return {isValid:true,dataValue:null,normalizedLocValue:a,hasLocValue:true,hasDataValue:false}},FromDynamicUpdate:function(a){ULS_inplview();return {dataValue:a,locValue:a}},GetItems:function(){ULS_inplview();debugger;return null}};SPIcon=function(){ULS_inplview();};SPIcon.prototype={ID:"SPIcon",BeginValidateNormalizeConvert:function(d,e,a){ULS_inplview();return {isValid:true,dataValue:null,normalizedLocValue:a,hasLocValue:true,hasDataValue:false}},FromDynamicUpdate:function(a){ULS_inplview();return {dataValue:a,locValue:a}},GetImageSource:function(c,b){ULS_inplview();var a=b;if(a==null)return "";a=a.substr(0,a.indexOf("|"));if(a.length<=1)return "";return "/_layouts/images/"+a}};SPUrl=function(){ULS_inplview();};SPUrl.prototype={ID:"SPUrl",BeginValidateNormalizeConvert:function(d,e,a,b){ULS_inplview();if(b)return {isValid:true,dataValue:null,normalizedLocValue:a,hasLocValue:true,hasDataValue:false};else return {isValid:true,dataValue:a,normalizedLocValue:a,hasLocValue:true,hasDataValue:true}},FromDynamicUpdate:function(a){ULS_inplview();return {dataValue:a,locValue:a}}};SPUser=function(){ULS_inplview();};SPUser.prototype={ID:"SPUser",BeginValidateNormalizeConvert:function(e,f,a,c,d){ULS_inplview();if(c){var b=this.clvp,g=b.tc.GetCachedRecord(e);b.ValidateField(g,f,d,a);return null}else return {isValid:true,dataValue:a,normalizedLocValue:a,hasLocValue:true,hasDataValue:true}},FromDynamicUpdate:function(a){ULS_inplview();return {dataValue:a,locValue:a}}};var _v_bGridFieldTypeRegistered=false;function RegisterFieldTypeForEdit(){ULS_inplview();if(_v_bGridFieldTypeRegistered)return;var c=SP.JsGrid.PropertyType.RegisterNewCustomPropType,a=SP.JsGrid.DisplayControl.Type,b=SP.JsGrid.EditControl.Type;c(new SPBoolean,a.Checkbox,b.Checkbox);c(new SPNumber,a.Text,b.EditBox);c(new SPIcon,a.Image,b.EditBox);c(new SPUrl,a.Text,b.EditBox);c(new SPUser,a.Text,b.EditBox);c(new SPChoice,a.Text,b.ComboBox);_v_bGridFieldTypeRegistered=true}function HandleJsGridCellContentClick(a,g){ULS_inplview();var i=a.GetProp(g),e=i.propType,d=e.clvp;if(e.ID=="SPIcon"){var f=1*a.GetDataValue("FSObjType");if(f==1){var c=window.event,h=GetEventSrcElement(c);if(d!=null){var b=document.URL;b=SetUrlKeyValue("RootFolder",a.GetDataValue("FileRef"),true,b);d.EnterFolder(b,h)}c.canelBubble=true;c.returnValue=false}}}function ExpColGroupScripts(c){ULS_inplview();var d=[],e=/<script type="text\/javascript">ExpCollGroup\('[^']*',\s*'[^']*'\);<\/script>/g,b=e.exec(c);while(b!=null){var a=b[0],g=a.indexOf("ExpCollGroup"),f=a.indexOf(";");d.push(a.substring(g,f+1));b=e.exec(c)}return d}function InitCLVPs(callback){ULS_inplview();if(typeof g_ViewIdToViewCounterMap!="undefined"){var vid;for(vid in g_ViewIdToViewCounterMap){eval("var ctxT=ctx"+g_ViewIdToViewCounterMap[vid]+";");var clvp=new CLVP(ctxT);clvp.Init();callback(clvp)}}}function CLVPFromCtx(a){ULS_inplview();if(typeof a.clvp!="undefined")return a.clvp;return null}function CLVPFromEventReal(evt){ULS_inplview();if(evt==null)return null;if(evt.fromRibbon&&evt.currentCtx)return CLVPFromCtx(evt.currentCtx);var sender=GetEventSrcElement(evt),tabTb=null,tablv=null,tabs=null,oPopup=GetEventPopup(evt);if(oPopup!=null){if(typeof evt.currentCtx!="undefined"&&evt.currentCtx!=null){eval("var ctxCur=ctx"+evt.currentCtx.ctxId+";");return CLVPFromCtx(ctxCur)}if(typeof currentCtx!="undefined"&&currentCtx!=null)return CLVPFromCtx(currentCtx);if(typeof ctxFilter!="undefined"&&ctxFilter!=null)return CLVPFromCtx(ctxFilter);var m=oPopup.master;if(m==null)return null;if(m.id!=null&&m.id.indexOf("onetViewSelector_menu")>0){var idT=m.id.substr(0,m.id.indexOf("onetViewSelector_menu")+16);tabTb=GetAncestor(document.getElementById(idT),"TABLE")}else tabTb=GetAncestor(m,"TABLE")}else tabTb=GetAncestor(sender,"TABLE");while(tabTb!=null){if(tabTb.className=="ms-menutoolbar")break;if(tabTb.className=="ms-listviewtable"){tablv=tabTb;tabTb=null;break}tabTb=tabTb.parentNode;if(tabTb!=null)tabTb=GetAncestor(tabTb,"TABLE")}if(tabTb==null&&tablv==null)return null;if(tablv==null){var tab=tabTb.nextSibling;while(tab!=null&&(tab.nodeType!=1||tab.tagName!="TABLE"))tab=tab.nextSibling;if(tab==null)return null;var tabs=tab.getElementsByTagName("TABLE");if(tabs.length==0)return null;tablv=tabs[0]}var clvp=CLVPFromCtx(tablv);if(clvp==null){tabs=tab.getElementsByTagName("DIV");if(tabs.length==0)return null;tablv=tabs[0];clvp=CLVPFromCtx(tablv)}return clvp}function SetUrlKeyValue(b,e,f,a){ULS_inplview();if(a==null)a=window.location.href+"";var c=e,d=new CUrl(a);a=d.query;if(f)c=escapeProperly(c);if(a.indexOf(b+"=")<0){if(a.length>1)a+="&";else if(a.length==0)a+="?";a+=b+"="+c}else{var g=new RegExp(b+"=[^&]*");a=a.replace(g,b+"="+c)}d.query=a;return d.ToString()}function RemoveUrlKeyValue(c,a){ULS_inplview();var b=new RegExp(c+"=[^&]*&");a=a.replace(b,"");b=new RegExp(c+"=[^&]*");a=a.replace(b,"");return a}function FixUrlFromClvp(a,b){ULS_inplview();return FixUrlFromClvp2(a,b,true)}function FixUrlFromClvp2(c,a,d){ULS_inplview();var b=c.rootFolder;if((b==null||b.length==0)&&c.rgpaging==null&&!c.isEditing)return a;if(b!=null&&b.length>0)if(a.toUpperCase().indexOf("LISTEDIT.ASPX")==-1)a=SetUrlKeyValue("RootFolder",b,true,a);if(d){var e=GetSource2(null,c);a=SetUrlKeyValue("Source",e,true,a)}return a}function STSNavigateToViewReal(b,a){ULS_inplview();STSNavigate(a);return true}function STSNavigate2Real(b,a){ULS_inplview();STSNavigate(a);return true}function GetSource2(c,b){ULS_inplview();var a=GetUrlKeyValue("Source");if(a=="")if(c!=null&&c!="")a=c;else a=window.location.href;if(a.length>0){var e=new CUrl(a);e.hash="";a=e.ToString()}if(b==null&&typeof currentCtx!="undefined")b=currentCtx!=null?currentCtx.clvp:null;if(b!=null&&(b.rootFolder!=null||b.rgpaging!=null))if(a!=""){if(b.rootFolder!=null&&b.rootFolder!="")a=SetUrlKeyValue("RootFolder",b.rootFolder,true,a);if(b.rgpaging!=null){var d;for(d in b.rgpaging)a=SetUrlKeyValue(d,b.rgpaging[d],false,a);if(b.rgpaging["PagedPrev"]==null){a=RemoveUrlKeyValue("PagedPrev",a);a=RemoveUrlKeyValue("PageLastRow",a)}if(b.rgpaging["PageFirstRow"]==null)a=RemoveUrlKeyValue("PageFirstRow",a)}}if(b!=null&&b.isEditing&&a!="")a=SetUrlKeyValue("JsGrid","1",false,a);return STSPageUrlValidation(a)}function OnClickFilterV4(d){ULS_inplview();var c=FindSTSMenuTable(d,"CTXNum");if(c!=null&&c.getAttribute("SortFields")!=null){var b=c.getAttribute("SortFields");if(b.indexOf("?")>0)b=b.substr(b.indexOf("?")+1);var a=GetUrlWithNoSortParameters(b);a=RemovePagingArgs(a);if(a.indexOf("?")<0)a+="?";else a+="&";a=a+b;SubmitFormPost(a)}return false}function HandleFilterReal(b,a){ULS_inplview();SubmitFormPost(a);return false}function DebugCLVP(){ULS_inplview();}function InitAllClvps(){ULS_inplview();if(FV4UI()||GroupCollapse())InitCLVPs(DebugCLVP)}function FixDroppedOrPastedClvps(){ULS_inplview();if(typeof g_ViewIdToViewCounterMap!="undefined"){var vid;for(vid in g_ViewIdToViewCounterMap){eval("var ctxT=ctx"+g_ViewIdToViewCounterMap[vid]+";");var clvp=ctxT.clvp;if(!clvp.tab||!clvp.tab.parentNode||1!=clvp.tab.parentNode.nodeType){var clvp=new CLVP(ctxT);clvp.Init()}}}}var focusAcc=null;function GetFocusInfo(c,j){ULS_inplview();var b={};b.elem=null;b.id=null;b.tagName=null;b.focusInCLVPTab=null;var a=null;if(c.target)a=c.target;else if(c.srcElement)a=c.srcElement;if(typeof c.fakeEvent!="undefined"&&c.fakeEvent){if(a.master!=null)a=a.master._oParent;if(a!=null&&a.tagName!="A")a=a.getElementsByTagName("A")[0]}else if(c.fromRibbon!=true)while(a.tagName!="A"&&a.tagName!="BODY")a=a.parentNode;var e=null;if(a!=null){while(a.id.length==0&&a.tagName!="BODY")a=a.parentNode;e=a.id}var d=null;if(a!=null)d=a.tagName;var h=false,f=null;if(j!=null)f=j.tab;if(f!=null&&d!=null&&e!=null){var i=f.getElementsByTagName(d);for(var g=0;g<i.length;g++)if(i[g].id==e){h=true;break}}b.elem=a;b.id=e;b.tagName=d;b.focusInCLVPTab=h;focusAcc=b}function ExpGroup(e,b){ULS_inplview();tabBody=document.getElementById("tbod"+b+"_");if(tabBody!=null)tabTb=GetAncestor(tabBody,"TABLE");if(tabBody==null||tabBody.tagName!="TBODY"||tabTb==null||tabTb.clvp==null||tabBody.getAttribute("isLoaded")==null)return;var d=b.substring(0,b.indexOf("-")),c=document.getElementById("GroupByCol"+d),a="?";if(c!=null)a+=c.getAttribute("queryString");a=RemoveOnlyPagingArgs(a);a+="&GroupString=";a+=titlTbody.getAttribute("groupString");a+="&IsGroupRender=TRUE";tabTb.clvp.tBody=tabBody;tabTb.clvp.RefreshPaging(a,null)}function DeleteSelectedItems(a){ULS_inplview();a=FixupCtx(a);var b=a.clvp,d=GetSelectedItemsDict(a),h=0,f=CountDictionary(d);if(f>0){var c=a.RecycleBinEnabled?L_STSRecycleConfirm_Text:L_STSDelConfirm_Text;if(a.HasRelatedCascadeLists&&a.CascadeDeleteWarningMessage!=null)c=a.CascadeDeleteWarningMessage+c;if(!confirm(c))return}var g;for(g in d){var e=d[g];b.DeleteItemCore(e.id,e.fsObjType,false)}b.pendingItems=[];if(f>0)b.cctx.executeQuery(function(){ULS_inplview();RefreshPage(SP.UI.DialogResult.OK)},function(){ULS_inplview();if(typeof b.rgehs!="undefined")b.ShowErrorDialog()})}function CheckOutSingleItem(b,c){ULS_inplview();b=FixupCtx(b);var e=GetAttributeFromItemTable(c,"Url","ServerUrl"),d=GetAttributeFromItemTable(c,"Icon","DocIcon").split("|"),a=null;if(d.length>=3)a=d[2];if(a=="SharePoint.OpenDocuments")a="SharePoint.OpenDocuments.3";CheckoutDocument(b.HttpRoot,e,a)}function FixupCtx(ctx){ULS_inplview();if(ctx&&typeof ctx.clvp=="undefined"&&typeof ctx.ctxId!="undefined"){eval("var ctxT=ctx"+ctx.ctxId+";");if(ctxT)return ctxT}return ctx}function CheckInSingleItemFromECB(c,a,d){ULS_inplview();a=FixupCtx(a);var b=a.clvp;GetFocusInfo(c,b);CheckInSingleItem(a,d)}function CheckInSingleItem(b,d){ULS_inplview();var a=GetAttributeFromItemTable(d,"Url","ServerUrl");if(a!=null)a=escapeProperly(unescapeProperly(a));var c=b.HttpRoot+"/_layouts/checkin.aspx?"+"List="+b.listName+"&FileName="+a;OpenPopUpPage(c,RefreshPage)}function ManageCopies(b){ULS_inplview();var e=b.clvp,a=GetSelectedItemsDict(b),f=CountDictionary(a),c,d;if(f==1)for(d in a){var c=a[d];e.ManageCopies(c.id,c.fsObjType)}}function CheckoutSelectedItems(e){ULS_inplview();var b=e.clvp,a=GetSelectedItemsDict(e),f=CountDictionary(a),c,d;if(f==1)for(d in a){c=a[d];FetchEcbInfo(e,c.id,"DIV",CheckOutSingleItem);return}if(!confirm(L_CheckoutConfirm))return;for(d in a){var c=a[d];b.CheckoutItem(c.id,c.fsObjType)}if(f>0)b.cctx.executeQuery(function(){ULS_inplview();RefreshPage(SP.UI.DialogResult.OK)},function(){ULS_inplview();if(typeof b.rgehs!="undefined")b.ShowErrorDialog()})}function DiscardCheckoutSelectedItems(b){ULS_inplview();b=FixupCtx(b);var a=b.clvp,c=GetSelectedItemsDict(b),f=CountDictionary(c),d,e;if(!confirm(L_DiscardCheckoutConfirm))return;for(e in c){var d=c[e];a.DiscardCheckoutItem(d.id,d.fsObjType)}if(f>0)a.cctx.executeQuery(function(){ULS_inplview();RefreshPage(SP.UI.DialogResult.OK)},function(){ULS_inplview();if(typeof a.rgehs!="undefined")a.ShowErrorDialog()})}function CheckinSelectedItems(d){ULS_inplview();var a=d.clvp,b=[],c=GetSelectedItemsDict(d),j=CountDictionary(c),f,g;if(j==1)for(g in c){f=c[g];FetchEcbInfo(d,f.id,"DIV",CheckInSingleItem);return}var e=a.ctx.HttpRoot;b.push(e);if(e[e.length-1]!="/")b.push("/");b.push("_layouts/checkin.aspx?List=");b.push(a.ctx.listName);b.push("&IsBulk=1");var h=function(f){ULS_inplview();var e,d=0;for(e in c){var b=c[e];a.CheckinItem(b.id,b.fsObjType,f);d++}if(d>0)a.cctx.executeQuery(function(){ULS_inplview();RefreshPage(SP.UI.DialogResult.OK)},function(){ULS_inplview();if(typeof a.rgehs!="undefined")a.ShowErrorDialog()})},i=function(c,b){ULS_inplview();a.EnsureEcbInfo(h,b,null)};OpenPopUpPage(b.join(""),i)}function HandleCheckoutSelection(b){ULS_inplview();var a=CLVPFromEventReal(b);if(a!=null)CheckoutSelectedItems(a.ctx)}function HandleDeleteSelection(b){ULS_inplview();var a=CLVPFromEventReal(b);if(a!=null)DeleteSelectedItems(a.ctx)}function HandleCheckinSelection(b){ULS_inplview();var a=CLVPFromEventReal(b);CheckinSelectedItems(a.ctx)}function DismissErrDlg(){ULS_inplview();var a=window.top.g_childDialog;if(a)a.close(0)}function Noop(){ULS_inplview();}function CanNavigateUp(a){ULS_inplview();if(a==null||a.clvp==null)return false;var b=unescapeProperly(GetRootFolder2(a));if(b==null||b==unescapeProperly(a.listUrlDir))return false;return true}function NavigateUp(d){ULS_inplview();if(!CanNavigateUp(d))return;var b=unescapeProperly(GetRootFolder2(d));if(b==null)return;var e=b.lastIndexOf("/"),c="";if(e>0)c=b.substr(0,e);else return;var a=document.URL;a=RemoveParametersFromUrl(a);a=a+"?RootFolder="+escapeProperly(c);SubmitFormPost(a)}InitAllClvps();var inplview={CheckOutSingleItem:CheckOutSingleItem,InitAllClvps:InitAllClvps,HandleFilterReal:HandleFilterReal,OnClickFilterV4:OnClickFilterV4,STSNavigate2Real:STSNavigate2Real,DeleteSelectedItems:DeleteSelectedItems,HandleDeleteSelection:HandleDeleteSelection,HandleCheckoutSelection:HandleCheckoutSelection,HandleCheckinSelection:HandleCheckinSelection,ExpGroup:ExpGroup,STSNavigateToViewReal:STSNavigateToViewReal,CheckInSingleItemFromECB:CheckInSingleItemFromECB};if(typeof Sys!="undefined"&&Sys&&Sys.Application)Sys.Application.notifyScriptLoaded();NotifyScriptLoadedAndExecuteWaitingJobs("inplview.js")