function ULSveE(){var o=new Object;o.ULSTeamName="DLC Server";o.ULSFileName="MDN.js";return o;}

Type.registerNamespace('Microsoft.Office.Server.Ajax');Microsoft.Office.Server.Ajax.ViewDropDownFilter=function(pageManager){ULSveE:;Microsoft.Office.Server.Ajax.ViewDropDownFilter.initializeBase(this);this.$1_0=pageManager;}
Microsoft.Office.Server.Ajax.ViewDropDownFilter.prototype={$1_0:null,getGlobalCommands:function(){ULSveE:;return ['CustomPopulateViewDropDown'];},canHandleCommand:function(commandId){ULSveE:;if(commandId==='CustomPopulateViewDropDown'){return this.$1_0.get_commandDispatcher().isCommandEnabled('PopulateViewDropDown');}return false;},$1_1:function($p0){var $0=($p0);if(SP.ScriptUtility.isNullOrEmptyString($0.PopulationXML)){return;}var $1=SP.Ribbon.NativeUtility.createXMLDocFromStringCore($0.PopulationXML,true);if(SP.ScriptUtility.isNullOrUndefined($1)){return;}var $2=this.$1_3($1,'/Menu/MenuSection[@Id=\'Ribbon.Library.CustomViews.DisplayView.Menu.Other\']');if(!$2){return;}var $3=this.$1_3($2,'Controls/Button[@Id=\'Ribbon.Library.CustomViews.DisplayView.Menu.Other.__DlcPlvConfigLink\']');if(!$3){return;}var $4=this.$1_2($2,'Controls/Button');var $5=$2;if($4.length!==1){$3.parentNode.removeChild($3);$5=$2.cloneNode(false);var $6=$1.createElement('Controls');$5.appendChild($6);this.setNodeAttribute($6,'Id','Ribbon.Library.CustomViews.DisplayView.Menu.Settings.Controls');$6.appendChild($3);$2.parentNode.appendChild($5);}this.setNodeAttribute($5,'Title',SP.UI.Policy.Resources.mdn_SettingsMenuGroup);$0.PopulationXML=this.xmlDocumentToString($1);},handleCommand:function(commandId,properties,sequence){ULSveE:;if(commandId==='CustomPopulateViewDropDown'){if(this.$1_0.get_commandDispatcher().executeCommand('PopulateViewDropDown',properties)){this.$1_1(properties);return true;}return false;}return false;},$1_2:function($p0,$p1){try{return $p0.selectNodes($p1);}catch($5){}var $0=new XPathEvaluator();var $1=$0.evaluate($p1,$p0,eval('document.createNSResolver(document)'),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var $2=new Array($1.snapshotLength);for(var $6=0;$6<$1.snapshotLength;$6++){$2[$6]=$1.snapshotItem($6);}var $3=$2;var $4=$3;return $4;},$1_3:function($p0,$p1){try{return $p0.selectSingleNode($p1);}catch($1){}var $0=this.$1_2($p0,$p1+'[1]');if($0.length){for(var $2=$0.length-1;$2>=0;$2--){if($0[$2]){return $0[$2];}}}return null;},setNodeAttribute:function(node,attributeName,value){ULSveE:;node.setAttribute(attributeName,value);},xmlDocumentToString:function(doc){ULSveE:;var $0=doc.xml;if(SP.ScriptUtility.isNullOrUndefined($0)){var $1=eval('new XMLSerializer()');return $1.serializeToString(doc);}else{return doc.xml.toString();}}}
Microsoft.Office.Server.Ajax.TaxTreeViewResources=function(){}
Microsoft.Office.Server.Ajax.TaxTreeViewResources.GetIncludeTooltipString=function(){ULSveE:;return SP.UI.Policy.Resources.taxTreeView_TooltipIncludeDescendants;}
Microsoft.Office.Server.Ajax.TaxTreeViewResources.GetExcludeTooltipString=function(){ULSveE:;return SP.UI.Policy.Resources.taxTreeView_TooltipExcludeDescendants;}
Microsoft.Office.Server.Ajax.ViewDropDownFilter.registerClass('Microsoft.Office.Server.Ajax.ViewDropDownFilter',CUI.Page.PageComponent,CUI.Page.ICommandHandler);Microsoft.Office.Server.Ajax.TaxTreeViewResources.registerClass('Microsoft.Office.Server.Ajax.TaxTreeViewResources');Microsoft.Office.Server.Ajax.ViewDropDownFilter._CustomPopulateViewDropDown='CustomPopulateViewDropDown';Microsoft.Office.Server.Ajax.ViewDropDownFilter._PopulateViewDropDown='PopulateViewDropDown';
// ---- Do not remove this footer ----
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
// -----------------------------------
function loadFilterFn(){ULSveE:;var currentPageManager=SP.Ribbon.PageManager.get_instance();currentPageManager.addPageComponent(new Microsoft.Office.Server.Ajax.ViewDropDownFilter(currentPageManager))}
loadFilterFn();function PlvHandleFolder(ele,objEvent,url,a,b,c,d,e,f,g,h,i,j,k,l,m){ULSveE:;try{if(ctx.overrideFilterQstring!=undefined){var newUrl=RemoveParametersFromUrl(url)+'?'+ctx.overrideFilterQstring;var mdnlocationQParams=new Array("TreeField","TreeValue","OverrideScope","ProcessQStringToCAML","TaxDesc","FallbackLimit","IndexKey");for(var i=mdnlocationQParams.length-1;i>=0;i--){newUrl=RemoveQueryParameterFromUrl(newUrl,mdnlocationQParams[i]);} var r='RootFolder';url=StURLSetVar2(newUrl,r,GetUrlKeyValue(r,true,url));}} catch(e){};return OldHandleFolder(ele,objEvent,url,a,b,c,d,e,f,g,h,i,j,k,l,m);}
var OldHandleFolder=HandleFolder;HandleFolder=PlvHandleFolder;var treeSelectedNodeClassName='ms-tvselected';var treeSelectedNodeDescendantClassName='descendant';function getElementsByClass(searchClass,node,tag){ULSveE:;var classElements=new Array();if(node===null){node=document;} if(tag===null){tag='*';} var els=node.getElementsByTagName(tag);var elsLen=els.length;var pattern=new RegExp("(^|\\s)"+searchClass+"(\\s|$)");var j=0;var i;for(i=0;i<elsLen;i++){if(pattern.test(els[i].className)){classElements[j]=els[i];j++;}} return classElements;}
function getSelectedNode(){ULSveE:;var elements=getElementsByClass(treeSelectedNodeClassName,null,'TD');if(elements.length!=1){return null;} return elements[0];}
function applyStyles(selected){ULSveE:;var el=selected.parentNode.parentNode.parentNode;do{el=el.nextSibling;} while(el&&el.nodeType!=1);if(el){el.className+=treeSelectedNodeDescendantClassName;setIconsToSelected(el.getElementsByTagName("IMG"));}}
function displayDescendantsButton(selected,fInclude){ULSveE:;var newHref=document.createElement('A');var newImage=document.createElement('IMG');var url=selected.childNodes[0].href;if(fInclude){url=url.replace('\\u0026TreeValue=','\\u0026TaxDesc=0\u0026TreeValue=');newImage.src='/_layouts/images/IncludeDescendantsSelected.png';newImage.alt=Microsoft.Office.Server.Ajax.TaxTreeViewResources.GetExcludeTooltipString();newImage.title=Microsoft.Office.Server.Ajax.TaxTreeViewResources.GetExcludeTooltipString();applyStyles(selected);var node=selected;while(node!=null){if(node.tagName=="TABLE"&&node.nextSibling!=null&&node.nextSibling.tagName=="DIV"){node.nextSibling.className+=' '+treeSelectedNodeClassName;break;} node=node.parentNode;}} else{url=url.replace('\\u0026TreeValue=','\\u0026TaxDesc=1\u0026TreeValue=');newImage.src='/_layouts/images/IncludeDescendants.png';newImage.alt=Microsoft.Office.Server.Ajax.TaxTreeViewResources.GetIncludeTooltipString();newImage.title=Microsoft.Office.Server.Ajax.TaxTreeViewResources.GetIncludeTooltipString();} newHref.href=url;selected.childNodes[0].href=url;var previousNode=selected;do{previousNode=previousNode.previousSibling;} while(previousNode&&previousNode.nodeType!=1);if(previousNode)previousNode.childNodes[0].href=url;newImage.style.borderStyle='none';newHref.appendChild(newImage);var newTd=document.createElement('TD');newTd.style.width='100%';newTd.appendChild(newHref);selected.parentNode.appendChild(newTd);}
function IncludeDescendants_Load(){ULSveE:;var selected=getSelectedNode();if(selected==null)return;if(typeof(dlc_tvi)!="undefined"&&dlc_tvi!=null&&dlc_tvi.ShowIncludeDescendantsUI){displayDescendantsButton(selected,dlc_tvi.IncludeDescendants);} if(selected&&selected.previousSibling){setIconsToSelected(selected.previousSibling.getElementsByTagName("IMG"));}}
function setChildrenIconsToSelected(node){ULSveE:;while(node!=null){if(node.tagName=="DIV"&&node.className!=null&&node.className.indexOf(treeSelectedNodeDescendantClassName)!=-1){setIconsToSelected(node.getElementsByTagName("IMG"));break;} node=node.parentNode;}}function setIconsToSelected(treeNodeImages){ULSveE:;var valueNodeIconSrc="/_layouts/images/mdnvalue.png";var selectedValueNodeIconSrc="/_layouts/images/mdnvalueselected.png";if(!treeNodeImages||typeof(treeNodeImages.length)=="undefined")return;for(i=0;i<treeNodeImages.length;++i){if(treeNodeImages[i].tagName!="IMG")continue;var startIndexToReplace=treeNodeImages[i].src.indexOf(valueNodeIconSrc);if(startIndexToReplace!=-1){treeNodeImages[i].src=treeNodeImages[i].src.substring(0,startIndexToReplace)+selectedValueNodeIconSrc;}}}
IncludeDescendants_Load();if(typeof(Sys)!="undefined"&&Sys&&Sys.Application){Sys.Application.notifyScriptLoaded();}
if(typeof(NotifyScriptLoadedAndExecuteWaitingJobs)!="undefined"){NotifyScriptLoadedAndExecuteWaitingJobs("mdn.js");}

