var comment={server:"http://comentarios.esmas.com/",origin:"http://origin-comentarios.esmas.com/",sending:0,snd_id:0,lst_frm:0,recaptcha:"6LcK6QQAAAAAAEeH1Knhzi8XKAHe6xx9XM8RtF2f",reCap:!0,timer:"",lastId:"",pSound:!0,sPying:!1,url:"",total:0,comm_repository:"COMM_comments",autoRefresh:!1,single_message:"",single_num:0,single_comment_time:5500,single_comment_length:200,elemento_live:"",elemento_single:"",msg:{name:"Ingresa tu nombre.<br/>",email:"Ingresa un correo electr&oacute;nico v&aacute;lido.<br/>",
comment:"Tienes que ingresar un comentario u opinion de la nota.<br>",recaptcha:'Para poder agregar tu comentario es necesario que ingreses el c&oacute;digo mostrado.<br> En caso de no ser claro cambialo haciendo clic en "Obtener otro c&oacute;digo".<br>',sending:"El comentario esta siendo enviado. Espera un momento.",recived:"Tu comentario fue ingresado exitosamente. <br/>Pude tardar algunos minutos en ser publicado definitivamente.",recived_i:"Tu comentario fue enviado. Pude tardar algunos minutos en ser publicado definitivamente.",
waittill:"Por favor espera a que se complete tu envio antes de enviar un nuevo comentario.",ercaptcha:'El c&oacute;digo de seguridad es incorrecto. En caso de no ser claro cambialo haciendo clic en "Obtener otro c&oacute;digo".',erhtml:"Recuerda que no se permite contenido HTML. Tu comentario ha sido rechazado.",pass:"Contrase&ntilde;a incorrecta",nofull:"Tu comentario ha sido agregado, sin embargo al parecer los datos de tu cuenta se encuentran incompletos, no podr&aacute;s ingresar comentarios con tu usuario hasta que completes tu registro. http://mipagina.esmas.com.mx/",
allerr:"Tu comentario ha sido agregado, sin embargo ocurrio un error que provoco que no se pudiera iniciar sesi&oacute;n, para obtener mas informaci&oacute;n ingresa a http://mipagina.esmas.com.mx/ ",passkey:"El password no puede estar vacio",loging:"Estamos validando tu usuario por favor espera.",em:"Ingresa&nbsp;tu&nbsp;correo&nbsp;electronico",nm:"Ingresa&nbsp;tu&nbsp;nombre",loading:"Cargando comentarios",note:'<div style="text-align:right;"><input type="button" value="&nbsp;" onclick="comment.answer(0,0);" class="comment_note">',
errsrv:"Hubo un problema al procesar tu comentario, por favor intentalo de nuevo mas tarde."},el:function(a){return document.getElementById(a)},toggle:function(a){a.style.display=a.style.display=="none"?"block":"none"},cl_url:function(a){var b=a.search(/\#/);b!=-1&&(a=a.substring(0,b));b=a.search(/\?/);b!=-1&&(a=a.substring(0,b));return a},init:function(){this.url="undefined"==typeof comment_url?this.cl_url(document.location.href):this.cl_url(comment_url);if("undefined"!=typeof comment_origin)this.origin=
comment_origin;if("undefined"!=typeof comment_server)this.server=comment_server;if("undefined"!=typeof comment_total)this.total=comment_total;if("undefined"!=typeof comment_reCap)this.reCap=comment_reCap;if("undefined"!=typeof comment_recaptcha)this.recaptcha=comment_recaptcha;if(this.el(this.comm_repository)){(this.el("COMM_comments")||this.el("comments_container"))&&this.loadJS("http://api.recaptcha.net/js/recaptcha_ajax.js");document.getElementById("comm_pre");setTimeout("comment.getComm(0,0);",
2E3);if(this.el("addComentForm"))this.el("addComentForm").style.display="none",this.el("addComentForm").innerHTML="";if(this.autoRefresh)comment.refrex=window.setInterval("comment.onlyComments();",6E4)}},loadJS:function(a){var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src",a);document.getElementsByTagName("head")[0].appendChild(b);return!0},addCss:function(a){var b=document.createElement("style");b.type="text/css";b.styleSheet?b.styleSheet.cssText=
a:b.appendChild(document.createTextNode(a));document.getElementsByTagName("head")[0].appendChild(b)},limit:function(a,b){"undefined"==typeof b&&(b=800);if(a.value.length>b)a.value=a.value.substring(0,b),this.el("msg_"+this.lst_frm).innerHTML="<div class='alerta'>Solo se permiten "+b+" caracteres.</div>",setTimeout("comment.hidemsg('msg_"+this.lst_frm+"');",3E3)},hidemsg:function(a){ob=this.el(a);ob.innerHTML=""},getanswers:function(a,b){this.toggle(this.el("chl_"+a));b.innerHTML=b.innerHTML=="Ver [-] comentarios"?
"Ver [+] comentarios":"Ver [-] comentarios"},cleantxt:function(a){if(a.name=="name"&&a.value.substr(0,7)=="Ingresa")a.value="";if(a.name=="email"&&a.value.substr(0,7)=="Ingresa")a.value=""},isEmailAddress:function(a){return/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(a)?!0:!1},stats:function(){},onlyComments:function(){template="undefined"==typeof comment_tpl?"":"template="+comment_tpl+"&";this.loadJS(this.server+"fast_comments/rdCom_only_comments.php?"+template+"url="+this.cl_url(this.url)+
"&url_real="+this.cl_url(document.location.href))},reloadForm:function(){template="undefined"==typeof comment_tpl?"":"template="+comment_tpl+"&";this.loadJS("http://comentarios.esmas.com/rdForm.php?"+template+"url="+this.cl_url(this.url)+"&url_real="+this.cl_url(document.location.href)+template)},mkCookie:function(a,b){var c=document.domain.substring(document.domain.indexOf(".")+1);document.cookie=a+"="+b+"; path=/; domain="+c},rdCookie:function(a){if(document.cookie.length>0&&(c_start=document.cookie.indexOf(a+
"="),c_start!=-1)){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end))}return null},readEm:function(){if(this.rdCookie("email"))return this.rdCookie("email");if(this.rdCookie("com_email"))return this.rdCookie("com_email");return""},readNM:function(){if(this.rdCookie("user_data"))return tmp_nm=this.rdCookie("user_data").split("|"),tmp_nm[3];if(this.rdCookie("nickname"))return this.rdCookie("nickname");
if(this.rdCookie("com_nick_name"))return this.rdCookie("com_nick_name");return""},wrEm:function(a){this.rdCookie("com_email")?this.rdCookie("com_email")!=a&&this.mkCookie("com_email",a):this.mkCookie("com_email",a)},wrNM:function(a){this.rdCookie("com_nick_name")?this.rdCookie("com_nick_name")!=a&&this.mkCookie("com_nick_name",a):this.mkCookie("com_nick_name",a)},playSound:function(a){if(this.pSound&&!this.sPying)this.sPying=!0,document.getElementById("comm_sound").innerHTML='<embed src="'+this.server+
"sounds/"+a+'.swf" width="1" height="1" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash">',setTimeout("comment.sPying=false;",3E3)},wait:function(){if(location.hash!=this.lastId){this.lastId=location.hash;var a=!1;switch(this.lastId){case "#OK":this.el("msg_"+this.snd_id).innerHTML="<div class='exito'>"+this.msg.recived+"</div>";this.el("ans_"+this.snd_id).innerHTML="";this.playSound("ok");a=!0;
setTimeout("comment.el('msg_"+this.snd_id+"').innerHTML=''; comment.answer(0,0);",5E3);setTimeout("comment.sending\t=\t0; comment.snd_id\t=\t0;",5E3);break;case "#ER":this.el("msg_"+this.snd_id).innerHTML="<div class='error'>"+this.msg.errsrv+"</div>";this.el("ans_"+this.snd_id).style.display="block";this.playSound("err");setTimeout("comment.sending\t=\t0; comment.snd_id\t=\t0;",5E3);Recaptcha.reload();a=!0;break;case "#CA":this.el("msg_"+this.snd_id).innerHTML="<div class='error'>"+this.msg.ercaptcha+
"</div>";this.el("ans_"+this.snd_id).style.display="block";this.playSound("err");setTimeout("comment.sending\t=\t0; comment.snd_id\t=\t0;",5E3);Recaptcha.reload();a=!0;break;case "#HT":this.el("msg_"+this.snd_id).innerHTML="<div class='error'>"+this.msg.erhtml+"</div>";this.el("ans_"+this.snd_id).style.display="block";this.playSound("err");setTimeout("comment.sending\t=\t0; comment.snd_id\t=\t0;",5E3);Recaptcha.reload();a=!0;break;case "#LG":this.el("msg_"+this.snd_id).innerHTML="<div class='alerta'>"+
this.el("advice_login").innerHTML+"</div>";this.playSound("advice");a=!0;break;case "#LO":this.el("msg_"+this.snd_id).innerHTML="<div class='exito'>"+this.msg.recived+"</div>";this.playSound("ok");setTimeout("comment.sending\t=\t0; comment.snd_id\t=\t0;",5E3);a=!0;break;case "#LC":this.el("msg_"+this.snd_id).innerHTML="<div class='error'>"+this.msg.pass+"</div>";this.playSound("err");this.getLogin();a=!0;break;case "#LI":this.el("msg_"+this.snd_id).innerHTML="<div class='exito'>"+this.msg.nofull+
"</div>";this.playSound("advice");a=!0;break;case "#LE":this.el("msg_"+this.snd_id).innerHTML="<div class='exito'>"+this.msg.allerr+"</div>",this.playSound("advice"),a=!0}a?(this.setView(),document.getElementById("procc_comment").src=this.server,this.lastId=document.location.href="#com"):comment.timer=setTimeout("comment.wait()",500)}else comment.timer=setTimeout("comment.wait()",500)},send:function(a){if(comment.reCap)a.holder_recaptcha.value=RecaptchaState.challenge;if(this.sending==0)return msg=
"",a.name.value==""?msg+=this.msg.name:a.name.value.substring(0,7)=="Ingresa"&&(msg+=this.msg.name),this.isEmailAddress(a.email.value)?a.email.value.substring(0,7)=="Ingresa"&&(msg+=this.msg.email):msg+=this.msg.email,a.comment.value==""&&(msg+=this.msg.comment),comment.reCap?a.recaptcha_response_field.value==""&&(msg+=this.msg.recaptcha):a.recaptcha_response_field.value="off_recaptcha",msg!=""?(this.el("msg_"+a.parent_id.value).innerHTML="<div class='error'>"+msg+"</div>",this.playSound("err"),!1):
(wait4me=this.wrEm(a.email.value),wait4me=this.wrNM(a.name.value),this.el("ans_"+a.parent_id.value).style.display="none",this.el("msg_"+a.parent_id.value).style.display="block",this.el("msg_"+a.parent_id.value).innerHTML="<div class='info'>"+this.msg.sending+"</div>",this.sending=1,this.snd_id=a.parent_id.value,this.wait(),"undefined"!=typeof comment_tpl&&(comment_tpl=="ipad"||comment_tpl=="iphone"||comment_tpl=="iphone2")&&alert(this.msg.recived_i),!0);else this.el("msg_"+a.parent_id.value).innerHTML=
"<div class='alerta'>"+this.msg.waittill+"</div>"},answer:function(a,b){try{var c=this.el("ans_"+a);if(this.lst_frm!=a&&(this.toggle(this.el("ans_"+this.lst_frm)),this.el("ans_"+this.lst_frm).innerHTML="",this.lst_frm==0))this.el("ans_"+this.lst_frm).innerHTML=this.msg.note,this.el("ans_"+this.lst_frm).style.display="block";if(a==0&&c.innerHTML!="")this.el("ans_0").innerHTML="",this.toggle(this.el("ans_0"));if(c.innerHTML==""){if(c.style.display=="")c.style.display="none";this.toggle(c);text=this.el("answer_level0").innerHTML;
this.lst_frm=a;em=this.readEm();nm=this.readNM();this.rdCookie("user_data")&&u_email!=""&&(tmp_user_data=comunidades.rdCookie("user_data").split("|"),text=text.replace("<p>Tu correo electr?nico v?lido</p>",""),text=text.replace("<p>Tu correo electr&oacute;nico v&aacute;lido</p>",""),text=text.replace("<p>Tu correo electrónico válido</p>",""),text=text.replace("<P>Tu correo electrónico válido</P>",""),text=text.replace('value="CoM_EmAiL"','style="display:none !important; visibility:hidden;" value="'+
u_email+'"'),text=text.replace("value=CoM_EmAiL","style=display:none !important; visibility:hidden; value="+u_email));comment.reCap||(text=text.replace('class="commentData"','class="commentData" style="width:100% !important;"'),text=text.replace("class=commentData","style=width:100% !important;"),text=text.replace('class="ans_form"','class="ans_form" style="width:100% !important;"'),text=text.replace("class=ans_form"," style=width:100% !important;"),document.getElementById("comm_div_submit_comment")&&
(text=text.replace('id="comm_div_submit_comment"','id="comm_div_submit_comment" style="float:none;"'),text=text.replace("id=comm_div_submit_comment","id=comm_div_submit_comment style=float:none;"),text=text.replace('id="comm_user_info"','id="comm_user_info"  style="margin-bottom:15px;"'),text=text.replace("id=comm_user_info","id=comm_user_info  style=margin-bottom:15px;"),text=text.replace("textarea",'textarea style="width:800px;"'),text=text.replace("TEXTAREA","TEXTAREA style=width:800px;")));text=
text.replace("PaReNt_Id",a);text=text.replace("UrL_FrOm",this.url);text=text.replace("UrL_ReAl",document.location.href);text=text.replace("LeVeL",b);text=text.replace("CaPtChA_Id","captcha_"+a);text=text.replace("ReCaPtChA_ImAgE1","recaptcha_image");text=text.replace("ReCaPtChA_ReSpOnSe_FiElD1","recaptcha_response_field");text=text.replace("ReCaPtChA_HoLdEr","recaptcha_holder");text=nm!=""?text.replace("CoM_NaMe",nm):text.replace("CoM_NaMe",this.msg.nm);text=em!=""?text.replace("CoM_EmAiL",em):text.replace("CoM_EmAiL",
this.msg.em);c.innerHTML=text;this.reCap&&Recaptcha.create(this.recaptcha,"recaptcha_widget",{theme:"custom",lang:"es",custom_theme_widget:"recaptcha_widget"})}}catch(d){txt="comment.answer("+a+","+b+");",setTimeout(txt,3E3)}},getComm:function(a,b,c){"undefined"==typeof c&&(c="");template="undefined"==typeof comment_tpl?"":"&template="+comment_tpl;"undefined"!=typeof comment_limit&&(template=template+"&limit="+comment_limit);c!=""?this.el("msg_"+c).innerHTML="<div class='info'>"+this.msg.loading+
"</div>":this.el(this.comm_repository).innerHTML="<div class='info'>"+this.msg.loading+"</div>";url=this.server+"rdCom.php?page="+b+"&level="+a;url+=template;c!=""&&(url+="&comment_id="+c);url+="&comm_repository="+this.comm_repository;this.reCap||(url+="&no_captcha=1");url+="&url="+this.cl_url(this.url);url+="&url_real="+document.location.href;this.loadJS(url);b!=0&&this.setView();"undefined"!=typeof comment_tpl&&comment_tpl=="ipad"&&(comment_limit=10);setTimeout("searchsingleComment();",4E3)},getLogin:function(){this.el("ans_"+
this.snd_id).innerHTML="";text=this.el("login_form").innerHTML;em=this.readEm();text=em!=""?text.replace("CoM_EmAiL",em):text.replace("CoM_EmAiL",this.msg.em);text=text.replace("UrL_FrOm",this.url);text=text.replace("UrL_ReAl",document.location.href);this.el("ans_"+this.snd_id).innerHTML=text;this.el("ans_"+this.snd_id).style.display="block";if(this.el("msg_"+this.snd_id).innerHTML=="<div class='alerta'>"+this.el("advice_login").innerHTML+"</div>")this.el("msg_"+this.snd_id).innerHTML=""},chklogin:function(a){a.email.value==
""&&(msg+=this.msg.email);a.password.value==""&&(msg+=this.msg.passkey);return msg!=""?(this.el("msg_"+this.snd_id).innerHTML="<div class='error'>"+msg+"</div>",this.playSound("err"),!1):(this.el("ans_"+this.snd_id).style.display="none",this.el("msg_"+this.snd_id).style.display="block",this.el("msg_"+this.snd_id).innerHTML="<div class='info'>"+this.msg.loging+"</div>",this.wait(),!0)},resend:function(){document.getElementById("procc_comment").src=this.origin+"noLg.php?url_from="+this.url+"&url_real="+
document.location.href;this.el("msg_"+this.snd_id).innerHTML="<div class='info'>"+this.msg.sending+"</div>";this.wait()},setView:function(){try{(new Image).src=doStats("comments",this.url+"?comments")}catch(a){}},getByClass:function(a,b,c){b=b||document.body;c=c||"*";if(document.getElementsByClassName)return b.getElementsByClassName(a);if(b.querySelectorAll)return b.querySelectorAll((c||"")+"."+a);for(var b=b.getElementsByTagName(c),c=[],d=0;d<b.length;d++)for(var f=b[d],g=f.className.split(" "),
e=0;e<g.length;e++)if(g[e]==a){c.push(f);break}return c}};function comment_send(a){return comment.send(a)}function comenta(){}function getLogin(a){a==1?comment.getLogin():comment.resend()}function comment_wait(){comment.wait()}function limit_comm(a,b){"undefined"==typeof b&&(b=800);comment.limit(a,b)}function comment_login(a){return comment.chklogin(a)}function clean(a){return comment.cleantxt(a)}function commentsInitDinamic(){}
if(document.getElementById("COMM_comments_reduced"))comment.comm_repository="COMM_comments_reduced",comment.reCap=!1,comment.autoRefresh=!0;else if(document.getElementById("COMM_comments_live"))comment.comm_repository="COMM_comments_live",comment.reCap=!1,comment.autoRefresh=!0;else if(document.getElementById("comments_container"))comment.comm_repository="comments_container";
if(comment.rdCookie("user_data")){tmp_user_data=comment.rdCookie("user_data").split("|");var u_name=tmp_user_data[0],u_email="";comment.reCap=!1;comment.loadJS(comment.server+"esmas_login/getEmail.php?token="+comment.rdCookie("token"))}else comment.reCap=!1,comment.init();
function getComments(){comment.elemento_live.getElementsByTagName("ul")?(ul=comment.elemento_live.getElementsByTagName("ul"),ul.length>comment.single_num?comment.single_message=ul[comment.single_num].getElementsByTagName("p")[0].innerHTML:(comment.single_num=0,"undefined"!=typeof ul[0]?comment.single_message=ul[0].getElementsByTagName("p")[0].innerHTML:setTimeout("getComments()",3E3)),single_nombre1=comment.single_message.indexOf("&nbsp;")+13,single_nombre2=comment.single_message.indexOf("escribi"),
single_nombre=comment.single_message.substring(single_nombre1,single_nombre2),single_comentario1=comment.single_message.toLowerCase().indexOf("br>")+3,single_comentario=comment.single_message.substring(single_comentario1),single_comentario=single_comentario.substring(0,comment.single_comment_length),single_comentario=single_comentario.replace("<br>","  "),single_comentario=single_comentario.replace("<br/>","  "),single_comentario=single_comentario.replace("</br>","  "),comment.elemento_single.innerHTML=
"<b>"+single_nombre+" escribió: </b>   "+single_comentario,comment.single_num++,setTimeout("getComments()",comment.single_comment_time)):setTimeout("getComments()",6E3)}
function searchsingleComment(){if(document.getElementById("COMM_comments_live")&&document.getElementById("singleComment")){comment.elemento_live=document.getElementById("COMM_comments_live");comment.elemento_single=document.getElementById("singleComment");if("undefined"!=typeof single_comment_parameters){if("undefined"!=typeof single_comment_parameters.time){comment.single_comment_time=single_comment_parameters.time;if(comment.single_comment_time>1E3)comment.single_comment_time=Math.round(comment.single_comment_time/
1E3);if(comment.single_comment_time>300)comment.single_comment_time=300;else if(comment.single_comment_time<1)comment.single_comment_time=1;comment.single_comment_time*=1E3}if("undefined"!=typeof single_comment_parameters.length)comment.single_comment_length=single_comment_parameters.length}comment.elemento_single.style.paddingLeft="10px";getComments()}};

