var adagioIsIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var adagioIsWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var adagioIsOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;var adagioIsChrome=(navigator.userAgent.toLowerCase().indexOf("chrome")>-1)?true:false;var ADX_label="";var adagioObj=document;try{adagioObj=window.parent}catch(e){try{adagioObj=window}catch(e){adagioObj=document}}function findPos(B){try{var C=curtop=0;if(B){if(B.offsetParent){C=B.offsetLeft;curtop=B.offsetTop;while(B=B.offsetParent){C+=B.offsetLeft;curtop+=B.offsetTop}}return[C,curtop]}else{return[0,0]}}catch(A){return[0,0]}}function adagioWriteBanner(A){return""}function adagioGetURL(L,F,Q,G,W,S,P,H,U,O){var A="";var J=parseInt((Math.random()*(Date.parse(new Date()))));var T=0;try{var B=false;var D=false;if(adagioReadCookie("ovl")!=null){D=true}var I=G.split(",");var K="";for(j=0;j<I.length;j++){if(B&&I[j]=="1p_u"){continue}if(D&&I[j]=="1o_u"){continue}K+=I[j]+","}if(K!=""){K=K.substring(0,K.length-1)}G=K}catch(R){}try{adagioObj=window.parent}catch(R){try{adagioObj=window}catch(R){adagioObj=document}}try{adagioObj.adagioLocation=L}catch(R){}if(L.indexOf("ame_pr_")==0){F="fmt_pcpro"}else{if(L.indexOf("ame_tm_")==0){F="fmt_mytech"}else{if(L.indexOf("grune_fo_")==0){F="fmt_focus"}else{if(L.indexOf("hears_mp_")==0&&L.indexOf("mb_u")<0){F="fmt_cosmo"}}}}if(F&&F!=""){A="http://adlev.neodatagroup.com/ad/mediamond.jsp?loc="+L+"&fmt="+F+"&fmtpos="+G}else{A="http://adlev.neodatagroup.com/ad/mediamond.jsp?loc="+L+""}if(U){U=U.replace(/[^A-Z0-9a-z-,\|]+/g,"_")}else{U=""}var C="";var V="";try{var N="";try{N=parent.document.location.href}catch(R){N=document.location.href}if(/^http:\/\/.*\/(.*)/i.test(N)){C=RegExp.$1;C=C.replace(/\.[^\.]*$/,"");C=C.replace(/[^A-Z0-9a-z-]+/g,"_");if(C!=""){C+=","}V=N.replace("http://","");V=V.replace(/[^A-Z0-9a-z-]+/g,"_");if(U){U=U+","}else{U=""}}var E=new Date();var M="slot_"+(E.getMinutes());if(U!=""||C!=""||V!=""){M=","+M}if(U!=""||C!=""||V!=""||M!=""){A+="&keyw="+U+C+V+M}}catch(R){}try{if(!adagioObj.adagioBT){adagioObj.adagioBT="n"}if(!adagioObj.adagioWT){adagioObj.adagioWT="n"}if(!adagioObj.adagioWC){adagioObj.adagioWC=""}else{A+="&wc="+adagioObj.adagioWC}if(!adagioObj.adagioWADV){adagioObj.adagioWADV=""}else{A+="&wadv="+adagioObj.adagioWADV}if(!adagioObj.adagioBADV){adagioObj.adagioBADV=""}else{A+="&badv="+adagioObj.adagioBADV}if(!adagioObj.adagioBT){adagioObj.adagioBT=""}else{A+="&bt="+adagioObj.adagioBT}if(!adagioObj.adagioBL){adagioObj.adagioBL=""}else{A+="&bl="+adagioObj.adagioBL}if(!adagioObj.adagioWT){adagioObj.adagioWT=""}else{A+="&wt="+adagioObj.adagioWT}if(!adagioObj.adagioWL){adagioObj.adagioWL=""}else{A+="&wl="+adagioObj.adagioWL}}catch(R){}if(W==1){if(H&&H!=""){A+="&jsfuncnoint="+escape(H)}if(S&&S!=""){A+="&jsfuncstart="+escape(S)}if(P&&P!=""){A+="&jsfuncint="+escape("document.write(adagioBCode);")+escape(P)}else{A+="&jsfuncint="+escape("document.write(adagioBCode);")}}else{if(W==0){if(P&&P!=""){A+="&jsfuncint="+escape(P)}if(H&&H!=""){A+="&jsfuncnoint="+escape(H)}if(S&&S!=""){A+="&jsfuncstart="+escape("var adagioRedirNoJQ=true;")+escape(S)}else{A+="&jsfuncstart="+escape("var adagioRedirNoJQ=true;")}}else{if(P&&P!=""){A+="&jsfuncint="+escape(P)}if(H&&H!=""){A+="&jsfuncnoint="+escape(H)}if(S&&S!=""){A+="&jsfuncstart="+escape(S)}}}if(O!=""){A+="&"+O}return A+"&rnd="+J}function adagioWriteTag(A,F,C,E,J,D,I,H,B,G){if(B){if(B!=""){B+=","+ADX_label}else{B=ADX_label}}else{B=ADX_label}var K=adagioGetURL(A,F,C,E,J,D,I,H,B,G);document.write('<script src="'+K+'" ><\/script>')}function adagioControlVersion(){var A;var B;var C;try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");A=B.GetVariable("$version")}catch(C){}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");A="WIN 6,0,21,0";B.AllowScriptAccess="always";A=B.GetVariable("$version")}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");A=B.GetVariable("$version")}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");A="WIN 3,0,18,0"}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");A="WIN 2,0,0,11"}catch(C){A=-1}}return A}function adagioGetSwfVer(){var G=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var F=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var A=navigator.plugins["Shockwave Flash"+F].description;var E=A.split(" ");var C=E[2].split(".");var H=C[0];var B=C[1];var D=E[3];if(D==""){D=E[4]}if(D[0]=="d"){D=D.substring(1)}else{if(D[0]=="r"){D=D.substring(1);if(D.indexOf("d")>0){D=D.substring(0,D.indexOf("d"))}}}var G=H+"."+B+"."+D}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){G=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){G=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){G=2}else{if(adagioIsIE&&adagioIsWin&&!adagioIsOpera){G=adagioControlVersion()}}}}}return G}function adagioDetectFlashVer(F,D,C){versionStr=adagioGetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(adagioIsIE&&adagioIsWin&&!adagioIsOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var E=versionArray[0];var A=versionArray[1];var B=versionArray[2];if(E>parseFloat(F)){return true}else{if(E==parseFloat(F)){if(A>parseFloat(D)){return true}else{if(A==parseFloat(D)){if(B>=parseFloat(C)){return true}}}}}return false}}}function adagioHideDiv(A){try{document.getElementById(A).style.display="none";document.getElementById(A).style.visibility="hidden"}catch(B){}}function adagioReadCookie(A){A=A+"=";return adagioGetCookieValue(document.cookie,A,";")}function adagioGetCookieValue(F,D,B){var C;var E;var A;if(F==null){return null}if(F.length>0){E=F.indexOf(D);if(E!=-1){E+=D.length;A=F.indexOf(B,E);if(A==-1){A=F.length}return unescape(F.substring(E,A))}}return null}function trackEvents(D){try{var B=document.createElement("img");var A=parseInt((Math.random()*(Date.parse(new Date()))));B.src="http://adlev.neodatagroup.com/ad/event77.jsp?x="+D.acampId+"."+D.locationId+"."+D.creativeId+".0."+A+".&type="+D.eventType+"&value="+D.eventValue;B.width="1";B.height="1";B.border="0";if(D.objId&&document.getElementById(D.objId)){document.getElementById(D.objId).appendChild(B)}else{document.body.appendChild(B)}}catch(C){}}function adagioWriteCookie(A,C,D){var E="/";var B=A+"="+escape(C);myPath=E;B+=";path="+myPath;if(D){if(D!=""&&D!=null){B+=";expires="+D}}document.cookie=B}function adagioParentSkinSetWidthHeight2(){var D=window.parent.document;var A=0;if(adagioParentGetWidth()>1020){A=(adagioParentGetWidth()-1020)/2}var E=adagioParentGetHeight();var B=D.getElementById("skinadvdx");var C=D.getElementById("skinadvsx");B.style.width=A+"px";B.style.height=E+"px";C.style.width=A+"px";C.style.height=E+"px";B=D.getElementById("skinadvdx");C=D.getElementById("skinadvsx");B.style.width=A+"px";B.style.height=E+"px";C.style.width=(A-5)+"px";C.style.height=E+"px"}function adagioParentSkinSetWidthHeight(){var D=window.parent.document;var A=0;if(adagioParentGetWidth()>1020){A=(adagioParentGetWidth()-1020)/2}var E=adagioParentGetHeight();var B=D.getElementById("skinadvdxa");var C=D.getElementById("skinadvsxa");B.style.width=A+"px";B.style.height=E+"px";C.style.width=A+"px";C.style.height=E+"px";B=D.getElementById("skinadvdx");C=D.getElementById("skinadvsx");B.style.width=A+"px";B.style.height=E+"px";C.style.width=A+"px";C.style.height=E+"px"}function adagioParentGetWidth(){var B=window.parent.document;var A=0;if(B.innerHeight){A=B.innerWidth}else{if(B.documentElement&&B.documentElement.clientHeight){A=B.documentElement.clientWidth}else{if(B.body){A=B.body.clientWidth}}}return A}function adagioParentGetHeight(){var A=window.parent.document;var B=0;if(A.innerHeight){B=A.innerHeight}else{if(A.documentElement&&A.documentElement.clientHeight){B=A.documentElement.clientHeight}else{if(A.body){B=A.body.clientHeight}}}return B}function adagioParentSkinSetWH(B,H,A){var F=window.parent.document;var C=0;if(adagioParentGetWidth()>B){C=(adagioParentGetWidth()-B)/2}var G=adagioParentGetHeight();var D=F.getElementById(A);var E=F.getElementById(H);D.style.width=C+"px";D.style.height=G+"px";E.style.width=C+"px";E.style.height=G+"px";D=F.getElementById(A);E=F.getElementById(H);D.style.width=C+"px";D.style.height=G+"px";E.style.width=(C-5)+"px";E.style.height=G+"px"}function adagioSkinSetWidthHeight2(){var A=0;if(adagioGetWidth()>1020){A=(adagioGetWidth()-1020)/2}var D=adagioGetHeight();var B=document.getElementById("skinadvdx");var C=document.getElementById("skinadvsx");B.style.width=A+"px";B.style.height=D+"px";C.style.width=A+"px";C.style.height=D+"px";B=document.getElementById("skinadvdx");C=document.getElementById("skinadvsx");B.style.width=A+"px";B.style.height=D+"px";qqqxSize=A-5;if(qqqxSize<0){qqqxSize=0}C.style.width=qqqxSize+"px";C.style.height=D+"px"}function adagioSkinSetWidthHeight(){var A=0;if(adagioGetWidth()>1020){A=(adagioGetWidth()-1020)/2}var D=adagioGetHeight();var B=document.getElementById("skinadvdxa");var C=document.getElementById("skinadvsxa");B.style.width=A+"px";B.style.height=D+"px";C.style.width=A+"px";C.style.height=D+"px";B=document.getElementById("skinadvdx");C=document.getElementById("skinadvsx");B.style.width=A+"px";B.style.height=D+"px";C.style.width=A+"px";C.style.height=D+"px"}function adagioGetWidth(){var A=0;if(self.innerHeight){A=self.innerWidth}else{if(document.documentElement&&document.documentElement.clientHeight){A=document.documentElement.clientWidth}else{if(document.body){A=document.body.clientWidth}}}return A}function adagioGetHeight(){var A=0;if(self.innerHeight){A=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){A=document.documentElement.clientHeight}else{if(document.body){A=document.body.clientHeight}}}return A}var adagioEventUtil={addHandler:function(A,C,B){if(A.addEventListener){A.addEventListener(C,B,false)}else{if(A.attachEvent){A.attachEvent("on"+C,B)}else{A["on"+C]=B}}},removeHandler:function(A,C,B){if(A.removeEventListener){A.removeEventListener(C,B,false)}else{if(A.detachEvent){A.detachEvent("on"+C,B)}else{A["on"+C]=null}}},getEvent:function(A){return A?A:window.event},getTarget:function(A){return A.target||A.srcElement},preventDefault:function(A){if(A.preventDefault){A.preventDefault()}else{A.returnValue=false}},stopPropagation:function(A){if(A.stopPropagation){A.stopPropagation()}else{A.cancelBubble=true}}};adagioInlogoClip="00:00:20.000";adagioVideoClipId="";adagioCookieStr="";adagioCookieValue=new Object();function adagioTagVideo(){var L=new Array();L.gf=1;var Y="";var d="";var G="";var J="";var P="";var H="";var W="";var b="";var V="";var R="";var B="";var C="";var F="";var U="";var Q="";var A="";var m="";var Z=false;try{if(jsonVideoMetadata.id){Y=jsonVideoMetadata.id}if(jsonVideoMetadata.production_date){d=jsonVideoMetadata.production_date}if(jsonVideoMetadata.type){G=jsonVideoMetadata.type}if(jsonVideoMetadata.title){J=jsonVideoMetadata.title}if(jsonVideoMetadata.brand){P=jsonVideoMetadata.brand}if(jsonVideoMetadata.subbrand){H=jsonVideoMetadata.subbrand}if(jsonVideoMetadata.season){W=jsonVideoMetadata.season}if(jsonVideoMetadata.category){b=jsonVideoMetadata.category}if(jsonVideoMetadata.episode_number){V=jsonVideoMetadata.episode_number}if(jsonVideoMetadata.episode_type){R=jsonVideoMetadata.episode_type}if(jsonVideoMetadata.ads){B=jsonVideoMetadata.ads}if(jsonVideoMetadata.producer){C=jsonVideoMetadata.producer}if(jsonVideoMetadata.duration){F=jsonVideoMetadata.duration;U=F.replace(/\./g,":")}if(jsonVideoMetadata.keywords&&jsonVideoMetadata.keywords!=""){m=jsonVideoMetadata.keywords+"|"}if(adagioPopOut){A="_popout|";Z=true}}catch(h){}var k=false;if(L[P]==1&&m=="fixdesign"){k=true}var c="";var O="";var g="";var K="";var S="";var l="";var E=m+A+P+"^"+H+"^"+W+"^"+V+"^"+R+"^"+Q;if(P=="sportmediaset"&&H=="sportmediaset/tutti_i_gol"){E+=",sportmediaset_tutti_i_gol"}E=E.replace(/\./g,"_");E=E.replace(/,/g,"||");E=E.replace(/\?/g,"");var N=Y+"^"+d+"^"+G+"^"+J+"^"+P+"^"+H+"^"+W+"^"+b+"^"+V+"^"+R+"^"+B+"^"+C+"^"+U;N=N.replace(/'/g,"");N=N.replace(/\"/g,"");N=N.replace(/\./g,"_");N=N.replace(/,/g,"||");N=N.replace(/\?/g,"");if(Y=="test1"&&P=="test"){G="fep";l="&bv=nospecial"}if(G=="fep"&&P=="iene"){l="&bv=nospecial"}if(G=="fep"&&P=="gf"){l="&bv=nospecial"}if(G=="clip"&&P=="test"){g="fmt_clip_interattiva2pr_inlogo";O="fmt_tgcom_players_clip";K="rti_tg_play_c"+P.toLowerCase()+"_"}else{if(G=="fep"&&P=="intervista_vip"){g="fmt_fep_interattiva2pr";l="&bv=nospecial";if(B=="false"){g="fmt_clip_noads"}O="fmt_tgcom_players_fep";K="rti_tg_play_f"+P.toLowerCase()+"_";try{var M=0;var a=adagioStrToMillis(F);var f=5;if(a<=10000){f=0}}catch(h){adagioInlogoClip="00:00:30.000"}}else{if(G=="clip"&&P=="talent11_sm"){g="fmt_clip_sm";if(B=="false"){g="fmt_clip_sm_noads"}else{if(checkVideo3Min(1,X)){g="fmt_clip_sm_noads"}}S=adagioCookieStr;O="fmt_tgcom_players_clip";K="rti_tg_play_c"+P.toLowerCase()+"_"}else{if(G=="clip"){var D=new Array();D.motogp=1;D.medusa=1;D.magazine_cinema=1;D.altre_visioni=1;D.speciale_cinema=1;try{var M=0;var a=adagioStrToMillis(F);var f=5;if(a<=10000){f=0}adagioInlogoClip=adagioMillisToStr((M+((a-M)/2)-(f*1000)))}catch(h){adagioInlogoClip="00:00:30.000"}adagioVideoClipId=Y;var X="adVid3m";var I=adagioReadCookie(X);if(I==null){g="fmt_clip";if(D[P]==1){g="fmt_clipgp"}if(k){g="fmt_clip_interattiva"}}else{g="fmt_clip2";if(D[P]==1){g="fmt_clip2gp"}if(k){g="fmt_clip_interattiva"}}var T=adagioStrToMillis(F);var i=5;if(T>(i*60*1000)){if(I==null){g="fmt_clip2pr";if(D[P]==1){g="fmt_clipgp"}if(k){g="fmt_clip_interattiva2pr"}}else{g="fmt_clip2pr2";if(D[P]==1){g="fmt_clip2gp"}if(k){g="fmt_clip_interattiva2pr"}}}if(B=="false"){g="fmt_clip_noads"}else{if(checkVideo3Min(1,X)){g="fmt_clip_nopre";if(D[P]==1){g="fmt_clip_nopregp"}if(k){g="fmt_clip_interattiva_nopr"}}}S=adagioCookieStr;O="fmt_tgcom_players_clip";K="rti_tg_play_c"+P.toLowerCase()+"_"}else{if(G=="fep"){g=Y;O="fmt_tgcom_players_fep"}else{if(G=="live"){g="fmt_live";O="fmt_tgcom_players_live";if(P=="motogp"||P=="poker1mania"){g="fmt_livegp"}if(B=="false"){g="fmt_live_noads"}K="rti_tg_play_l"+P.toLowerCase()+"_"}else{if(G=="vx_clip"){K="rti_tg_play_v"+P.toLowerCase()+"_";O="fmt_tgcom_players_vx";g="fmt_vx_clip";var X="vx_adVid3m";var I=adagioReadCookie(X);if(B=="false"){g="fmt_vx_clip_noads"}else{if(checkVideo3Min(1,X)){g="fmt_vx_clip_nopre"}}}}}}}}}c="&dawb=1&user_vars="+N+l;if(Z){c+="&popout=true"}adagioWriteTag(K,O,"","vp_1,vp_2,vp_3,si_u,vo_1,vo_2,vo_3,vf_1,vf_2,vf_3",2,"",S,"",E,c)}function checkVideo3Min(C,B){var A=adagioReadCookie(B);then=new Date();if(A==null||A==""){if(C==1){adagioCookieValue=new Object();adagioCookieValue.myName=B;adagioCookieValue.myValue=then.getTime();adagioCookieValue.myLife="-1";adagioCookieValue.myPath="/";adagioCookieValue.encode=0}return false}else{ora=then.getTime()-180000;if(ora<=parseInt(A,10)){return true}else{if(C==1){adagioCookieValue=new Object();adagioCookieValue.myName=B;adagioCookieValue.myValue=then.getTime();adagioCookieValue.myLife="-1";adagioCookieValue.myPath="/";adagioCookieValue.encode=0}return false}}}function adagioWriteCookiePlayer(){if(adagioCookieValue){if(adagioCookieValue.myName&&adagioCookieValue.myName!=""&&adagioCookieValue.myValue&&adagioCookieValue.myValue!=""){adagioWriteCookie(adagioCookieValue.myName,adagioCookieValue.myValue,adagioCookieValue.myLife,adagioCookieValue.myPath,adagioCookieValue.encode)}}}function adagioMillisToStr(A){var E=parseInt(A);var C=Math.floor(E/3600000);var D=Math.floor((E%3600000)/60000);var B=Math.floor((E%3600000)%60000/1000);var F=Math.floor((E%3600000)%60000%1000);if(C<10){C="0"+C}if(D<10){D="0"+D}if(B<10){B="0"+B}if(F<10){F="00"+F}else{if(F<100){F="0"+F}}return C+":"+D+":"+B+"."+F}function adagioStrToMillis(A){var E=A.split(".");var C=E[0];var B=C.split(":");var D=(parseInt(B[0],10)*60*60*1000)+(parseInt(B[1],10)*60*1000)+(parseInt(B[2],10)*1000)+(parseInt(E[1],10));return D};
