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},listToObject:function(C){var B={};if(C){for(var A=0;A<C.length;A++){B[C[A]]=true}}return B},ObjectToArray:function(C){var A=[];for(var B in C){if(C.hasOwnProperty(B)){A.push(B)}}return A}});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};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){var H=window.event}var I=E;var G=(H.relatedTarget||H.toElement);while((G!=I)&&(G.nodeName!="BODY")&&(G.nodeName!="HTML")){G=G.parentNode}if(G!=I){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)},createOption: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};return C},createLink:function(A,B,C){var E=document.createElement("a");E.href=B;if(C){E.target=C}E.innerHTML=A;E.style.display="block";var D=this;E.onclick=function(){D.close();return true};return E},appendOption:function(A,B){this.menuDiv.appendChild(this.createOption(A,B))},appendSeparation:function(){this.menuDiv.appendChild(document.createElement("hr"))},appendCheck:function(A,B,D){var C=this.createOption(A,D);C.className="menuItemCheck"+(B?"On":"Off");this.menuDiv.appendChild(C)},appendLink:function(A,B,C){this.menuDiv.appendChild(this.createLink(A,B,C))},appendOptions:function(C){if(C&&C.length){var D;for(var B=0,A=C.length;B<A;B++){D=C[B];if(D.link){this.appendLink(D.text,D.link,D.target)}else{this.appendOption(D.text,D.callback)}}}}});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.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 D;function B(I){var J=json_parse(I);if(J[0]==-1){MVD.CMS.LoginDialog.show(F.errSesionHide)}else{D=MVD.listToObject(J[1]);MVD.CMS.ComPag.refreshPage()}}function E(J,K,I){J.appendOptions(MVD.CMS.Social.getMenuOptions(K,I));J.appendOption(H.conf,function(){(new MVD.CMS.MyConfigDialog(B)).load()});J.appendOption(H.help,MVD.CMS.HelpDialog.show)}function A(J,M,L,I){var K=new MVD.MenuDespl(J,"menuCom");K.appendOption(H.show,function(){MVD.Ajax.postGX("ancomocultausrreg",{UsrRegId:L,Action:"D"},B)});E(K,L,I);return K}function G(J,M,L,I){var K=new MVD.MenuDespl(J,"menuCom");K.appendOption(H.hide,function(){MVD.Ajax.postGX("ancomocultausrreg",{UsrRegId:L,Action:"B"},B)});E(K,L,I);return K}function C(M,P,O,I){var N=!(D[O]);var L;var J=M.allWithClass("btnMenuCom");for(var K=0;K<J.length;K++){L=J[K];if(L){L.onclick=function(){if(!this.menu){(N?G:A)(this,P,O,I)}return false}}}}return{setUsers:function(I){D=MVD.listToObject(I)},isUserHidden:function(I){return D[I]},programarMenu:C}}();MVD.CMS.ComPag=function(){var A=60;var Q;var d;var j;var E;var s,K;var l="";var k={nick:/%%NNotComUsrRegNick%%/g,date:/%%NNotComFechaHora%%/g,txt:/%%NNotComTexto%%/g,id:/%%NNotComId%%/g,usr:/%%NNotComUsrRegId%%/g};var m={NNotCantCom:"cantComs",com_nro_pag1:"nroPag",com_nro_pag2:"nroPag",com_cant_pag1:"cantPag",com_cant_pag2:"cantPag"};var AC={"buenos":"que aportan (0 o mejor)","inter":"intermedios (-4 o mejor)","mejores":"ordenados por calificaci&oacute;n","todos":"todos","no":"ninguno"};var T;var w,b,t;var r;var f=0;var AB=0;var Z=new Image();var AA="";var J=true;var e=[];var M=MVD.Cookies.get("filterSelect")||"inter";var z=parseInt(MVD.Cookies.get("reputationSelect")||"0",10);var F=function(){return !z};var c=new MVD.EventManager();function u(){var AG=d.innerHTML;d.innerHTML="";var AD=/%%ComentarioVisible_INI%%([\s\S]*)%%ComentarioVisible_FIN%%/g;var AE=AD.exec(AG);if(AE){s=AE[1]}else{s=AG;K=AG;return }var AF=/%%ComentarioOculto_INI%%([\s\S]*)%%ComentarioOculto_FIN%%/g;AE=AF.exec(AG);if(AE){K=AE[1]}else{K=s}}var q=function(){var AD=function(AI,AH){return'<a href="#" onclick="return MVD.CMS.ComPag.pag('+AI+')">'+AI+AH+"</a> "};var AG="";var AF=Math.floor(b/10)*10;var AE=AF-10;while((AE>=(AF-50))&&(AE>=0)){if(AE===0){AE=1}AG=AD(AE,"..")+AG;AE-=10}AE=AF;if(AE===0){AE=1}while((AE<=AF+9)&&(AE<=t)){if(AE===b){if(AA){AG+='<span class="'+AA+'">'+AE+"</span> "}else{AG+="["+AE+"] "}}else{AG+=AD(AE,"")}AE++}while((AE<=(AF+50))&&(AE<=t)){AG+=AD(AE,"..");AE+=10}return AG};var G=/[\xad|\xa0]/g;var C=function(AD){return AD.replace(G,"-")};function x(AF,AD,AE){var AI=AE||MVD.CMS.ComHidden.isUserHidden(AF.usr);var AH=(AE||(!AI&&AD))?s:K;for(var AG in k){if(k.hasOwnProperty(AG)){AH=AH.replace(k[AG],(AG==="nick"?C(AF[AG]):AF[AG]))}}return AH}function y(AD){var AE=MVD.get("comment"+AD.id);AE.setHTML(x(AD,1,1));MVD.CMS.ComHidden.programarMenu(AE,AD.id,AD.usr,AD.nick);MVD.CMS.ComCal.setup(AE,AD.id,AD.pos,AD.neg);MVD.CMS.UserStates.setup(AE,AD.usr,AD.nick);W(AE,AD)}function W(AG,AF){var AD=AG.firstWithClass("btnShowComment");if(AD){AD.onclick=function(){y(AF);return false}}var AE=AG.firstWithClass("uoculto");if(AE){if(MVD.CMS.ComHidden.isUserHidden(AF.usr)){AE.setHTML("(Comentarista Oculto)").show()}else{if(!AF.vis&&!F()){AE.setHTML('<a href="http://www.montevideo.com.uy/hnnoticiaj1.aspx?87987" target="_blank">(Baja valoraci&oacute;n en el Portal)</a>').show()}else{AE.hide()}}}}var Y=/(.+)[ ,.;](.+)/;function X(AE){var AD=Y.exec(AE);return AD&&AD[1]}function V(AD,AE){var AK=AE.firstWithClass("commentText");var AM;function AJ(){return AK.offsetHeight||parseInt(MVD.getComputedStyle(AK,"height"),10)}function AG(AN){var AO,AP;if(AN<AM.length){AP=X(AM.slice(0,AN-1));AO=AP?AP+" ...":AM}else{AO=AM}AK.innerHTML=AO;return AJ()}function AI(AP,AO){if(AP==AO){return AP}if((AP+1)==AO){if(AG(AO)<A){return AO}else{return AP}}var AN=Math.floor((AP+AO)/2);if(AG(AN)<A){return AI(AN,AO)}else{return AI(AP,AN)}}if(AK){AM=AK.innerHTML;var AH=AJ();if(AH>A){AG(AI(0,AM.length));var AF=AJ();var AL=AE.firstWithClass("commentExpand");if(AL){AL.show();AL.onclick=function(){AL.hide();this.onclick=null;AK.setHeight(AF);AK.innerHTML=AM;(new MVD.Tween({from:AF,to:AH,update:function(AN){AK.setHeight(AN)},time:(AH-AF)*2})).start();return false}}}}AE.style.visibility=""}function o(AF,AE){var AD=(AF-AE);return(M!="inter")?(AD>=0):(AD>=-4)}function i(){return(M=="mejores")?"C":"F"}function g(){return(M!="todos")&&(M!="mejores")}function I(){d.innerHTML="";r.foreach(function(AE,AD){var AF;AF=MVD.createElem("div");AF.setAttribute("id","comment"+AD.id);AF.style.visibility="hidden";AF.className="comment";AF.setHTML(x(AD,(F()||AD.vis)&&(!g()||o(AD.pos,AD.neg))));W(AF,AD);MVD.CMS.ComHidden.programarMenu(AF,AD.id,AD.usr,AD.nick);MVD.CMS.ComCal.setup(AF,AD.id,AD.pos,AD.neg);d.appendChild(AF)});setTimeout(function(){r.foreach(function(AE,AD){var AF=MVD.get("comment"+AD.id);V(AD.id,AF)})},500);U()}function P(){r.foreach(function(AE,AD){var AF=MVD.get("comment"+AD.id);MVD.CMS.UserStates.setup(AF,AD.usr,AD.nick)})}function U(){if(r){var AD={};r.foreach(function(AF,AE){var AG=MVD.get("comment"+AE.id);MVD.CMS.Social.setup(AG,AE.usr,AE.nick);MVD.CMS.UserStates.setup(AG,AE.usr,AE.nick);AD[AE.usr]=1});MVD.CMS.UserStates.add(MVD.ObjectToArray(AD),P)}}function v(){if(M!="no"){I();E.show()}else{E.hide()}}function D(AD){if(t>1){AD.anterior[(b<=1)?"hide":"show"]();AD.siguiente[(b==t)?"hide":"show"]();AD.container.show()}else{AD.container.hide()}}function H(){var AD=q();e.foreach(function(AE,AF){D(AF);AF.paginas.setHTML(AD)})}function h(){e.foreach(function(AD,AE){AE.container.hide()})}var O=function(AH){if(AB){clearTimeout(AB);AB=0}var AD=AH;AH=AH.replace(/\r/g," ");AH=AH.replace(/\n/g," ");var AG,AE;AG=json_parse(AH);if(AG!==null){MVD.CMS.ComHidden.setUsers(AG.hidden);r=AG.coms;b=AG.nroPag;t=AG.cantPag;w=AG.cantComs;var AF=MVD.getSafe("commentsPageCounter");for(AE in m){if(m.hasOwnProperty(AE)){MVD.getSafe(AE).innerHTML=AG[m[AE]]}}if(t>1){AF.show();H()}else{AF.hide();h()}v();T=true;j.show();if(J){J=false}else{window.location.hash="com"}}else{j.hide()}};var n=function(AE){var AD="<br><br><br><br><br>";AD+=AD;d.innerHTML=AD+"<center>"+AE+"</center>"+AD};var L=function(){if(AB){clearTimeout(AB);AB=0}n("Ocurri&oacute; un error en el servidor, int&eacute;ntelo m&aacute;s tarde. Gracias.");T=true};var N=function(){n('<img src="'+Z.src+'">');if(AB){clearTimeout(AB);AB=0}};function B(AD){T=false;AB=setTimeout(N,1000);MVD.Ajax.postGX("ancomgetpag",{uc:Q,pag:AD,order:i()},O,L)}function a(){MVD.CMS.Social.get();MVD.Ajax.postGX("ancomgetpag",{uc:Q,pag:1,order:i()},function(AD){O(AD);c.dispatchEvent("onFirstLoad")})}function S(){var AD=MVD.get("commentsFilter");if(AD){AD.onclick=function(){var AE=new MVD.MenuDespl(AD,"menuCom");for(var AF in AC){if(AC.hasOwnProperty(AF)){(function(){var AG=AF;AE.appendOption(AC[AF],function(){var AH=i();M=AG;MVD.Cookies.set("filterSelect",M);AD.setHTML(AC[M]);if(AH!=i()){MVD.CMS.ComPag.pag(1)}else{MVD.CMS.ComPag.refreshPage()}})})()}}AE.appendSeparation();AE.appendCheck("Ver cerrados los comentarios de usuarios con baja valoraci&oacute;n",z,function(){z=!z;MVD.Cookies.set("reputationSelect",z?"1":"0");MVD.CMS.ComPag.refreshPage()});if(MVD.CMS.UserStates){MVD.CMS.UserStates.setupFilterOption(AE)}return false};AD.setHTML(AC[M])}}function p(AE){var AD=MVD.get(AE);var AF={container:AD};["primero","anterior","siguiente","ultimo","paginas"].foreach(function(AG,AH){AF[AH]=AD.firstWithClass(AH)||MVD.elemNull});AF.primero.onclick=function(){if(T&&b>1){B(1)}return false};AF.anterior.onclick=function(){if(T&&b>1){B(b-1)}return false};AF.siguiente.onclick=function(){if(T&&b<t){B(b+1)}return false};AF.ultimo.onclick=function(){if(T&&b<t){B(99999)}return false};e.push(AF)}function R(){d=MVD.get("lista_comentarios");u();var AD=MVD.get("com_separador");if(AD){l=AD.innerHTML;AD.innerHTML=""}p("com_pag1");p("com_pag2");j=MVD.get("commentsBlock");E=MVD.get("commentsView");a();S()}return{init:function(AD){Q=AD;MVD.CMS.ComCal.init(AD);R();return this},pag:function(AD){if(T){B(AD)}return false},setImgProgress:function(AD){Z.src=AD;return this},setCurrentPageClass:function(AD){AA=AD;return this},getCantComs:function(){return w},refreshPage:function(){v()},addEventListener:function(AD,AE){c.addEventListener(AD,AE)},setupSocial:U,updateCommentCalification:function(AI,AH,AG){var AE;for(var AF=0,AD=r.length;AF<AD;AF++){AE=r[AF];if(AE.id==AI){AE.pos=AH;AE.neg=AG;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}}}}();MVD.CMS.Social=function(){var D={};var L=0;var F=/_off/g;var N=/_on/g;function K(){return MVD.CMS.Social.enabled}function A(I){D={};if(I){var O=json_parse(I);if(O){if(O.err===0){D=MVD.listToObject(O.res);L=O.usr;MVD.CMS.ComPag.setupSocial()}else{if(O.err===4){console.log("desabilitado");MVD.CMS.Social.enabled=false}}}}}var G;function H(I){if(!G){G=new MVD.Dialog("MyDialog")}G.open();G.setContent(I);G.appendCloseButton();G.show()}function J(){H("Lamentablemente no es posible realizar tu solicitud, vuelve a intentarlo luego de algunos minutos.")}function B(P,I){var O=P.firstChild;var Q=O.src;if(I){Q=Q.replace(F,"_on")}else{Q=Q.replace(N,"_off")}O.src=Q;P.title=I?"Dejar de seguir":"Seguir"}function E(){return false}function C(O,I){if(I=="S"){D[O]=true}else{delete D[O]}MVD.CMS.ComPag.setupSocial()}function M(P,R,I,O){if(P){var Q=json_parse(P);switch(Q.err){case 0:switch(Q.res){case 1:H((O=="S"?"Ahora sigues a ":"Dejaste de seguir a ")+I);C(R,O);break;case 0:H((O=="S"?"Continuas siguendo a ":"No sigues a ")+I);C(R,O);break;case -4:H("No puedes seguirte a ti mismo");break;default:J()}break;case 2:MVD.CMS.LoginDialog.show("Debes iniciar la sesi&oacute;n para seguir a "+I);break;default:J()}}else{J()}}return{enabled:true,get:function(){if(K()){MVD.Ajax.postGX("aredsocialproxy",{func:"seguidos"},A,A)}},getMenuOptions:function(Q,I){if(!K()||(Q===L)){return null}else{var P=D[Q];var O=(P?"D":"S");return[{text:(P?"Dejar de seguir a ":"Seguir a ")+I,callback:function(){var R=function(S){M(S,Q,I,O)};MVD.Ajax.postGX("aredsocialproxy",{func:"SeguirA",UsrRegId:Q,accion:O},R,R)}},{text:"Mi perfil",link:"http://comunidad.montevideo.com.uy/amiperfil.aspx",target:"_blank"}]}},setup:function(R,T,I){var Q=R.firstWithClass("btnFollow");if(Q){if(!K()||(T===L)){Q.hide()}else{var O=D[T];B(Q,O);var P=(O?"D":"S");var S=function(U){M(U,T,I,P)};Q.onclick=function(){MVD.Ajax.postGX("aredsocialproxy",{func:"SeguirA",UsrRegId:T,accion:P},S,S);return false};Q.style.cursor=""}}}}}();MVD.CMS.UserStates=function(){var A="http://comunidad.montevideo.com.uy/";var B={};var G=' <a href="'+A+'aperfilactividadestado.aspx?@ID@" target="_blank">Comentar estado<a>';var E=parseInt(MVD.Cookies.get("statesOption")||"1",10);function F(){}function D(J){var K;for(var I=0,H=J.length;I<H;I++){K=J[I];B[K.id]=K.state}}function C(I){var H=json_parse(I);if(H&&(H.err===0)){D(H.res)}}return{add:function(I,K){var L=[],M;for(var J=0,H=I.length;J<H;J++){M=I[J];if(typeof B[M]=="undefined"){L.push(M);B[M]=""}}if(L.length){MVD.Ajax.postGX("aredsocialproxy",{func:"estados",users:L.join(",")},function(N){C(N);if(K){K()}},F)}},setup:function(J,L,H){var K=J.firstWithClass("user_state");if(K){if(E){var I=B[L];if(I){K.setHTML("ESTADO:"+I+G.replace(/@ID@/g,L).replace(/@NICK@/g,H)).show()}else{K.hide()}}else{K.hide()}}},setupFilterOption:function(H){H.appendCheck("Mostrar los estados en los comentarios",E,function(){E=!E;MVD.Cookies.set("statesOption",E?"1":"0");MVD.CMS.ComPag.refreshPage()})}}}();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(l){MVD.get("usrmail").setHTML(l.mail);if(l.id){var i=MVD.get("imagen-perfil-self");if(i&&i.src){i.src=i.src.split("?")[0]+"?"+l.id}}if(l.nick&&V.test(l.nick)){MVD.get("nick").hide();MVD.get("usrnick").setHTML(l.nick);G=true}else{Y.setValue("nick",l.nick);MVD.get("usrnick").hide()}X=l.docRequired;if(l.docRequired){if(l.docValid){MVD.get("doc").hide();MVD.get("usrdoc").setHTML(l.docNum);MVD.get("paisdoc").hide();MVD.get("usrpaisdoc").setHTML(l.docCtryName);I=true}else{MVD.get("usrdoc").hide();Y.setValue("doc",l.docNum);MVD.get("usrpaisdoc").hide();var k=Y.getInput("paisdoc");Y.setSelectOptions(k,l.ctryLst);Y.setSelectValue(k,l.docCtry||"UY");var j=MVD.addNotice("paisdoc","paisnotice",c.docWarning,"avisoDocumentoComentarios");k.onchange=function(){if(Y.getSelectValue(this)==="UY"){j.fadeIn()}else{j.fadeOut()}};k.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}}}()