var CMSTools={isCMSBackend:!1,enabledWfb:!1,enabledWtw:!1,enabledWgp:!1,enabledWpinit:!1,hostWebsocket:"",keyWSelector:"selectorSocialWigget",rTime:null,rTimeout:null,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.checkRefresh();if(this.showInvalidBrowser){if(Browser.name=='ie'&&Browser.version==7){urlInvalidBrowser=this.urlInvalidBrowser;this.openLayer(urlInvalidBrowser,'Navegador no soportado','width:770,height:320')} if(Browser.name=='firefox'&&Browser.version<3.6){urlInvalidBrowser=this.urlInvalidBrowser;this.openLayer(urlInvalidBrowser,'Navegador no soportado','width:770,height:320')}} 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="";el.set("html",html)})}},createSocialGoogle:function(selector){var splugins=$$(selector+" ."+this.keySocialSel+"."+this.keySocialGoogle);if(splugins.length){splugins.each(function(el){var data=JSON.decode(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.decode(el.get("rel"));var texto=typeof(data.text)!="undefined"?data.text:"";var html="";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))},processScripts:function(){var arrScript=$$("var.td-cms-script");for(var i=0;i59){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+='\n';html+='\n';html+='\n';html+='\n';html+='\n';html+='\n';html+='\n';html+='\n';html+='\n';html+='';html+='\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()})},checkRefresh:function(){var arrRefresh=$$("meta[name='td-refresh']");if(typeof(arrRefresh[0])!='undefined'){CMSTools.refreshTime(arrRefresh[0].content)}}} window.addEvent('load',function(){CMSTools.onLoad()})