var comment={server:"http://comentarios.esmas.com/",origin:"http://origin-comentarios.esmas.com/",sending:0,snd_id:0,lst_frm:0,recaptcha:"6LcK6QQAAAAAAEeH1Knhzi8XKAHe6xx9XM8RtF2f",reCap:true,timer:"",lastId:"",pSound:true,sPying:false,url:"",total:0,comm_repository:"COMM_comments",autoRefresh:false,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.",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(elemt){return document.getElementById(elemt)},toggle:function(ob){if(ob.style.display=="none"){ob.style.display="block"}else{ob.style.display="none"}},cl_url:function(url){var lst_ch=url.search(/\#/);if(lst_ch!=-1){url=url.substring(0,lst_ch)}lst_ch=url.search(/\?/);if(lst_ch!=-1){url=url.substring(0,lst_ch)}return url},init:function(){if('undefined'==typeof comment_url){this.url=this.cl_url(document.location.href)}else{this.url=this.cl_url(comment_url)}if('undefined'==typeof comment_origin){}else{this.origin=comment_origin}if('undefined'==typeof comment_server){}else{this.server=comment_server}if('undefined'==typeof comment_total){}else{this.total=comment_total}if('undefined'==typeof comment_reCap){}else{this.reCap=comment_reCap}if('undefined'==typeof comment_recaptcha){}else{this.recaptcha=comment_recaptcha}if(this.el(this.comm_repository)){if(this.el('COMM_comments')){this.loadJS('http://api.recaptcha.net/js/recaptcha_ajax.js')}if(document.getElementById("comm_pre")){setTimeout("comment.getComm(0,0);",2000)}else{setTimeout("comment.getComm(0,0);",2000)}if(this.el("addComentForm")){this.el("addComentForm").style.display="none";this.el("addComentForm").innerHTML=""}if(this.autoRefresh){setTimeout("comment.onlyComments();",60000)}}},loadJS:function(url){var sc=document.createElement('script');sc.setAttribute('type','text/javascript');sc.setAttribute('src',url);var hd=document.getElementsByTagName('head')[0];hd.appendChild(sc);return true},addCss:function(cssCode){var styleElement=document.createElement("style");styleElement.type="text/css";if(styleElement.styleSheet){styleElement.styleSheet.cssText=cssCode}else{styleElement.appendChild(document.createTextNode(cssCode))}document.getElementsByTagName("head")[0].appendChild(styleElement)},limit:function(obj,txtmax){if('undefined'==typeof txtmax){txtmax=800}if(obj.value.length>txtmax){obj.value=obj.value.substring(0,txtmax);this.el("msg_"+this.lst_frm).innerHTML="<div class='alerta'>Solo se permiten "+txtmax+" caracteres.</div>";setTimeout("comment.hidemsg('"+"msg_"+this.lst_frm+"');",3000)}},hidemsg:function(oNm){ob=this.el(oNm);ob.innerHTML=""},getanswers:function(id,obj){var ob=this.el("chl_"+id);this.toggle(ob);if(obj.innerHTML=="Ver [-] comentarios"){obj.innerHTML="Ver [+] comentarios"}else{obj.innerHTML="Ver [-] comentarios"}},cleantxt:function(ob){if(ob.name=="name"){if(ob.value.substr(0,7)=="Ingresa"){ob.value=""}}if(ob.name=="email"){if(ob.value.substr(0,7)=="Ingresa"){ob.value=""}}},isEmailAddress:function(address){var filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(filter.test(address))return true;else return false},stats:function(action){if('undefined'==typeof action){action="show"}try{}catch(error){}},onlyComments:function(){if('undefined'==typeof comment_tpl){template=""}else{template="template="+comment_tpl+"&"}this.loadJS('http://comentarios.esmas.com/fast_comments/rdCom_only_comments.php?'+template+'url='+this.cl_url(this.url)+'&url_real='+this.cl_url(document.location.href));setTimeout("comment.onlyComments();",60000)},reloadForm:function(){if('undefined'==typeof comment_tpl){template=""}else{template="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(c_name,value,expiredays){var getdomain=document.domain.substring(document.domain.indexOf('.')+1);document.cookie=c_name+"="+value+"; path=/; domain="+getdomain},rdCookie:function(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.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")){tmp_nm=this.rdCookie("user_data").split("|");return 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(em){if(this.rdCookie("com_email")){if(this.rdCookie("com_email")!=em){this.mkCookie("com_email",em)}}else{this.mkCookie("com_email",em)}},wrNM:function(nm){if(this.rdCookie("com_nick_name")){if(this.rdCookie("com_nick_name")!=nm){this.mkCookie("com_nick_name",nm)}}else{this.mkCookie("com_nick_name",nm)}},playSound:function(sound){if(!this.pSound)return;if(this.sPying){return}this.sPying=true;var D=document.getElementById("comm_sound");var h="<embed src=\""+this.server+"sounds/"+sound+".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\">";D.innerHTML=h;setTimeout("comment.sPying=false;",3000)},wait:function(){if(location.hash!=this.lastId){this.lastId=location.hash;var getin=false;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");getin=true;setTimeout("comment.el('msg_"+this.snd_id+"').innerHTML=''; comment.answer(0,0);",5000);setTimeout("comment.sending	=	0; comment.snd_id	=	0;",5000);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	=	0; comment.snd_id	=	0;",5000);Recaptcha.reload();getin=true;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	=	0; comment.snd_id	=	0;",5000);Recaptcha.reload();getin=true;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	=	0; comment.snd_id	=	0;",5000);Recaptcha.reload();getin=true;break;case"#LG":this.el("msg_"+this.snd_id).innerHTML="<div class='alerta'>"+this.el("advice_login").innerHTML+"</div>";this.playSound("advice");getin=true;break;case"#LO":this.el("msg_"+this.snd_id).innerHTML="<div class='exito'>"+this.msg.recived+"</div>";this.playSound("ok");setTimeout("comment.sending	=	0; comment.snd_id	=	0;",5000);getin=true;break;case"#LC":this.el("msg_"+this.snd_id).innerHTML="<div class='error'>"+this.msg.pass+"</div>";this.playSound("err");this.getLogin();getin=true;break;case"#LI":this.el("msg_"+this.snd_id).innerHTML="<div class='exito'>"+this.msg.nofull+"</div>";this.playSound("advice");getin=true;break;case"#LE":this.el("msg_"+this.snd_id).innerHTML="<div class='exito'>"+this.msg.allerr+"</div>";this.playSound("advice");getin=true;break}if(getin){this.setView();document.getElementById("procc_comment").src=this.server;document.location.href="#com";this.lastId="#com"}else{comment.timer=setTimeout("comment.wait()",500)}}else{comment.timer=setTimeout("comment.wait()",500)}},send:function(obj){if(comment.reCap){obj.holder_recaptcha.value=RecaptchaState.challenge}if(this.sending==0){msg="";if(obj.name.value==""){msg+=this.msg.name}else{if(obj.name.value.substring(0,7)=="Ingresa"){msg+=this.msg.name}}if(!this.isEmailAddress(obj.email.value)){msg+=this.msg.email}else{if(obj.email.value.substring(0,7)=="Ingresa"){msg+=this.msg.email}}if(obj.comment.value==""){msg+=this.msg.comment}if(comment.reCap){if(obj.recaptcha_response_field.value==""){msg+=this.msg.recaptcha}}else{obj.recaptcha_response_field.value="off_recaptcha"}if(msg!=""){this.el("msg_"+obj.parent_id.value).innerHTML="<div class='error'>"+msg+"</div>";this.playSound("err");return false}else{wait4me=this.wrEm(obj.email.value);wait4me=this.wrNM(obj.name.value);this.el("ans_"+obj.parent_id.value).style.display="none";this.el("msg_"+obj.parent_id.value).style.display="block";this.el("msg_"+obj.parent_id.value).innerHTML="<div class='info'>"+this.msg.sending+"</div>";this.sending=1;this.snd_id=obj.parent_id.value;this.wait();return true}}else{this.el("msg_"+obj.parent_id.value).innerHTML="<div class='alerta'>"+this.msg.waittill+"</div>"}},answer:function(id,level){try{var ob=this.el("ans_"+id);if(this.lst_frm!=id){this.toggle(this.el("ans_"+this.lst_frm));this.el("ans_"+this.lst_frm).innerHTML="";if(this.lst_frm==0){this.el("ans_"+this.lst_frm).innerHTML=this.msg.note;this.el("ans_"+this.lst_frm).style.display="block"}}if(id==0){if(ob.innerHTML!=""){this.el("ans_0").innerHTML="";this.toggle(this.el("ans_0"))}}if(ob.innerHTML==""){if(ob.style.display==""){ob.style.display="none"}this.toggle(ob);text=this.el("answer_level0").innerHTML;this.lst_frm=id;em=this.readEm();nm=this.readNM();if(this.rdCookie('user_data')&&em!=""){text=text.replace("Tu correo electrónico válido","&nbsp;");text=text.replace('value="CoM_EmAiL"','style="display:none !important; visibility:hidden;" value="'+em+'"');text=text.replace('value=CoM_EmAiL','style=display:none !important; visibility:hidden; value='+em)}text=text.replace("PaReNt_Id",id);text=text.replace("UrL_FrOm",this.url);text=text.replace("UrL_ReAl",document.location.href);text=text.replace("LeVeL",level);text=text.replace("CaPtChA_Id","captcha_"+id);text=text.replace("ReCaPtChA_ImAgE1","recaptcha_image");text=text.replace("ReCaPtChA_ReSpOnSe_FiElD1","recaptcha_response_field");text=text.replace("ReCaPtChA_HoLdEr","recaptcha_holder");if(nm!=""){text=text.replace("CoM_NaMe",nm)}else{text=text.replace("CoM_NaMe",this.msg.nm)}if(em!=""){text=text.replace("CoM_EmAiL",em)}else{text=text.replace("CoM_EmAiL",this.msg.em)}ob.innerHTML=text;if(this.reCap){Recaptcha.create(this.recaptcha,"captcha_"+id,{theme:"custom",lang:"es",custom_theme_widget:"captcha_"+id})}}}catch(error){txt="comment.answer("+id+","+level+");";setTimeout(txt,3000)}},getComm:function(level,page,comment_id){if('undefined'==typeof comment_id){comment_id=''}if('undefined'==typeof comment_tpl){template=""}else{template="&template="+comment_tpl}if('undefined'!=typeof comment_limit){template=template+"&limit="+comment_limit}if(comment_id!="")this.el("msg_"+comment_id).innerHTML="<div class='info'>"+this.msg.loading+"</div>";else this.el(this.comm_repository).innerHTML="<div class='info'>"+this.msg.loading+"</div>";url=this.server+"rdCom.php?page="+page+"&level="+level;url+=template;if(comment_id!=''){url+="&comment_id="+comment_id}url+="&comm_repository="+this.comm_repository;if(!this.reCap){url+="&no_captcha=1"}url+="&url="+this.cl_url(this.url);url+="&url_real="+document.location.href;this.loadJS(url);if(page!=0){this.setView()}},getLogin:function(){this.el("ans_"+this.snd_id).innerHTML="";text=this.el("login_form").innerHTML;em=this.readEm();if(em!=""){text=text.replace("CoM_EmAiL",em)}else{text=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(obj){if(obj.email.value==""){msg+=this.msg.email}if(obj.password.value==""){msg+=this.msg.passkey}if(msg!=""){this.el("msg_"+this.snd_id).innerHTML="<div class='error'>"+msg+"</div>";this.playSound("err");return false}else{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();return true}},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{var pix=new Image();pix.src=doStats('comments',this.url+"?comments")}catch(error){}},getByClass:function(className,root,tagName){root=root||document.body;tagName=tagName||'*';if(document.getElementsByClassName){return root.getElementsByClassName(className)}if(root.querySelectorAll){tagName=tagName||'';return root.querySelectorAll(tagName+'.'+className)}var children=root.getElementsByTagName(tagName);var elements=new Array();for(var i=0;i<children.length;i++){var child=children[i];var classNames=child.className.split(' ');for(var j=0;j<classNames.length;j++){if(classNames[j]==className){elements.push(child);break}}}return elements}};if(document.getElementById('COMM_comments_reduced')){comment.comm_repository="COMM_comments_reduced";comment.reCap=false;comment.autoRefresh=true}if(comment.rdCookie('user_data')){comment.reCap=false}function comment_send(obj){return comment.send(obj)}function comenta(){}function getLogin(num){if(num==1){comment.getLogin()}else{comment.resend()}}function comment_wait(){comment.wait()}function limit_comm(obj,txtmax){if('undefined'==typeof txtmax){txtmax=800}comment.limit(obj,txtmax)}function comment_login(obj){return comment.chklogin(obj)}function clean(ob){return comment.cleantxt(ob)}function commentsInitDinamic(){div_autor=document.getElementById('COMM_editor_name');ref_position=document.getElementById(comment.comm_repository).offsetTop;comment_width=document.getElementById(comment.comm_repository).offsetWidth;url=document.location.href;if(url.search(/\/cine\/peliculas\//)!=-1){PAGE_TYPE='movies'}if(url.search(/fanexito=/)!=-1){alert('Ya te has unido como un FAN. Gracias!');last_char=url.search(/\?/);url=url.substring(0,last_char);window.location=url}else if(url.search(/vparam=/)!=-1){if(url.search(/=si/)!=-1){alert('Se agrego con éxito este video a tus favoritos.')}else{alert('El video ya ha sido agregado a tus  favoritos.')}last_char=url.search(/\?/);url=url.substring(0,last_char);window.location=url}last_char=url.search(/\#/);if(last_char!=-1){url=url.substring(0,last_char)}last_char=url.search(/\?/);if(last_char!=-1){url=url.substring(0,last_char)}if(typeof URL_FORCE!="undefined"){url=URL_FORCE}uri=url;if(readCookie('email')){if(document.getElementById('teams_big')){loadJS('http://comentarios.esmas.com/apis/isFan.php?id=teams_big&type='+PAGE_TYPE+'&email='+unescape(readCookie('email')))}else if(document.getElementById('join_fav_div')){loadJS('http://comentarios.esmas.com/apis/isFan.php?id=join_fav_div&type='+PAGE_TYPE+'&email='+unescape(readCookie('email'))+'&url='+url)}else{loadJS('http://comentarios.esmas.com/apis/isFan.php?email='+unescape(readCookie('email'))+'&type='+PAGE_TYPE+'&url='+url)}}loadJS('http://origin-comentarios.esmas.com/ranking/insertViewsLine.php?page_type='+PAGE_TYPE+'&url='+url+'&url_r='+document.referrer)}comment.init();