var requiredMajorVersion=10;var requiredMinorVersion=0;var requiredRevision=0;var clipBaseUrlRaw='';var clipBaseUrl=encodeURIComponent(clipBaseUrlRaw);var playerBaseUrl='';var playerWidth=400;var playerHeight=225;function toggleTab(baseName,number,total,classNormal,classActive){for(i=1;i<=total;i++)
{document.getElementById(baseName+i).className=classNormal;};document.getElementById(baseName+number).className=classActive;};function switchDiv(divBaseName,divNumber,divTotal){for(i=1;i<=divTotal;i++)
{document.getElementById(divBaseName+i).style.display='none';};document.getElementById(divBaseName+divNumber).style.display='block';};function cclass(obj,id,newClass){if(obj==null)
{document.getElementById(id).className=newClass;}
else{obj.className=newClass;};};function changeDescription(idMain,idChild,content){document.getElementById(idChild).innerHTML=content;if(!(document.getElementById(idMain).style.height=='0px')){document.getElementById(idMain).style.height=document.getElementById(idChild).offsetHeight+"px";};};function changeRating(valoracion,haSidoValorado){var classTemp='';var valoracionInt=parseInt(valoracion);var rateCode1='<div id="rateMe" style="margin:0px; padding:0px;">';var rateCode2a='<img src="plantillas/images/spcd.gif" width="12" height="13" class="';var rateCode2b='" onclick="rateIt(this)" id="_';var rateCode2c='" alt="'+txt_current_rating;var rateCode2d='" title="'+txt_current_rating;var rateCode2e='" onmouseover="ratingOver(this)" onmouseout="off(this,';var rateCode2f=')" />';var rateCode3='</div>';if(valoracion>0.5){classTemp='starOn';var rateHTMLCode1=rateCode2a+classTemp+rateCode2b+1+rateCode2c+valoracion+rateCode2d+valoracion+rateCode2e+valoracionInt+rateCode2f;}else{classTemp='';var rateHTMLCode1=rateCode2a+classTemp+rateCode2b+1+rateCode2c+valoracion+rateCode2d+valoracion+rateCode2e+1+rateCode2f;};if(valoracion>1.5){classTemp='starOn'}else{classTemp=''};var rateHTMLCode2=rateCode2a+classTemp+rateCode2b+2+rateCode2c+valoracion+rateCode2d+valoracion+rateCode2e+valoracionInt+rateCode2f;if(valoracion>2.5){classTemp='starOn'}else{classTemp=''};var rateHTMLCode3=rateCode2a+classTemp+rateCode2b+3+rateCode2c+valoracion+rateCode2d+valoracion+rateCode2e+valoracionInt+rateCode2f;if(valoracion>3.5){classTemp='starOn'}else{classTemp=''};var rateHTMLCode4=rateCode2a+classTemp+rateCode2b+4+rateCode2c+valoracion+rateCode2d+valoracion+rateCode2e+valoracionInt+rateCode2f;if(valoracion>4.5){classTemp='starOn'}else{classTemp=''};var rateHTMLCode5=rateCode2a+classTemp+rateCode2b+5+rateCode2c+valoracion+rateCode2d+valoracion+rateCode2e+valoracionInt+rateCode2f;document.getElementById('dynamicStat1').innerHTML=rateCode1+rateHTMLCode1+rateHTMLCode2+rateHTMLCode3+rateHTMLCode4+rateHTMLCode5+rateCode3;if(haSidoValorado==null){haSidoValorado=false};if((haSidoValorado)){document.formRating.ratingField.value=0}else{document.formRating.ratingField.value=parseInt(valoracion)};};function get_ents(str){var temp=document.createElement("pre");temp.innerHTML=str;return temp.firstChild.nodeValue;}
function html_entity_decode(str){str=str.replace(/</g,"<").replace(/>/g,">");try{var ta=document.createElement("textarea");ta.innerHTML=str;return ta.value;}catch(e){};try{var d=document.createElement("div");if(typeof d.innerText!="undefined")return d.innerText;}catch(e){}}
function changeSharing(idMain,idClip,title){if(idClip==null){idVideo=0};var sharePreTitle=encodeURIComponent('Vídeo: ');var shareTitle=encodeURIComponent(html_entity_decode(title));var shareButton1='<a rel="nofollow" href="http://www.facebook.com/sharer.php?u='+clipBaseUrl+idClip+'&t='+sharePreTitle+shareTitle+'" target="_blank" ><img class="iconSocialFacebook" src="plantillas/images/spcd.gif" alt="'+txt_share_on_facebook+'" title="'+txt_share_on_facebook+'"/><\/a> ';var shareButton2='<a rel="nofollow" href="http://www.myspace.com/Modules/PostTo/Pages/?u='+clipBaseUrl+idClip+'&t='+sharePreTitle+shareTitle+'" target="_blank" ><img class="iconSocialMyspace" src="plantillas/images/spcd.gif" alt="'+txt_share_on_myspace+'" title="'+txt_share_on_myspace+'"/><\/a> ';var shareButton3='<a rel="nofollow" href="http://digg.com/submit?phase=2&url='+clipBaseUrl+idClip+'&title='+sharePreTitle+shareTitle+'" target="_blank" ><img class="iconSocialDigg" src="plantillas/images/spcd.gif" alt="'+txt_share_on_digg+'" title="'+txt_share_on_digg+'"/><\/a> ';var shareButton4='<a rel="nofollow" href="http://meneame.net/login.php?return=/submit.php?url='+clipBaseUrl+idClip+'&title='+sharePreTitle+shareTitle+'" target="_blank" ><img class="iconSocialMeneame" src="plantillas/images/spcd.gif" alt="'+txt_share_on_meneame+'" title="'+txt_share_on_meneame+'"/><\/a> ';var shareButton5='<a rel="nofollow" href="http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&u='+clipBaseUrl+idClip+'&t='+sharePreTitle+shareTitle+'&d=&ei=UTF" target="_blank" ><img class="iconSocialYahoo" src="plantillas/images/spcd.gif" alt="'+txt_share_on_yahoo+'" title="'+txt_share_on_yahoo+'"/><\/a> ';var shareButton6='<a rel="nofollow" href="http://twitter.com/home?status='+sharePreTitle+shareTitle+' '+clipBaseUrl+idClip+'" target="_blank" ><img class="iconSocialTwitter" src="plantillas/images/spcd.gif" alt="'+txt_share_on_twitter+'" title="'+txt_share_on_twitter+'"/><\/a> ';var shareButton7='<a rel="nofollow" href="https://favorites.live.com/quickadd.aspx?marklet=1&mkt=es&url='+clipBaseUrl+idClip+'&title='+sharePreTitle+shareTitle+'" target="_blank" ><img class="iconSocialLive" src="plantillas/images/spcd.gif" alt="'+txt_share_on_live+'" title="'+txt_share_on_live+'"/><\/a> ';var shareButton8='<a rel="nofollow" href="http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='+clipBaseUrl+idClip+'&title='+sharePreTitle+shareTitle+'" target="_blank" ><img class="iconSocialGoogle" src="plantillas/images/spcd.gif" alt="'+txt_share_on_google+'" title="'+txt_share_on_google+'"/><\/a> ';document.getElementById(idMain).innerHTML=shareButton1+shareButton2+shareButton3+shareButton4+shareButton5+shareButton6+shareButton7+shareButton8;};function changeEmbed(textField,idClip){if(idClip==null){idClip=0};var embedHTMLCode1='<div id="videoObject"><object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="embeddedVideo" width="'+playerWidth+'" height="'+playerHeight+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" style="border:none" >';var embedHTMLCode2='<param name="movie" value="'+playerBaseUrl+idClip+'"></param>';var embedHTMLCode3='<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="SCALE" value="ExactFit"></param><param name="quality" value="High"></param><param name="loop" value="false"></param><param name="swliveconnect" value="true"></param><param name="wmode" value="opaque"></param>';var embedHTMLCode4='<embed name="embeddedVideo" width="'+playerWidth+'" height="'+playerHeight+'" src="'+playerBaseUrl+idClip+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" quality="High" loop="false" allowfullscreen="true" scale="exactFit" swliveconnect="true"></embed>';var embedHTMLCode5='</object></div>';textField.value=embedHTMLCode1+embedHTMLCode2+embedHTMLCode3+embedHTMLCode4+embedHTMLCode5;};function changeVideoData(titulo,valoracion,reproducciones,fecha,descripcion,idClip,haSidoValorado,urlClip,urlPlayer){if(idClip==null){idClip="indefinido"};if(urlClip==null){urlClip="*url clip indefinido* id="};if(urlPlayer==null){urlPlayer="*url player indefinido* id="};clipBaseUrlRaw=urlClip;clipBaseUrl=encodeURIComponent(clipBaseUrlRaw);playerBaseUrl=urlPlayer;if(titulo==null)titulo=txt_clip_not_found;tmpTitle=titulo;tmpTitle=tmpTitle.replace(/á/g,"á");tmpTitle=tmpTitle.replace(/Á/g,"Á");tmpTitle=tmpTitle.replace(/é/g,"é");tmpTitle=tmpTitle.replace(/É/g,"É");tmpTitle=tmpTitle.replace(/í/g,"í");tmpTitle=tmpTitle.replace(/Í/g,"Í");tmpTitle=tmpTitle.replace(/ó/g,"ó");tmpTitle=tmpTitle.replace(/Ó/g,"Ó");tmpTitle=tmpTitle.replace(/ú/g,"ú");tmpTitle=tmpTitle.replace(/Ú/g,"Ú");tmpTitle=tmpTitle.replace(/à/g,"à");tmpTitle=tmpTitle.replace(/À/g,"À");tmpTitle=tmpTitle.replace(/è/g,"è");tmpTitle=tmpTitle.replace(/È/g,"È");tmpTitle=tmpTitle.replace(/ì/g,"ì");tmpTitle=tmpTitle.replace(/Ì/g,"Ì");tmpTitle=tmpTitle.replace(/ò/g,"ò");tmpTitle=tmpTitle.replace(/Ò/g,"Ò");tmpTitle=tmpTitle.replace(/ù/g,"ù");tmpTitle=tmpTitle.replace(/Ù/g,"Ù");tmpTitle=tmpTitle.replace(/ñ/g,"ñ");tmpTitle=tmpTitle.replace(/Ñ/g,"Ñ");tmpTitle=tmpTitle.replace(/ü/g,"ü");tmpTitle=tmpTitle.replace(/Ü/g,"Ü");tmpTitle=tmpTitle.replace(/¡/g,"¡");tmpTitle=tmpTitle.replace(/¿/g,"¿");document.getElementById('dynamicTitle').innerHTML=titulo;if(!(fecha==null))changeRating(valoracion,haSidoValorado);document.formRating.ratingIdClip.value=idClip;if(reproducciones==null)reproducciones="";document.getElementById('dynamicStat2').innerHTML=reproducciones;if(fecha==null)fecha="";document.getElementById('dynamicStat3').innerHTML=fecha;if(descripcion==null)descripcion="";changeDescription('videoDescriptionCont','dynamicDescription',descripcion);document.videoShareForm.shareLink.value=clipBaseUrlRaw+idClip;document.videoShareForm.shareTitle.value=titulo;changeEmbed(document.videoShareForm.shareEmbed,idClip);changeSharing('dynamicShare',idClip,titulo);if(fecha=="")document.videoShareForm.shareLink.value="";if(fecha=="")document.videoShareForm.shareEmbed.value="";};var urlParams=new Array();function getUrlParams(){var idx=document.URL.indexOf('?');if(idx!=-1){var pairs=document.URL.substring(idx+1,document.URL.length).split('&');for(var i=0;i<pairs.length;i++){nameVal=pairs[i].split('=');urlParams[nameVal[0]]=nameVal[1];};};return urlParams;};function inclVideo(url,w,h,id,wmode,idForAlternateContent,requiredFlash){if(!(requiredFlash==null))requiredMajorVersion=requiredFlash;var hasRightVersion=DetectFlashVer(requiredMajorVersion,requiredMinorVersion,requiredRevision);if(hasRightVersion){if(wmode==null)wmode="transparent";document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="');document.write(id);document.write('" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" border="0" width="');document.write(w);document.write('" height="');document.write(h);document.write('" >\n');document.write('<param name="movie" value="');document.write(url);document.write('">\n');document.write('<param name="SCALE" value="ExactFit">\n');document.write('<param name="quality" value="High">\n');document.write('<param name="loop" value="false">\n');document.write('<param name="swliveconnect" value="true">\n');document.write('<param name="allowScriptAccess" value="always">\n');document.write('<param name="allowFullScreen" value="true">\n');document.write('<param name="wmode" value="');document.write(wmode);document.write('">\n');document.write('<embed src="');document.write(url);document.write('" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="');document.write(id);document.write('" width="');document.write(w);document.write('" height="');document.write(h);document.write('" quality="High" loop="false" allowFullScreen="true" allowScriptAccess="always" scale="exactFit" swliveconnect="true" wmode="');document.write(wmode);document.write('"></object>\n');}
else{var alternateContent='<br /><br /><br />'+txt_get_flash_player+'<br /><br /><br /><br />';document.getElementById(idForAlternateContent).innerHTML=alternateContent;};};function fixSingleQuote(field){var tmpStr=field.value;field.value=tmpStr.replace(/''/g,"'");var tmpStr=field.value;field.value=tmpStr.replace(/'/g,"''");}
function filterText(obj,objid){if((obj==null)&&(objid!=null))
{textField=document.getElementById(objid);}
else if((obj!=null)&&(objid==null))
{textField=obj;}
var tmpStr=textField.value;tmpStr=tmpStr.replace(/'/g," ");tmpStr=tmpStr.replace(/%/g,"");tmpStr=tmpStr.replace(/=/g,"");tmpStr=tmpStr.replace(/http:/gi,"");tmpStr=tmpStr.replace(/https:/gi,"");tmpStr=tmpStr.replace(/ftp:/gi,"");tmpStr=tmpStr.replace(/rtmp:/gi,"");tmpStr=tmpStr.replace(/rtsp:/gi,"");tmpStr=tmpStr.replace(/:/g,"");tmpStr=tmpStr.replace(/,/g,"");tmpStr=tmpStr.replace(/;/g,"");tmpStr=tmpStr.replace(/"/g,"");tmpStr=tmpStr.replace(/\//g,"");tmpStr=tmpStr.replace(/\\/g,"");tmpStr=tmpStr.replace(/\?/g,"");tmpStr=tmpStr.replace(/\!/g,"");tmpStr=tmpStr.replace(/\$/g,"");tmpStr=tmpStr.replace(/\>/g,"");tmpStr=tmpStr.replace(/\</g,"");tmpStr=tmpStr.replace(/\#/g,"");tmpStr=tmpStr.replace(/\@/g,"");tmpStr=tmpStr.replace(/\(/g,"");tmpStr=tmpStr.replace(/\)/g,"");tmpStr=tmpStr.replace(/&/g,"");tmpStr=tmpStr.replace(/\*/g,"");tmpStr=tmpStr.replace(/\[/g,"");tmpStr=tmpStr.replace(/\]/g,"");tmpStr=tmpStr.replace(/\{/g,"");tmpStr=tmpStr.replace(/\}/g,"");textField.value=tmpStr;}
function adjustChannelButtons(){var channelBarWidth=document.getElementById("menuItems").offsetWidth;var moreChannelsButton=document.getElementById("buttonMoreChannels");var lessChannelsButton=document.getElementById("buttonLessChannels");if(moreChannelsButton.style.display=="block"){var w1=moreChannelsButton.offsetWidth+15;}
else{var w1=lessChannelsButton.offsetWidth+5;}
var homeButton=document.getElementById("homeButton");if(homeButton.style.display=="block"){var w2=document.getElementById("homeButton").offsetWidth+5;}
else{homeButton.style.display=="block";var w2=document.getElementById("homeButton").offsetWidth+5;homeButton.style.display=="none";}
var channelBarAvailWidth=channelBarWidth-w1-w2;var buttonsArray=document.getElementById("menuItems").getElementsByTagName("li");var tmpButtonWidth=0;var numberOfDisplayedButtons=0;for(i=0;i<buttonsArray.length-4;i++){buttonsArray[i].style.display="block";tmpButtonWidth=buttonsArray[i].offsetWidth;if((channelBarAvailWidth-tmpButtonWidth)<=0)
{buttonsArray[i].style.display="none";break;}
else{channelBarAvailWidth=channelBarAvailWidth-tmpButtonWidth;numberOfDisplayedButtons++;}}
var secondaryChannelBar=document.getElementById("menuButtonGroupMore");var secondaryButtonsArray=secondaryChannelBar.getElementsByTagName("li");var numberOfSecondaryButtons=secondaryButtonsArray.length;if(numberOfDisplayedButtons==numberOfSecondaryButtons)
{document.getElementById("buttonMoreChannels").style.display="none";document.getElementById("buttonLessChannels").style.display="none";document.getElementById("menuItemsMoreCont").style.display="none";}
for(i=0;i<numberOfDisplayedButtons;i++)
{secondaryButtonsArray[i].style.display="none";}}
function playVideoClip(id,playInCurrentPlaylist){var thePlayer;if(navigator.appName.indexOf("Microsoft")!=-1)
{thePlayer=window["video"];}
else
{thePlayer=document["video"];}
thePlayer.playTheClip(id,playInCurrentPlaylist);}
function encodeURInoHTTp(thestring){thestring=thestring.replace(/http:/gi,"");thestring=thestring.replace(/\/\//g,"");return encodeURIComponent(thestring);}
