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){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))},makeSafe:function(A){return A||MVD.elemNull},getSafe:function(A){return MVD.makeSafe(MVD.get(A))},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,C,D,B){var F=document.createElement("a");F.href=C;if(D){F.target=D}F.innerHTML=A;F.style.display="block";var E=this;F.onclick=function(){E.close();if(B){return confirm(B)}else{return true}};return F},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,C,D,B){this.menuDiv.appendChild(this.createLink(A,C,D,B))},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,D.confirm)}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;this.input=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(),G=MVD.Window.getViewHeight();var F=MVD.Window.getScrollX(),B=MVD.Window.getViewWidth();var E=this.maxViewWidth||B;var D=C+((G-this.getHeight())/2);var A=F+((E-this.getWidth())/2);this.el.setTop(D).setLeft(A);this.blocker.setWidth(B).setHeight(G);this.blocker.setTop(C).setLeft(F)},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},appendInput:function(A){if(!this.input){this.input=MVD.createElem("input");MVD.extend(this.input,A);this.el.appendChild(this.input)}},getInputValue:function(){return this.input&&this.input.value},setInputValue:function(A){if(this.input){this.input.value=A}},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(B){var A=this;this.appendClickButton(B||"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 e;var k;var E;var t,K;var m="";var l={nick:/%%NNotComUsrRegNick%%/g,date:/%%NNotComFechaHora%%/g,txt:/%%NNotComTexto%%/g,id:/%%NNotComId%%/g,usr:/%%NNotComUsrRegId%%/g};var n={NNotCantCom:"cantComs",com_nro_pag1:"nroPag",com_nro_pag2:"nroPag",com_cant_pag1:"cantPag",com_cant_pag2:"cantPag"};var AE={"buenos":"que aportan (0 o mejor)","inter":"intermedios (-4 o mejor)","mejores":"ordenados por calificaci&oacute;n","todos":"todos","no":"ninguno"};var T;var x,b,u;var s;var g=0;var AD=0;var Z=new Image();var AC="";var J=true;var f=[];var M=MVD.Cookies.get("filterSelect")||"inter";var AB=parseInt(MVD.Cookies.get("reputationSelect")||"0",10);var d;var z;var F=function(){return !AB};var c=new MVD.EventManager();function v(){var AI=e.innerHTML;e.innerHTML="";var AF=/%%ComentarioVisible_INI%%([\s\S]*)%%ComentarioVisible_FIN%%/g;var AG=AF.exec(AI);if(AG){t=AG[1]}else{t=AI;K=AI;return }var AH=/%%ComentarioOculto_INI%%([\s\S]*)%%ComentarioOculto_FIN%%/g;AG=AH.exec(AI);if(AG){K=AG[1]}else{K=t}}var r=function(){var AF=function(AK,AJ){return'<a href="#" onclick="return MVD.CMS.ComPag.pag('+AK+')">'+AK+AJ+"</a> "};var AI="";var AH=Math.floor(b/10)*10;var AG=AH-10;while((AG>=(AH-50))&&(AG>=0)){if(AG===0){AG=1}AI=AF(AG,"..")+AI;AG-=10}AG=AH;if(AG===0){AG=1}while((AG<=AH+9)&&(AG<=u)){if(AG===b){if(AC){AI+='<span class="'+AC+'">'+AG+"</span> "}else{AI+="["+AG+"] "}}else{AI+=AF(AG,"")}AG++}while((AG<=(AH+50))&&(AG<=u)){AI+=AF(AG,"..");AG+=10}return AI};var G=/[\xad|\xa0]/g;var C=function(AF){return AF.replace(G,"-")};function y(AH,AF,AG){var AK=AG||MVD.CMS.ComHidden.isUserHidden(AH.usr);var AJ=(AG||(!AK&&AF))?t:K;for(var AI in l){if(l.hasOwnProperty(AI)){AJ=AJ.replace(l[AI],(AI==="nick"?C(AH[AI]):AH[AI]))}}return AJ}function AA(AF){var AG=MVD.get("comment"+AF.id);AG.setHTML(y(AF,1,1));MVD.CMS.ComHidden.programarMenu(AG,AF.id,AF.usr,AF.nick);MVD.CMS.ComCal.setup(AG,AF.id,AF.pos,AF.neg);MVD.CMS.UserStates.setup(AG,AF.usr,AF.nick);W(AG,AF)}function W(AI,AH){var AF=AI.firstWithClass("btnShowComment");if(AF){AF.onclick=function(){AA(AH);return false}}var AG=AI.firstWithClass("uoculto");if(AG){if(MVD.CMS.ComHidden.isUserHidden(AH.usr)){AG.setHTML("(Comentarista Oculto)").show()}else{if(!AH.vis&&!F()){AG.setHTML('<a href="http://www.montevideo.com.uy/hnnoticiaj1.aspx?87987" target="_blank">(Baja valoraci&oacute;n en el Portal)</a>').show()}else{AG.hide()}}}}var Y=/(.+)[ ,.;](.+)/;function X(AG){var AF=Y.exec(AG);return AF&&AF[1]}function V(AF,AG){var AM=AG.firstWithClass("commentText");var AO;function AL(){return AM.offsetHeight||parseInt(MVD.getComputedStyle(AM,"height"),10)}function AI(AP){var AQ,AR;if(AP<AO.length){AR=X(AO.slice(0,AP-1));AQ=AR?AR+" ...":AO}else{AQ=AO}AM.innerHTML=AQ;return AL()}function AK(AR,AQ){if(AR==AQ){return AR}if((AR+1)==AQ){if(AI(AQ)<A){return AQ}else{return AR}}var AP=Math.floor((AR+AQ)/2);if(AI(AP)<A){return AK(AP,AQ)}else{return AK(AR,AP)}}if(AM){AO=AM.innerHTML;var AJ=AL();if(AJ>A){AI(AK(0,AO.length));var AH=AL();var AN=AG.firstWithClass("commentExpand");if(AN){AN.show();AN.onclick=function(){AN.hide();this.onclick=null;AM.setHeight(AH);AM.innerHTML=AO;(new MVD.Tween({from:AH,to:AJ,update:function(AP){AM.setHeight(AP)},time:(AJ-AH)*2})).start();return false}}}}AG.style.visibility=""}function p(AH,AG){var AF=(AH-AG);return(M!="inter")?(AF>=0):(AF>=-4)}function j(){return(M=="mejores")?"C":"F"}function h(){return(M!="todos")&&(M!="mejores")}function I(){e.innerHTML="";s.foreach(function(AH,AG){var AI;AI=MVD.createElem("div");AI.setAttribute("id","comment"+AG.id);AI.style.visibility="hidden";AI.className="comment";AI.setHTML(y(AG,(F()||AG.vis)&&(!h()||p(AG.pos,AG.neg))));var AF=AI.firstWithClass("user-image");if(AF){AF.src=d+"?"+AG.usr}var AJ=AI.firstWithClass("facebook-tag");if(AJ){if(AG.fbnew){AJ.show()}else{AJ.hide()}}W(AI,AG);MVD.CMS.ComHidden.programarMenu(AI,AG.id,AG.usr,AG.nick);MVD.CMS.ComCal.setup(AI,AG.id,AG.pos,AG.neg);e.appendChild(AI)});setTimeout(function(){s.foreach(function(AG,AF){var AH=MVD.get("comment"+AF.id);V(AF.id,AH)})},500);U()}function P(){s.foreach(function(AG,AF){var AH=MVD.get("comment"+AF.id);MVD.CMS.UserStates.setup(AH,AF.usr,AF.nick)})}function U(){if(s){var AF={};s.foreach(function(AH,AG){var AI=MVD.get("comment"+AG.id);MVD.CMS.Social.setup(AI,AG.usr,AG.nick);MVD.CMS.UserStates.setup(AI,AG.usr,AG.nick);AF[AG.usr]=1});MVD.CMS.UserStates.add(MVD.ObjectToArray(AF),P)}}function w(){if(M!="no"){I();E.show()}else{E.hide()}}function D(AF){if(u>1){AF.anterior[(b<=1)?"hide":"show"]();AF.siguiente[(b==u)?"hide":"show"]();AF.container.show()}else{AF.container.hide()}}function H(){var AF=r();f.foreach(function(AG,AH){D(AH);AH.paginas.setHTML(AF)})}function i(){f.foreach(function(AF,AG){AG.container.hide()})}var O=function(AJ){if(AD){clearTimeout(AD);AD=0}var AF=AJ;AJ=AJ.replace(/\r/g," ");AJ=AJ.replace(/\n/g," ");var AI,AG;AI=json_parse(AJ);if(AI!==null){MVD.CMS.ComHidden.setUsers(AI.hidden);s=AI.coms;b=AI.nroPag;u=AI.cantPag;x=AI.cantComs;var AH=MVD.getSafe("commentsPageCounter");for(AG in n){if(n.hasOwnProperty(AG)){MVD.getSafe(AG).innerHTML=AI[n[AG]]}}if(u>1){AH.show();H()}else{AH.hide();i()}w();T=true;k.show();if(J){J=false}else{window.location.hash="com"}}else{k.hide()}};var o=function(AG){var AF="<br><br><br><br><br>";AF+=AF;e.innerHTML=AF+"<center>"+AG+"</center>"+AF};var L=function(){if(AD){clearTimeout(AD);AD=0}o("Ocurri&oacute; un error en el servidor, int&eacute;ntelo m&aacute;s tarde. Gracias.");T=true};var N=function(){o('<img src="'+Z.src+'">');if(AD){clearTimeout(AD);AD=0}};function B(AF){T=false;AD=setTimeout(N,1000);MVD.Ajax.postGX("ancomgetpag",{uc:Q,pag:AF,order:j()},O,L)}function a(){MVD.CMS.Social.get();MVD.Ajax.postGX("ancomgetpag",{uc:Q,pag:1,order:j()},function(AF){O(AF);c.dispatchEvent("onFirstLoad")})}function S(){var AF=MVD.get("commentsFilter");if(AF){AF.onclick=function(){var AG=new MVD.MenuDespl(AF,"menuCom");for(var AH in AE){if(AE.hasOwnProperty(AH)){(function(){var AI=AH;AG.appendOption(AE[AH],function(){var AJ=j();M=AI;MVD.Cookies.set("filterSelect",M);AF.setHTML(AE[M]);if(AJ!=j()){MVD.CMS.ComPag.pag(1)}else{MVD.CMS.ComPag.refreshPage()}})})()}}AG.appendSeparation();AG.appendCheck("Ver cerrados los comentarios de usuarios con baja valoraci&oacute;n",AB,function(){AB=!AB;MVD.Cookies.set("reputationSelect",AB?"1":"0");MVD.CMS.ComPag.refreshPage()});if(MVD.CMS.UserStates){MVD.CMS.UserStates.setupFilterOption(AG)}return false};AF.setHTML(AE[M])}}function q(AG){var AF=MVD.get(AG);var AH={container:AF};["primero","anterior","siguiente","ultimo","paginas"].foreach(function(AI,AJ){AH[AJ]=AF.firstWithClass(AJ)||MVD.elemNull});AH.primero.onclick=function(){if(T&&b>1){B(1)}return false};AH.anterior.onclick=function(){if(T&&b>1){B(b-1)}return false};AH.siguiente.onclick=function(){if(T&&b<u){B(b+1)}return false};AH.ultimo.onclick=function(){if(T&&b<u){B(99999)}return false};f.push(AH)}function R(){e=MVD.get("lista_comentarios");v();var AF=MVD.get("com_separador");if(AF){m=AF.innerHTML;AF.innerHTML=""}q("com_pag1");q("com_pag2");k=MVD.get("commentsBlock");E=MVD.get("commentsView");a();S()}return{init:function(AF,AG){Q=AF;MVD.CMS.ComCal.init(AF);d=AG;R();return this},pag:function(AF){if(T){B(AF)}return false},setImgProgress:function(AF){Z.src=AF;return this},setCurrentPageClass:function(AF){AC=AF;return this},getCantComs:function(){return x},refreshPage:function(){w()},addEventListener:function(AF,AG){c.addEventListener(AF,AG)},setupSocial:U,updateCommentCalification:function(AK,AJ,AI){var AG;for(var AH=0,AF=s.length;AH<AF;AH++){AG=s[AH];if(AG.id==AK){AG.pos=AJ;AG.neg=AI;return }}},setUsrImgFBUrl:function(AF){}}}();MVD.CMS.ComCal=function(){var B;function C(D,I,H,G,F){var E=I-H;D.innerHTML=""+E;D.className=(E>0)?"comment_pos":(E<=-4)?"comment_neg":"comment_med";if(G){G.innerHTML=(I>0?"+":"")+I}if(F){F.innerHTML=(H>0?"-":"")+H}}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(E,D,J,F){var I=E.firstWithClass("caltot");if(!I){return }var H=E.firstWithClass("caltotpos"),M=E.firstWithClass("caltotneg");C(I,J,F,H,M);var K=E.firstWithClass("calpos");if(!K){return }var G=E.firstWithClass("calneg");function L(P){var N;switch(P){case"2":N="Ya calificaste el comentario";break;case"3":N="No puedes calificar tu propio comentario";break;default:N="Hubo un error al procesar su calificaci&oacute;n. Int&eacute;ntelo m&aacute;s tarde";break}var Q=MVD.addNotice(I,"avicaltot"+D,N,"calError");Q.fadeIn();var O=setTimeout(function(){Q.fadeOut()},3000)}K.onclick=function(){A(K,G);MVD.Ajax.postGX("annotcomcal",{NNotId:B,NNotComId:D,Cal:1},function(N){if(N=="0"){MVD.CMS.ComPag.updateCommentCalification(D,J+1,F);C(I,J+1,F,H,M)}else{L(N)}});return false};G.onclick=function(){A(K,G);MVD.Ajax.postGX("annotcomcal",{NNotId:B,NNotComId:D,Cal:-1},function(N){if(N=="0"){MVD.CMS.ComPag.updateCommentCalification(D,J,F+1);C(I,J,F+1,H,M)}else{L(N)}});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){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.replace(/</g,"&lt;").replace(/>/g,"&gt;")}}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(I+G.replace(/@ID@/g,L).replace(/@NICK@/g,H)).show()}else{K.hide()}}else{K.hide()}}},getState:function(H){return B[H]},showState:function(J,H){var I=B[J];if(typeof I=="undefined"){MVD.Ajax.postGX("aredsocialproxy",{func:"estados",users:J},function(K){C(K);H(B[J])},F)}else{H(I)}},update:function(I,H){B[I]=H},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 V;var E=false;var H=false;var U;var d=0;var S=/^[0-9A-Za-z_]+$/;var Y;var J=0;var Z,c,G,X;var K;var a={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 O;var F;var R=function(h,f){var g=(h in a)?a[h]:h;Z.setHTML(g);if(!f){Z.showAndHide(g.length*100)}else{Z.show()}};var C=function(f){if(f==="1"){MVD.CMS.ComPag.pag(1);R("comSend");if(J){MVD.Ajax.updateGX("ablogultimoscomentariosj1",J,"blogUltimosComentarios")}}else{if(f==="2"){R("comSendMod")}else{R("comSendError")}}V.enable(true);G.hide();X.hide();V.getInput("comentario").value=""};var B=function(){R("comSendError");G.hide();V.enable(true)};var L=function(){MVD.Ajax.postGX("anguardacomentario",{NNotId:d,BlogId:J,comentario:V.get("comentario")},C,B)};function P(){if(!E){O()}else{if(U&&!H){I()}else{L()}}}function e(){G.hide();if(U&&!H){V.getInput("paisdoc").onchange()}V.enable(true)}function T(){V.enable(false);MVD.getSafe("paisnotice").hide();G.show()}var N=function(){V.init();V.clearErrors();if(!E){if(V.checkNotEmpty("nick",a.nickEmptyError)){V.checkRegExp("nick",S,a.nickFormatError)}}if(U&&!H){if(V.checkNotEmpty("doc",a.docEmptyError)){if(V.checkNumber("doc",a.docFormatError)){if(parseInt(V.get("doc"),10)==0){V.addError(a.docEmptyError)}}}var f=V.getSelectValue("paisdoc");if(!f||(f==="0")||(f=="ND")){V.addError(a.docCountryError)}}V.checkNotEmpty("comentario",a.comEmptyError);V.showErrors();if(V.valid()){T();P()}return false};var A=function(f){switch(f){case"0":E=true;MVD.get("nick").hide();MVD.get("usrnick").setHTML(V.get("nick")).show();P();break;case"4":V.showErrors(a.nickNotAvailable);e();V.getInput("nick").focus();break;default:V.showErrors(a.nickSendError);e();V.getInput("nick").focus();break}};function D(g){var f=json_parse(g);switch(f.result){case 0:H=true;MVD.get("doc").hide();MVD.get("usrdoc").setHTML(V.get("doc")).show();MVD.get("paisdoc").hide();MVD.get("usrpaisdoc").setHTML(V.getSelectOptions("paisdoc")[V.getSelectValue("paisdoc")]).show();P();break;case 3:V.showErrors(a.docCIError);e();V.getInput("doc").focus();break;case 4:X.hide();R("docConfirmError");break;case 6:X.hide();R("tooManyDocErrors");break;case 7:X.hide();var h=a.mustUseOtherUserError;R(h.replace(/%%user%%/,f.usrmustuse));break;case 8:V.showErrors(a.docDuplicatedError);e();V.getInput("doc").focus();break;default:X.hide();R("generalError");break}}function O(){MVD.Ajax.postGX("anupdnick",{nick:V.get("nick")},A)}function I(){MVD.Ajax.postGX("anupddoc",{doc:V.get("doc"),paisdoc:V.get("paisdoc")},D)}function W(){c.show();if(F){F()}}function Q(i){MVD.get("usrmail").setHTML(i.mail);if(i.id){var f=MVD.get("imagen-perfil-self");if(f&&f.src){f.src=Y+"?"+i.id}}if(i.nick&&S.test(i.nick)){MVD.get("nick").hide();MVD.get("usrnick").setHTML(i.nick);E=true}else{V.setValue("nick",i.nick||i.nicksuggest||"");MVD.get("usrnick").hide()}U=i.docRequired;if(i.docRequired){if(i.docValid){MVD.get("col-pais-documento").hide();MVD.get("col-documento").hide();H=true}else{V.setValue("doc",i.docNum);var h=V.getInput("paisdoc");V.setSelectOptions(h,i.ctryLst);V.setSelectValue(h,i.docCtry||"UY");var g=MVD.addNotice("paisdoc","paisnotice",a.docWarning,"avisoDocumentoComentarios");h.onchange=function(){if(V.getSelectValue(this)==="UY"){g.fadeIn()}else{g.fadeOut()}};h.onchange()}}else{MVD.get("col-pais-documento").hide();MVD.get("col-documento").hide()}X.show();V.enable(true)}var b=function(f){var g=json_parse(f);if(g&&g.state){switch(g.state){case 0:W();break;case 2:R("userBlocked",true);break;case 3:R("tooManyDocErrors");break;case 4:X.hide();R("mustUseOtherUserError",true);break;case 9:R(g.errmsg);break;case 1:c.hide();if(MVD.CMS.SocialShare){MVD.CMS.SocialShare.setUser(g.id)}Q(g);break}}else{W()}};var M=function(){MVD.Ajax.getGX("anusrregcom2",d,b,function(){R("generalError")});return false};return{validar:N,init:function(i,g,h){d=i;J=g||0;if(J){a.comSendMod="El comentario fue enviado, el propietario del blog decidir&aacute; si el mismo ser&aacute; publicado o no. Gracias.";a.comSend="El comentario fue enviado con &eacute;xito"}Z=MVD.get("comentarios-mensajes");c=MVD.get("comentarios-sesion")||Z;G=MVD.get("env_status");X=MVD.get("com_form");F=h;var f=MVD.get("comentario");if(f){f.onpaste=function(){return false}}V=new MVD.Form("MAINFORM");V.setErrorElem("blockerror");V.init();document.MAINFORM.onsubmit=N;M();return this},setNoLoginMsg:function(f){a.noLoginMsg=f;return this},setMessage:function(g,f){a[g]=f;return this},setImageUrl:function(f){Y=f},refreshUserState:function(){M()}}}();MVD.CMS.SocialShare=function(){var I,E;var A,C;var G;var J;var F;function B(){if(!A){A=MVD.get("logged-user-state");C=A.firstWithClass("logged-user-state-show");A.firstWithClass("state-change-button").onclick=function(){D();return false}}return A}function D(){var O=new MVD.Dialog("MyDialog");O.open();O.setContent("Cambia tu estado:");O.appendInput({maxLength:250,className:"input-estado"});O.appendAcceptButton();O.appendCloseButton("Cancelar");O.onAccept=function(){var P=O.getInputValue();if(P){M(P.substr(0,250))}};O.show()}function H(O){if(!G){G=new MVD.Dialog("MyDialog")}G.open();G.setContent(O);G.appendCloseButton();G.show()}function L(){H("Lamentablemente no es posible realizar tu solicitud, vuelve a intentarlo luego de algunos minutos.")}function N(P,O){if(P){var Q=json_parse(P);switch(Q.err){case 0:if(Q.res===1){H("Has cambiado tu estado");F.update(J,O);MVD.CMS.ComPag.refreshPage()}else{H("No se pudo cambiar tu estado, vuelve a intentarlo más tarde.")}break;case 2:MVD.CMS.LoginDialog.show("Tu sesión ha expirado, iníciala nuevamete y vuelve a intentarlo.");break;default:L()}}else{L()}F.showState(J,K)}function M(O){MVD.Ajax.postGX("aredsocialproxy",{func:"comp_est",text:O},function(P){N(P,O)},N);K("...")}function K(O){if(B()){var P=A.firstWithClass("state-text");if(P){P.setHTML(O||"<i>Actualmente no estas compartiendo un estado.</i>");A.style.display=""}}}return{setUser:function(O){F=MVD.CMS.UserStates;if(O&&F){J=O;F.showState(O,K)}}}}();(function(){var C;var B;function H(I){return new RegExp("^(https?://)?[^/]*"+I.replace(/\./g,".")+"/.*$")}function G(I){var K=document.location.href;for(var J in I){if(I.hasOwnProperty(J)){if(K.match(H(J))){return I[J]}}}return null}function A(I,L){var M=MVD.get("FacebookLoggedIn"),O=MVD.get("FacebookLoggedOut"),K;if((I===1)&&L){O.hide();var N=M.firstWithClass("fbnombre");N.setHTML(L.name);if(L.id){var J=M.firstWithClass("fbimg");J.src="https://graph.facebook.com/"+L.id+"/picture";J.onload=function(){J.show()}}K=M.firstWithClass("loginFacebookBtn");K.onclick=E;K=M.firstWithClass("fbclose");if(K){K.onclick=function(){FB.logout();A(0);return false}}M.show()}else{if((I===0)||(I===1)){M.hide();K=O.firstWithClass("loginFacebookBtn");K.onclick=!I?function(){FB.login(D,{perms:"email"});return false}:E;O.show()}else{M.hide();O.hide();MVD.get("FacebookLoginError").show()}}}function F(I){if(I.status==="connected"){A(1);FB.api("/me",function(J){A(1,J)})}else{A(0)}}window.fbAsyncInit=function(){FB.init({appId:C,status:true,cookie:true,xfbml:false});FB.getLoginStatus(F)};MVD.initFacebook=function(I,J){if(typeof I==="string"){C=I}else{C=G(I)}if(!C){return }B=J;if(MVD.get("FacebookLoggedOut")){var K=document.createElement("script");K.src=document.location.protocol+"//connect.facebook.net/es_LA/all.js";K.async=true;document.getElementById("fb-root").appendChild(K)}};function E(){MVD.Ajax.postGX("annewsessionfacebook",{FacebookAppId:C},function(I){if((I==="1")){if(B){B()}}else{A(null)}});return false}function D(I){if(I.session){var J=I.perms.split(",");if(J.contains("email")){E()}}}})()