var UFO={req:["movie","width","height","majorversion","build"],opt:["play","loop","menu","quality","scale","salign","wmode","bgcolor","base","flashvars","devicefont","allowscriptaccess","seamlesstabbing","allowfullscreen","allownetworking"],optAtt:["id","name","align"],optExc:["swliveconnect"],ximovie:"ufo.swf",xiwidth:"215",xiheight:"138",ua:navigator.userAgent.toLowerCase(),pluginType:"",fv:[0,0],foList:[],create:function(A,B){if(!UFO.uaHas("w3cdom")||UFO.uaHas("ieMac")){return }UFO.getFlashVersion();UFO.foList[B]=UFO.updateFO(A);UFO.createCSS("#"+B,"visibility:hidden;");UFO.domLoad(B)},updateFO:function(A){if(typeof A.xi!="undefined"&&A.xi=="true"){if(typeof A.ximovie=="undefined"){A.ximovie=UFO.ximovie}if(typeof A.xiwidth=="undefined"){A.xiwidth=UFO.xiwidth}if(typeof A.xiheight=="undefined"){A.xiheight=UFO.xiheight}}A.mainCalled=false;return A},domLoad:function(B){var A=setInterval(function(){if((document.getElementsByTagName("body")[0]!=null||document.body!=null)&&document.getElementById(B)!=null){UFO.main(B);clearInterval(A)}},250);if(typeof document.addEventListener!="undefined"){document.addEventListener("DOMContentLoaded",function(){UFO.main(B);clearInterval(A)},null)}},main:function(B){var A=UFO.foList[B];if(A.mainCalled){return }UFO.foList[B].mainCalled=true;document.getElementById(B).style.visibility="hidden";if(UFO.hasRequired(B)){if(UFO.hasFlashVersion(parseInt(A.majorversion,10),parseInt(A.build,10))){if(typeof A.setcontainercss!="undefined"&&A.setcontainercss=="true"){UFO.setContainerCSS(B)}UFO.writeSWF(B)}else{if(A.xi=="true"&&UFO.hasFlashVersion(6,65)){UFO.createDialog(B)}}}document.getElementById(B).style.visibility="visible"},createCSS:function(A,E){var D=document.getElementsByTagName("head")[0];var C=UFO.createElement("style");if(!UFO.uaHas("ieWin")){C.appendChild(document.createTextNode(A+" {"+E+"}"))}C.setAttribute("type","text/css");C.setAttribute("media","screen");D.appendChild(C);if(UFO.uaHas("ieWin")&&document.styleSheets&&document.styleSheets.length>0){var B=document.styleSheets[document.styleSheets.length-1];if(typeof B.addRule=="object"){B.addRule(A,E)}}},setContainerCSS:function(D){var C=UFO.foList[D];var A=/%/.test(C.width)?"":"px";var B=/%/.test(C.height)?"":"px";UFO.createCSS("#"+D,"width:"+C.width+A+"; height:"+C.height+B+";");if(C.width=="100%"){UFO.createCSS("body","margin-left:0; margin-right:0; padding-left:0; padding-right:0;")}if(C.height=="100%"){UFO.createCSS("html","height:100%; overflow:hidden;");UFO.createCSS("body","margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;")}},createElement:function(A){return(UFO.uaHas("xml")&&typeof document.createElementNS!="undefined")?document.createElementNS("http://www.w3.org/1999/xhtml",A):document.createElement(A)},createObjParam:function(C,D,B){var A=UFO.createElement("param");A.setAttribute("name",D);A.setAttribute("value",B);C.appendChild(A)},uaHas:function(E){var D=UFO.ua;switch(E){case"w3cdom":return(typeof document.getElementById!="undefined"&&typeof document.getElementsByTagName!="undefined"&&(typeof document.createElement!="undefined"||typeof document.createElementNS!="undefined"));case"xml":var A=document.getElementsByTagName("meta");var C=A.length;for(var B=0;B<C;B++){if(/content-type/i.test(A[B].getAttribute("http-equiv"))&&/xml/i.test(A[B].getAttribute("content"))){return true}}return false;case"ieMac":return/msie/.test(D)&&!/opera/.test(D)&&/mac/.test(D);case"ieWin":return/msie/.test(D)&&!/opera/.test(D)&&/win/.test(D);case"gecko":return/gecko/.test(D)&&!/applewebkit/.test(D);case"opera":return/opera/.test(D);case"safari":return/applewebkit/.test(D);default:return false}},getFlashVersion:function(){if(UFO.fv[0]!=0){return }if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){UFO.pluginType="npapi";var A=navigator.plugins["Shockwave Flash"].description;if(typeof A!="undefined"){A=A.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var B=parseInt(A.replace(/^(.*)\..*$/,"$1"),10);var E=/r/.test(A)?parseInt(A.replace(/^.*r(.*)$/,"$1"),10):0;UFO.fv=[B,E]}}else{if(window.ActiveXObject){UFO.pluginType="ax";try{var C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(D){try{var C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");UFO.fv=[6,0];C.AllowScriptAccess="always"}catch(D){if(UFO.fv[0]==6){return }}try{var C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(D){}}if(typeof C=="object"){var A=C.GetVariable("$version");if(typeof A!="undefined"){A=A.replace(/^\S+\s+(.*)$/,"$1").split(",");UFO.fv=[parseInt(A[0],10),parseInt(A[2],10)]}}}}},hasRequired:function(C){var B=UFO.req.length;for(var A=0;A<B;A++){if(typeof UFO.foList[C][UFO.req[A]]=="undefined"){return false}}return true},hasFlashVersion:function(B,A){return(UFO.fv[0]>B||(UFO.fv[0]==B&&UFO.fv[1]>=A))?true:false},writeSWF:function(E){var G=UFO.foList[E];var I=document.getElementById(E);if(UFO.pluginType=="npapi"){if(UFO.uaHas("gecko")||UFO.uaHas("xml")){while(I.hasChildNodes()){I.removeChild(I.firstChild)}var J=UFO.createElement("object");J.setAttribute("type","application/x-shockwave-flash");J.setAttribute("data",G.movie);J.setAttribute("width",G.width);J.setAttribute("height",G.height);var F=UFO.optAtt.length;for(var H=0;H<F;H++){if(typeof G[UFO.optAtt[H]]!="undefined"){J.setAttribute(UFO.optAtt[H],G[UFO.optAtt[H]])}}var D=UFO.opt.concat(UFO.optExc);var F=D.length;for(var H=0;H<F;H++){if(typeof G[D[H]]!="undefined"){UFO.createObjParam(J,D[H],G[D[H]])}}I.appendChild(J)}else{var K="";var D=UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);var F=D.length;for(var H=0;H<F;H++){if(typeof G[D[H]]!="undefined"){K+=" "+D[H]+'="'+G[D[H]]+'"'}}I.innerHTML='<embed type="application/x-shockwave-flash" src="'+G.movie+'" width="'+G.width+'" height="'+G.height+'" pluginspage="http://www.macromedia.com/go/getflashplayer"'+K+"></embed>"}}else{if(UFO.pluginType=="ax"){var C="";var F=UFO.optAtt.length;for(var H=0;H<F;H++){if(typeof G[UFO.optAtt[H]]!="undefined"){C+=" "+UFO.optAtt[H]+'="'+G[UFO.optAtt[H]]+'"'}}var A="";var F=UFO.opt.length;for(var H=0;H<F;H++){if(typeof G[UFO.opt[H]]!="undefined"){A+='<param name="'+UFO.opt[H]+'" value="'+G[UFO.opt[H]]+'" />'}}var B=window.location.protocol=="https:"?"https:":"http:";I.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+C+' width="'+G.width+'" height="'+G.height+'" codebase="'+B+"//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+G.majorversion+",0,"+G.build+',0"><param name="movie" value="'+G.movie+'" />'+A+"</object>"}}},createDialog:function(B){var C=UFO.foList[B];UFO.createCSS("html","height:100%; overflow:hidden;");UFO.createCSS("body","height:100%; overflow:hidden;");UFO.createCSS("#xi-con","position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");UFO.createCSS("#xi-dia","position:absolute; left:50%; top:50%; margin-left: -"+Math.round(parseInt(C.xiwidth,10)/2)+"px; margin-top: -"+Math.round(parseInt(C.xiheight,10)/2)+"px; width:"+C.xiwidth+"px; height:"+C.xiheight+"px;");var I=document.getElementsByTagName("body")[0];var H=UFO.createElement("div");H.setAttribute("id","xi-con");var E=UFO.createElement("div");E.setAttribute("id","xi-dia");H.appendChild(E);I.appendChild(H);var J=window.location;if(UFO.uaHas("xml")&&UFO.uaHas("safari")){var G=document.getElementsByTagName("title")[0].firstChild.nodeValue=document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0,47)+" - Flash Player Installation"}else{var G=document.title=document.title.slice(0,47)+" - Flash Player Installation"}var A=UFO.pluginType=="ax"?"ActiveX":"PlugIn";var F=typeof C.xiurlcancel!="undefined"?"&xiUrlCancel="+C.xiurlcancel:"";var D=typeof C.xiurlfailed!="undefined"?"&xiUrlFailed="+C.xiurlfailed:"";UFO.foList["xi-dia"]={movie:C.ximovie,width:C.xiwidth,height:C.xiheight,majorversion:"6",build:"65",flashvars:"MMredirectURL="+J+"&MMplayerType="+A+"&MMdoctitle="+G+F+D};UFO.writeSWF("xi-dia")},expressInstallCallback:function(){var B=document.getElementsByTagName("body")[0];var A=document.getElementById("xi-con");B.removeChild(A);UFO.createCSS("body","height:auto; overflow:auto;");UFO.createCSS("html","height:auto; overflow:auto;")},cleanupIELeaks:function(){var B=document.getElementsByTagName("object");var D=B.length;for(var C=0;C<D;C++){B[C].style.display="none";for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=null}}}}};if(typeof window.attachEvent!="undefined"&&UFO.uaHas("ieWin")){window.attachEvent("onunload",UFO.cleanupIELeaks)};function getCookie(C){var D=document.cookie.indexOf(C+"=");var A=D+C.length+1;if((!D)&&(C!=document.cookie.substring(0,C.length))){return null}if(D==-1){return null}var B=document.cookie.indexOf(";",A);if(B==-1){B=document.cookie.length}return unescape(document.cookie.substring(A,B))}function setCookie(C,E,D,G,A,H){var B=new Date();B.setTime(B.getTime());if(D){D=D*1000*60*60*24}var F=new Date(B.getTime()+(D));document.cookie=C+"="+escape(E)+((D)?";expires="+F.toGMTString():"")+((G)?";path="+G:"")+((A)?";domain="+A:"")+((H)?";secure":"")}function deleteCookie(B,C,A){if(getCookie(B)){document.cookie=B+"="+((C)?";path="+C:"")+((A)?";domain="+A:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};galeria=Class.create();galeria.prototype={initialize:function(B,A,C,D){this.idModulo=B;this.numeroTotal=A;this.posInicial=C;this.posFinal=D;this.posOcultar=C;if(D>0&&C+1>A){this.posMostrar=C}else{this.posMostrar=C+1}},efecto_Avanzar:function(D,B,C,A){nombreCajaOcultar="caja_"+this.idModulo+"_"+D;nombreCajaMostrar="caja_"+this.idModulo+"_"+C;new Effect.Fade(nombreCajaOcultar,{duration:0});new Effect.Appear(nombreCajaMostrar,{duration:1})},avanzar:function(){if(this.posMostrar<=this.numeroTotal){this.efecto_Avanzar(this.posOcultar,"top-left",this.posMostrar,"top-left");this.posOcultar++;this.posMostrar++}},retroceder:function(){if(this.posOcultar>this.posInicial){this.posOcultar--;this.posMostrar--;this.efecto_Avanzar(this.posMostrar,"top-left",this.posOcultar,"top-left")}},avanzar_horizontal:function(D){if(this.posFinal>0){if(this.posMostrar<=this.numeroTotal){var C="caja_"+this.idModulo+"_"+this.posMostrar;var B="contenedor_galeria_"+this.idModulo;$(B).setStyle({overflow:"hidden",height:D[this.posMostrar-1]+"px"});this.efecto_Avanzar(this.posOcultar,"bottom-left",this.posMostrar,"top-left");if(this.posMostrar==(this.posInicial+1)){var A="retroceder_"+this.idModulo;$(A).show()}this.posOcultar++;this.posMostrar++}}else{if(this.posMostrar>=this.numeroTotal+1){this.posMostrar=1}C="caja_"+this.idModulo+"_"+this.posMostrar;B="contenedor_galeria_"+this.idModulo;$(B).setStyle({overflow:"hidden",height:D[this.posMostrar-1]+"px"});this.efecto_Avanzar(this.posOcultar,"bottom-left",this.posMostrar,"top-left");this.posOcultar=this.posMostrar;if(this.posOcultar==this.numeroTotal){this.posMostrar=1}else{this.posMostrar++}}},retroceder_horizontal:function(C){if(this.posFinal>0){if(this.posOcultar>this.posInicial){this.posOcultar--;this.posMostrar--;nombreCajaMostrar="caja_"+this.idModulo+"_"+this.posMostrar;contenedorGaleria="contenedor_galeria_"+this.idModulo;$(contenedorGaleria).setStyle({overflow:"hidden",height:C[this.posMostrar-1]+"px"});this.efecto_Avanzar(this.posMostrar,"top-left",this.posOcultar,"top-left");if(this.posMostrar==(this.posInicial+1)){var A="retroceder_"+this.idModulo;$(A).hide()}if(this.posMostrar==this.numeroTotal){var B="avanzar_"+this.idModulo;$(B).show()}}}else{if(this.posOcultar==1){this.posMostrar=this.numeroTotal}else{this.posMostrar=this.posOcultar-1}nombreCajaMostrar="caja_"+this.idModulo+"_"+this.posMostrar;contenedorGaleria="contenedor_galeria_"+this.idModulo;$(contenedorGaleria).setStyle({overflow:"hidden",height:C[this.posMostrar-1]+"px"});this.efecto_Avanzar(this.posOcultar,"top-left",this.posMostrar,"top-left");this.posOcultar=this.posMostrar;if(this.posOcultar==this.numeroTotal){this.posMostrar=1}else{this.posMostrar=this.posOcultar+1}}},mostrar:function(A){nombreCajaMostrar="caja_"+this.idModulo+"_"+A;new Effect.Grow(nombreCajaMostrar,{direction:"top-right"})},ocultar:function(A){nombreCajaOcultar="caja_"+this.idModulo+"_"+A;new Effect.Shrink(nombreCajaOcultar,{direction:"top-right"})},eliminar:function(A){nombreEliminar="caja_"+this.idModulo+"_"+A;Element.hide(nombreEliminar)}};masNoticias=Class.create();masNoticias.prototype={initialize:function(B,A){this.idDivMostrar=B;this.idDivTagMostrar=A},ocultar:function(A){Element.hide(A)},mostrar:function(A,B){Element.hide(this.idDivMostrar);Element.removeClassName(this.idDivTagMostrar,"select");Element.show(B);Element.addClassName(A,"select");this.idDivMostrar=B;this.idDivTagMostrar=A}};var idDivSondeo;function LeerSondeo(D,B){var C="";idDivSondeo=D;var A=new Ajax.Updater(D,B,{method:"get",parameters:C})}function escribirRespuesta_Sondeos(A){$(idDivSondeo).innerHTML=A.responseText}function enviarDatos(I,K,D,G){var J=-1;var E="/sondeos/index.php";var C;var H=document.forms[D][G].length;if(isNaN(H)){if(document.forms[D][G].checked){J=document.forms[D][G].value}}for(C=0;C<H;C++){if(document.forms[D][G][C].checked){J=document.forms[D][G][C].value}}if(J==-1){alert("Selecciona una opcion");return false}var B="poll_id="+I;B+="&poll_ident="+I;B+="&action=vote";B+="&option_id="+J;var A=K;var F=new Ajax.Updater(A,E,{method:"get",parameters:B});return false}function enviarDatos_Titulo(I,K,D,G){var J=-1;var E="/sondeos/index_Titulo.php";var C;var H=document.forms[D][G].length;if(isNaN(H)){if(document.forms[D][G].checked){J=document.forms[D][G].value}}for(C=0;C<H;C++){if(document.forms[D][G][C].checked){J=document.forms[D][G][C].value}}if(J==-1){alert("Selecciona una opcion");return false}var B="poll_id="+I;B+="&poll_ident="+I;B+="&action=vote";B+="&option_id="+J;var A=K;var F=new Ajax.Updater(A,E,{method:"get",parameters:B});return false}function verResultados(C,E){var B="/sondeos/index.php";var D="poll_id="+C;D+="&poll_ident="+C;D+="&action=results";var F=E;var A=new Ajax.Updater(F,B,{method:"get",parameters:D});return false}function verResultados_Completo(C,E){var B="/sondeos/index_Completo.php";var D="poll_id="+C;D+="&poll_ident="+C;D+="&action=results";var F=E;var A=new Ajax.Updater(F,B,{method:"get",parameters:D});return false}function verResultados_Titulo(C,E){var B="/sondeos/index_Titulo.php";var D="poll_id="+C;D+="&poll_ident="+C;D+="&action=results";var F=E;var A=new Ajax.Updater(F,B,{method:"get",parameters:D});return false};ValoracionSlider=Class.create({id:null,parametros:null,slider:null,positivos:null,negativos:null,neutrales:null,puntos:null,nota:null,total:null,slider_value:6,actual_vote:-1,new_vote:null,signo:null,average:null,options:null,show:null,show_onSlide:null,showLast:null,update:null,slide:null,change:null,vote:null,getLast:null,receive:null,receiveLast:null,toggle:null,handles:null,cookie:null,urls:null,options:null,initSlider:function(){if(getCookie(this.cookie)){this.actual_vote=parseInt(getCookie(this.cookie));this.slider_value=this.actual_vote+1;if(this.actual_vote>5){this.signo="+"}else{if(this.actual_vote<5){this.signo="-"}else{this.signo="="}}}this.slider=new Control.Slider(this.handles.slider,this.handles.slider_track,{range:$R(1,11),values:[1,2,3,4,5,6,7,8,9,10,11],sliderValue:this.slider_value,onSlide:this.slide.bindAsEventListener(this),onChange:this.change.bindAsEventListener(this)});this.getLast()}});ValoracionSlider_Media_Votos=Class.create(ValoracionSlider,{init:function(C,D,B,A,E){this.parametros=C;this.puntos=parseInt(D);this.total=parseInt(B);this.toggle=this.options.toggle||false;this.urls=this.options.urls||this.urls;this.cookie=this.options.cookie||A+"_puntos_"+E;this.handles=this.options.handles||{result:A+"_puntos_"+E,result_votes:A+"_puntos_votes_"+E,slider:"handle_"+E,slider_track:"track_"+E,texto:"texto_"+E,grVote:"gr_"+A+"_puntos_vote_"+E,grResult:"gr_"+A+"_puntos_result_"+E};this.show=this.options.show||this.show;this.show_onSlide=this.options.show_onSlide||this.show_onSlide;this.showLast=this.options.showLast||this.showLast;this.update=this.options.update||this.update;this.slide=this.options.slide||this.slide;this.change=this.options.change||this.change;this.vote=this.options.vote||this.vote;this.getLast=this.options.getLast||this.getLast;this.receive=this.options.receive||this.receive;this.receiveLast=this.options.receiveLast||this.receiveLast},show:function(){$(this.handles.result).removeClassName("verde");$(this.handles.result).removeClassName("rojo");if(this.puntos/this.total>=5){$(this.handles.result).addClassName("verde")}else{$(this.handles.result).addClassName("rojo")}if(this.total>0){$(this.handles.result).update(Number(this.puntos/this.total).toFixed(1))}else{$(this.handles.result).update("-")}$(this.handles.result_votes).update(Number(this.total).toFixed(0));$(this.handles.texto).update("Ya has votado")},show_onSlide:function(){$(this.handles.result).removeClassName("verde");$(this.handles.result).removeClassName("rojo");if(Number(this.average)>=5){$(this.handles.result).addClassName("verde")}else{$(this.handles.result).addClassName("rojo")}$(this.handles.result).update(Number(this.average).toFixed(1));$(this.handles.result_votes).update(Number(this.total).toFixed(0))},showLast:function(){$(this.handles.result).removeClassName("verde");$(this.handles.result).removeClassName("rojo");if(this.puntos/this.total>=5){$(this.handles.result).addClassName("verde")}else{$(this.handles.result).addClassName("rojo")}if(this.total>0){$(this.handles.result).update(Number(this.puntos/this.total).toFixed(1))}else{$(this.handles.result).update("-")}$(this.handles.result_votes).update(Number(this.total).toFixed(0))},update:function(B){var A;A=parseInt(B);if(this.actual_vote==-1){if(this.total!=0){this.average=(A-1+this.puntos)/(this.total+1)}else{this.average=A-1+this.puntos}}else{if(this.total!=0){this.average=(A-1-this.actual_vote+this.puntos)/this.total}else{this.average=A-1-this.actual_vote+this.puntos}}},slide:function(A){this.update(A);this.show_onSlide()},change:function(A){this.update(A);this.show_onSlide();this.new_vote=parseInt(A)-1;this.vote()},vote:function(){myAjax=new Ajax.Request(this.urls.actualizar,{parameters:Object.extend({actual_vote:this.actual_vote,new_vote:this.new_vote},this.parametros),method:"get",onComplete:this.receive.bind(this)});this.actual_vote=this.new_vote},getLast:function(){myAjax=new Ajax.Request(this.urls.consultar,{parameters:this.parametros,method:"get",onComplete:this.receiveLast.bind(this)})},receive:function(B){var A=B.responseText.split("#");this.puntos=parseInt(A[3]);this.total=parseInt(A[4]);this.actual_vote=parseInt(A[6]);setCookie(this.cookie,this.actual_vote,1,"/","","");if(this.total!=0){this.show()}this.slider.disabled=true;if(this.toggle){Element.hide(this.handles.grVote);Element.show(this.handles.grResult)}},receiveLast:function(B){var A=B.responseText.split("#");this.puntos=parseInt(A[3]);this.total=parseInt(A[4]);this.showLast()},initSlider:function($super){$super();if(getCookie(this.cookie)){this.slider.disabled=true;$(this.handles.texto).update("Ya has votado")}if(this.toggle==true){if(getCookie(this.cookie)){Element.show(this.handles.grResult)}else{Element.show(this.handles.grVote)}}}});var fnVS_N={show_Swap:function(){$(this.handles.result).removeClassName("verde");$(this.handles.result).removeClassName("rojo");if(this.puntos/this.total>=5){$(this.handles.result).addClassName("verde")}else{$(this.handles.result).addClassName("rojo")}if(this.total>0){$(this.handles.result).update(Number(this.puntos/this.total).toFixed(1))}else{$(this.handles.result).update("-")}$(this.handles.result_votes).update(Number(this.total).toFixed(0))}};ValoracionSlider_Noticia=Class.create(ValoracionSlider_Media_Votos,{initialize:function(G,D,E,C){var A="not";var F=G;var B={not_id:G};this.options=C||{};this.urls=this.options.urls||{actualizar:"/noticias-categoria/noticia_puntos_actualizar.php",consultar:"/noticias-categoria/noticia_puntos_consultar.php"};this.init(B,D,E,A,F);this.initSlider()}});ValoracionSlider_Cronica=Class.create(ValoracionSlider_Media_Votos,{initialize:function(G,D,E,C){var A="cronica";var F=G;var B={not_id:G};this.options=C||{};this.urls=this.options.urls||{actualizar:"/cronicas/cronicas_puntos_actualizar.php",consultar:"/cronicas/cronicas_puntos_consultar.php"};this.init(B,D,E,A,F);this.initSlider()}});ValoracionSlider_Segregado=Class.create(ValoracionSlider,{init:function(B,F,E,H,C,D,A,G){this.parametros=B;this.positivos=parseInt(F);this.negativos=parseInt(E);this.neutrales=parseInt(H);this.puntos=parseInt(C);this.total=parseInt(D);this.nota=(D/C);this.toggle=this.options.toggle||false;this.urls=this.options.urls||this.urls;this.cookie=this.options.cookie||A+"_puntos_"+G;this.handles=this.options.handles||{result_positivos:A+"_positivos_"+G,result_negativos:A+"_negativos_"+G,result_neutrales:A+"_neutrales_"+G,result_nota:A+"_nota_"+G,slider:"handle_"+G,slider_track:"track_"+G};this.show=this.options.show||this.show;this.show_onSlide=this.options.show||this.show_onSlide;this.showLast=this.options.showLast||this.showLast;this.update=this.options.update||this.update;this.slide=this.options.slide||this.slide;this.change=this.options.change||this.change;this.vote=this.options.vote||this.vote;this.getLast=this.options.getLast||this.getLast;this.receive=this.options.receive||this.receive;this.receiveLast=this.options.receiveLast||this.receiveLast},show:function(){$(this.handles.result_positivos).update(this.positivos);$(this.handles.result_negativos).update(this.negativos);$(this.handles.result_nota).update(Number(this.nota).toFixed(2))},show_onSlide:function(){$(this.handles.result_positivos).update(this.positivos);$(this.handles.result_negativos).update(this.negativos);$(this.handles.result_nota).update(Number(this.nota).toFixed(2))},showLast:function(){$(this.handles.result_positivos).update(this.positivos);$(this.handles.result_negativos).update(this.negativos);$(this.handles.result_nota).update(Number(this.nota).toFixed(2))},update:function(E){var A;var D;var C;var F;var B;B=parseInt(E);D=0;C=0;F=0;if(this.actual_vote==-1){if(this.total!=0){A=(B-1+this.puntos)/(this.total+1)}else{A=B-1+this.puntos}if(B>6){if(this.signo!="+"){D=1}if(this.signo=="-"){C=-1}if(this.signo=="="){F=-1}this.signo="+"}else{if(B<6){if(this.signo=="+"){D=-1}if(this.signo!="-"){C=1}if(this.signo=="="){F=-1}this.signo="-"}else{if(this.signo=="+"){D=-1}if(this.signo=="-"){C=-1}if(this.signo!="="){F=1}this.signo="="}}}else{if(this.total!=0){A=(B-1-this.actual_vote+this.puntos)/this.total}else{A=B-1-this.actual_vote+this.puntos}if(this.actual_vote>5){if(B>6){if(this.signo!="+"){D=1;if(this.signo=="-"){C=-1}if(this.signo=="="){F=-1}this.signo="+"}}else{if(B<6){if(this.signo!="-"){if(this.signo=="+"){D=-1}C=1;if(this.signo=="="){F=-1}this.signo="-"}}else{if(this.signo!="="){if(this.signo=="+"){D=-1}if(this.signo=="-"){C=-1}F=1;this.signo="="}}}}else{if(this.actual_vote<5){if(B>6){if(this.signo!="+"){D=1;if(this.signo=="-"){C=-1}if(this.signo=="="){F=-1}this.signo="+"}}else{if(B<6){if(this.signo!="-"){if(this.signo=="+"){D=-1}C=1;if(this.signo=="="){F=-1}this.signo="-"}}else{if(this.signo!="="){if(this.signo=="+"){D=-1}if(this.signo=="-"){C=-1}F=1;this.signo="="}}}}else{if(B>6){if(this.signo!="+"){D=1;if(this.signo=="-"){C=-1}if(this.signo=="="){F=-1}this.signo="+"}}else{if(B<6){if(this.signo!="-"){if(this.signo=="+"){D=-1}C=1;if(this.signo=="="){F=-1}this.signo="-"}}else{if(this.signo!="="){if(this.signo=="+"){D=-1}if(this.signo=="-"){C=-1}F=1;this.signo="="}}}}}}this.positivos+=D;this.negativos+=C;this.neutrales+=F;this.nota=A},slide:function(A){this.update(A);this.show_onSlide()},change:function(A){this.update(A);this.new_vote=parseInt(A)-1;this.vote()},vote:function(){myAjax=new Ajax.Request(this.urls.actualizar,{parameters:Object.extend({actual_vote:this.actual_vote,new_vote:this.new_vote},this.parametros),method:"get",onComplete:this.receive.bind(this)});this.actual_vote=this.new_vote},getLast:function(){myAjax=new Ajax.Request(this.urls.consultar,{parameters:this.parametros,method:"get",onComplete:this.receiveLast.bind(this)})},receive:function(B){var A=B.responseText.split("#");this.positivos=parseInt(A[0]);this.negatavos=parseInt(A[1]);this.neutrales=parseInt(A[2]);this.puntos=parseInt(A[3]);this.total=parseInt(A[4]);if(this.total!=0){this.nota=this.puntos/this.total}else{this.nota=this.puntos}this.actual_vote=parseInt(A[6]);setCookie(this.cookie,this.actual_vote,1,"/","","");this.show();this.slider.disabled=true},receiveLast:function(B){var A=B.responseText.split("#");this.positivos=parseInt(A[0]);this.negatavos=parseInt(A[1]);this.neutrales=parseInt(A[2]);this.puntos=parseInt(A[3]);this.total=parseInt(A[4]);if(this.total!=0){this.nota=this.puntos/this.total}else{this.nota=this.puntos}this.showLast()},initSlider:function($super){$super();if(getCookie(this.cookie)){this.slider.disabled=true}}});ValoracionSlider_Entidad=Class.create(ValoracionSlider_Segregado,{initialize:function(C,E,A,B,F,H,G){var J=C;var D="ent";var I={ent_id:C};this.options=G||{};this.urls=this.options.urls||{actualizar:"/entidades-operaciones/entidades_puntos_actualizar.php",consultar:"/entidades-operaciones/entidades_puntos_consultar.php"};this.init(I,E,A,B,F,H,D,J);this.initSlider()}});var fnVS_P={show:function(){$(this.handles.result).removeClassName("verde");$(this.handles.result).removeClassName("rojo");mediaBayesiana=((this.total)/(this.total+this.m))*(this.puntos/this.total)+((this.m/(this.total+this.m))*this.C);if(mediaBayesiana>=5){$(this.handles.result).addClassName("verde")}else{$(this.handles.result).addClassName("rojo")}if(this.total>0){$(this.handles.result).update(Number(mediaBayesiana).toFixed(1))}else{$(this.handles.result).update("-")}$(this.handles.result_votes).update(Number(this.total).toFixed(0));$(this.handles.texto).update("Ya has votado")},show_onSlide:function(){$(this.handles.result).removeClassName("verde");$(this.handles.result).removeClassName("rojo");mediaBayesiana=((this.total)/(this.total+this.m))*(this.average)+((this.m/(this.total+this.m))*this.C);if(Number(mediaBayesiana)>=5){$(this.handles.result).addClassName("verde")}else{$(this.handles.result).addClassName("rojo")}$(this.handles.result).update(Number(mediaBayesiana).toFixed(1));$(this.handles.result_votes).update(Number(this.total).toFixed(0))},showLast:function(){$(this.handles.result).removeClassName("verde");$(this.handles.result).removeClassName("rojo");mediaBayesiana=((this.total)/(this.total+this.m))*(this.puntos/this.total)+((this.m/(this.total+this.m))*this.C);if(mediaBayesiana>=5){$(this.handles.result).addClassName("verde")}else{$(this.handles.result).addClassName("rojo")}if(this.total>0){$(this.handles.result).update(Number(mediaBayesiana).toFixed(1))}else{$(this.handles.result).update("-")}$(this.handles.result_votes).update(Number(this.total).toFixed(0))},receiveLast:function(B){var A=B.responseText.split("#");this.puntos=parseInt(A[3]);this.total=parseInt(A[4]);this.m=parseInt(A[7]);this.C=parseFloat(A[8]);if(this.total>0){this.showLast()}}};Puntos_Pelicula=Class.create(ValoracionSlider_Media_Votos,{initialize:function(G,D,E,C){var A="peli";var F=G;var B={not_id:G};this.options=C||{};this.urls=this.options.urls||{actualizar:"/cartelera/ajax/pelicula_puntos_actualizar.php",consultar:"/cartelera/ajax/pelicula_puntos_consultar.php"};this.init(B,D,E,A,F);this.initSlider()}});Puntos_Pelicula_MB=Class.create(ValoracionSlider_Media_Votos,{initialize:function(B,F,H,E,A,G){var D="peli";var J=B;var I={not_id:B};this.options=G||{};this.m=E;this.C=A;this.urls=this.options.urls||{actualizar:"/cartelera/ajax/pelicula_puntos_actualizar.php",consultar:"/cartelera/ajax/pelicula_puntos_consultar.php"};this.init(I,F,H,D,J);this.initSlider()}});Puntos_Pelicula_MB_No_Slider=Class.create(ValoracionSlider_Media_Votos,{initialize:function(E,G,F,I,D,A,H){var B="peli";var K=E+"_"+G;var J={not_id:G};this.options=H||{};this.m=D;this.C=A;this.urls=this.options.urls||{actualizar:"/cartelera/ajax/pelicula_puntos_actualizar.php",consultar:"/cartelera/ajax/pelicula_puntos_consultar.php"};this.init(J,F,I,B,K);this.getLast()}});ValoracionTriario=Class.create({parametros:null,id_1:null,id_2:null,Positivos:null,Positivos_Porcentaje:null,Negativos:null,Negativos_Porcentaje:null,Neutrales:null,Neutrales_Porcentaje:null,Total:null,new_vote:null,options:null,Voto:null,Voto_Positivo:null,Voto_Negativo:null,Voto_Neutral:null,getLast:null,show:null,showLast:null,receive:null,receiveLast:null,handles:null,cookie:null,urls:null,no_voto:null,voto_negativo:null,voto_neutro:null,voto_positivo:null,img_pos:null,img_neg:null,img_neu:null,init:function(){if(!getCookie(this.cookie)){Element.hide(this.handles.result)}else{Element.hide(this.handles.accion)}this.getLast()}});ValoracionTriario_Sustitucion=Class.create(ValoracionTriario,{init:function(B,A,C){this.no_voto=this.options.no_voto||-1;this.voto_negativo=this.options.no_voto||1;this.voto_neutro=this.options.no_voto||2;this.voto_positivo=this.options.no_voto||3;this.img_pos=this.options.img_pos||'<img src="/imagenes/flecha-verde1.png" />';this.img_neg=this.options.img_neg||'<img src="/imagenes/flecha-roja1.png" />';this.img_neu=this.options.img_neu||'<img src="/imagenes/flecha-neutro1.png" />';this.parametros=B;this.urls=this.options.urls||this.urls;this.cookie=this.options.cookie||A+"_triarias_"+C;this.handles=this.options.handles||{accion:A+"_accion_"+C,result:A+"_resul_"+C,result_positivos:A+"_resul_positivos_"+C,result_positivos_porcentajes:A+"_resul_positivos_porcentajes_"+C,result_neutrales:A+"_resul_neutrales_"+C,result_neutrales_porcentajes:A+"_resul_neutrales_porcentajes_"+C,result_negativos:A+"_resul_negativos_"+C,result_negativos_porcentajes:A+"_resul_negativos_porcentajes_"+C,result_imagen:A+"_imagen_"+C};this.Voto=this.options.Voto||this.Voto;this.Voto_Positivo=this.options.Voto_Positivo||this.Voto_Positivo;this.Voto_Negativo=this.options.Voto_Negativo||this.Voto_Negativo;this.Voto_Neutral=this.options.Voto_Neutral||this.Voto_Neutral;this.getLast=this.options.getLast||this.getLast;this.show=this.options.show||this.show;this.showLast=this.options.showLast||this.showLast;this.receive=this.options.receive||this.receive;this.receiveLast=this.options.receiveLast||this.receiveLast;this.images=this.options.images||{img_pos:this.img_pos,img_neg:this.img_neg,img_neu:this.img_neu};if(!getCookie(this.cookie)){Element.hide(this.handles.result)}else{Element.hide(this.handles.accion)}this.getLast()},Voto:function(A){if(!getCookie(this.cookie)){myAjax=new Ajax.Request(this.urls.actualizar,{parameters:Object.extend({actual_vote:this.no_voto,new_vote:A},this.parametros),method:"get",onComplete:this.receive.bind(this)})}},Voto_Positivo:function(){this.Voto(this.voto_positivo)},Voto_Negativo:function(){this.Voto(this.voto_negativo)},Voto_Neutral:function(){this.Voto(this.voto_neutro)},getLast:function(){myAjax=new Ajax.Request(this.urls.consultar,{parameters:this.parametros,method:"get",onComplete:this.receiveLast.bind(this)})},show:function(){$(this.handles.result_positivos).update(this.Positivos);$(this.handles.result_positivos_porcentajes).update(Number(this.Positivos_Porcentaje).toFixed(2));$(this.handles.result_negativos).update(this.Negativos);$(this.handles.result_negativos_porcentajes).update(Number(this.Negativos_Porcentaje).toFixed(2));if(this.Positivos>this.Negativos){$(this.handles.result_imagen).update(this.images.img_pos)}else{if(this.Positivos<this.Negativos){$(this.handles.result_imagen).update(this.images.img_neg)}else{$(this.handles.result_imagen).update(this.images.img_neu)}}Element.hide(this.handles.accion);Element.show(this.handles.result)},showLast:function(){$(this.handles.result_positivos).update(this.Positivos);$(this.handles.result_positivos_porcentajes).update(Number(this.Positivos_Porcentaje).toFixed(2));$(this.handles.result_negativos).update(this.Negativos);$(this.handles.result_negativos_porcentajes).update(Number(this.Negativos_Porcentaje).toFixed(2));if(this.Positivos>this.Negativos){$(this.handles.result_imagen).update(this.images.img_pos)}else{if(this.Positivos<this.Negativos){$(this.handles.result_imagen).update(this.images.img_neg)}else{$(this.handles.result_imagen).update(this.images.img_neu)}}},receive:function(B){var A=B.responseText.split("#");this.Positivos=parseInt(A[0]);this.Negativos=parseInt(A[1]);this.Neutrales=parseInt(A[2]);this.Total=parseInt(A[3]);this.new_vote=parseInt(A[5]);this.Positivos_Porcentaje=this.Positivos*100/this.Total;this.Negativos_Porcentaje=this.Negativos*100/this.Total;setCookie(this.cookie,this.new_vote,1,"/","","");this.show()},receiveLast:function(B){var A=B.responseText.split("#");this.Positivos=parseInt(A[0]);this.Negativos=parseInt(A[1]);this.Neutrales=parseInt(A[2]);this.Total=parseInt(A[3]);this.Positivos_Porcentaje=this.Positivos*100/this.Total;this.Negativos_Porcentaje=this.Negativos*100/this.Total;this.showLast()},handles:null,cookie:null,urls:null});triarioNoticia=Class.create(ValoracionTriario_Sustitucion,{initialize:function(B,C){var A="not";var E=B;var D={not_id:B};this.options=C||{};this.urls=this.options.urls||{actualizar:"/noticias-categoria/noticia_triarias_actualizar.php",consultar:"/noticias-categoria/noticia_triarias_consultar.php"};this.init(D,A,E)}});triarioNoticiaEntidad=Class.create(ValoracionTriario_Sustitucion,{initialize:function(B,E,C){var A="not_ent";var F=B+"_"+E;var D={not_id:B,ent_id:E};this.options=C||{};this.urls=this.options.urls||{actualizar:"/noticias-categoria/noticia_entidades_triarias_actualizar.php",consultar:"/noticias-categoria/noticia_entidades_triarias_consultar.php"};this.init(D,A,F)}});galeria_videos=Class.create();galeria_videos.prototype={initialize:function(B,A,C,D){this.idModulo=B;this.numeroTotal=A;this.posInicial=C;this.posFinal=D;this.posOcultar=C;this.posMostrar=D+1;this.info_videos=new Array();this.width=$("player_"+this.idModulo).up().clientWidth},anadir_xml:function(A,B){this.info_videos[B]=A},efecto_Avanzar:function(D,B,C,A){nombreCajaOcultar="caja_"+this.idModulo+"_"+D;nombreCajaMostrar="caja_"+this.idModulo+"_"+C;new Effect.Parallel([new Effect.Appear(nombreCajaMostrar,{duration:1}),new Effect.Fade(nombreCajaOcultar,{duration:0})],{duration:1});this.mostrar_flash(C)},avanzar:function(){if(this.posMostrar<=this.numeroTotal){this.efecto_Avanzar(this.posOcultar,"top-left",this.posMostrar,"top-left");this.posOcultar++;this.posMostrar++}},retroceder:function(){if(this.posOcultar>this.posInicial){this.posOcultar--;this.posMostrar--;this.efecto_Avanzar(this.posMostrar,"top-left",this.posOcultar,"top-left")}},avanzar_horizontal:function(){if(this.posMostrar<=this.numeroTotal){this.efecto_Avanzar(this.posOcultar,"bottom-left",this.posMostrar,"top-left");this.posOcultar++;this.posMostrar++}},retroceder_horizontal:function(){if(this.posOcultar>this.posInicial){this.posOcultar--;this.posMostrar--;this.efecto_Avanzar(this.posMostrar,"top-left",this.posOcultar,"top-left")}},mostrar:function(A){nombreCajaMostrar="caja_"+this.idModulo+"_"+A;new Effect.Grow(nombreCajaMostrar,{direction:"top-right"})},ocultar:function(A){nombreCajaOcultar="caja_"+this.idModulo+"_"+A;new Effect.Shrink(nombreCajaOcultar,{direction:"top-right"})},eliminar:function(A){nombreEliminar="caja_"+this.idModulo+"_"+A;Element.hide(nombreEliminar)},mostrar_flash:function(B){zona_player="player_"+this.idModulo;var A={movie:"/vVideos/mediaplayer.swf",width:this.width,height:"260",majorversion:"7",build:"0",bgcolor:"#FFFFFF",allowfullscreen:"true",flashvars:"file="+this.info_videos[B]+"&amp;autostart=false&amp;logo=/imagenes/logos/economista-video.png&amp;repeat=false&amp;showfsbutton=false"};UFO.create(A,zona_player)}};Array.prototype.in_array=function(A){for(var C=0,B=this.length;C<B;C++){if(this[C]==A){return true}}return false};var tv_horario=new Array();function tv_horario_construct(B,A){this.id=B;this.estado=A}function tv_horario_init(){var A=null;var C=false;var B=$("tv_horario_hora").getAttribute("value");if((B>="06:00")&&(B<"14:00")){C=true}else{C=false}$("tv_horario_m").checked=C;A=new tv_genero_construct("m",C);tv_horario.push(A);if((B>="14:00")&&(B<"22:00")){C=true}else{C=false}$("tv_horario_t").checked=C;A=new tv_genero_construct("t",C);tv_horario.push(A);if((B>="22:00")||(B<"06:00")){C=true}else{C=false}$("tv_horario_n").checked=C;A=new tv_genero_construct("n",C);tv_horario.push(A)}function tv_horario_set_estado(C,B){for(var A=0;A<tv_horario.length;A++){if(tv_horario[A].id==C){tv_horario[A].estado=B}}tv_parrilla_pintar()}function tv_horario_get_estado(B){for(var A=0;A<tv_horario.length;A++){if(tv_horario[A].id==B){return tv_horario[A].estado}}return false}var tv_genero=new Array;function tv_genero_construct(C,B,A){this.id=C;this.estado=B;this.color=A}function tv_genero_init(){var A=null;$("tv_genero_Informativos").checked=false;A=new tv_genero_construct("Informativos",false,"#FF6666");tv_genero.push(A);$("tv_genero_Deportes").checked=false;A=new tv_genero_construct("Deportes",false,"#fcb857");tv_genero.push(A);$("tv_genero_Series").checked=false;A=new tv_genero_construct("Series",false,"#99CCFF");tv_genero.push(A);$("tv_genero_Cine").checked=false;A=new tv_genero_construct("Cine",false,"#7fdc68");tv_genero.push(A);$("tv_genero_Magazine").checked=false;A=new tv_genero_construct("Magazine",false,"#FF99FF");tv_genero.push(A)}function tv_genero_set_estado(C,B){for(var A=0;A<tv_genero.length;A++){if(tv_genero[A].id==C){tv_genero[A].estado=B}}tv_parrilla_pintar()}var tv_canal=new Array();function tv_canal_construct(D,C,A,B){this.id=D;this.nombre=C;this.logo=A;this.estado=B}function tv_canal_add(E,D,B,C){var A=new tv_canal_construct(E,D,B,C);tv_canal.push(A)}function tv_canal_get_seleccionados(){var B=new Array();for(var A=0;A<tv_canal.length;A++){if(tv_canal[A].estado==true){B.push(tv_canal[A].id)}}return B}function tv_canal_get_seleccionados_total(){var A=tv_canal_get_seleccionados();return A.length}function tv_canal_set_estado(C,B){for(var A=0;A<tv_canal.length;A++){if(tv_canal[A].id==C){tv_canal[A].estado=B;if($("tv_canal_check_"+C)){$("tv_canal_check_"+C).checked=B}if($("tv_canal_check_pie_"+C)){$("tv_canal_check_pie_"+C).checked=B}}}tv_parrilla_pintar()}function tv_canal_mostrar(A){$("tv_canal_logo_"+A).show();$("tv_canal_programacion_"+A).show()}function tv_canal_ocultar(A){$("tv_canal_logo_"+A).hide();$("tv_canal_programacion_"+A).hide()}function tv_canal_add_programa(D,G,E,B,I,H,C,A,F){$("tv_canal_programacion_"+D).innerHTML=$("tv_canal_programacion_"+D).innerHTML+'<div class="tv_programa '+G+'" rel="'+E+" "+B+" "+I+'" style="height: '+H+"em; margin-top: 0; background-color: "+C+';"><span class="hora-p">'+A+'</span><span class="tipo-programa">'+F+"</span></div>"}function tv_cookie_set(){var A=new Date();A.setTime(A.getTime());milisegundosCaduca=365*24*60*60*1000;var C=new Date(A.getTime()+milisegundosCaduca);var B=tv_canal_get_seleccionados();setCookie("tv_cookie_cadenas",B.join(","),C.toGMTString(),"/");alert("La lista de cadenas se ha almacenado correctamente")}function tv_cookie_get(){return getCookie("tv_cookie_cadenas")}function tv_cookie_load(){for(var B=0;B<tv_canal.length;B++){if(tv_canal[B].estado==true){tv_canal_set_estado(tv_canal[B].id,true)}else{tv_canal_set_estado(tv_canal[B].id,false)}}var A=tv_cookie_get();if(A!=null){var C=A.split(",");for(var B=0;B<tv_canal.length;B++){if(C.in_array(tv_canal[B].id)){tv_canal_set_estado(tv_canal[B].id,true)}else{tv_canal_set_estado(tv_canal[B].id,false)}}}}function tv_programa_get_franja(A){var B=A.getAttribute("rel");var C=B.split(" ");return C[0]}function tv_programa_get_genero(A){var B=A.getAttribute("rel");var C=B.split(" ");return C[1]}function tv_programa_get_offset(A){var B=A.getAttribute("rel");var C=B.split(" ");return C[2]}var tv_parrilla_limite_visualizadas=6;var tv_parrilla_offset_visualizadas=0;function tv_parrilla_pintar(){var B=0;var A=0;if((tv_canal_get_seleccionados_total()-tv_parrilla_offset_visualizadas)<tv_parrilla_limite_visualizadas){tv_parrilla_offset_visualizadas=0}for(var G=0;G<tv_canal.length;G++){if(tv_canal[G].estado==false){tv_canal_ocultar(tv_canal[G].id)}else{if(A<tv_parrilla_offset_visualizadas){tv_canal_ocultar(tv_canal[G].id);A++}else{if(B<tv_parrilla_limite_visualizadas){tv_canal_mostrar(tv_canal[G].id);B++}else{tv_canal_ocultar(tv_canal[G].id)}}}}for(var G=0;G<tv_genero.length;G++){var C=$$("div.tv_programa");for(var F=0;F<C.length;F++){if(tv_programa_get_genero(C[F])==tv_genero[G].id){if(tv_genero[G].estado){C[F].style.backgroundColor=tv_genero[G].color}else{if(C[F].className=="tv_programa par"){C[F].style.backgroundColor="rgb(204,204,204)"}else{C[F].style.backgroundColor="rgb(230,230,230)"}}}}}for(var G=0;G<tv_horario.length;G++){var C=$$("div.tv_programa");for(var F=0;F<C.length;F++){if(tv_programa_get_franja(C[F])==tv_horario[G].id){if(tv_horario[G].estado){C[F].show()}else{C[F].hide()}}}}var H="";if(tv_horario_get_estado("n")){H="n"}if(tv_horario_get_estado("t")){H="t"}if(tv_horario_get_estado("m")){H="m"}var E="";var D="";var I="";var C=$$("div.tv_programa");for(var G=0;G<C.length;G++){E=tv_programa_get_franja(C[G]);I=C[G].parentNode.id;if((I!=D)&&(E==H)){D=I;C[G].style.marginTop=(tv_programa_get_offset(C[G])+"em")}else{C[G].style.marginTop="0"}}}function tv_parrilla_desplazar_izquierda_check(){if(tv_parrilla_offset_visualizadas==0){return false}else{return true}}function tv_parrilla_desplazar_derecha_check(){if((tv_canal_get_seleccionados_total()-tv_parrilla_offset_visualizadas)>tv_parrilla_limite_visualizadas){return true}else{return false}}function tv_parrilla_desplazar_izquierda(){if(tv_parrilla_desplazar_izquierda_check()){tv_parrilla_offset_visualizadas--;tv_parrilla_pintar()}else{alert("No quedan cadenas en la parte izquierda de la tabla")}}function tv_parrilla_desplazar_derecha(){if(tv_parrilla_desplazar_derecha_check()){tv_parrilla_offset_visualizadas++;tv_parrilla_pintar()}else{alert("No quedan cadenas en la parte derecha de la tabla")}};var DatePickerInline=Class.create();DatePickerInline.prototype={Version:"0.9.2",_relative:null,_div_id_inline:null,_language:"en",_language_month:$H({fr:["Janvier","F&#233;vrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","D&#233;cembre"],en:["January","February","March","April","May","June","July","August","September","October","November","December"],sp:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],de:["Januar","Februar","M&#228;rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],pt:["Janeiro","Fevereiro","Mar&#231;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]}),_language_day:$H({fr:["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],en:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],sp:["Lun","Mar","Mie","Jue","Vie","S&#225;b","Dom"],it:["Lun","Mar","Mer","Gio","Ven","Sab","Dom"],de:["Mon","Die","Mit","Don","Fre","Sam","Son"],pt:["Seg","Ter","Qua","Qui","Sex","S&#225;","Dom"]}),_daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],_todayDate:null,_date_regexp:/^(\d{4})(\/|\.|\-)(\d{1,2})(?:\/|\.|\-)(\d{1,2})$/,_current_date:null,_clickCallback:Prototype.emptyFunction,_date_separator:"-",_id_datepicker:null,_use_clickable_dates:true,_array_dates_clickable:new Array(),addClickableDate:function(A){this._array_dates_clickable.push(A)},isClickableDate:function(A){for(var B=0;B<this._array_dates_clickable.length;B++){if(A==this._array_dates_clickable[B]){return true}}return false},_getMonthDays:function(A,B){if(((0==(A%4))&&((0!=(A%100))||(0==(A%400))))&&(B==1)){return 29}return this._daysInMonth[B]},getMonthLocale:function(A){return this._language_month._object[this._language][A]},_initCurrentDate:function(){this._current_date=$F(this._relative);if(!this._date_regexp.test(this._current_date)){var B=new Date();var A=this._leftpad_zero(B.getDate(),2);var C=this._leftpad_zero(B.getMonth()+1,2);this._current_date=B.getFullYear()+"-"+C+"-"+A;$(this._relative).setAttribute("value",this._current_date)}var D=this._current_date.match(this._date_regexp);this._date_separator=String(D[2]);this._current_mon=Number(D[3])-1;this._current_day=Number(D[4]);this._current_year=Number(D[1])},initialize:function(A){this._relative=A.relative;this._div_id_inline=A.div_id_inline;if(A.language){this._language=A.language}if(typeof (A.clickCallback)=="function"){this._clickCallback=A.clickCallback}if(A.current_date){this._current_date=A.current_date;this._todayDate=new Date();this._todayDate.setFullYear(Number(A.current_date.substr(0,4)),Number(A.current_date.substr(5,2))-1,Number(A.current_date.substr(8,2)))}this._id_datepicker=this._div_id_inline;this._id_datepicker_prev=this._id_datepicker+"-prev";this._id_datepicker_next=this._id_datepicker+"-next";this._id_datepicker_hdr=this._id_datepicker+"-header";this._id_datepicker_ftr=this._id_datepicker+"-footer";$(this._id_datepicker_prev).setAttribute("style","cursor: pointer;");$(this._id_datepicker_next).setAttribute("style","cursor: pointer;");Event.observe(window,"load",this.load.bindAsEventListener(this),false)},load:function(){this._initCurrentDate();Event.observe($(this._id_datepicker_prev),"click",this.prevMonth.bindAsEventListener(this),false);Event.observe($(this._id_datepicker_next),"click",this.nextMonth.bindAsEventListener(this),false);this._redrawCalendar()},_nextMonthYear:function(){var B=this._current_mon;var A=this._current_year;if(B+1>11){B=0;A+=1}else{B+=1}return[B,A]},nextMonth:function(){var A=this._nextMonthYear();this._current_mon=A[0];this._current_year=A[1];this._redrawCalendar()},_prevMonthYear:function(){var B=this._current_mon;var A=this._current_year;if(B-1<0){B=11;A-=1}else{B-=1}return[B,A]},prevMonth:function(){var A=this._prevMonthYear();this._current_mon=A[0];this._current_year=A[1];this._redrawCalendar()},_buildCalendar:function(){var _self=this;var tbody=document.createElement("tbody");var trDay=document.createElement("tr");this._language_day._object[this._language].each(function(item){var td=document.createElement("td");td.innerHTML=item;td.className="wday";trDay.appendChild(td)});tbody.appendChild(trDay);var a_d=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];var d=new Date(this._current_year,this._current_mon,1,12);var startIndex=(!d.getDay())?6:d.getDay()-1;var nbDaysInMonth=this._getMonthDays(this._current_year,this._current_mon);var daysIndex=1;for(var j=startIndex;j<7;j++){var dayDate=this._current_year+"-"+this._leftpad_zero(this._current_mon+1,2)+"-"+this._leftpad_zero(daysIndex,2);a_d[0][j]={d:daysIndex,m:this._current_mon,y:this._current_year,c:(this.isClickableDate(dayDate)?"clickable":null)};daysIndex++}var a_prevMY=this._prevMonthYear();var nbDaysInMonthPrev=this._getMonthDays(a_prevMY[1],a_prevMY[0]);for(var j=0;j<startIndex;j++){var dayDate=a_prevMY[1]+"-"+this._leftpad_zero(Number(a_prevMY[0])+1,2)+"-"+this._leftpad_zero(Number(nbDaysInMonthPrev-startIndex+j+1),2);a_d[0][j]={d:Number(nbDaysInMonthPrev-startIndex+j+1),m:Number(a_prevMY[0]),y:a_prevMY[1],c:(this.isClickableDate(dayDate)?"clickable outbound":"outbound")}}var switchNextMonth=false;var currentMonth=this._current_mon;var currentYear=this._current_year;for(var i=1;i<6;i++){for(var j=0;j<7;j++){var dayDate=currentYear+"-"+this._leftpad_zero(currentMonth+1,2)+"-"+this._leftpad_zero(daysIndex,2);a_d[i][j]={d:daysIndex,m:currentMonth,y:currentYear,c:(switchNextMonth)?((this.isClickableDate(dayDate))?"clickable outbound":"outbound"):(((daysIndex==this._todayDate.getDate())&&(this._current_mon==this._todayDate.getMonth())&&(this._current_year==this._todayDate.getFullYear()))?"today":(this.isClickableDate(dayDate)?"clickable":null))};daysIndex++;if(daysIndex>nbDaysInMonth){daysIndex=1;switchNextMonth=true;if(this._current_mon+1>11){currentMonth=0;currentYear+=1}else{currentMonth+=1}}}}for(var i=0;i<6;i++){var tr=document.createElement("tr");for(var j=0;j<7;j++){var h_ij=a_d[i][j];var td=document.createElement("td");var id=$A([this._relative,h_ij.y,this._leftpad_zero((h_ij.m+1),2),this._leftpad_zero(h_ij.d,2)]).join("-");td.setAttribute("id",id);if(h_ij.c){td.className=h_ij.c}td.onclick=function(){$(_self._relative).value=String($(this).readAttribute("id")).replace(_self._relative+"-","").replace(/-/g,_self._date_separator);if(_self.isClickableDate($(_self._relative).value)){eval(_self._clickCallback())}};td.innerHTML=h_ij.d;tr.appendChild(td)}tbody.appendChild(tr)}return tbody},_redrawCalendar:function(){this._setLocaleHdr();var A=$(this._id_datepicker+"-table");try{while(A.hasChildNodes()){A.removeChild(A.childNodes[0])}}catch(B){}A.appendChild(this._buildCalendar())},_setLocaleHdr:function(){var A=this._nextMonthYear();$(this._id_datepicker_next).setAttribute("title",this.getMonthLocale(A[0])+" "+A[1]);var B=this._prevMonthYear();$(this._id_datepicker_prev).setAttribute("title",this.getMonthLocale(B[0])+" "+B[1]);$(this._id_datepicker_hdr).update("&nbsp;&nbsp;&nbsp;"+this.getMonthLocale(this._current_mon)+"&nbsp;"+this._current_year+"&nbsp;&nbsp;&nbsp;")},_leftpad_zero:function(C,D){var B="";for(var A=0;A<(D-String(C).length);A++){B+="0"}return B+C}};