var CMSTools={isCMSBackend:!1,enabledWfb:!1,enabledWtw:!1,enabledWgp:!1,enabledWpinit:!1,hostWebsocket:"",keyWSelector:"selectorSocialWigget",rTime:null,rTimeout:null,loaded:!1,keySocialGenerated:"socialWidgetGenerated",keySocialSel:"socialWidgetCMS",keySocialFacebook:"fblike",keySocialTwitter:"tweetear",keySocialGoogle:"gplike",urlInvalidBrowser:'/libs/invalidBrowser/es/Alerta_NoSoportado.html',showInvalidBrowser:!0,activateWfb:function(){this.enabledWfb=!0},activateWtw:function(){this.enabledWtw=!0},activateWgp:function(){this.enabledWgp=!0},activateWpinit:function(){this.enabledWpinit=!0},setIsCMSBackend:function(){this.isCMSBackend=!0},onLoad:function(){this.processScripts();this.processSocialLinksGa();this.processLoginEventGa();if(this.enabledWgp){(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}
js=d.createElement(s);try{js.innerHTML="{lang: \''.$lang.'\'}"}catch(e){}
js.id=id;js.src="https://apis.google.com/js/plusone.js";fjs.parentNode.insertBefore(js,fjs)}(document,"script","google-plusbutton"))}
if(this.enabledWtw){(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}
js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs)}(document,"script","platform-twitter"))}
if(this.enabledWfb){(function(d,s,id){var lang=typeof(FBLang)!="undefined"?FBLang:"es_ES";var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}
js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/"+lang+"/all.js#xfbml=1";fjs.parentNode.insertBefore(js,fjs)}(document,'script','facebook-jssdk'))}
if(this.enabledWpinit){(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}
js=d.createElement(s);js.id=id;js.src="//assets.pinterest.com/js/pinit.js";fjs.parentNode.insertBefore(js,fjs)}(document,"script","pinit"))}},createSocialFacebook:function(selector){var splugins=$$(selector+" ."+this.keySocialSel+"."+this.keySocialFacebook);if(splugins.length){var lang=typeof(FBLang)!="undefined"?FBLang:"es_ES";splugins.each(function(el){var data=JSON.decode(el.get("rel"));var html="<iframe src=\"//www.facebook.com/plugins/like.php?locale="+lang+"&href="+data.url+"&amp;layout="+data.layout+"&amp;show_faces=true&amp;width="+data.width+"&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:"+data.width+"px;\" allowTransparency=\"true\"></iframe>";el.set("html",html)})}},createSocialGoogle:function(selector){var splugins=$(selector+" ."+this.keySocialSel+"."+this.keySocialGoogle);if(splugins.length){splugins.each(function(el){var data=JSON.parse(el.get("rel"));gapi.plusone.render(el,{'href':data.url,'size':data.layout})})}},createSocialTwitter:function(selector){var splugins=$(selector+" ."+this.keySocialSel+"."+this.keySocialTwitter);if(splugins.length){splugins.each(function(el){var data=JSON.parse(el.get("rel"));var texto=typeof(data.text)!="undefined"?data.text:"";var html="<iframe src=\"//platform.twitter.com/widgets/tweet_button.html?url="+data.url+"&count="+data.layout+"&text="+texto+"\" allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\"></iframe>";el.set("html",html)})}},showSocialWidgets:function(ev){var el=ev.target;var selector=$(el).retrieve(this.keyWSelector);while(!selector&&el.getParent()){el=el.getParent();selector=$(el).retrieve(this.keyWSelector)}
if($(el).retrieve(this.keySocialGenerated)!="generated"){this.createSocialFacebook(selector);this.createSocialTwitter(selector);this.createSocialGoogle(selector);$(el).store(this.keySocialGenerated,"generated")}
$$(selector).setStyle("display","block")},hideSocialWidgets:function(ev){var el=ev.target;var selector=$(el).retrieve(this.keyWSelector);while(!selector&&el.getParent()){el=el.getParent();selector=$(el).retrieve(this.keyWSelector)}
$$(selector).setStyle("display","none")},hoverSocialWidgets:function(idObject,selector){$(idObject).store(this.keyWSelector,"#"+idObject+" "+selector);$(idObject).addEvent('mouseover',this.showSocialWidgets.bind(this));$(idObject).addEvent('mouseout',this.hideSocialWidgets.bind(this))},sendLoginGA:function(type){ga('tdGA.send','event',{eventCategory:'NTG account',eventAction:type,eventLabel:'success',nonInteraction:!1})},sendSocialGA:function(net){ga('tdGA.send','event',{eventCategory:'NTG social',eventAction:'social share',eventLabel:net,nonInteraction:!1})},processLoginEventGa:function(){if(typeof window.TDUser!="undefined"){window.TDUser.addEvent("onUserLogin",function(){CMSTools.sendLoginGA('login')});window.TDUser.addEvent("onRegistrationFinish",function(){CMSTools.sendLoginGA('registration')})}},processSocialLinksGa:function(){if(typeof ga!="function")return;var arrSocial=[{"pattern":"facebook.com/sharer","key":"facebook"},{"pattern":"facebook.com/dialog/feed","key":"facebook"},{"pattern":"twitter.com/intent/tweet","key":"twitter"},{"pattern":"linkedin.com/shareArticle","key":"linkedin"},{"pattern":"whatsapp://send","key":"whatsapp"}]
arrSocial.forEach(function(s){jQuery("a[href*='"+s.pattern+"']").on('click',function(){CMSTools.sendSocialGA(s.key)})})},processScripts:function(){if(this.isCMSBackend){initBackendPage()}},refreshTime:function(rTime){this.rTime=rTime;this.loadRefreshTime()},loadRefreshTime:function(){if(!isNaN(this.rTime)&&this.rTime>59){this.rTimeout=setTimeout(function(){window.location=location.href},this.rTime*1000)}},cancelRefresh:function(){if(this.rTimeout){clearTimeout(this.rTimeout)}},debug:function(obj,forceDebug){forceDebug=typeof(forceDebug)!="undefined"?forceDebug:!1;if(window.location.href.indexOf('debugJs')>-1||forceDebug){if(typeof(console)!="undefined"){if(typeof(console.debug)!="undefined"){console.debug(obj)}else if(typeof(console.log)!="undefined"){console.log(obj)}}}},isValidLocation:function(){if(window.location.href.indexOf("/backend/drop.php")>-1){return!1}
return!0},getStyleAtt:function(el,att){if(typeof(window.getComputedStyle)!="undefined"){if(Browser.firefox3){return window.getComputedStyle(el,null)[att]}else{return window.getComputedStyle(el)[att]}}else{return el.currentStyle[att]}},runSWF:function(archivo,ancho,alto,version,bgcolor,idIe,idMz,menu,FlashVars,quality,allowScriptAccess,writeScript,wmode){var version_data=(version?version:"6,0,0,0");var menu_data=(menu?menu:!1);var bgcolor_data=(bgcolor?bgcolor:"#FFFFFF");var idIe_data=(idIe?idIe:"flashMovIe");var idMz_data=(idMz?idMz:"flashMovMz");var quality_data=(quality?quality:"high");var allowScriptAccess_data=(allowScriptAccess?allowScriptAccess:"always");var agt=navigator.userAgent.toLowerCase();var is_safari=((agt.indexOf('safari')!=-1))?true:!1;if(typeof(writeScript)=="undefined"||writeScript==""){writeScript="1"}
if(typeof(wmode)=="undefined"){wmode="transparent"}
quality_data="high";var html="";html+='<object id="'+idIe_data+'" width="'+ancho+'" height="'+alto+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version_data+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">\n';html+='<param name="movie" value="'+archivo+'">\n';html+='<param name="quality" value="'+quality_data+'">\n';html+='<param name="FlashVars" value="'+FlashVars+'">\n';html+='<param name="bgcolor" value="'+bgcolor_data+'">\n';html+='<param name="menu" value="'+menu_data+'">\n';html+='<param name="wmode" value="'+wmode+'">\n';html+='<param name="allowScriptAccess" value="'+allowScriptAccess_data+'">\n';html+='<param name="allowFullScreen" value="true">\n';html+='<embed src="'+archivo+'" id="'+idMz_data+'" width="'+ancho+'" height="'+alto+'" quality="'+quality_data+'" wmode="'+wmode+'" bgcolor="'+bgcolor_data+'" FlashVars="'+FlashVars+'" menu="'+menu_data+'" allowScriptAccess="'+allowScriptAccess_data+'" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" swLiveConnect="true"></embed>';html+='</object>\n';if(typeof(document.readyState)=="undefined"||document.readyState=="interactive"||is_safari||document.readyState=="loading"){if(writeScript=="1"){document.write(html)}else{return html}}},openLayer:function(url,title,size){milkbox.openWithFile({href:url,title:title,size:size},{overlayOpacity:0.5,fileboxBorderWidth:'0px',fileboxBorderColor:'#ffffff',resizeDuration:1,resizeTransition:'bounce:out',centered:!0});milkbox.display.bottom.setStyle('display','none');milkbox.display.mainbox.setStyles({border:"0px",padding:"0px"});milkbox.display.addEvent("resizeComplete",function(){milkbox.display.hide_loader()})},}
document.addEventListener("DOMContentLoaded",function(){CMSTools.onLoad()})
CMSTools.onLoad();window.onload=function(){}