function doLineupReset(){TVMDS.cookie.clear("id");self.location.reload(true);return false}function doLineupSelector(){document.getElementById("lineup_selector_container").style.display="block";TVMDS.lineups.onSuccess(function(){document.getElementById("lineup_selector_container").style.display="none";doTvGrid()});TVMDS.lineups.draw();return false}function doShowSearch(E){closeShowPopup();document.getElementById("tv_grid_container").style.display="none";document.getElementById("search_container").style.display="block";document.getElementById("tvm_search_string").value=E;var B=C(document.forms["tvm_search"].elements["tvm_search_type"]);var D=C(document.forms["tvm_search"].elements["tvm_search_mode"]);var A=C(document.forms["tvm_search"].elements["tvm_search_range"]);TVMDS.search.doSearch(E,B,D,A);return false;function C(G){for(var F=0;F<G.length;F++){if(G[F].checked){break}}return G[F].value}}function doTvGrid(){document.getElementById("tv_grid_container").style.display="block";TVMDS.grid.draw()}function doLineupCustomize(){closeShowPopup();document.getElementById("tv_grid_container").style.display="none";document.getElementById("search_container").style.display="none";document.getElementById("personalize_container").style.display="block";document.getElementById("personalize_frame").src="http://tvmds.tvpassport.com/php/customize_channels.php?sid="+TVMDS.session.data.session_id}function doShowPopup(){if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){var C=window.innerWidth;var A=window.innerHeight}if(navigator.appName.indexOf("Microsoft")!=-1){var C=document.body.offsetWidth;var A=document.body.offsetHeight}}var D=550;var B=300;document.getElementById("tvm_pi_top_tail_nw").style.display="none";document.getElementById("tvm_pi_top_tail_ne").style.display="none";document.getElementById("tvm_pi_bottom_tail_sw").style.display="none";document.getElementById("tvm_pi_bottom_tail_se").style.display="none";if(TVMDS.programinfo.properties.mouseY+B<A){document.getElementById("tvm_pi_container").style.top=(TVMDS.programinfo.properties.mouseY+20)+"px";if(TVMDS.programinfo.properties.mouseX<400){document.getElementById("tvm_pi_top_tail_nw").style.display="block";document.getElementById("tvm_pi_top_tail_nw").style.left=(TVMDS.programinfo.properties.mouseX)+"px"}else{document.getElementById("tvm_pi_top_tail_ne").style.display="block";document.getElementById("tvm_pi_top_tail_ne").style.left=(TVMDS.programinfo.properties.mouseX-45)+"px"}}else{document.getElementById("tvm_pi_container").style.top=(TVMDS.programinfo.properties.mouseY-301)+"px";if(TVMDS.programinfo.properties.mouseX<400){document.getElementById("tvm_pi_bottom_tail_sw").style.display="block";document.getElementById("tvm_pi_bottom_tail_sw").style.left=(TVMDS.programinfo.properties.mouseX)+"px"}else{document.getElementById("tvm_pi_bottom_tail_se").style.display="block";document.getElementById("tvm_pi_bottom_tail_se").style.left=(TVMDS.programinfo.properties.mouseX-45)+"px"}}document.getElementById("tvm_pi_container").style.left="80px";document.getElementById("tvm_pi_container").style.display="block";window.frames["msnad"].location="sympatico_ad_frame.html";}function closeShowPopup(){window.frames["msnad"].location="empty_page.html";document.getElementById("tvm_pi_container").style.display="none"}function doOnStartup(){document.getElementById("loader").style.display="none";if(!TVMDS.session.data.lineup_id){doLineupSelector()}else{doTvGrid()}}function drawDOWSelector(){var C=document.getElementById("dow_select");var B=new Date(TVMDS.grid.properties.gmt_now*1000);var H=new Date(TVMDS.grid.properties.start_time*1000);var L=["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"];var D=["aujourd'hui","demain"];var K=["minuit","01h","02h","03h","04h","05h","06h","07h","08h","09h","10h","11h","midi","13h","14h","15h","16h","17h","18h","19h","20h","21h","22h","23h"];var F=TVMDS.grid.properties.lineup_channels;var N=TVMDS.grid.properties.start_index;var M="";for(var E=0;E<=6;E++){comp_date=new Date(B.getTime()+(E*(3600*24*1000)));comp_date.setHours(H.getHours());if(comp_date.getDay()==H.getDay()){var J=D[E]||L[comp_date.getDay()];M=M+'<option value="'+comp_date.getTime()+'" selected>'+J+"</option>"}else{var J=D[E]||L[comp_date.getDay()];M=M+'<option value="'+comp_date.getTime()+'">'+J+"</option>"}}M='<select class="dow_select" name="dow" onchange="TVMDS.grid.jumpToTime(this.value / 1000)">'+M+"</select>";var I="";var G=new Date(TVMDS.grid.properties.start_time*1000);for(var E=0;E<=23;E++){G.setHours(E);if(G.getHours()==H.getHours()){I=I+'<option value="'+G.getTime()+'" selected>'+K[G.getHours()]+"</option>"}else{I=I+'<option value="'+G.getTime()+'">'+K[G.getHours()]+"</option>"}}I='<select class="dow_select" name="dow" onchange="TVMDS.grid.jumpToTime(this.value / 1000)">'+I+"</select>";var A="";for(var E=0;E<F.length;E++){if(E==N){A=A+'<option value="'+E+'" selected>'+F[E]+"</option>"}else{A=A+'<option value="'+E+'" >'+F[E]+"</option>"}}A='<select class="dow_select" name="channel" onchange="TVMDS.grid.jumpToChannelIndex(this.value)">'+A+"</select>";C.innerHTML="Voir "+M+" &agrave; "+I+", sur "+A+"."}(function(){document.onunload=closeShowPopup();TVMDS.sympatico={};TVMDS.sympatico.start=function(){TVMDS.session.init()};TVMDS.sympatico.onStart=function(A){TVMDS.session.events.onLoad.push(A)};TVMDS.sympatico.onProgramClick=function(A){TVMDS.programinfo.events.onInfoLoad.push(A)};TVMDS.sympatico.onGridDraw=function(A){TVMDS.grid.events.onGridDraw.push(A)};TVMDS.sympatico.onStart(doOnStartup);TVMDS.sympatico.onProgramClick(doShowPopup);TVMDS.sympatico.onGridDraw(drawDOWSelector);TVMDS.grid.events.onGetGridStartTime.push(function(){TVMDS.grid.draw()})})()
