if(typeof MVD==="undefined"){var MVD={}}MVD.extend=function(C,B){for(var A in B){if(B.hasOwnProperty(A)){C[A]=B[A]}}};MVD.extend(Array.prototype,{contains:function(C){for(var B=0,A=this.length;B<A;B++){if(this[B]===C){return true}}return false},filter:function(D){var C=[];for(var B=0,A=this.length;B<A;B++){if(D(this[B])){C.push[this[B]]}}return C},foreach:function(C){for(var B=0,A=this.length;B<A;B++){C(B,this[B])}}});MVD.nullFunc=function(){return this};MVD.elemExtension={show:function(){this.style.display=((this.nodeName=="SPAN")||(this.nodeName=="A"))?"inline":"block";return this},hide:function(){this.style.display="none";return this},setHTML:function(A){this.innerHTML=A;return this},getWidth:function(){if(this.style.pixelWidth){return this.style.pixelWidth}else{return parseInt(this.style.width,10)}},getHeight:function(){if(this.style.pixelHeight){return this.style.pixelHeight}else{return parseInt(this.style.height,10)}},setTop:function(A){if(this.style.pixelTop){this.style.pixelTop=A}else{this.style.top=A+"px"}return this},setLeft:function(A){if(this.style.pixelLeft){this.style.pixelLeft=A}else{this.style.left=A+"px"}return this},setHeight:function(A){if(this.style.pixelHeight){this.style.pixelHeight=A}else{this.style.height=A+"px"}return this},setWidth:function(A){if(this.style.pixelWidth){this.style.pixelWidth=A}else{this.style.width=A+"px"}return this},setOpacity:function(A){A=(A>=100)?99.99999:A;this.style.filter="alpha(opacity:"+A+")";this.style.KHTMLOpacity=A/100;this.style.MozOpacity=A/100;this.style.opacity=A/100;return this},fadeOut:function(){return this.hide()},showAndHide:function(B){if(!B){B=2000}var A=this.show();var C=setTimeout(function(){A.fadeOut()},B);return this},hasClass:function(A){return this.className.split(" ").contains(A)},childWithClass:function(A){if(0&&this.getElementsByClassName){console.log(this,A);console.log(this.getElementsByClassName(A));return this.getElementsByClassName(A)}else{return MVD.filter(this.getElementsByTagName("*"),function(B){return B.className&&B.className.split(" ").contains(A)})}},firstWithClass:function(B){if(this.getElementsByClassName){var D=this.getElementsByClassName(B);if(D.length){return MVD.extendElement(D[0])}}else{var E=this.getElementsByTagName("*");var F;for(var C=0,A=E.length;C<A;C++){F=E[C];if(F.className&&F.className.split(" ").contains(B)){return MVD.extendElement(F)}}}return null},allWithClass:function(B){if(this.getElementsByClassName){return this.getElementsByClassName(B)}else{var E=this.getElementsByTagName("*"),D=[],F;for(var C=0,A=E.length;C<A;C++){F=E[C];if(F.className&&F.className.split(" ").contains(B)){D.push(MVD.extendElement(F))}}return D}return null}};MVD.extend(MVD,{elemNull:{show:MVD.nullFunc,setHTML:MVD.nullFunc,hide:MVD.nullFunc},extendElement:function(A){if(A){MVD.extend(A,MVD.elemExtension)}return A},get:function(A){return MVD.extendElement(document.getElementById(A))},createElem:function(A){return MVD.extendElement(document.createElement(A))},getSafe:function(A){return MVD.get(A)||MVD.elemNull},addNotice:function(D,A,F,C){var B=typeof D==="string"?MVD.get(D):D;var E=null;if(B&&!MVD.get(A)){E=MVD.createElem("span");E.id=A;E.hide();E.style.position="absolute";E.className=C;E.setHTML(F);B.parentNode.insertBefore(E,B.nextSibling)}return E},filter:function(D){var C=[];for(var B=0,A=this.length;B<A;B++){if(D(this[B])){C.push[this[B]]}}return C},getSelectValue:function(B){var A=(typeof B==="string")?MVD.get(B):B;return A.options&&A.options[A.selectedIndex].value}});if(typeof MVD==="undefined"){MVD={}}if(!MVD.Ajax){MVD.Ajax=function(){var G=function(){var H=false;if(window.XMLHttpRequest){H=new XMLHttpRequest();if(H.readyState===null){H.readyState=1;H.addEventListener("load",function(){H.readyState=4;if(typeof (H.onreadystatechange)==="function"){H.onreadystatechange()}},false)}}else{if(window.ActiveXObject){try{H=new ActiveXObject("Msxml2.XMLHTTP")}catch(J){try{H=new ActiveXObject("Microsoft.XMLHTTP")}catch(I){}}}}return H};var E="";var B=".aspx";var C=encodeURIComponent;var D=function(J,I){var H=G();if(H){H.onreadystatechange=function(){if(H.readyState==4||H.readyState=="complete"){var L=0;try{L=H.status}catch(K){}if((L>=200)&&(L<300)){if(J){J(H.responseText)}}else{if(I){I(H.responseText)}}}}}return H};var A=function(I,K,J){var H=D(K,J);if(H){H.open("GET",I,true);H.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");H.send(null)}};var F=function(J,K,M,L){var I=D(M,L);if(I){I.open("POST",J,true);I.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var H="";for(var N in K){if(K.hasOwnProperty(N)){if(H){H+="&"}H+=N+"="+C(K[N])}}I.send(H)}};return{get:A,getGX:function(H,K,J,I){A(E+H+B+"?"+K,J,I)},updateGX:function(H,K,J){var I=document.getElementById(J);if(I){this.getGX(H,K,function(L){I.innerHTML=L})}},post:F,postGX:function(H,K,J,I){F(E+H+B,K,J,I)},setEncode:function(H){C=(H=="UTF8")?encodeURIComponent:escape;return this},setPrefix:function(H){E=H;return this},setExt:function(H){B=H;return this}}}();var jxcll=MVD.Ajax.get;var jxcllPost=MVD.Ajax.post}MVD.EventManager=function(){this.events={}};MVD.extend(MVD.EventManager.prototype,{addEventListener:function(A,B){var C=this.events;if(C[A]){C[A].push(B)}else{C[A]=[B]}},dispatchEvent:function(D,C){var E=this.events;if(E[D]){for(var B=0,A=E[D].length;B<A;B++){E[D][B](C)}}}});json_parse=function(){var D,B,A={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},M,K=function(N){throw {name:"SyntaxError",message:N,at:D,text:M}},G=function(N){if(N&&N!==B){K("Expected '"+N+"' instead of '"+B+"'")}B=M.charAt(D);D+=1;return B},F=function(){var O,N="";if(B==="-"){N="-";G("-")}while(B>="0"&&B<="9"){N+=B;G()}if(B==="."){N+=".";while(G()&&B>="0"&&B<="9"){N+=B}}if(B==="e"||B==="E"){N+=B;G();if(B==="-"||B==="+"){N+=B;G()}while(B>="0"&&B<="9"){N+=B;G()}}O=+N;if(isNaN(O)){K("Bad number")}else{return O}},H=function(){var Q,P,O="",N;if(B==='"'){while(G()){if(B==='"'){G();return O}else{if(B==="\\"){G();if(B==="u"){N=0;for(P=0;P<4;P+=1){Q=parseInt(G(),16);if(!isFinite(Q)){break}N=N*16+Q}O+=String.fromCharCode(N)}else{if(typeof A[B]==="string"){O+=A[B]}else{break}}}else{O+=B}}}}K("Bad string")},J=function(){while(B&&B<=" "){G()}},C=function(){switch(B){case"t":G("t");G("r");G("u");G("e");return true;case"f":G("f");G("a");G("l");G("s");G("e");return false;case"n":G("n");G("u");G("l");G("l");return null}K("Unexpected '"+B+"'")},L,I=function(){var N=[];if(B==="["){G("[");J();if(B==="]"){G("]");return N}while(B){N.push(L());J();if(B==="]"){G("]");return N}G(",");J()}}K("Bad array")},E=function(){var O,N={};if(B==="{"){G("{");J();if(B==="}"){G("}");return N}while(B){O=H();J();G(":");if(Object.hasOwnProperty.call(N,O)){K('Duplicate key "'+O+'"')}N[O]=L();J();if(B==="}"){G("}");return N}G(",");J()}}K("Bad object")};L=function(){J();switch(B){case"{":return E();case"[":return I();case'"':return H();case"-":return F();default:return B>="0"&&B<="9"?F():C()}};return function(Q,O){var N;M=Q;D=0;B=" ";N=L();J();if(B){K("Syntax error")}return typeof O==="function"?function P(U,T){var S,R,V=U[T];if(V&&typeof V==="object"){for(S in V){if(Object.hasOwnProperty.call(V,S)){R=P(V,S);if(R!==undefined){V[S]=R}else{delete V[S]}}}}return O.call(U,T,V)}({"":N},""):N}}();MVD.Cookies=function(){function A(B){return(B||"").replace(/^\s+|\s+$/g,"")}return{getAll:function(){var F={};if(document.cookie){var D,C=document.cookie.split(";");for(var E=0,B=C.length;E<B;E++){D=C[E].split("=");F[A(D[0])]=unescape(D[1])}}return F},check:function(B){return(document.cookie.indexOf(B)!=-1)},get:function(B){return this.getAll()[A(B)]},del:function(B){var C=new Date();C.setTime(C.getTime()-1);document.cookie=B+"=;expires="+C.toGMTString()+";path=/"},set:function(B,C){var D=new Date(2100,12,31);document.cookie=B+"="+escape(C)+";expires="+D.toGMTString()+";path=/"}}}();MVD.Form=function(A){this.id=A;this.form=null;this.errors=[];this.errElem=null;return this};MVD.extend(MVD.Form.prototype,{emailExp:/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/,numberExp:/^[0-9]+$/,init:function(){if(!this.form){this.form=document[this.id]}},submit:function(){this.form.submit()},get:function(A){return this.form[A].value},getInput:function(A){return this.form[A]},setValue:function(B,A){this.getInput(B).value=A},getSelectValue:function(B){var A=(typeof B==="string")?this.getInput(B):B;return A.options&&A.options[A.selectedIndex].value},setSelectValue:function(D,C){var B=(typeof D==="string")?this.getInput(D):D;if(B.options){var A=B.options.length-1;while(A>0){if(B.options[A].value===C){B.selectedIndex=A;return true}A--}}return false},setSelectOptions:function(E,B){var A,C=(typeof E==="string")?this.getInput(E):E;C.options.length=0;for(var D in B){if(B.hasOwnProperty(D)){A=document.createElement("option");A.setAttribute("value",D);A.innerHTML=B[D];C.appendChild(A)}}},getSelectOptions:function(F){var C={},D=(typeof F==="string")?this.getInput(F):F;var E=D.options;for(var B=0,A=E.length;B<A;B++){C[E[B].value]=E[B].innerHTML}return C},getFormElements:function(){var C=this.form.elements,B={};for(var A=0;A<C.length;A++){B[C[A].name]=C[A].value}return B},enable:function(C){var B=this.form.elements;for(var A=0;A<B.length;A++){if((B[A].type==="text")||(B[A].type==="textarea")){B[A].readOnly=!C}else{if(B[A].type==="submit"){B[A].disabled=!C}}}},clear:function(){var B=this.form.elements;for(var A=0;A<B.length;A++){B[A].value=""}},checkNotEmpty:function(A,B){if(this.form[A].value.length===0){this.errors.push(B);return false}return true},checkMail:function(A,B){if(!this.form[A].value.match(this.emailExp)){var C="La direcci&oacute;n de e-mail "+(B?B+" ":"")+"no es v&aacute;lida";this.errors.push(C);return false}return true},checkNumber:function(A,B){if(!this.form[A].value.match(this.numberExp)){this.errors.push(B);return false}return true},checkRegExp:function(A,B,C){if(!this.form[A].value.match(B)){this.errors.push(C);return false}return true},addError:function(A){this.errors.push(A)},setErrorElem:function(A){this.errElem=MVD.get(A)},showErrors:function(A){var B=this.errElem;if(B){if(A||this.errors.length>0){B.setHTML("<ul><li>"+(A?A:this.errors.join("</li><li>"))+"</li></ul>").show();B.showAndHide(this.errors.join("").length*50)}else{B.hide()}}},valid:function(){return(this.errors.length===0)},clearErrors:function(){this.errors=[]}});MVD.MenuDespl=function(F,B){this.base=MVD.extendElement(F);this.base.style.outline="none";this.menuCont=document.createElement("span");this.menuCont.style.position="absolute";F.parentNode.insertBefore(this.menuCont,F);var A=F.cloneNode(true);A.style.visibility="hidden";this.menuCont.appendChild(A);if(MVD.getComputedStyle(A,"display")!="block"){this.menuCont.appendChild(MVD.createElem("br"))}var E=MVD.createElem("div");this.menuDiv=E;E.className=B;this.menuCont.appendChild(E);var C=this;E.onmouseout=function(H){if(!H){H=event}var G;if(H.relatedTarget){G=H.relatedTarget}else{if(H.toElement){G=H.toElement}}if(G!=E&&G.parentNode!=E){C.close()}};var D=setTimeout(function(){C.close()},3000);E.onmouseover=function(){if(D){clearTimeout(D)}D=null};this.base.menu=this};MVD.extend(MVD.MenuDespl.prototype,{close:function(){this.base.menu=null;this.base.parentNode.removeChild(this.menuCont)},appendOption:function(A,D){var C=document.createElement("a");C.href="#";C.innerHTML=A;C.style.display="block";var B=this;C.onclick=function(){B.close();D();return false};this.menuDiv.appendChild(C)}});MVD.Tween=function(A){MVD.extend(this,{from:0,to:1,time:500,onFinish:null,update:function(){},onStart:null,mode:0,steps:1,step:0,timer:null,isActive:function(){return(this.timer!==null)},fps:30,stepFunction:null,transition:function(B){return 1-Math.cos(Math.PI*B/2)}});MVD.extend(this,A);return this};MVD.extend(MVD.Tween.prototype,{stepForward:function(){with(this){if(step>(steps-1)){update(to);clearInterval(timer);timer=null;if(onFinish){onFinish()}}else{step++;update(from+(to-from)*transition(step/steps))}}},stepBackward:function(){with(this){if(step<=0){update(from);clearInterval(timer);timer=null;if(onFinish){onFinish()}}else{step--;update(from+(to-from)*transition(step/steps))}}},programTimer:function(){var A=this;this.timer=setInterval(function(){A.stepFunction()},this.time/this.steps)},start:function(){if(this.timer===null){with(this){stepFunction=stepForward;if(onStart){onStart()}steps=Math.round((fps*time)/1000);step=0;update(from);programTimer()}}else{this.stepFunction=this.stepForward}},rewind:function(){if(this.timer==null){with(this){this.stepFunction=this.stepBackward;if(onStart){onStart()}steps=Math.round((fps*time)/1000);step=steps;update(to);programTimer()}}else{this.stepFunction=this.stepBackward}},stop:function(){if(this.timer){clearInterval(this.timer);this.timer=null}}});if(MVD.elemExtension){MVD.elemExtension.fadeOut=function(C){var B=this;if(!C){C=500}var A=new MVD.Tween({from:100,to:0,time:C,update:function(D){B.setOpacity(D)},onFinish:function(){B.hide();B.setOpacity(100)}});A.start()};MVD.elemExtension.fadeIn=function(C){var B=this;if(!C){C=500}var A=new MVD.Tween({from:0,to:100,time:C,update:function(D){B.setOpacity(D)},onStart:function(){B.setOpacity(0);B.show()}});A.start()}}MVD.Window=function(){var B,E,D,C;function A(F){return(typeof (F)==="number")}if(A(window.innerHeight)){B=function(){return document.body.clientWidth};E=function(){return window.innerHeight}}else{if(document.documentElement&&(document.documentElement.clientWidth>0)){B=function(){return document.documentElement.clientWidth};E=function(){return document.documentElement.clientHeight}}else{if(document.body&&A(document.body.clientWidth)){B=function(){return document.body.clientWidth};E=function(){return document.body.clientHeight}}else{B=function(){return 0};E=B}}}if(A(window.pageYOffset)){C=function(){return window.pageYOffset};D=function(){return window.pageXOffset}}else{if(document.body&&A(document.body.scrollLeft)&&document.documentElement&&A(document.documentElement.scrollLeft)){C=function(){return document.body.scrollTop||document.documentElement.scrollTop};D=function(){return document.body.scrollLeft||document.documentElement.scrollLeft}}else{if(document.body&&A(document.body.scrollLeft)){C=function(){return document.body.scrollTop};D=function(){return document.body.scrollLeft}}else{if(document.documentElement&&A(document.documentElement.scrollLeft)){C=function(){return document.documentElement.scrollTop};D=function(){return document.documentElement.scrollLeft}}else{C=function(){return 0};D=C}}}}return{getViewHeight:E,getViewWidth:B,getScrollX:D,getScrollY:C}}();MVD.getComputedStyle=function(D,A,E){var F;if(!E){E=A}if(D.currentStyle){F=D.currentStyle[E];if(!/^\d+(px)?$/i.test(F)&&/^\d/.test(F)){var C=D.style.left;var B=D.runtimeStyle.left;D.runtimeStyle.left=D.currentStyle.left;D.style.left=F||0;F=D.style.pixelLeft+"px";D.style.left=C;D.runtimeStyle.left=B}}else{if(document.defaultView&&document.defaultView.getComputedStyle){F=document.defaultView.getComputedStyle(D,null).getPropertyValue(A)}}return F};MVD.Dialog=function(A){this.title=null;this.el=null;this.content=null;this.className=A;this.blocker=null;this.buttons=null;return this};MVD.extend(MVD.Dialog.prototype,{block:function(){var A=MVD.createElem("div");A.style.position="absolute";A.style.background="black";A.setOpacity(0);this.blocker=A;document.body.appendChild(A)},setTitle:function(A){if(!this.title){this.title=MVD.createElem("div");this.title.className="DialogTitle";this.el.insertBefore(this.title,this.content)}this.title.setHTML(A);this.reposition()},open:function(){this.block();var A=MVD.createElem("div");A.className=this.className;A.hide();A.style.position="absolute";document.body.appendChild(A);var B=MVD.createElem("div");B.className="DialogContent";A.appendChild(B);this.el=A;this.content=B},close:function(){var A=this;this.tween.onFinish=function(){document.body.removeChild(A.blocker);A.blocker=null};this.tween.rewind();document.body.removeChild(this.el);this.content=null;this.el=null;this.buttons=null;window.onresize=null;window.onscroll=null},setContent:function(A){this.content.setHTML(A);this.reposition()},setSize:function(B,A){this.el.setWidth(B).setHeight(A)},getWidth:function(){var A=this.el.getWidth();if(!A){A=parseInt(MVD.getComputedStyle(this.el,"width"),10);if(!A){A=this.el.offsetWidth}}return A},getHeight:function(){var A=this.el.getHeight();if(!A){A=parseInt(MVD.getComputedStyle(this.el,"height"),10);if(!A){A=this.el.offsetHeight}}return A},reposition:function(){var C=MVD.Window.getScrollY(),F=MVD.Window.getViewHeight();var E=MVD.Window.getScrollX(),B=MVD.Window.getViewWidth();var D=C+((F-this.getHeight())/2);var A=E+((B-this.getWidth())/2);this.el.setTop(D).setLeft(A);this.blocker.setWidth(B).setHeight(F);this.blocker.setTop(C).setLeft(E)},show:function(B){var A=this.blocker;this.tween=new MVD.Tween({to:30,time:100,update:function(E){A.setOpacity(E)}});this.tween.start();this.el.show();this.reposition();var D=this;var C=function(){D.reposition()};window.onresize=C;window.onscroll=C},appendButton:function(B){if(!this.buttons){this.buttons=MVD.createElem("div");this.buttons.className="DialogButtons";this.el.appendChild(this.buttons)}var A=MVD.createElem("a");A.className="btn";A.setHTML(B);this.buttons.appendChild(A);this.reposition();return A},appendClickButton:function(C,B){var A=this.appendButton(C);A.href="#";A.onclick=function(){B();return false}},appendLinkButton:function(E,C,D){var A=this.appendButton(E);A.href=C;var B=this;A.onclick=function(){B.close();return true}},appendCloseButton:function(){var A=this;this.appendClickButton("Cerrar",function(){A.close()})},appendAcceptButton:function(){var A=this;this.appendClickButton("Aceptar",function(){if(A.onAccept){A.onAccept()}A.close()})}});MVD.DialogMsg=function(B,A){this.el=null;this.content=null;this.className=A;this.blocker=null;this.buttons=null;this.open();this.setContent(B);this.appendCloseButton();this.show();return this};MVD.DialogMsg.prototype=MVD.Dialog.prototype;if(typeof MVD.CMS==="undefined"){MVD.CMS={}}MVD.CMS.HelpDialog=function(){var A;var B=new MVD.Dialog("MyDialog");return{show:function(){if(A){B.open();B.setContent("Cargando");B.appendCloseButton();B.show();MVD.Ajax.get(A,function(C){B.setContent(C)},function(){B.setContent("Lamentablemente la ayuda no est&aacute; disponible.")})}},setUrl:function(C){A=C}}}();MVD.CMS.LoginDialog=function(){var B;var A=new MVD.Dialog("MyDialog");return{show:function(C){texto=C;A.open();A.setContent(C);if(B){A.appendLinkButton("Iniciar",B,"_blank")}A.appendCloseButton();A.show()},setLink:function(C){B=C}}}();MVD.CMS.MyConfigDialog=function(desbloquearCallBack){this.el=null;this.content=null;this.className="MyDialog";var that=this;var desbloquear=function(){var l=this.content.getElementsByTagName("input");var inp;for(var i=0;i<l.length;i++){inp=l[i];if(!inp.checked){MVD.Ajax.postGX("ancomocultausrreg",{UsrRegId:inp.value,Action:"D"},desbloquearCallBack)}}};var miConfigCont=function(txt){var s;var data;eval("data = "+txt);var cant=0;if(data){var res=data[0];if(res==-1){that.close();MVD.CMS.LoginDialog.show("Debe iniciar la sesi&oacute;n para editar su configuraci&oacute;n.")}else{var usr=data[1];cant=usr.length;if(cant>0){s='<div style="margin: 4px; width: 140px;'+(cant>10?"height: 190px; overflow: auto;":"")+'">';s+="<ul>";for(var i=0;i<cant;i++){s+='<li><input value="'+usr[i].id+'" type="checkbox" checked>'+usr[i].nick+"</li>"}s+="</ul>";that.appendAcceptButton();that.onAccept=desbloquear;that.setTitle("Usuarios ocultos:");s+="</div>"}else{s="No hay usuarios ocultos."}that.appendCloseButton();that.setContent(s)}}};var miConfigError=function(){that.setContent("Se produjo un error, vuelva a intentarlo m&aacute;s tarde.<br>Gracias.");that.appendCloseButton()};this.load=function(){this.open();this.setContent("Cargando...");this.show();MVD.Ajax.getGX("ancomgetusrregocultos","",miConfigCont,miConfigError)};return this};MVD.CMS.MyConfigDialog.prototype=MVD.Dialog.prototype;MVD.CMS.ComHidden=function(){var H={hide:"Ocultar comentarios de este usuario",conf:"Mi configuraci&oacute;n",show:"Mostrar comentarios de este usuario",showThis:"Mostrar este comentario",help:"Ayuda"};var F={errSesionHide:"Debe iniciar la sesi&oacute;n para ocultar o mostrar usuarios."};var E;function D(K){var J={};if(K){for(var I=0;I<K.length;I++){J[K[I]]=true}}return J}function B(I){var J=json_parse(I);if(J[0]==-1){MVD.CMS.LoginDialog.show(F.errSesionHide)}else{E=D(J[1]);MVD.CMS.ComPag.refreshPage()}}function A(I,M,L){var J=new MVD.MenuDespl(I,"menuCom");var K;J.appendOption(H.show,function(){MVD.Ajax.postGX("ancomocultausrreg",{UsrRegId:L,Action:"D"},B)});J.appendOption(H.conf,function(){var N=new MVD.CMS.MyConfigDialog(B);N.load()});J.appendOption(H.help,MVD.CMS.HelpDialog.show);return J}function G(I,M,L){var J=new MVD.MenuDespl(I,"menuCom");var K;J.appendOption(H.hide,function(){MVD.Ajax.postGX("ancomocultausrreg",{UsrRegId:L,Action:"B"},B)});J.appendOption(H.conf,function(){var N=new MVD.CMS.MyConfigDialog(B);N.load()});J.appendOption(H.help,MVD.CMS.HelpDialog.show);return J}function C(L,O,N){var M=!(E[N]);var K;var I=L.allWithClass("btnMenuCom");for(var J=0;J<I.length;J++){K=I[J];if(K){K.onclick=function(){if(!this.menu){(M?G:A)(this,O,N)}return false}}}}return{setUsers:function(I){E=D(I)},isUserHidden:function(I){return E[I]},programarMenu:C}}();MVD.CMS.ComPag=function(){var A=60;var O;var a;var g;var E;var p,J;var i="";var h={nick:/%%NNotComUsrRegNick%%/g,date:/%%NNotComFechaHora%%/g,txt:/%%NNotComTexto%%/g,id:/%%NNotComId%%/g,usr:/%%NNotComUsrRegId%%/g};var j={NNotCantCom:"cantComs",com_nro_pag1:"nroPag",com_nro_pag2:"nroPag",com_cant_pag1:"cantPag",com_cant_pag2:"cantPag"};var y={"buenos":"que aportan (0 o mejor)","inter":"intermedios (-4 o mejor)","mejores":"ordenados por calificaci&oacute;n","todos":"todos","no":"ninguno"};var R;var t,Y,q;var o;var c=0;var x=0;var W=new Image();var w="";var I=true;var b=[];var L=MVD.Cookies.get("filterSelect")||"inter";var Z=new MVD.EventManager();function r(){var AC=a.innerHTML;a.innerHTML="";var z=/%%ComentarioVisible_INI%%([\s\S]*)%%ComentarioVisible_FIN%%/g;var AA=z.exec(AC);if(AA){p=AA[1]}else{p=AC;J=AC;return }var AB=/%%ComentarioOculto_INI%%([\s\S]*)%%ComentarioOculto_FIN%%/g;AA=AB.exec(AC);if(AA){J=AA[1]}else{J=p}}var n=function(){var z=function(AE,AD){return'<a href="#" onclick="return MVD.CMS.ComPag.pag('+AE+')">'+AE+AD+"</a> "};var AC="";var AB=Math.floor(Y/10)*10;var AA=AB-10;while((AA>=(AB-50))&&(AA>=0)){if(AA===0){AA=1}AC=z(AA,"..")+AC;AA-=10}AA=AB;if(AA===0){AA=1}while((AA<=AB+9)&&(AA<=q)){if(AA===Y){if(w){AC+='<span class="'+w+'">'+AA+"</span> "}else{AC+="["+AA+"] "}}else{AC+=z(AA,"")}AA++}while((AA<=(AB+50))&&(AA<=q)){AC+=z(AA,"..");AA+=10}return AC};var F=/[\xad|\xa0]/g;var C=function(z){return z.replace(F,"-")};function u(AB,z,AA){var AE=AA||MVD.CMS.ComHidden.isUserHidden(AB.usr);var AD=(AA||(!AE&&z))?p:J;for(var AC in h){if(h.hasOwnProperty(AC)){AD=AD.replace(h[AC],(AC==="nick"?C(AB[AC]):AB[AC]))}}return AD}function v(z){var AA=MVD.get("comment"+z.id);AA.setHTML(u(z,1,1));MVD.CMS.ComHidden.programarMenu(AA,z.id,z.usr);MVD.CMS.ComCal.setup(AA,z.id,z.pos,z.neg);T(AA,z)}function T(AC,AB){var z=AC.firstWithClass("btnShowComment");if(z){z.onclick=function(){v(AB);return false}}var AA=AC.firstWithClass("uoculto");if(AA){if(!MVD.CMS.ComHidden.isUserHidden(AB.usr)){AA.hide()}}}var V=/^(.+)[ ,.;](.+)$/;function U(AA){var z=V.exec(AA);return z&&z[1]}function S(AF,AC){var AA=AC.firstWithClass("commentText");var AE;function AB(){return AA.offsetHeight||parseInt(MVD.getComputedStyle(AA,"height"),10)}function AD(AG){var AH,AI;if(AG<AE.length){AI=U(AE.slice(0,AG-1));AH=AI?AI+" ...":AE}else{AH=AE}AA.innerHTML=AH;return AB()}function z(AI,AH){if(AI==AH){return AI}if((AI+1)==AH){if(AD(AH)<A){return AH}else{return AI}}var AG=Math.floor((AI+AH)/2);if(AD(AG)<A){return z(AG,AH)}else{return z(AI,AG)}}if(AA){AE=AA.innerHTML;AA.style.visibility="hidden";setTimeout(function(){var AH=AB();if(AH>A){AD(z(0,AE.length));var AI=AB();var AG=AC.firstWithClass("commentExpand");if(AG){AG.show();AG.onclick=function(){AG.hide();this.onclick=null;AA.setHeight(AI);AA.innerHTML=AE;(new MVD.Tween({from:AI,to:AH,update:function(AJ){AA.setHeight(AJ)},time:(AH-AI)*2})).start();return false}}}AA.style.visibility="visible"},10)}}function l(AB,AA){var z=(AB-AA);return(L!="inter")?(z>=0):(z>=-4)}function f(){return(L=="mejores")?"C":"F"}function d(){return(L!="todos")&&(L!="mejores")}function H(){var AA,z;a.innerHTML="";o.foreach(function(AC,AB){AA=MVD.createElem("div");AA.setAttribute("id","comment"+AB.id);AA.className="comment";AA.setHTML(u(AB,!d()||l(AB.pos,AB.neg)));T(AA,AB);MVD.CMS.ComHidden.programarMenu(AA,AB.id,AB.usr);MVD.CMS.ComCal.setup(AA,AB.id,AB.pos,AB.neg);a.appendChild(AA);S(AB.id,AA)})}function s(){if(L!="no"){H();E.show()}else{E.hide()}}function D(z){if(q>1){z.anterior[(Y<=1)?"hide":"show"]();z.siguiente[(Y==q)?"hide":"show"]();z.container.show()}else{z.container.hide()}}function G(){var z=n();b.foreach(function(AA,AB){D(AB);AB.paginas.setHTML(z)})}function e(){b.foreach(function(z,AA){AA.container.hide()})}var N=function(AD){if(x){clearTimeout(x);x=0}var z=AD;AD=AD.replace(/\r/g," ");AD=AD.replace(/\n/g," ");var AC,AA;AC=json_parse(AD);if(AC!==null){MVD.CMS.ComHidden.setUsers(AC.hidden);o=AC.coms;Y=AC.nroPag;q=AC.cantPag;t=AC.cantComs;var AB=MVD.getSafe("commentsPageCounter");for(AA in j){if(j.hasOwnProperty(AA)){MVD.getSafe(AA).innerHTML=AC[j[AA]]}}if(q>1){AB.show();G()}else{AB.hide();e()}s();R=true;g.show();if(I){I=false}else{window.location.hash="com"}}else{g.hide()}};var k=function(AA){var z="<br><br><br><br><br>";z+=z;a.innerHTML=z+"<center>"+AA+"</center>"+z};var K=function(){if(x){clearTimeout(x);x=0}k("Ocurri&oacute; un error en el servidor, int&eacute;ntelo m&aacute;s tarde. Gracias.");R=true};var M=function(){k('<img src="'+W.src+'">');if(x){clearTimeout(x);x=0}};function B(z){R=false;x=setTimeout(M,1000);MVD.Ajax.postGX("ancomgetpag",{uc:O,pag:z,order:f()},N,K)}function X(){MVD.Ajax.postGX("ancomgetpag",{uc:O,pag:1,order:f()},function(z){N(z);Z.dispatchEvent("onFirstLoad")})}function Q(){var z=MVD.get("commentsFilter");if(z){z.onclick=function(){var AA=new MVD.MenuDespl(z,"menuCom");for(var AB in y){if(y.hasOwnProperty(AB)){(function(){var AC=AB;AA.appendOption(y[AB],function(){var AD=f();L=AC;MVD.Cookies.set("filterSelect",L);z.setHTML(y[L]);if(AD!=f()){MVD.CMS.ComPag.pag(1)}else{MVD.CMS.ComPag.refreshPage()}})})()}}return false};z.setHTML(y[L])}}function m(AA){var z=MVD.get(AA);var AB={container:z};["primero","anterior","siguiente","ultimo","paginas"].foreach(function(AC,AD){AB[AD]=z.firstWithClass(AD)||MVD.elemNull});AB.primero.onclick=function(){if(R&&Y>1){B(1)}return false};AB.anterior.onclick=function(){if(R&&Y>1){B(Y-1)}return false};AB.siguiente.onclick=function(){if(R&&Y<q){B(Y+1)}return false};AB.ultimo.onclick=function(){if(R&&Y<q){B(99999)}return false};b.push(AB)}function P(){a=MVD.get("lista_comentarios");r();var z=MVD.get("com_separador");if(z){i=z.innerHTML;z.innerHTML=""}m("com_pag1");m("com_pag2");g=MVD.get("commentsBlock");E=MVD.get("commentsView");X();Q()}return{init:function(z){O=z;MVD.CMS.ComCal.init(z);P();return this},pag:function(z){if(R){B(z)}return false},setImgProgress:function(z){W.src=z;return this},setCurrentPageClass:function(z){w=z;return this},getCantComs:function(){return t},refreshPage:function(){s()},addEventListener:function(z,AA){Z.addEventListener(z,AA)},updateCommentCalification:function(AE,AD,AC){var AA;for(var AB=0,z=o.length;AB<z;AB++){AA=o[AB];if(AA.id==AE){AA.pos=AD;AA.neg=AC;return }}}}}();MVD.CMS.ComCal=function(){var B;function C(D,G,F){var E=G-F;D.innerHTML=""+E;D.className=(E>0)?"comment_pos":(E<=-4)?"comment_neg":"comment_med"}function A(E,D){D.className+=" btnCalDisabled";E.className+=" btnCalDisabled";D.onclick=E.onclick=function(){return false}}return{init:function(D){B=D},setup:function(H,K,J,I){var D=H.firstWithClass("caltot");if(!D){return }C(D,J,I);var G=H.firstWithClass("calpos");if(!G){return }var F=H.firstWithClass("calneg");function E(N){var L;switch(N){case"2":L="Ya calificaste el comentario";break;case"3":L="No puedes calificar tu propio comentario";break;default:L="Hubo un error al procesar su calificaci&oacute;n. Int&eacute;ntelo m&aacute;s tarde";break}var O=MVD.addNotice(D,"avicaltot"+K,L,"calError");O.fadeIn();var M=setTimeout(function(){O.fadeOut()},3000)}G.onclick=function(){A(G,F);MVD.Ajax.postGX("annotcomcal",{NNotId:B,NNotComId:K,Cal:1},function(L){if(L=="0"){MVD.CMS.ComPag.updateCommentCalification(K,J+1,I);C(D,J+1,I)}else{E(L)}});return false};F.onclick=function(){A(G,F);MVD.Ajax.postGX("annotcomcal",{NNotId:B,NNotComId:K,Cal:-1},function(L){if(L=="0"){MVD.CMS.ComPag.updateCommentCalification(K,J,I+1);C(D,J,I+1)}else{E(L)}});return false}}}}();if(typeof MVD.CMS==="undefined"){MVD.CMS={}}MVD.CMS.ComSend=function(){var Y;var G=false;var I=false;var X;var g=false;var e=0;var V=/^[0-9A-Za-z_]+$/;var K=0;var N,H,b;var L;var c={comSendMod:"El comentario fue enviado, el equipo de contenido decidir&aacute; si el mismo ser&aacute; publicado o no. Gracias.",comSend:"El comentario fue enviado con &eacute;xito. El Administrador se reserva el derecho de publicaci&oacute;n.",comSendError:"Ocurri&oacute; un error al enviar su comentario. Int&eacute;ntelo nuevamente en unos minutos. Gracias.",nickEmptyError:"Debe ingresar un Nick.",comEmptyError:"El texto del comentario no puede estar vac&iacute;o.",nickNotAvailable:"Ese nick est&aacute; siendo utilizado por otro usuario.",nickSendError:"Hubo un error al actualizar su nick. Int&eacute;ntelo nuevamente en unos minutos. Gracias.",userBlocked:"No puede dejar m&aacute;s comentarios.",generalError:"Ocurri&oacute; un error inesperado, vuelva a intentarlo m&aacute;s tarde. Gracias.",noLoginMsg:"Debe iniciar la sesi&oacute;n para enviar comentarios.",docWarning:"Incluir el d&iacute;gito verificador, sin punto ni guiones.<br>Nota: No podr&aacute;s cambiar tu c&eacute;dula despu&eacute;s de que la ingreses.",nickFormatError:"El nick solo puede tener letras, n&uacute;meros y gui&oacute;n bajo (_).",docEmptyError:"Debe ingresar su n&uacute;mero de documento.",docFormatError:"El documento solo debe tener n&uacute;meros",docCountryError:"Debe seleccionar el pa&iacute;s de su documento.",docCIError:"El n&uacute;mero de documento ingresado no corresponde a una c&eacute;dula de identidad v&aacute;lida.",docConfirmError:"Estimado usuario: para poder comentar debe enviar una constancia de domiclio (recibo, carnet social, mutualista, etc) a comentarios@montevideo.com.uy",docDuplicatedError:"Ya hay un usuario registrado con el mismo documento.",tooManyDocErrors:"Se excedi&oacute; la cantidad de errores permitidos en el ingreso de documento.",mustUseOtherUserError:"Ya hay otro usuario habilitado con el mismo documento para dejar comentarios."};var Q;var T=function(j,f){var i=(j in c)?c[j]:j;N.setHTML(i);if(!f){N.showAndHide(i.length*50)}else{N.show()}};var U=function(){var i=0;try{i=MVD.CMS.ComPag.getCantComs()}catch(f){}if(i>8){MVD.getSafe("enviacom2").show()}};var E=function(f){if(f==="1"){MVD.CMS.ComPag.pag(1);T("comSend");if(K){MVD.Ajax.updateGX("ablogultimoscomentariosj1",K,"blogUltimosComentarios")}}else{if(f==="2"){T("comSendMod")}else{T("comSendError")}}MVD.get("enviacom").show();U();Y.enable(true);H.hide();b.hide();Y.getInput("comentario").value=""};var D=function(){T("comSendError");H.hide();Y.enable(true)};var M=function(){MVD.Ajax.postGX("anguardacomentario",{NNotId:e,BlogId:K,comentario:Y.get("comentario")},E,D)};function R(){if(!G){Q()}else{if(X&&!I){J()}else{M()}}}function h(){H.hide();if(X&&!I){Y.getInput("paisdoc").onchange()}Y.enable(true)}function W(){Y.enable(false);MVD.getSafe("paisnotice").hide();H.show()}var P=function(){Y.init();Y.clearErrors();if(!G){if(Y.checkNotEmpty("nick",c.nickEmptyError)){Y.checkRegExp("nick",V,c.nickFormatError)}}if(X&&!I){if(Y.checkNotEmpty("doc",c.docEmptyError)){if(Y.checkNumber("doc",c.docFormatError)){if(parseInt(Y.get("doc"),10)==0){Y.addError(c.docEmptyError)}}}var f=Y.getSelectValue("paisdoc");if(!f||(f==="0")||(f=="ND")){Y.addError(c.docCountryError)}}Y.checkNotEmpty("comentario",c.comEmptyError);Y.showErrors();if(Y.valid()){W();R()}return false};var C=function(f){switch(f){case"0":G=true;MVD.get("nick").hide();MVD.get("usrnick").setHTML(Y.get("nick")).show();R();break;case"4":Y.showErrors(c.nickNotAvailable);h();Y.getInput("nick").focus();break;default:Y.showErrors(c.nickSendError);h();Y.getInput("nick").focus();break}};function F(i){var f=json_parse(i);switch(f.result){case 0:I=true;MVD.get("doc").hide();MVD.get("usrdoc").setHTML(Y.get("doc")).show();MVD.get("paisdoc").hide();MVD.get("usrpaisdoc").setHTML(Y.getSelectOptions("paisdoc")[Y.getSelectValue("paisdoc")]).show();R();break;case 3:Y.showErrors(c.docCIError);h();Y.getInput("doc").focus();break;case 4:b.hide();T("docConfirmError");break;case 6:b.hide();T("tooManyDocErrors");break;case 7:b.hide();var j=c.mustUseOtherUserError;T(j.replace(/%%user%%/,f.usrmustuse));break;case 8:Y.showErrors(c.docDuplicatedError);h();Y.getInput("doc").focus();break;default:b.hide();T("generalError");break}}function Q(){MVD.Ajax.postGX("anupdnick",{nick:Y.get("nick")},C)}function J(){MVD.Ajax.postGX("anupddoc",{doc:Y.get("doc"),paisdoc:Y.get("paisdoc")},F)}var a=function(){return MVD.Cookies.check("comautoform=1")};var A=function(){MVD.Cookies.del("comautoform")};var B=function(){MVD.Cookies.set("comautoform","1")};function Z(){T("noLoginMsg",true);if(!g){B()}g=false}function S(k){MVD.get("usrmail").setHTML(k.mail);if(k.nick&&V.test(k.nick)){MVD.get("nick").hide();MVD.get("usrnick").setHTML(k.nick);G=true}else{Y.setValue("nick",k.nick);MVD.get("usrnick").hide()}X=k.docRequired;if(k.docRequired){if(k.docValid){MVD.get("doc").hide();MVD.get("usrdoc").setHTML(k.docNum);MVD.get("paisdoc").hide();MVD.get("usrpaisdoc").setHTML(k.docCtryName);I=true}else{MVD.get("usrdoc").hide();Y.setValue("doc",k.docNum);MVD.get("usrpaisdoc").hide();var j=Y.getInput("paisdoc");Y.setSelectOptions(j,k.ctryLst);Y.setSelectValue(j,k.docCtry||"UY");var i=MVD.addNotice("paisdoc","paisnotice",c.docWarning,"avisoDocumentoComentarios");j.onchange=function(){if(Y.getSelectValue(this)==="UY"){i.fadeIn()}else{i.fadeOut()}};j.onchange()}}else{var f=MVD.get("com_form").getElementsByTagName("table")[0].getElementsByTagName("tr");f[1].style.display="none";f[2].style.display="none"}b.show();if(!G){Y.getInput("nick").focus()}else{Y.getInput("comentario").focus()}Y.enable(true)}var d=function(f){var i=json_parse(f);window.location.hash="form_com";if(i&&i.state){switch(i.state){case 0:Z();break;case 2:T("userBlocked",true);break;case 3:T("tooManyDocErrors");break;case 4:b.hide();T("mustUseOtherUserError",true);break;case 9:T(i.errmsg);break;case 1:S(i);break}}else{Z()}};var O=function(){MVD.get("enviacom").hide();MVD.getSafe("enviacom2").hide();MVD.Ajax.getGX("anusrregcom2",e,d,function(){T("generalError");MVD.get("enviacom").show();U()});return false};return{validar:P,init:function(j,i){e=j;K=i||0;if(K){c.comSendMod="El comentario fue enviado, el propietario del blog decidir&aacute; si el mismo ser&aacute; publicado o no. Gracias.";c.comSend="El comentario fue enviado con &eacute;xito"}N=MVD.get("no_com");H=MVD.get("env_status");b=MVD.get("com_form");MVD.get("enviacom").onclick=O;MVD.getSafe("enviacom2").onclick=O;var f=MVD.get("comentario");if(f){f.onpaste=function(){return false}}Y=new MVD.Form("MAINFORM");Y.setErrorElem("blockerror");Y.init();document.MAINFORM.onsubmit=P;if(MVD.CMS.ComPag){MVD.CMS.ComPag.addEventListener("onFirstLoad",function(){if(a()){g=true;A()}U()})}return this},setNoLoginMsg:function(f){c.noLoginMsg=f;return this},setMessage:function(i,f){c[i]=f;return this}}}()