function doPlayVideo(n,t){var r,i,u;if(masTerPAge=="video_detalhe.aspx"){r=document.getElementById("SlrealVideo");if(r!=null){try{i=document.getElementById("ancorvideo"),i&&i.focus()}catch(e){}r.Content.VideoPlayerPage.PlayVideo(t,!0)}else alertScreen();try{top.changeAdress("/video_detalhe/"+n+"/","MYWAY VÍDEO - videoclips oficiais, concertos, entrevistas, ensaios, making-ofs")}catch(f){}}else u=tr.concat("http://"+location.hostname+"/video_detalhe/",n,".aspx"),top.setLocation(u)}function isAudioPlayerPlaying(){try{return top.frmPlayer.isAudioPlayerPlaying()}catch(n){return!1}}function doPlayRadio(n){try{top.frmPlayer.playRadio(n)}catch(t){alertScreen()}}function doPlayRadioFromProcura(n,t,i,r,u,f){doPlayRadio(n);var i=document.getElementById(i);i&&(i.value=unescape(t)),hidePreLoad(r),f=="true"&&top.setLocation(tr.concat("http://"+location.hostname+"/",u,".aspx"))}function doPlayArtist(n,t){try{top.frmPlayer.playArtist(n);var i;wreport_ok==1&&(i=new wreport_counter("Play Artist",n,421060,WRP_ACC,WRP_CHANNEL),i.add_content("Nome: "+t),i.count())}catch(r){alertScreen()}}function doPlayArtistSong(n,t){try{top.frmPlayer.playArtistSong(n);var i;wreport_ok==1&&(i=new wreport_counter("Play Artist",n,421060,WRP_ACC,WRP_CHANNEL),i.add_content("Nome: "+t),i.count())}catch(r){alertScreen()}}function doPlayArtistFromProcura(n,t,i,r,u,f,e){f!="false"&&isAudioPlayerPlaying()||doPlayArtist(n,e);var i=document.getElementById(i);i&&(i.value=unescape(t)),hidePreLoad(r),f=="true"&&top.setLocation(tr.concat("http://"+location.hostname+"/artista/",u,".aspx"))}function doPlayMusic(n){try{top.frmPlayer.playMusic(n)}catch(t){alertScreen()}}function doPlaySongFromProcura(n,t,i,r){doPlayMusic(n);var i=document.getElementById(i);i&&(i.value=unescape(t)),hidePreLoad(r)}function doPlayAlbum(n){try{top.frmPlayer.playAlbum(n)}catch(t){alertScreen()}}function doPlayAlbumFromProcura(n,t,i,r,u,f){f!="false"&&isAudioPlayerPlaying()||doPlayAlbum(n);var i=document.getElementById(i);i&&(i.value=unescape(t)),hidePreLoad(r),f=="true"&&top.setLocation(tr.concat("http://"+location.hostname+"/album/",u,".aspx"))}function doPlaySubStructure(n){try{top.frmPlayer.playSubStructure(n)}catch(t){alertScreen()}}function doPlaySubStructureFromProcura(n,t,i,r){doPlaySubStructure(n);var i=document.getElementById(i);i&&(i.value=unescape(t)),hidePreLoad(r)}function doPlayUserPlaylist(n,t){try{top.frmPlayer.playUserPlaylist(n,t)}catch(i){alertScreen()}}function doPlayVideoFromProcura(n,t,i,r,u){doPlayVideo(u,n);var i=document.getElementById(i);i&&(i.value=unescape(t)),hidePreLoad(r)}function openPageVideo(n){location.href("http://www.myway.pt/video_detalhe/"+n+".aspx")}function putAllinOrder(){var n,t;try{top.frmPlayer.putAllinOrder()}catch(i){}n=document.getElementById("DivNotOK"),n&&(n.style.width=con.concat(document.documentElement.scrollWidth,"px"),n.style.height=con.concat(document.documentElement.scrollHeight,"px")),n=document.getElementById("IMGNotOK"),n&&(n.style.width=con.concat(document.documentElement.scrollWidth,"px"),n.style.height=con.concat(document.documentElement.scrollHeight,"px")),n=document.getElementById("NotOkSilver"),n&&(t=parseInt((document.documentElement.offsetWidth-610)/2),t<0&&(t=0),n.style.position="absolute",n.style.left=con.concat(t,"px"),n.style.position="fixed"),n=document.getElementById("NotOkMyway"),n&&(t=parseInt((document.documentElement.offsetWidth-610)/2),t<0&&(t=0),n.style.position="absolute",n.style.left=con.concat(t,"px"),n.style.position="fixed")}function onSilverlightError(){}function alertScreen(){putAllinOrder();try{top.frmPlayer.UnCleanMyScreen()}catch(n){}hidePreLoad("PUBPLAYER"),Silverlight.isInstalled("3.0.40624.0")==!0?showPreLoad("NotOkMyway"):showPreLoad("NotOkSilver"),showPreLoad("DivNotOK")}function fechaAlert(){Silverlight.isInstalled("3.0.40624.0")==!0,hidePreLoad("DivNotOK");try{top.frmPlayer.CleanMyScreen()}catch(n){}}function doNotShow(n){var i;if(n){var t=new Date,r="",u=tr.concat("qual=HideSilverlightPOPUP&valor=",n.checked);r=tr.concat(t.getFullYear(),"_",t.getMonth(),"_",t.getDate(),"_",t.getHours(),"_",t.getMinutes(),"_",t.getSeconds()),xhrPedido==!0&&xhr.abort(),xhrPedido=!0,xhr=createXHR(),xhr&&(i=tr.concat("http://"+location.hostname+"/ground/xSaveCookie.aspx?ts=",r),xhr.open("POST",i),xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"),xhr.onreadystatechange=function(){xhr.readyState==4&&xhr.status==200&&(xhrPedido=!1)},xhr.send(u))}}function getCookie(n){for(var r,u,i=document.cookie.split(";"),t=0;t<i.length;t++){r=i[t].substr(0,i[t].indexOf("=")),u=i[t].substr(i[t].indexOf("=")+1),r=r.replace(/^\s+|\s+$/g,"");if(r==n)return unescape(u)}}function setCookie(n,t,i){var r=new Date,u;r.setDate(r.getDate()+i),u=escape(t)+(i==null?"":"; expires="+r.toUTCString()),document.cookie=n+"="+u}function mouseLeavesShare(n,t){var i=!1;return typeof t.toElement!="undefined"&&t.toElement.nodeName=="DIV"&&typeof n.contains!="undefined"?i=!n.contains(t.toElement):typeof t.relatedTarget!="undefined"&&t.relatedTarget&&t.relatedTarget.nodeName=="DIV"&&(i=!elementContains(n,t.relatedTarget)),i==!0&&(i=!0),i}function PopUp(n){ShowBlanketFadeIn(),CenterFixedDiv(n),$("#"+n).fadeIn("slow")}function PopOut(n){HideBlanketFadeOut(),$("#"+n).fadeOut("slow")}function refreshIframe(){var n=document.getElementById("mrecIFrame");n.contentDocument.location.reload(!0)}function ganhaFocusTexto(n,t){n!=null&&n.value==t&&(n.value="")}function perdeFocusTexto(n,t){n!=null&&n.value==""&&(n.value=t)}function escondenumero(n,t){hidePreLoad(n),showPreLoad(t)}function motranumero(n,t){hidePreLoad(t),showPreLoad(n)}function contaCaracteres(n,t,i,r,u){var e=document.getElementById(t),s=document.getElementById(r),f=document.getElementById(n),o;if(e&&s&&f)return o=f.value.length,e.innerHTML=o,o<i?(e.style.color="",s.style.color="",f.value!=u&&f.value!=""?!0:!1):(e.style.color="red",s.style.color="red",!1)}function ChangeHeigth(n,t,i){var e=document.getElementById(n),u,o,r,f;i=parseInt(i),u=document.getElementById(t),e&&u&&(o="",r=u.offsetHeight,r=r.toString().replace("px",""),r=parseInt(r),f=r+i,e.style.height=o.concat(f,"px"))}function ChangeMaxHeight(n,t,i){t=parseInt(t),i=parseInt(i),typeof n=="string"&&(n=document.getElementById(n)),n&&(n.style.height=i>t?i+"px":t+"px")}function DestMove(n,t){var r=document.getElementById(t),i;DesTimerIsOn==!0&&DestMoveStop(),r&&(i=r.style.left,i=parseInt(i.toString().replace("px","")),i<0?(DesTimerIsOn=!0,destMovePositive(n,t)):i>0?(DesTimerIsOn=!0,destMoveNegative(n,t)):i==0&&(DesTimerIsOn=!1))}function DestMoveStop(){clearTimeout(DesT),DesTimerIsOn=!1}function destMovePositive(n,t){var f,h,c,l,o,u,r,e,s;if(DesTimerIsOn==!0){var i=0,a=!1,v=document.getElementById(t);v&&(i=v.style.left,i=parseInt(i.replace("px",""))),f=i+DesTimerPixeis,h=Math.abs(i-f),f<0||(h=Math.abs(i),f=0,a=!0),c=document.getElementById(n);if(c){l=c.value;if(l.indexOf("§")!=-1)for(o=l.split("§"),u=0;u<o.length;u++)r=document.getElementById(o[u]),r&&(e=r.style.left,e=e.replace("px",""),s=0,s=parseInt(e)+h,r.style.left=s+"px")}a==!0?DestMoveStop():DesT=setTimeout("destMovePositive('"+n+"','"+t+"')",DesTimerOut)}}function destMoveNegative(n,t){var f,h,c,l,o,u,r,e,s;if(DesTimerIsOn==!0){var i=0,a=!1,v=document.getElementById(t);v&&(i=v.style.left,i=parseInt(i.replace("px",""))),f=i-DesTimerPixeis,h=Math.abs(i-f),f>0||(h=Math.abs(i),f=0,a=!0),c=document.getElementById(n);if(c){l=c.value;if(l.indexOf("§")!=-1)for(o=l.split("§"),u=0;u<o.length;u++)r=document.getElementById(o[u]),r&&(e=r.style.left,e=e.replace("px",""),s=0,s=parseInt(e)-h,r.style.left=s+"px")}a==!0?DestMoveStop():DesT=setTimeout("destMoveNegative('"+n+"','"+t+"')",DesTimerOut)}}function changebntsColor(n,t,i,r){var s=document.getElementById(t),o,f,u,e;if(s){o=s.value;if(o.indexOf("§")!=-1)for(f=o.split("§"),u=0;u<f.length;u++)e=document.getElementById(f[u]),e&&(e.style.color=r)}n&&(n.style.color=i)}function moveNextItem(n){var t=document.getElementById(n);t!=null&&document.getElementById(n).focus()}function MM_swapImgRestore(){for(var n,i=document.MM_sr,t=0;i&&t<i.length&&(n=i[t])&&n.oSrc;t++)n.src=shardIfSmallImg(n.oSrc)}function MM_swapimgRestore(){for(var n,i=document.MM_sr,t=0;i&&t<i.length&&(n=i[t])&&n.oSrc;t++)n.src=shardIfSmallImg(n.oSrc)}function MM_preloadImages(){var n=document,t,r,i;if(n.images)for(n.MM_p||(n.MM_p=[]),r=n.MM_p.length,i=MM_preloadImages.arguments,t=0;t<i.length;t++)i[t].indexOf("#")!=0&&(n.MM_p[r]=new Image,n.MM_p[r++].src=shardIfSmallImg(i[t]))}function MM_showHideLayers(){for(var u,n,t,r=MM_showHideLayers.arguments,i=0;i<r.length-2;i+=3)(t=MM_findObj(r[i]))!=null&&(n=r[i+2],t.style&&(t=t.style,n=n=="show"?"visible":n=="hide"?"hidden":n),t.visibility=n)}function MM_displayLayers(){for(var u,n,t,r=MM_displayLayers.arguments,i=0;i<r.length-2;i+=3)(t=MM_findObj(r[i]))!=null&&(n=r[i+2],t.style&&(t=t.style,n=n=="show"?"block":n=="hide"?"none":n),t.display=n)}function MM_findObj(n,t){var u,r,i;for(t||(t=document),(u=n.indexOf("?"))>0&&parent.frames.length&&(t=parent.frames[n.substring(u+1)].document,n=n.substring(0,u)),(i=t[n])||!t.all||(i=t.all[n]),r=0;!i&&r<t.forms.length;r++)i=t.forms[r][n];for(r=0;!i&&t.layers&&r<t.layers.length;r++)i=MM_findObj(n,t.layers[r].document);return!i&&t.getElementById&&(i=t.getElementById(n)),i}function MM_swapImage(){var t,r=0,n,i=MM_swapImage.arguments;for(document.MM_sr=[],t=0;t<i.length-2;t+=3)(n=MM_findObj(i[t]))!=null&&(document.MM_sr[r++]=n,n.oSrc||(n.oSrc=n.src),n.src=i[t+2])}function MM_changeImage(n,t){var i=document.getElementById(n);i.src=t,FitImageWindow(i)}function FitImageWindow(n){var u,i,t,r;typeof window.innerWidth!="undefined"?(u=window.innerWidth,i=window.innerHeight):typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0?(u=document.documentElement.clientWidth,i=document.documentElement.clientHeight):(u=document.getElementsByTagName("body")[0].clientWidth,i=document.getElementsByTagName("body")[0].clientHeight),t=new Image,t.src=shardIfSmallImg(n.src),r=0,t.height!=0&&(r=t.width/t.height,n.height=i-150,n.width=(i-150)*r)}function getDaysInMonth(n,t){var i;return mymonth=n+1,mymonth==1||mymonth==3||mymonth==5||mymonth==7||mymonth==8||mymonth==10||mymonth==12?i=31:mymonth==4||mymonth==6||mymonth==9||mymonth==11?i=30:mymonth==2&&(i=isLeapYear(t)?29:28),i}function isLeapYear(n){return n%4==0&&n%100!=0||n%400==0?!0:!1}function createXHR(){var n=!1;try{n=new ActiveXObject("Msxml2.XMLHTTP")}catch(r){try{n=new ActiveXObject("Microsoft.XMLHTTP")}catch(i){try{n=new XMLHttpRequest}catch(t){n=!1}}}return n}function IsValidTime(n){var i=/^(\d{1,2}):(\d{1,2}):(\d{1,2})/,t=n.match(i);if(t==null)return!1;return hour=t[1],minute=t[2],second=t[3],second==""&&(second=null),hour<0||hour>23?!1:minute<0||minute>59?!1:second!=null&&(second<0||second>59)?!1:!0}function isEmail(n){var t=/^[\w-]+(\.[\w-]+)*@(([\w-]{2,63}\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;return t.test(n)}function justNumbers(n){reg=/[^0-9]/g,n.value=n.value.replace(reg,"")}function money(n){reg=/[^0-9.,]/g,n.value=n.value.replace(reg,"")}function removePercent(n){return reg=/[%]/g,n=n.replace(reg," "),reg=/[*]/g,n=n.replace(reg," "),reg=/[']/g,n.replace(reg," ")}function readyForFilter(n){n!=null&&(n.value=removePercentWithSpaces(n.value),n.value=n.value.split("  ").join(" "),n.value="%"+n.value+"%",n.value=n.value.split("%%").join("%"))}function readyForFilterSql(n){n!=null&&(n.value=removePercentWithSpaces(n.value),n.value=removeSpacesWithPercent(n.value))}function limpaFiltro(n){n!=null&&(n.value=removePercentWithSpaces(n.value))}function numbersAndAlpha(n){reg=/[^A-Za-z0-9]/g,n.value=n.value.replace(reg,"")}function numbersAndAlphaAndPoint(n){reg=/[^A-Za-z0-9_.]/g,n.value=n.value.replace(reg,"")}function showPreLoad(n){var t=document.getElementById(n);t!=null&&(t.style.visibility="visible",t.style.display="block")}function getScrollPosY(){return document.documentElement.scrollTop!=null?document.documentElement.scrollTop:window.pageYOffset!=null?window.pageYOffset:0}function hidePreLoad(n){var t=document.getElementById(n);t!=null&&(t.style.visibility="hidden",t.style.display="none")}function removeSpaces(n){return n.split(" ").join("")}function removeSpacesWithPercent(n){var t="%"+n.split(" ").join("%")+"%";return t=t.split("%%").join("%")}function removePercentWithSpaces(n){var t=n.split("%").join(" ");return t=t.split("  ").join(" "),t.substring(0,1)==" "&&(t=t.substring(1)),t.substring(t.length-1)==" "&&(t=t.substring(0,t.length-1)),t}function Position(n,t){this.X=n,this.Y=t,this.Add=function(n){var t=new Position(this.X,this.Y);return n!=null&&(isNaN(n.X)||(t.X+=n.X),isNaN(n.Y)||(t.Y+=n.Y)),t},this.Subtract=function(n){var t=new Position(this.X,this.Y);return n!=null&&(isNaN(n.X)||(t.X-=n.X),isNaN(n.Y)||(t.Y-=n.Y)),t},this.Min=function(n){var t=new Position(this.X,this.Y);return n==null?t:(!isNaN(n.X)&&this.X>n.X&&(t.X=n.X),!isNaN(n.Y)&&this.Y>n.Y&&(t.Y=n.Y),t)},this.Max=function(n){var t=new Position(this.X,this.Y);return n==null?t:(!isNaN(n.X)&&this.X<n.X&&(t.X=n.X),!isNaN(n.Y)&&this.Y<n.Y&&(t.Y=n.Y),t)},this.Bound=function(n,t){var i=this.Max(n);return i.Min(t)},this.Check=function(){var n=new Position(this.X,this.Y);return isNaN(n.X)&&(n.X=0),isNaN(n.Y)&&(n.Y=0),n},this.Apply=function(n){typeof n=="string"&&(n=document.getElementById(n));if(n==null)return;isNaN(this.X)||(n.style.left=this.X+"px"),isNaN(this.Y)||(n.style.top=this.Y+"px")}}function dragObject(n,t,i,r,u,f,e,o){function b(t){if(!h&&c&&!s)return h=!0,u!=null&&u(t,n),a=absoluteCursorPostion(t),l=new Position(parseInt(n.style.left),parseInt(n.style.top)),l=l.Check(),hookEvent(document,"mousemove",p),hookEvent(document,"mouseup",v),cancelEvent(t)}function p(t){if(!h||s)return;var u=absoluteCursorPostion(t);return u=u.Add(l).Subtract(a),u=u.Bound(i,r),u.Apply(n),f!=null&&f(u,n),cancelEvent(t)}function v(n){return y(),cancelEvent(n)}function y(){if(!h||s)return;unhookEvent(document,"mousemove",p),unhookEvent(document,"mouseup",v),a=null,l=null,e!=null&&e(n),h=!1}var w;typeof n=="string"&&(n=document.getElementById(n));if(n==null)return;i!=null&&r!=null&&(w=i.Min(r),r=i.Max(r),i=w);var a=null,l=null,h=!1,c=!1,s=!1;this.Dispose=function(){if(s)return;this.StopListening(!0),n=null,t=null,i=null,r=null,u=null,f=null,e=null,s=!0},this.StartListening=function(){if(c||s)return;c=!0,hookEvent(t,"mousedown",b)},this.StopListening=function(n){if(!c||s)return;unhookEvent(t,"mousedown",b),c=!1,n&&h&&y()},this.IsDragging=function(){return h},this.IsListening=function(){return c},this.IsDisposed=function(){return s},typeof t=="string"&&(t=document.getElementById(t)),t==null&&(t=n),o||this.StartListening()}function correctOffset(n,t,i){return i?n.Subtract(t):n.Add(t)}function hookEvent(n,t,i){typeof n=="string"&&(n=document.getElementById(n));if(n==null)return;n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent&&n.attachEvent("on"+t,i)}function unhookEvent(n,t,i){typeof n=="string"&&(n=document.getElementById(n));if(n==null)return;n.removeEventListener?n.removeEventListener(t,i,!1):n.detachEvent&&n.detachEvent("on"+t,i)}function cancelEvent(n){return n=n?n:window.event,n.stopPropagation&&n.stopPropagation(),n.preventDefault&&n.preventDefault(),n.cancelBubble=!0,n.cancel=!0,n.returnValue=!1,!1}function getMousePos(n){n=n?n:window.event;var t;return t=isNaN(n.layerX)?new Position(n.offsetX,n.offsetY):new Position(n.layerX,n.layerY),correctOffset(t,pointerOffset,!0)}function getEventTarget(n){return n=n?n:window.event,n.target?n.target:n.srcElement}function absoluteCursorPostion(n){return n=n?n:window.event,isNaN(window.scrollX)?new Position(n.clientX+document.documentElement.scrollLeft+document.body.scrollLeft,n.clientY+document.documentElement.scrollTop+document.body.scrollTop):new Position(n.clientX+window.scrollX,n.clientY+window.scrollY)}function mouseLeavesElement(n,t){return typeof t.toElement!="undefined"&&typeof n.contains!="undefined"?!n.contains(t.toElement):typeof t.relatedTarget!="undefined"&&t.relatedTarget?!elementContains(n,t.relatedTarget):void 0}function elementContains(n,t){while(t){if(n==t)return!0;t=t.parentNode}return!1}function gotoanchor(n){var t=document.getElementById(n);return t&&t.focus(),!0}function changelinkColor(n,t){var i=document.getElementById(n);i&&(i.style.color=t)}function toggle(n){var t=document.getElementById(n);t.style.display=t.style.display=="none"?"block":"none"}function blanket_size(n){var i,t;viewportheight=typeof window.innerWidth!="undefined"?window.innerHeight:document.documentElement.clientHeight,blanket_height=viewportheight>document.body.parentNode.scrollHeight&&viewportheight>document.body.parentNode.clientHeight?viewportheight:document.body.parentNode.clientHeight>document.body.parentNode.scrollHeight?document.body.parentNode.clientHeight:document.body.parentNode.scrollHeight,i=document.getElementById("blanket"),i.style.height=blanket_height+"px",t=document.getElementById(n),popUpDiv_height=blanket_height/2-150,t.style.top="100px"}function window_pos(n){viewportwidth=typeof window.innerWidth!="undefined"?window.innerHeight:document.documentElement.clientHeight,window_width=viewportwidth>document.body.parentNode.scrollWidth&&viewportwidth>document.body.parentNode.clientWidth?viewportwidth:document.body.parentNode.clientWidth>document.body.parentNode.scrollWidth?document.body.parentNode.clientWidth:document.body.parentNode.scrollWidth;var t=document.getElementById(n);window_width=window_width/2-300,t.style.marginleft="auto",t.style.marginright="auto",t.style.position="fixed",t.style.top=window.document.body.scrollTop+100}function popuppassatempos(n){blanket_size(n),window_pos(n),toggle("blanket"),toggle(n)}function setTitle(n,t){div=document.getElementById(t),div.innerHTML=n}function RecentPostsScrollerv2(n){var f,s,i,t,h,l,e,o,u,r;try{for(t='<MARQUEE onmouseover="this.stop();" onmouseout="this.start();" ',t=nWidth?t+' width = "'+nWidth+'%"':t+' width = "100%"',nScrollDelay&&(t=t+' scrolldelay = "'+nScrollDelay+'"'),sDirection&&(t=t+' direction = "'+sDirection+'"',e=sDirection=="left"||sDirection=="right"?"&nbsp;&nbsp;":"<br/>"),o=sOpenLinkLocation=="N"?' target= "_blank" ':" ",h="</MARQUEE>",f="",u=0;u<nMaxPosts;u++){for(i=n.feed.entry[u],r=0;r<i.link.length;r++)if(i.link[r].rel=="alternate"){s=i.link[r].href;break}f=f+"<b>"+sBulletChar+"</b> <a "+o+' href="'+s+'">'+i.title.$t+"</a>"+e}document.write(t+f+h)}catch(c){alert(c)}}function playRadioAndNavigate(n,t){doPlayRadio(n),top.setLocation(t)}var DesT,DesTimerIsOn=!1,DesTimerOut=50,DesTimerPixeis=20,pointerOffset;window.shardIfSmallImg=function(n){var t=n.indexOf("-s")!==-1,u=n.indexOf("-m")!==-1;if(n.indexOf("http://")!==-1&&(t||u)){var f=n.lastIndexOf("/")+1,i=n.charAt(f),r=n.slice(n.ixOfGuid).slice(0,n.length-6);return"http://"+i+".services.myway.pt/Image/"+r+"?size="+(t?"50":"300")}return n},pointerOffset=new Position(0,navigator.userAgent.indexOf("Firefox")>=0?1:0)
