var CurrentUrl="",SiteUrl="",queryLimit=4E3;$(document).ready(function(){null!=document.getElementById("NavegacionPQ")&&setNavigationNodes()});function setNavigationNodes(){SiteUrl=_spPageContextInfo.webAbsoluteUrl;var a=getModulesNode();PaintMainNodes(a);$("#NavegacionAuxiliarPQ").prop("style","position:absolute")} function PaintMainNodes(a){$("#NavegacionPrincipalPQ").prop("style","display:flex;");for(var b=0;b "+$(a[b]).attr("Titulo")+"")} function SetNavegacion(a){$("#NavegacionPQ").empty();$("#NavegacionAuxiliarPQ1").empty();$("#NavegacionAuxiliarPQ2").empty();var b=[];a=""+a+"";$().SPServices({operation:"GetListItems",async:!1,listName:"NavegacionNodos",CAMLViewFields:"", CAMLQuery:a,completefunc:function(a,d){b=[];$(a.responseXML).SPFilterNode("z:row").each(function(){var a={URL:$(this).attr("ows_Link"),Image:$(this).attr("ows_Imagen"),Titulo:$(this).attr("ows_Title"),Tipo:""==$(this).attr("ows_TipoNodo")||void 0==$(this).attr("ows_TipoNodo")?"":$(this).attr("ows_TipoNodo"),Modulo:$(this).attr("ows_Modulo"),Hijo:""==$(this).attr("ows_ModuloHijo")||void 0==$(this).attr("ows_ModuloHijo")?"":$(this).attr("ows_ModuloHijo"),NombreCorto:""==$(this).attr("ows_NombreCorto")|| void 0==$(this).attr("ows_NombreCorto")?"":$(this).attr("ows_NombreCorto")};b.push(a)})}});PaintNodes(b,"NavegacionPQ")} function SetNavegacionAuxiliar(a,b){if(""!=a){2!=b&&$("#NavegacionAuxiliarPQ1").empty();$("#NavegacionAuxiliarPQ2").empty();var c=[],d=""+a+"";$().SPServices({operation:"GetListItems",async:!1,listName:"NavegacionNodos",CAMLViewFields:"",CAMLQuery:d, completefunc:function(a,b){c=[];$(a.responseXML).SPFilterNode("z:row").each(function(){var a={URL:$(this).attr("ows_Link"),Image:$(this).attr("ows_Imagen"),Titulo:$(this).attr("ows_Title"),Tipo:""==$(this).attr("ows_TipoNodo")||void 0==$(this).attr("ows_TipoNodo")?"":$(this).attr("ows_TipoNodo"),Modulo:$(this).attr("ows_Modulo"),Hijo:""==$(this).attr("ows_ModuloHijo")||void 0==$(this).attr("ows_ModuloHijo")?"":$(this).attr("ows_ModuloHijo"),NombreCorto:""==$(this).attr("ows_NombreCorto")||void 0== $(this).attr("ows_NombreCorto")?"":$(this).attr("ows_NombreCorto")};c.push(a)})}});PaintNodes(c,"NavegacionAuxiliarPQ"+b)}} function PaintNodes(a,b){for(var c=0;c ");break;case "NavegacionAuxiliarPQ2":0==c&&($("#"+b).append(""), $("#"+b).append(""))}$("#"+b).prop("style","display:flex");var e="";""==$(a[c]).attr("NombreCorto")?e=$(a[c]).attr("Titulo"):e=$(a[c]).attr("NombreCorto");var f;f='"'+SiteUrl+$(a[c]).attr("URL")+'"';0==c?(d="onclick='window.location= "+f+"'",$("#"+b).append("")):(""==$(a[c]).attr("Hijo")&&(d="onclick='window.location="+ f+"'"),$("#"+b).append(""))}} function getModulesNode(){var a=[];$().SPServices({operation:"GetListItems",async:!1,listName:"NavegacionNodos",CAMLViewFields:"",CAMLQuery:"1",completefunc:function(b,c){$(b.responseXML).SPFilterNode("z:row").each(function(){var b= {URL:$(this).attr("ows_Link"),Titulo:$(this).attr("ows_Title"),Modulo:$(this).attr("ows_Modulo"),Tipo:""==$(this).attr("ows_TipoNodo")||void 0==$(this).attr("ows_TipoNodo")?"":$(this).attr("ows_TipoNodo")};a.push(b)})}});console.log("Nodos: "+a);return a} function GetCalendarURL(a){var b=_spPageContextInfo.webAbsoluteUrl;a=a.URL;var c="",d=_spPageContextInfo.webTitle,e="",e="GUIDS",f=""+a+"";$().SPServices({operation:"GetListItems",async:!1,listName:e,CAMLRowLimit:queryLimit,CAMLViewFields:"",CAMLQuery:f,completefunc:function(a,b){$(a.responseXML).SPFilterNode("z:row").each(function(){c= $(this).attr("ows_Clave");e=$(this).attr("ows_Title")})}});return"stssync://sts/?ver=1.1&type=calendar&cmd=add-folder&base-url="+encodeURIComponent(b)+"&list-url="+encodeURIComponent(a)+"&guid="+encodeURIComponent("{"+c+"}")+"&site-name="+encodeURIComponent(d)+"&list-name="+encodeURIComponent(e)};